diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/AccountsOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/AccountsOperations.cs index 8d7a24a402af..d2388a319c00 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/AccountsOperations.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/AccountsOperations.cs @@ -73,7 +73,7 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -196,14 +196,13 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient 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 ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -213,10 +212,6 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient 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); @@ -286,7 +281,7 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -415,14 +410,13 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient 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 ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -432,10 +426,6 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient 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); @@ -521,7 +511,7 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -637,14 +627,13 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient 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 ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -654,10 +643,6 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient 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); @@ -767,7 +752,7 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -892,14 +877,13 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient 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 ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -909,10 +893,6 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient 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); @@ -976,7 +956,7 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1107,14 +1087,13 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient 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 ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1124,10 +1103,6 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient 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); @@ -1209,7 +1184,7 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1332,14 +1307,13 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1349,10 +1323,6 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient 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); @@ -1449,7 +1419,7 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1562,14 +1532,13 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient 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 ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1579,10 +1548,6 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient 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); @@ -1622,7 +1587,7 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1718,14 +1683,13 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient 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 ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1735,10 +1699,6 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient 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); @@ -1796,7 +1756,7 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1892,14 +1852,13 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient 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 ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1909,10 +1868,6 @@ internal AccountsOperations(DataLakeAnalyticsAccountManagementClient 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/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/CatalogOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/CatalogOperations.cs deleted file mode 100644 index 17a557a278f7..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/CatalogOperations.cs +++ /dev/null @@ -1,14654 +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.DataLake.Analytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - 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; - - /// - /// CatalogOperations operations. - /// - internal partial class CatalogOperations : IServiceOperations, ICatalogOperations - { - /// - /// Initializes a new instance of the CatalogOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal CatalogOperations(DataLakeAnalyticsCatalogManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the DataLakeAnalyticsCatalogManagementClient - /// - public DataLakeAnalyticsCatalogManagementClient Client { get; private set; } - - /// - /// Creates the specified secret for use with external data sources in the - /// specified database. This is deprecated and will be removed in the next - /// release. Please use CreateCredential instead. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database in which to create the secret. - /// - /// - /// The name of the secret. - /// - /// - /// The parameters required to create the secret (name and password) - /// - /// - /// 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. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public async Task CreateSecretWithHttpMessagesAsync(string accountName, string databaseName, string secretName, DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (secretName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "secretName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("secretName", secretName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateSecret", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/secrets/{secretName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{secretName}", System.Uri.EscapeDataString(secretName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the specified secret in the specified database. This is deprecated and - /// will be removed in the next release. Please use GetCredential instead. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the secret. - /// - /// - /// The name of the secret to get - /// - /// - /// 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. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public async Task> GetSecretWithHttpMessagesAsync(string accountName, string databaseName, string secretName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (secretName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "secretName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("secretName", secretName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSecret", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/secrets/{secretName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{secretName}", System.Uri.EscapeDataString(secretName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Modifies the specified secret for use with external data sources in the - /// specified database. This is deprecated and will be removed in the next - /// release. Please use UpdateCredential instead. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the secret. - /// - /// - /// The name of the secret. - /// - /// - /// The parameters required to modify the secret (name and password) - /// - /// - /// 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. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public async Task UpdateSecretWithHttpMessagesAsync(string accountName, string databaseName, string secretName, DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (secretName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "secretName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("secretName", secretName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateSecret", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/secrets/{secretName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{secretName}", System.Uri.EscapeDataString(secretName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes the specified secret in the specified database. This is deprecated - /// and will be removed in the next release. Please use DeleteCredential - /// instead. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the secret. - /// - /// - /// The name of the secret to delete - /// - /// - /// 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. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public async Task DeleteSecretWithHttpMessagesAsync(string accountName, string databaseName, string secretName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (secretName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "secretName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("secretName", secretName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteSecret", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/secrets/{secretName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{secretName}", System.Uri.EscapeDataString(secretName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes all secrets in the specified database. This is deprecated and will - /// be removed in the next release. In the future, please only drop individual - /// credentials using DeleteCredential - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the secret. - /// - /// - /// 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. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public async Task DeleteAllSecretsWithHttpMessagesAsync(string accountName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteAllSecrets", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/secrets"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Creates the specified credential for use with external data sources in the - /// specified database. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database in which to create the credential. Note: This is - /// NOT an external database name, but the name of an existing U-SQL database - /// that should contain the new credential object. - /// - /// - /// The name of the credential. - /// - /// - /// The parameters required to create the credential (name and password) - /// - /// - /// 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 CreateCredentialWithHttpMessagesAsync(string accountName, string databaseName, string credentialName, DataLakeAnalyticsCatalogCredentialCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (credentialName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "credentialName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("credentialName", credentialName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateCredential", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/credentials/{credentialName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{credentialName}", System.Uri.EscapeDataString(credentialName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the specified credential from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the schema. - /// - /// - /// The name of the credential. - /// - /// - /// 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> GetCredentialWithHttpMessagesAsync(string accountName, string databaseName, string credentialName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (credentialName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "credentialName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("credentialName", credentialName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetCredential", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/credentials/{credentialName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{credentialName}", System.Uri.EscapeDataString(credentialName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Modifies the specified credential for use with external data sources in the - /// specified database - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the credential. - /// - /// - /// The name of the credential. - /// - /// - /// The parameters required to modify the credential (name and password) - /// - /// - /// 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 UpdateCredentialWithHttpMessagesAsync(string accountName, string databaseName, string credentialName, DataLakeAnalyticsCatalogCredentialUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (credentialName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "credentialName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("credentialName", credentialName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "UpdateCredential", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/credentials/{credentialName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{credentialName}", System.Uri.EscapeDataString(credentialName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Deletes the specified credential in the specified database - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the credential. - /// - /// - /// The name of the credential to delete - /// - /// - /// The parameters to delete a credential if the current user is not the - /// account owner. - /// - /// - /// Indicates if the delete should be a cascading delete (which deletes all - /// resources dependent on the credential as well as the credential) or not. If - /// false will fail if there are any resources relying on the credential. - /// - /// - /// 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 DeleteCredentialWithHttpMessagesAsync(string accountName, string databaseName, string credentialName, DataLakeAnalyticsCatalogCredentialDeleteParameters parameters = default(DataLakeAnalyticsCatalogCredentialDeleteParameters), bool? cascade = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (credentialName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "credentialName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("credentialName", credentialName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cascade", cascade); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DeleteCredential", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/credentials/{credentialName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{credentialName}", System.Uri.EscapeDataString(credentialName)); - List _queryParameters = new List(); - if (cascade != null) - { - _queryParameters.Add(string.Format("cascade={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(cascade, Client.SerializationSettings).Trim('"')))); - } - 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(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of credentials from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the schema. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListCredentialsWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListCredentials", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/credentials"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the specified external data source from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the external data source. - /// - /// - /// The name of the external data source. - /// - /// - /// 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> GetExternalDataSourceWithHttpMessagesAsync(string accountName, string databaseName, string externalDataSourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (externalDataSourceName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "externalDataSourceName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("externalDataSourceName", externalDataSourceName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetExternalDataSource", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/externaldatasources/{externalDataSourceName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{externalDataSourceName}", System.Uri.EscapeDataString(externalDataSourceName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of external data sources from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the external data sources. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListExternalDataSourcesWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListExternalDataSources", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/externaldatasources"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the specified procedure from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the procedure. - /// - /// - /// The name of the schema containing the procedure. - /// - /// - /// The name of the procedure. - /// - /// - /// 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> GetProcedureWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string procedureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (procedureName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "procedureName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("procedureName", procedureName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetProcedure", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/procedures/{procedureName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{procedureName}", System.Uri.EscapeDataString(procedureName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of procedures from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the procedures. - /// - /// - /// The name of the schema containing the procedures. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListProceduresWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListProcedures", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/procedures"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the specified table from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table. - /// - /// - /// The name of the schema containing the table. - /// - /// - /// The name of the table. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetTableWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (tableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTable", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of table fragments from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table fragments. - /// - /// - /// The name of the schema containing the table fragments. - /// - /// - /// The name of the table containing the table fragments. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListTableFragmentsWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (tableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTableFragments", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/tablefragments"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of tables from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the tables. - /// - /// - /// The name of the schema containing the tables. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The basic switch indicates what level of information to return when listing - /// tables. When basic is true, only database_name, schema_name, table_name and - /// version are returned for each table, otherwise all table metadata is - /// returned. By default, it is false. Optional. - /// - /// - /// 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>> ListTablesWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), bool? basic = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("basic", basic); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTables", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (basic != null) - { - _queryParameters.Add(string.Format("basic={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(basic, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of all table statistics within the specified schema from - /// the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the statistics. - /// - /// - /// The name of the schema containing the statistics. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListTableStatisticsByDatabaseAndSchemaWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTableStatisticsByDatabaseAndSchema", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/statistics"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the specified table type from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table type. - /// - /// - /// The name of the schema containing the table type. - /// - /// - /// The name of the table type to retrieve. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetTableTypeWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (tableTypeName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tableTypeName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("tableTypeName", tableTypeName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTableType", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/tabletypes/{tableTypeName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{tableTypeName}", System.Uri.EscapeDataString(tableTypeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of table types from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table types. - /// - /// - /// The name of the schema containing the table types. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListTableTypesWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTableTypes", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/tabletypes"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the specified package from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the package. - /// - /// - /// The name of the schema containing the package. - /// - /// - /// The name of the package. - /// - /// - /// 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> GetPackageWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string packageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (packageName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "packageName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("packageName", packageName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetPackage", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/packages/{packageName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{packageName}", System.Uri.EscapeDataString(packageName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of packages from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the packages. - /// - /// - /// The name of the schema containing the packages. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListPackagesWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListPackages", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/packages"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the specified view from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the view. - /// - /// - /// The name of the schema containing the view. - /// - /// - /// The name of the view. - /// - /// - /// 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> GetViewWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string viewName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (viewName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "viewName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("viewName", viewName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetView", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/views/{viewName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{viewName}", System.Uri.EscapeDataString(viewName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of views from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the views. - /// - /// - /// The name of the schema containing the views. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListViewsWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListViews", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/views"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the specified table statistics from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the statistics. - /// - /// - /// The name of the schema containing the statistics. - /// - /// - /// The name of the table containing the statistics. - /// - /// - /// The name of the table statistics. - /// - /// - /// 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> GetTableStatisticWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableName, string statisticsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (tableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); - } - if (statisticsName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "statisticsName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("statisticsName", statisticsName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTableStatistic", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/statistics/{statisticsName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - _url = _url.Replace("{statisticsName}", System.Uri.EscapeDataString(statisticsName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of table statistics from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the statistics. - /// - /// - /// The name of the schema containing the statistics. - /// - /// - /// The name of the table containing the statistics. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListTableStatisticsWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (tableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTableStatistics", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/statistics"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves a preview set of rows in given partition. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the partition. - /// - /// - /// The name of the schema containing the partition. - /// - /// - /// The name of the table containing the partition. - /// - /// - /// The name of the table partition. - /// - /// - /// The maximum number of preview rows to be retrieved.Rows returned may be - /// less than or equal to this number depending on row sizes and number of rows - /// in the partition. - /// - /// - /// The maximum number of columns to be retrieved. - /// - /// - /// 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> PreviewTablePartitionWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableName, string partitionName, long? maxRows = default(long?), long? maxColumns = default(long?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (tableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); - } - if (partitionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "partitionName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("partitionName", partitionName); - tracingParameters.Add("maxRows", maxRows); - tracingParameters.Add("maxColumns", maxColumns); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "PreviewTablePartition", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions/{partitionName}/previewrows"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - _url = _url.Replace("{partitionName}", System.Uri.EscapeDataString(partitionName)); - List _queryParameters = new List(); - if (maxRows != null) - { - _queryParameters.Add(string.Format("maxRows={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxRows, Client.SerializationSettings).Trim('"')))); - } - if (maxColumns != null) - { - _queryParameters.Add(string.Format("maxColumns={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxColumns, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the specified table partition from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the partition. - /// - /// - /// The name of the schema containing the partition. - /// - /// - /// The name of the table containing the partition. - /// - /// - /// The name of the table partition. - /// - /// - /// 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> GetTablePartitionWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableName, string partitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (tableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); - } - if (partitionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "partitionName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("partitionName", partitionName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTablePartition", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions/{partitionName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - _url = _url.Replace("{partitionName}", System.Uri.EscapeDataString(partitionName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves a preview set of rows in given table. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table. - /// - /// - /// The name of the schema containing the table. - /// - /// - /// The name of the table. - /// - /// - /// The maximum number of preview rows to be retrieved. Rows returned may be - /// less than or equal to this number depending on row sizes and number of rows - /// in the table. - /// - /// - /// The maximum number of columns to be retrieved. - /// - /// - /// 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> PreviewTableWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableName, long? maxRows = default(long?), long? maxColumns = default(long?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (tableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("maxRows", maxRows); - tracingParameters.Add("maxColumns", maxColumns); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "PreviewTable", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/previewrows"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - List _queryParameters = new List(); - if (maxRows != null) - { - _queryParameters.Add(string.Format("maxRows={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxRows, Client.SerializationSettings).Trim('"')))); - } - if (maxColumns != null) - { - _queryParameters.Add(string.Format("maxColumns={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxColumns, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of table partitions from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the partitions. - /// - /// - /// The name of the schema containing the partitions. - /// - /// - /// The name of the table containing the partitions. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListTablePartitionsWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (tableName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tableName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("tableName", tableName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTablePartitions", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/partitions"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{tableName}", System.Uri.EscapeDataString(tableName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of types within the specified database and schema from - /// the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the types. - /// - /// - /// The name of the schema containing the types. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListTypesWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTypes", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/types"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the specified table valued function from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table valued function. - /// - /// - /// The name of the schema containing the table valued function. - /// - /// - /// The name of the tableValuedFunction. - /// - /// - /// 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> GetTableValuedFunctionWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableValuedFunctionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (tableValuedFunctionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "tableValuedFunctionName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("tableValuedFunctionName", tableValuedFunctionName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetTableValuedFunction", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/tablevaluedfunctions/{tableValuedFunctionName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - _url = _url.Replace("{tableValuedFunctionName}", System.Uri.EscapeDataString(tableValuedFunctionName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of table valued functions from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table valued functions. - /// - /// - /// The name of the schema containing the table valued functions. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListTableValuedFunctionsWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTableValuedFunctions", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}/tablevaluedfunctions"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the specified assembly from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the assembly. - /// - /// - /// The name of the assembly. - /// - /// - /// 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> GetAssemblyWithHttpMessagesAsync(string accountName, string databaseName, string assemblyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (assemblyName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "assemblyName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("assemblyName", assemblyName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAssembly", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/assemblies/{assemblyName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{assemblyName}", System.Uri.EscapeDataString(assemblyName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of assemblies from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the assembly. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListAssembliesWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAssemblies", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/assemblies"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the specified schema from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the schema. - /// - /// - /// The name of the schema. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetSchemaWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (schemaName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "schemaName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("schemaName", schemaName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSchema", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas/{schemaName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - _url = _url.Replace("{schemaName}", System.Uri.EscapeDataString(schemaName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of schemas from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the schema. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListSchemasWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListSchemas", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/schemas"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of all statistics in a database from the Data Lake - /// Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table statistics. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListTableStatisticsByDatabaseWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTableStatisticsByDatabase", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/statistics"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of all tables in a database from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the tables. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The basic switch indicates what level of information to return when listing - /// tables. When basic is true, only database_name, schema_name, table_name and - /// version are returned for each table, otherwise all table metadata is - /// returned. By default, it is false - /// - /// - /// 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>> ListTablesByDatabaseWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), bool? basic = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("basic", basic); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTablesByDatabase", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/tables"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (basic != null) - { - _queryParameters.Add(string.Format("basic={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(basic, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of all table valued functions in a database from the - /// Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table valued functions. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListTableValuedFunctionsByDatabaseWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListTableValuedFunctionsByDatabase", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/tablevaluedfunctions"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of all views in a database from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the views. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListViewsByDatabaseWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListViewsByDatabase", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/views"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of access control list (ACL) entries for the database - /// from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListAclsByDatabaseWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAclsByDatabase", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/acl"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of access control list (ACL) entries for the Data Lake - /// Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListAclsWithHttpMessagesAsync(string accountName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListAcls", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/acl"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the specified database from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetDatabaseWithHttpMessagesAsync(string accountName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDatabase", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of databases from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// 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>> ListDatabasesWithHttpMessagesAsync(string accountName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListDatabases", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Grants an access control list (ACL) entry to the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// Parameters supplied to create or update an access control list (ACL) entry - /// for a Data Lake Analytics catalog. - /// - /// - /// 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 GrantAclWithHttpMessagesAsync(string accountName, AclCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - string op = "GRANTACE"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("op", op); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GrantAcl", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/acl"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - List _queryParameters = new List(); - if (op != null) - { - _queryParameters.Add(string.Format("op={0}", System.Uri.EscapeDataString(op))); - } - 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(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Grants an access control list (ACL) entry to the database from the Data - /// Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database. - /// - /// - /// Parameters supplied to create or update an access control list (ACL) entry - /// for a database. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task GrantAclToDatabaseWithHttpMessagesAsync(string accountName, string databaseName, AclCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - string op = "GRANTACE"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("op", op); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GrantAclToDatabase", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/acl"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - List _queryParameters = new List(); - if (op != null) - { - _queryParameters.Add(string.Format("op={0}", System.Uri.EscapeDataString(op))); - } - 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(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Revokes an access control list (ACL) entry from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// Parameters supplied to delete an access control list (ACL) entry from a - /// Data Lake Analytics catalog. - /// - /// - /// 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 RevokeAclWithHttpMessagesAsync(string accountName, AclDeleteParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - string op = "REVOKEACE"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("op", op); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RevokeAcl", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/acl"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - List _queryParameters = new List(); - if (op != null) - { - _queryParameters.Add(string.Format("op={0}", System.Uri.EscapeDataString(op))); - } - 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(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Revokes an access control list (ACL) entry for the database from the Data - /// Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database. - /// - /// - /// Parameters supplied to delete an access control list (ACL) entry for a - /// database. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task RevokeAclFromDatabaseWithHttpMessagesAsync(string accountName, string databaseName, AclDeleteParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaCatalogDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaCatalogDnsSuffix"); - } - if (databaseName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "databaseName"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - string op = "REVOKEACE"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("databaseName", databaseName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("op", op); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "RevokeAclFromDatabase", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "catalog/usql/databases/{databaseName}/acl"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaCatalogDnsSuffix}", Client.AdlaCatalogDnsSuffix); - _url = _url.Replace("{databaseName}", System.Uri.EscapeDataString(databaseName)); - List _queryParameters = new List(); - if (op != null) - { - _queryParameters.Add(string.Format("op={0}", System.Uri.EscapeDataString(op))); - } - 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(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of credentials from the Data Lake Analytics catalog. - /// - /// - /// 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>> ListCredentialsNextWithHttpMessagesAsync(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, "ListCredentialsNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of external data sources from the Data Lake Analytics - /// catalog. - /// - /// - /// 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>> ListExternalDataSourcesNextWithHttpMessagesAsync(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, "ListExternalDataSourcesNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of procedures from the Data Lake Analytics catalog. - /// - /// - /// 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>> ListProceduresNextWithHttpMessagesAsync(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, "ListProceduresNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of table fragments from the Data Lake Analytics catalog. - /// - /// - /// 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>> ListTableFragmentsNextWithHttpMessagesAsync(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, "ListTableFragmentsNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of tables from the Data Lake Analytics catalog. - /// - /// - /// 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>> ListTablesNextWithHttpMessagesAsync(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, "ListTablesNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of all table statistics within the specified schema from - /// the Data Lake Analytics catalog. - /// - /// - /// 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>> ListTableStatisticsByDatabaseAndSchemaNextWithHttpMessagesAsync(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, "ListTableStatisticsByDatabaseAndSchemaNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of table types from the Data Lake Analytics catalog. - /// - /// - /// 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>> ListTableTypesNextWithHttpMessagesAsync(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, "ListTableTypesNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of packages from the Data Lake Analytics catalog. - /// - /// - /// 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>> ListPackagesNextWithHttpMessagesAsync(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, "ListPackagesNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of views from the Data Lake Analytics catalog. - /// - /// - /// 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>> ListViewsNextWithHttpMessagesAsync(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, "ListViewsNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of table statistics from the Data Lake Analytics - /// catalog. - /// - /// - /// 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>> ListTableStatisticsNextWithHttpMessagesAsync(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, "ListTableStatisticsNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of table partitions from the Data Lake Analytics - /// catalog. - /// - /// - /// 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>> ListTablePartitionsNextWithHttpMessagesAsync(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, "ListTablePartitionsNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of types within the specified database and schema from - /// the Data Lake Analytics catalog. - /// - /// - /// 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>> ListTypesNextWithHttpMessagesAsync(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, "ListTypesNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of table valued functions from the Data Lake Analytics - /// catalog. - /// - /// - /// 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>> ListTableValuedFunctionsNextWithHttpMessagesAsync(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, "ListTableValuedFunctionsNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of assemblies from the Data Lake Analytics catalog. - /// - /// - /// 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>> ListAssembliesNextWithHttpMessagesAsync(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, "ListAssembliesNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of schemas from the Data Lake Analytics catalog. - /// - /// - /// 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>> ListSchemasNextWithHttpMessagesAsync(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, "ListSchemasNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of all statistics in a database from the Data Lake - /// Analytics catalog. - /// - /// - /// 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>> ListTableStatisticsByDatabaseNextWithHttpMessagesAsync(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, "ListTableStatisticsByDatabaseNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of all tables in a database from the Data Lake Analytics - /// catalog. - /// - /// - /// 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>> ListTablesByDatabaseNextWithHttpMessagesAsync(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, "ListTablesByDatabaseNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of all table valued functions in a database from the - /// Data Lake Analytics catalog. - /// - /// - /// 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>> ListTableValuedFunctionsByDatabaseNextWithHttpMessagesAsync(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, "ListTableValuedFunctionsByDatabaseNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of all views in a database from the Data Lake Analytics - /// catalog. - /// - /// - /// 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>> ListViewsByDatabaseNextWithHttpMessagesAsync(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, "ListViewsByDatabaseNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of access control list (ACL) entries for the database - /// from the Data Lake Analytics catalog. - /// - /// - /// 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>> ListAclsByDatabaseNextWithHttpMessagesAsync(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, "ListAclsByDatabaseNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of access control list (ACL) entries for the Data Lake - /// Analytics catalog. - /// - /// - /// 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>> ListAclsNextWithHttpMessagesAsync(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, "ListAclsNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Retrieves the list of databases from the Data Lake Analytics catalog. - /// - /// - /// 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>> ListDatabasesNextWithHttpMessagesAsync(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, "ListDatabasesNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/CatalogOperationsExtensions.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/CatalogOperationsExtensions.cs deleted file mode 100644 index dbf66210fc6f..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/CatalogOperationsExtensions.cs +++ /dev/null @@ -1,3821 +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.DataLake.Analytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for CatalogOperations. - /// - public static partial class CatalogOperationsExtensions - { - /// - /// Creates the specified secret for use with external data sources in the - /// specified database. This is deprecated and will be removed in the next - /// release. Please use CreateCredential instead. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database in which to create the secret. - /// - /// - /// The name of the secret. - /// - /// - /// The parameters required to create the secret (name and password) - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static void CreateSecret(this ICatalogOperations operations, string accountName, string databaseName, string secretName, DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters) - { - operations.CreateSecretAsync(accountName, databaseName, secretName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates the specified secret for use with external data sources in the - /// specified database. This is deprecated and will be removed in the next - /// release. Please use CreateCredential instead. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database in which to create the secret. - /// - /// - /// The name of the secret. - /// - /// - /// The parameters required to create the secret (name and password) - /// - /// - /// The cancellation token. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static async Task CreateSecretAsync(this ICatalogOperations operations, string accountName, string databaseName, string secretName, DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CreateSecretWithHttpMessagesAsync(accountName, databaseName, secretName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Gets the specified secret in the specified database. This is deprecated and - /// will be removed in the next release. Please use GetCredential instead. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the secret. - /// - /// - /// The name of the secret to get - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static USqlSecret GetSecret(this ICatalogOperations operations, string accountName, string databaseName, string secretName) - { - return operations.GetSecretAsync(accountName, databaseName, secretName).GetAwaiter().GetResult(); - } - - /// - /// Gets the specified secret in the specified database. This is deprecated and - /// will be removed in the next release. Please use GetCredential instead. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the secret. - /// - /// - /// The name of the secret to get - /// - /// - /// The cancellation token. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static async Task GetSecretAsync(this ICatalogOperations operations, string accountName, string databaseName, string secretName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetSecretWithHttpMessagesAsync(accountName, databaseName, secretName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Modifies the specified secret for use with external data sources in the - /// specified database. This is deprecated and will be removed in the next - /// release. Please use UpdateCredential instead. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the secret. - /// - /// - /// The name of the secret. - /// - /// - /// The parameters required to modify the secret (name and password) - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static void UpdateSecret(this ICatalogOperations operations, string accountName, string databaseName, string secretName, DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters) - { - operations.UpdateSecretAsync(accountName, databaseName, secretName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Modifies the specified secret for use with external data sources in the - /// specified database. This is deprecated and will be removed in the next - /// release. Please use UpdateCredential instead. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the secret. - /// - /// - /// The name of the secret. - /// - /// - /// The parameters required to modify the secret (name and password) - /// - /// - /// The cancellation token. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static async Task UpdateSecretAsync(this ICatalogOperations operations, string accountName, string databaseName, string secretName, DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.UpdateSecretWithHttpMessagesAsync(accountName, databaseName, secretName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deletes the specified secret in the specified database. This is deprecated - /// and will be removed in the next release. Please use DeleteCredential - /// instead. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the secret. - /// - /// - /// The name of the secret to delete - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static void DeleteSecret(this ICatalogOperations operations, string accountName, string databaseName, string secretName) - { - operations.DeleteSecretAsync(accountName, databaseName, secretName).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified secret in the specified database. This is deprecated - /// and will be removed in the next release. Please use DeleteCredential - /// instead. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the secret. - /// - /// - /// The name of the secret to delete - /// - /// - /// The cancellation token. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static async Task DeleteSecretAsync(this ICatalogOperations operations, string accountName, string databaseName, string secretName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteSecretWithHttpMessagesAsync(accountName, databaseName, secretName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deletes all secrets in the specified database. This is deprecated and will - /// be removed in the next release. In the future, please only drop individual - /// credentials using DeleteCredential - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the secret. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static void DeleteAllSecrets(this ICatalogOperations operations, string accountName, string databaseName) - { - operations.DeleteAllSecretsAsync(accountName, databaseName).GetAwaiter().GetResult(); - } - - /// - /// Deletes all secrets in the specified database. This is deprecated and will - /// be removed in the next release. In the future, please only drop individual - /// credentials using DeleteCredential - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the secret. - /// - /// - /// The cancellation token. - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - public static async Task DeleteAllSecretsAsync(this ICatalogOperations operations, string accountName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteAllSecretsWithHttpMessagesAsync(accountName, databaseName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Creates the specified credential for use with external data sources in the - /// specified database. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database in which to create the credential. Note: This is - /// NOT an external database name, but the name of an existing U-SQL database - /// that should contain the new credential object. - /// - /// - /// The name of the credential. - /// - /// - /// The parameters required to create the credential (name and password) - /// - public static void CreateCredential(this ICatalogOperations operations, string accountName, string databaseName, string credentialName, DataLakeAnalyticsCatalogCredentialCreateParameters parameters) - { - operations.CreateCredentialAsync(accountName, databaseName, credentialName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Creates the specified credential for use with external data sources in the - /// specified database. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database in which to create the credential. Note: This is - /// NOT an external database name, but the name of an existing U-SQL database - /// that should contain the new credential object. - /// - /// - /// The name of the credential. - /// - /// - /// The parameters required to create the credential (name and password) - /// - /// - /// The cancellation token. - /// - public static async Task CreateCredentialAsync(this ICatalogOperations operations, string accountName, string databaseName, string credentialName, DataLakeAnalyticsCatalogCredentialCreateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CreateCredentialWithHttpMessagesAsync(accountName, databaseName, credentialName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Retrieves the specified credential from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the schema. - /// - /// - /// The name of the credential. - /// - public static USqlCredential GetCredential(this ICatalogOperations operations, string accountName, string databaseName, string credentialName) - { - return operations.GetCredentialAsync(accountName, databaseName, credentialName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the specified credential from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the schema. - /// - /// - /// The name of the credential. - /// - /// - /// The cancellation token. - /// - public static async Task GetCredentialAsync(this ICatalogOperations operations, string accountName, string databaseName, string credentialName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetCredentialWithHttpMessagesAsync(accountName, databaseName, credentialName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Modifies the specified credential for use with external data sources in the - /// specified database - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the credential. - /// - /// - /// The name of the credential. - /// - /// - /// The parameters required to modify the credential (name and password) - /// - public static void UpdateCredential(this ICatalogOperations operations, string accountName, string databaseName, string credentialName, DataLakeAnalyticsCatalogCredentialUpdateParameters parameters) - { - operations.UpdateCredentialAsync(accountName, databaseName, credentialName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Modifies the specified credential for use with external data sources in the - /// specified database - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the credential. - /// - /// - /// The name of the credential. - /// - /// - /// The parameters required to modify the credential (name and password) - /// - /// - /// The cancellation token. - /// - public static async Task UpdateCredentialAsync(this ICatalogOperations operations, string accountName, string databaseName, string credentialName, DataLakeAnalyticsCatalogCredentialUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.UpdateCredentialWithHttpMessagesAsync(accountName, databaseName, credentialName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Deletes the specified credential in the specified database - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the credential. - /// - /// - /// The name of the credential to delete - /// - /// - /// The parameters to delete a credential if the current user is not the - /// account owner. - /// - /// - /// Indicates if the delete should be a cascading delete (which deletes all - /// resources dependent on the credential as well as the credential) or not. If - /// false will fail if there are any resources relying on the credential. - /// - public static void DeleteCredential(this ICatalogOperations operations, string accountName, string databaseName, string credentialName, DataLakeAnalyticsCatalogCredentialDeleteParameters parameters = default(DataLakeAnalyticsCatalogCredentialDeleteParameters), bool? cascade = false) - { - operations.DeleteCredentialAsync(accountName, databaseName, credentialName, parameters, cascade).GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified credential in the specified database - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the credential. - /// - /// - /// The name of the credential to delete - /// - /// - /// The parameters to delete a credential if the current user is not the - /// account owner. - /// - /// - /// Indicates if the delete should be a cascading delete (which deletes all - /// resources dependent on the credential as well as the credential) or not. If - /// false will fail if there are any resources relying on the credential. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteCredentialAsync(this ICatalogOperations operations, string accountName, string databaseName, string credentialName, DataLakeAnalyticsCatalogCredentialDeleteParameters parameters = default(DataLakeAnalyticsCatalogCredentialDeleteParameters), bool? cascade = false, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteCredentialWithHttpMessagesAsync(accountName, databaseName, credentialName, parameters, cascade, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Retrieves the list of credentials from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the schema. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListCredentials(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListCredentialsAsync(accountName, databaseName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of credentials from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the schema. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListCredentialsAsync(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListCredentialsWithHttpMessagesAsync(accountName, databaseName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the specified external data source from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the external data source. - /// - /// - /// The name of the external data source. - /// - public static USqlExternalDataSource GetExternalDataSource(this ICatalogOperations operations, string accountName, string databaseName, string externalDataSourceName) - { - return operations.GetExternalDataSourceAsync(accountName, databaseName, externalDataSourceName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the specified external data source from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the external data source. - /// - /// - /// The name of the external data source. - /// - /// - /// The cancellation token. - /// - public static async Task GetExternalDataSourceAsync(this ICatalogOperations operations, string accountName, string databaseName, string externalDataSourceName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetExternalDataSourceWithHttpMessagesAsync(accountName, databaseName, externalDataSourceName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of external data sources from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the external data sources. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListExternalDataSources(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListExternalDataSourcesAsync(accountName, databaseName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of external data sources from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the external data sources. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListExternalDataSourcesAsync(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListExternalDataSourcesWithHttpMessagesAsync(accountName, databaseName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the specified procedure from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the procedure. - /// - /// - /// The name of the schema containing the procedure. - /// - /// - /// The name of the procedure. - /// - public static USqlProcedure GetProcedure(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string procedureName) - { - return operations.GetProcedureAsync(accountName, databaseName, schemaName, procedureName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the specified procedure from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the procedure. - /// - /// - /// The name of the schema containing the procedure. - /// - /// - /// The name of the procedure. - /// - /// - /// The cancellation token. - /// - public static async Task GetProcedureAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string procedureName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetProcedureWithHttpMessagesAsync(accountName, databaseName, schemaName, procedureName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of procedures from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the procedures. - /// - /// - /// The name of the schema containing the procedures. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListProcedures(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListProceduresAsync(accountName, databaseName, schemaName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of procedures from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the procedures. - /// - /// - /// The name of the schema containing the procedures. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListProceduresAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListProceduresWithHttpMessagesAsync(accountName, databaseName, schemaName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the specified table from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table. - /// - /// - /// The name of the schema containing the table. - /// - /// - /// The name of the table. - /// - public static USqlTable GetTable(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableName) - { - return operations.GetTableAsync(accountName, databaseName, schemaName, tableName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the specified table from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table. - /// - /// - /// The name of the schema containing the table. - /// - /// - /// The name of the table. - /// - /// - /// The cancellation token. - /// - public static async Task GetTableAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetTableWithHttpMessagesAsync(accountName, databaseName, schemaName, tableName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of table fragments from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table fragments. - /// - /// - /// The name of the schema containing the table fragments. - /// - /// - /// The name of the table containing the table fragments. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListTableFragments(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListTableFragmentsAsync(accountName, databaseName, schemaName, tableName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of table fragments from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table fragments. - /// - /// - /// The name of the schema containing the table fragments. - /// - /// - /// The name of the table containing the table fragments. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTableFragmentsAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTableFragmentsWithHttpMessagesAsync(accountName, databaseName, schemaName, tableName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of tables from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the tables. - /// - /// - /// The name of the schema containing the tables. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The basic switch indicates what level of information to return when listing - /// tables. When basic is true, only database_name, schema_name, table_name and - /// version are returned for each table, otherwise all table metadata is - /// returned. By default, it is false. Optional. - /// - public static IPage ListTables(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), bool? basic = false) - { - return operations.ListTablesAsync(accountName, databaseName, schemaName, odataQuery, select, count, basic).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of tables from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the tables. - /// - /// - /// The name of the schema containing the tables. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The basic switch indicates what level of information to return when listing - /// tables. When basic is true, only database_name, schema_name, table_name and - /// version are returned for each table, otherwise all table metadata is - /// returned. By default, it is false. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTablesAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), bool? basic = false, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTablesWithHttpMessagesAsync(accountName, databaseName, schemaName, odataQuery, select, count, basic, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of all table statistics within the specified schema from - /// the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the statistics. - /// - /// - /// The name of the schema containing the statistics. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListTableStatisticsByDatabaseAndSchema(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListTableStatisticsByDatabaseAndSchemaAsync(accountName, databaseName, schemaName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of all table statistics within the specified schema from - /// the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the statistics. - /// - /// - /// The name of the schema containing the statistics. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTableStatisticsByDatabaseAndSchemaAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTableStatisticsByDatabaseAndSchemaWithHttpMessagesAsync(accountName, databaseName, schemaName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the specified table type from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table type. - /// - /// - /// The name of the schema containing the table type. - /// - /// - /// The name of the table type to retrieve. - /// - public static USqlTableType GetTableType(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableTypeName) - { - return operations.GetTableTypeAsync(accountName, databaseName, schemaName, tableTypeName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the specified table type from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table type. - /// - /// - /// The name of the schema containing the table type. - /// - /// - /// The name of the table type to retrieve. - /// - /// - /// The cancellation token. - /// - public static async Task GetTableTypeAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableTypeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetTableTypeWithHttpMessagesAsync(accountName, databaseName, schemaName, tableTypeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of table types from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table types. - /// - /// - /// The name of the schema containing the table types. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListTableTypes(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListTableTypesAsync(accountName, databaseName, schemaName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of table types from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table types. - /// - /// - /// The name of the schema containing the table types. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTableTypesAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTableTypesWithHttpMessagesAsync(accountName, databaseName, schemaName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the specified package from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the package. - /// - /// - /// The name of the schema containing the package. - /// - /// - /// The name of the package. - /// - public static USqlPackage GetPackage(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string packageName) - { - return operations.GetPackageAsync(accountName, databaseName, schemaName, packageName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the specified package from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the package. - /// - /// - /// The name of the schema containing the package. - /// - /// - /// The name of the package. - /// - /// - /// The cancellation token. - /// - public static async Task GetPackageAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string packageName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetPackageWithHttpMessagesAsync(accountName, databaseName, schemaName, packageName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of packages from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the packages. - /// - /// - /// The name of the schema containing the packages. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListPackages(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListPackagesAsync(accountName, databaseName, schemaName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of packages from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the packages. - /// - /// - /// The name of the schema containing the packages. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListPackagesAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListPackagesWithHttpMessagesAsync(accountName, databaseName, schemaName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the specified view from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the view. - /// - /// - /// The name of the schema containing the view. - /// - /// - /// The name of the view. - /// - public static USqlView GetView(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string viewName) - { - return operations.GetViewAsync(accountName, databaseName, schemaName, viewName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the specified view from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the view. - /// - /// - /// The name of the schema containing the view. - /// - /// - /// The name of the view. - /// - /// - /// The cancellation token. - /// - public static async Task GetViewAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string viewName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetViewWithHttpMessagesAsync(accountName, databaseName, schemaName, viewName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of views from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the views. - /// - /// - /// The name of the schema containing the views. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListViews(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListViewsAsync(accountName, databaseName, schemaName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of views from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the views. - /// - /// - /// The name of the schema containing the views. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListViewsAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListViewsWithHttpMessagesAsync(accountName, databaseName, schemaName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the specified table statistics from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the statistics. - /// - /// - /// The name of the schema containing the statistics. - /// - /// - /// The name of the table containing the statistics. - /// - /// - /// The name of the table statistics. - /// - public static USqlTableStatistics GetTableStatistic(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableName, string statisticsName) - { - return operations.GetTableStatisticAsync(accountName, databaseName, schemaName, tableName, statisticsName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the specified table statistics from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the statistics. - /// - /// - /// The name of the schema containing the statistics. - /// - /// - /// The name of the table containing the statistics. - /// - /// - /// The name of the table statistics. - /// - /// - /// The cancellation token. - /// - public static async Task GetTableStatisticAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableName, string statisticsName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetTableStatisticWithHttpMessagesAsync(accountName, databaseName, schemaName, tableName, statisticsName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of table statistics from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the statistics. - /// - /// - /// The name of the schema containing the statistics. - /// - /// - /// The name of the table containing the statistics. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListTableStatistics(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListTableStatisticsAsync(accountName, databaseName, schemaName, tableName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of table statistics from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the statistics. - /// - /// - /// The name of the schema containing the statistics. - /// - /// - /// The name of the table containing the statistics. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTableStatisticsAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTableStatisticsWithHttpMessagesAsync(accountName, databaseName, schemaName, tableName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves a preview set of rows in given partition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the partition. - /// - /// - /// The name of the schema containing the partition. - /// - /// - /// The name of the table containing the partition. - /// - /// - /// The name of the table partition. - /// - /// - /// The maximum number of preview rows to be retrieved.Rows returned may be - /// less than or equal to this number depending on row sizes and number of rows - /// in the partition. - /// - /// - /// The maximum number of columns to be retrieved. - /// - public static USqlTablePreview PreviewTablePartition(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableName, string partitionName, long? maxRows = default(long?), long? maxColumns = default(long?)) - { - return operations.PreviewTablePartitionAsync(accountName, databaseName, schemaName, tableName, partitionName, maxRows, maxColumns).GetAwaiter().GetResult(); - } - - /// - /// Retrieves a preview set of rows in given partition. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the partition. - /// - /// - /// The name of the schema containing the partition. - /// - /// - /// The name of the table containing the partition. - /// - /// - /// The name of the table partition. - /// - /// - /// The maximum number of preview rows to be retrieved.Rows returned may be - /// less than or equal to this number depending on row sizes and number of rows - /// in the partition. - /// - /// - /// The maximum number of columns to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task PreviewTablePartitionAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableName, string partitionName, long? maxRows = default(long?), long? maxColumns = default(long?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.PreviewTablePartitionWithHttpMessagesAsync(accountName, databaseName, schemaName, tableName, partitionName, maxRows, maxColumns, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the specified table partition from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the partition. - /// - /// - /// The name of the schema containing the partition. - /// - /// - /// The name of the table containing the partition. - /// - /// - /// The name of the table partition. - /// - public static USqlTablePartition GetTablePartition(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableName, string partitionName) - { - return operations.GetTablePartitionAsync(accountName, databaseName, schemaName, tableName, partitionName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the specified table partition from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the partition. - /// - /// - /// The name of the schema containing the partition. - /// - /// - /// The name of the table containing the partition. - /// - /// - /// The name of the table partition. - /// - /// - /// The cancellation token. - /// - public static async Task GetTablePartitionAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableName, string partitionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetTablePartitionWithHttpMessagesAsync(accountName, databaseName, schemaName, tableName, partitionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves a preview set of rows in given table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table. - /// - /// - /// The name of the schema containing the table. - /// - /// - /// The name of the table. - /// - /// - /// The maximum number of preview rows to be retrieved. Rows returned may be - /// less than or equal to this number depending on row sizes and number of rows - /// in the table. - /// - /// - /// The maximum number of columns to be retrieved. - /// - public static USqlTablePreview PreviewTable(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableName, long? maxRows = default(long?), long? maxColumns = default(long?)) - { - return operations.PreviewTableAsync(accountName, databaseName, schemaName, tableName, maxRows, maxColumns).GetAwaiter().GetResult(); - } - - /// - /// Retrieves a preview set of rows in given table. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table. - /// - /// - /// The name of the schema containing the table. - /// - /// - /// The name of the table. - /// - /// - /// The maximum number of preview rows to be retrieved. Rows returned may be - /// less than or equal to this number depending on row sizes and number of rows - /// in the table. - /// - /// - /// The maximum number of columns to be retrieved. - /// - /// - /// The cancellation token. - /// - public static async Task PreviewTableAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableName, long? maxRows = default(long?), long? maxColumns = default(long?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.PreviewTableWithHttpMessagesAsync(accountName, databaseName, schemaName, tableName, maxRows, maxColumns, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of table partitions from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the partitions. - /// - /// - /// The name of the schema containing the partitions. - /// - /// - /// The name of the table containing the partitions. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListTablePartitions(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListTablePartitionsAsync(accountName, databaseName, schemaName, tableName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of table partitions from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the partitions. - /// - /// - /// The name of the schema containing the partitions. - /// - /// - /// The name of the table containing the partitions. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTablePartitionsAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTablePartitionsWithHttpMessagesAsync(accountName, databaseName, schemaName, tableName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of types within the specified database and schema from - /// the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the types. - /// - /// - /// The name of the schema containing the types. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListTypes(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListTypesAsync(accountName, databaseName, schemaName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of types within the specified database and schema from - /// the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the types. - /// - /// - /// The name of the schema containing the types. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTypesAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTypesWithHttpMessagesAsync(accountName, databaseName, schemaName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the specified table valued function from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table valued function. - /// - /// - /// The name of the schema containing the table valued function. - /// - /// - /// The name of the tableValuedFunction. - /// - public static USqlTableValuedFunction GetTableValuedFunction(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableValuedFunctionName) - { - return operations.GetTableValuedFunctionAsync(accountName, databaseName, schemaName, tableValuedFunctionName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the specified table valued function from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table valued function. - /// - /// - /// The name of the schema containing the table valued function. - /// - /// - /// The name of the tableValuedFunction. - /// - /// - /// The cancellation token. - /// - public static async Task GetTableValuedFunctionAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, string tableValuedFunctionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetTableValuedFunctionWithHttpMessagesAsync(accountName, databaseName, schemaName, tableValuedFunctionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of table valued functions from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table valued functions. - /// - /// - /// The name of the schema containing the table valued functions. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListTableValuedFunctions(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListTableValuedFunctionsAsync(accountName, databaseName, schemaName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of table valued functions from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table valued functions. - /// - /// - /// The name of the schema containing the table valued functions. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTableValuedFunctionsAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTableValuedFunctionsWithHttpMessagesAsync(accountName, databaseName, schemaName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the specified assembly from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the assembly. - /// - /// - /// The name of the assembly. - /// - public static USqlAssembly GetAssembly(this ICatalogOperations operations, string accountName, string databaseName, string assemblyName) - { - return operations.GetAssemblyAsync(accountName, databaseName, assemblyName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the specified assembly from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the assembly. - /// - /// - /// The name of the assembly. - /// - /// - /// The cancellation token. - /// - public static async Task GetAssemblyAsync(this ICatalogOperations operations, string accountName, string databaseName, string assemblyName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAssemblyWithHttpMessagesAsync(accountName, databaseName, assemblyName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of assemblies from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the assembly. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListAssemblies(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListAssembliesAsync(accountName, databaseName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of assemblies from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the assembly. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAssembliesAsync(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAssembliesWithHttpMessagesAsync(accountName, databaseName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the specified schema from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the schema. - /// - /// - /// The name of the schema. - /// - public static USqlSchema GetSchema(this ICatalogOperations operations, string accountName, string databaseName, string schemaName) - { - return operations.GetSchemaAsync(accountName, databaseName, schemaName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the specified schema from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the schema. - /// - /// - /// The name of the schema. - /// - /// - /// The cancellation token. - /// - public static async Task GetSchemaAsync(this ICatalogOperations operations, string accountName, string databaseName, string schemaName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetSchemaWithHttpMessagesAsync(accountName, databaseName, schemaName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of schemas from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the schema. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListSchemas(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListSchemasAsync(accountName, databaseName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of schemas from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the schema. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListSchemasAsync(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListSchemasWithHttpMessagesAsync(accountName, databaseName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of all statistics in a database from the Data Lake - /// Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table statistics. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListTableStatisticsByDatabase(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListTableStatisticsByDatabaseAsync(accountName, databaseName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of all statistics in a database from the Data Lake - /// Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table statistics. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTableStatisticsByDatabaseAsync(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTableStatisticsByDatabaseWithHttpMessagesAsync(accountName, databaseName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of all tables in a database from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the tables. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The basic switch indicates what level of information to return when listing - /// tables. When basic is true, only database_name, schema_name, table_name and - /// version are returned for each table, otherwise all table metadata is - /// returned. By default, it is false - /// - public static IPage ListTablesByDatabase(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), bool? basic = false) - { - return operations.ListTablesByDatabaseAsync(accountName, databaseName, odataQuery, select, count, basic).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of all tables in a database from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the tables. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The basic switch indicates what level of information to return when listing - /// tables. When basic is true, only database_name, schema_name, table_name and - /// version are returned for each table, otherwise all table metadata is - /// returned. By default, it is false - /// - /// - /// The cancellation token. - /// - public static async Task> ListTablesByDatabaseAsync(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), bool? basic = false, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTablesByDatabaseWithHttpMessagesAsync(accountName, databaseName, odataQuery, select, count, basic, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of all table valued functions in a database from the - /// Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table valued functions. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListTableValuedFunctionsByDatabase(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListTableValuedFunctionsByDatabaseAsync(accountName, databaseName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of all table valued functions in a database from the - /// Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table valued functions. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTableValuedFunctionsByDatabaseAsync(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTableValuedFunctionsByDatabaseWithHttpMessagesAsync(accountName, databaseName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of all views in a database from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the views. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListViewsByDatabase(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListViewsByDatabaseAsync(accountName, databaseName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of all views in a database from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the views. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListViewsByDatabaseAsync(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListViewsByDatabaseWithHttpMessagesAsync(accountName, databaseName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of access control list (ACL) entries for the database - /// from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListAclsByDatabase(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListAclsByDatabaseAsync(accountName, databaseName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of access control list (ACL) entries for the database - /// from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAclsByDatabaseAsync(this ICatalogOperations operations, string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAclsByDatabaseWithHttpMessagesAsync(accountName, databaseName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of access control list (ACL) entries for the Data Lake - /// Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListAcls(this ICatalogOperations operations, string accountName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListAclsAsync(accountName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of access control list (ACL) entries for the Data Lake - /// Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAclsAsync(this ICatalogOperations operations, string accountName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAclsWithHttpMessagesAsync(accountName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the specified database from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database. - /// - public static USqlDatabase GetDatabase(this ICatalogOperations operations, string accountName, string databaseName) - { - return operations.GetDatabaseAsync(accountName, databaseName).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the specified database from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database. - /// - /// - /// The cancellation token. - /// - public static async Task GetDatabaseAsync(this ICatalogOperations operations, string accountName, string databaseName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetDatabaseWithHttpMessagesAsync(accountName, databaseName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of databases from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage ListDatabases(this ICatalogOperations operations, string accountName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListDatabasesAsync(accountName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of databases from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListDatabasesAsync(this ICatalogOperations operations, string accountName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListDatabasesWithHttpMessagesAsync(accountName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Grants an access control list (ACL) entry to the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// Parameters supplied to create or update an access control list (ACL) entry - /// for a Data Lake Analytics catalog. - /// - public static void GrantAcl(this ICatalogOperations operations, string accountName, AclCreateOrUpdateParameters parameters) - { - operations.GrantAclAsync(accountName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Grants an access control list (ACL) entry to the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// Parameters supplied to create or update an access control list (ACL) entry - /// for a Data Lake Analytics catalog. - /// - /// - /// The cancellation token. - /// - public static async Task GrantAclAsync(this ICatalogOperations operations, string accountName, AclCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.GrantAclWithHttpMessagesAsync(accountName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Grants an access control list (ACL) entry to the database from the Data - /// Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database. - /// - /// - /// Parameters supplied to create or update an access control list (ACL) entry - /// for a database. - /// - public static void GrantAclToDatabase(this ICatalogOperations operations, string accountName, string databaseName, AclCreateOrUpdateParameters parameters) - { - operations.GrantAclToDatabaseAsync(accountName, databaseName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Grants an access control list (ACL) entry to the database from the Data - /// Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database. - /// - /// - /// Parameters supplied to create or update an access control list (ACL) entry - /// for a database. - /// - /// - /// The cancellation token. - /// - public static async Task GrantAclToDatabaseAsync(this ICatalogOperations operations, string accountName, string databaseName, AclCreateOrUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.GrantAclToDatabaseWithHttpMessagesAsync(accountName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Revokes an access control list (ACL) entry from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// Parameters supplied to delete an access control list (ACL) entry from a - /// Data Lake Analytics catalog. - /// - public static void RevokeAcl(this ICatalogOperations operations, string accountName, AclDeleteParameters parameters) - { - operations.RevokeAclAsync(accountName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Revokes an access control list (ACL) entry from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// Parameters supplied to delete an access control list (ACL) entry from a - /// Data Lake Analytics catalog. - /// - /// - /// The cancellation token. - /// - public static async Task RevokeAclAsync(this ICatalogOperations operations, string accountName, AclDeleteParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RevokeAclWithHttpMessagesAsync(accountName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Revokes an access control list (ACL) entry for the database from the Data - /// Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database. - /// - /// - /// Parameters supplied to delete an access control list (ACL) entry for a - /// database. - /// - public static void RevokeAclFromDatabase(this ICatalogOperations operations, string accountName, string databaseName, AclDeleteParameters parameters) - { - operations.RevokeAclFromDatabaseAsync(accountName, databaseName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Revokes an access control list (ACL) entry for the database from the Data - /// Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database. - /// - /// - /// Parameters supplied to delete an access control list (ACL) entry for a - /// database. - /// - /// - /// The cancellation token. - /// - public static async Task RevokeAclFromDatabaseAsync(this ICatalogOperations operations, string accountName, string databaseName, AclDeleteParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.RevokeAclFromDatabaseWithHttpMessagesAsync(accountName, databaseName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Retrieves the list of credentials from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListCredentialsNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListCredentialsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of credentials from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListCredentialsNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListCredentialsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of external data sources from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListExternalDataSourcesNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListExternalDataSourcesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of external data sources from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListExternalDataSourcesNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListExternalDataSourcesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of procedures from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListProceduresNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListProceduresNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of procedures from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListProceduresNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListProceduresNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of table fragments from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListTableFragmentsNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListTableFragmentsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of table fragments from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTableFragmentsNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTableFragmentsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of tables from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListTablesNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListTablesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of tables from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTablesNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTablesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of all table statistics within the specified schema from - /// the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListTableStatisticsByDatabaseAndSchemaNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListTableStatisticsByDatabaseAndSchemaNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of all table statistics within the specified schema from - /// the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTableStatisticsByDatabaseAndSchemaNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTableStatisticsByDatabaseAndSchemaNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of table types from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListTableTypesNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListTableTypesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of table types from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTableTypesNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTableTypesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of packages from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListPackagesNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListPackagesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of packages from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListPackagesNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListPackagesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of views from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListViewsNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListViewsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of views from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListViewsNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListViewsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of table statistics from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListTableStatisticsNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListTableStatisticsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of table statistics from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTableStatisticsNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTableStatisticsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of table partitions from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListTablePartitionsNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListTablePartitionsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of table partitions from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTablePartitionsNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTablePartitionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of types within the specified database and schema from - /// the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListTypesNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListTypesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of types within the specified database and schema from - /// the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTypesNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTypesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of table valued functions from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListTableValuedFunctionsNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListTableValuedFunctionsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of table valued functions from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTableValuedFunctionsNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTableValuedFunctionsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of assemblies from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAssembliesNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListAssembliesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of assemblies from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAssembliesNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAssembliesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of schemas from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListSchemasNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListSchemasNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of schemas from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListSchemasNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListSchemasNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of all statistics in a database from the Data Lake - /// Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListTableStatisticsByDatabaseNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListTableStatisticsByDatabaseNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of all statistics in a database from the Data Lake - /// Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTableStatisticsByDatabaseNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTableStatisticsByDatabaseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of all tables in a database from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListTablesByDatabaseNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListTablesByDatabaseNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of all tables in a database from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTablesByDatabaseNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTablesByDatabaseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of all table valued functions in a database from the - /// Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListTableValuedFunctionsByDatabaseNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListTableValuedFunctionsByDatabaseNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of all table valued functions in a database from the - /// Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListTableValuedFunctionsByDatabaseNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListTableValuedFunctionsByDatabaseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of all views in a database from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListViewsByDatabaseNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListViewsByDatabaseNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of all views in a database from the Data Lake Analytics - /// catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListViewsByDatabaseNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListViewsByDatabaseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of access control list (ACL) entries for the database - /// from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAclsByDatabaseNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListAclsByDatabaseNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of access control list (ACL) entries for the database - /// from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAclsByDatabaseNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAclsByDatabaseNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of access control list (ACL) entries for the Data Lake - /// Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListAclsNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListAclsNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of access control list (ACL) entries for the Data Lake - /// Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAclsNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListAclsNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieves the list of databases from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListDatabasesNext(this ICatalogOperations operations, string nextPageLink) - { - return operations.ListDatabasesNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Retrieves the list of databases from the Data Lake Analytics catalog. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListDatabasesNextAsync(this ICatalogOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListDatabasesNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/ComputePoliciesOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/ComputePoliciesOperations.cs index a4943d3c4877..b9a5ce689486 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/ComputePoliciesOperations.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/ComputePoliciesOperations.cs @@ -66,7 +66,7 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -182,14 +182,13 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -199,10 +198,6 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie } 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); @@ -272,7 +267,7 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -409,14 +404,13 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -426,10 +420,6 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie } 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); @@ -492,7 +482,7 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -614,14 +604,13 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -631,10 +620,6 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie } 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); @@ -700,7 +685,7 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -829,14 +814,13 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -846,10 +830,6 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie } 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); @@ -913,7 +893,7 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1032,14 +1012,13 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie 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 ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1049,10 +1028,6 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie } 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); @@ -1092,7 +1067,7 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1188,14 +1163,13 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1205,10 +1179,6 @@ internal ComputePoliciesOperations(DataLakeAnalyticsAccountManagementClient clie } 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/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/DataLakeAnalyticsAccountManagementClient.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/DataLakeAnalyticsAccountManagementClient.cs index a26d529e7ff3..5ec05fcaa38b 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/DataLakeAnalyticsAccountManagementClient.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/DataLakeAnalyticsAccountManagementClient.cs @@ -206,7 +206,7 @@ protected DataLakeAnalyticsAccountManagementClient(System.Uri baseUri, HttpClien /// /// Thrown when a required parameter is null /// - internal DataLakeAnalyticsAccountManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public DataLakeAnalyticsAccountManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { @@ -233,7 +233,7 @@ internal DataLakeAnalyticsAccountManagementClient(ServiceClientCredentials crede /// /// Thrown when a required parameter is null /// - internal DataLakeAnalyticsAccountManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public DataLakeAnalyticsAccountManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { @@ -261,7 +261,7 @@ internal DataLakeAnalyticsAccountManagementClient(ServiceClientCredentials crede /// /// Thrown when a required parameter is null /// - internal DataLakeAnalyticsAccountManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public DataLakeAnalyticsAccountManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { @@ -289,7 +289,7 @@ internal DataLakeAnalyticsAccountManagementClient(ServiceClientCredentials crede /// /// Thrown when a required parameter is null /// - internal DataLakeAnalyticsAccountManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public DataLakeAnalyticsAccountManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -325,7 +325,7 @@ internal DataLakeAnalyticsAccountManagementClient(System.Uri baseUri, ServiceCli /// /// Thrown when a required parameter is null /// - internal DataLakeAnalyticsAccountManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public DataLakeAnalyticsAccountManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/DataLakeAnalyticsCatalogManagementClient.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/DataLakeAnalyticsCatalogManagementClient.cs deleted file mode 100644 index b2c21cd6328c..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/DataLakeAnalyticsCatalogManagementClient.cs +++ /dev/null @@ -1,246 +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.DataLake.Analytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - - /// - /// Creates an Azure Data Lake Analytics catalog client. - /// - public partial class DataLakeAnalyticsCatalogManagementClient : ServiceClient, IDataLakeAnalyticsCatalogManagementClient, IAzureClient - { - /// - /// The base URI of the service. - /// - internal string BaseUri {get; set;} - - /// - /// Gets or sets json serialization settings. - /// - public JsonSerializerSettings SerializationSettings { get; private set; } - - /// - /// Gets or sets json deserialization settings. - /// - public JsonSerializerSettings DeserializationSettings { get; private set; } - - /// - /// Credentials needed for the client to connect to Azure. - /// - public ServiceClientCredentials Credentials { get; private set; } - - /// - /// Client Api Version. - /// - public string ApiVersion { get; private set; } - - /// - /// Gets the DNS suffix used as the base for all Azure Data Lake Analytics - /// Catalog service requests. - /// - public string AdlaCatalogDnsSuffix { get; set; } - - /// - /// The preferred language for the response. - /// - public string AcceptLanguage { get; set; } - - /// - /// The retry timeout in seconds for Long Running Operations. Default value is - /// 30. - /// - public int? LongRunningOperationRetryTimeout { get; set; } - - /// - /// Whether a unique x-ms-client-request-id should be generated. When set to - /// true a unique x-ms-client-request-id value is generated and included in - /// each request. Default is true. - /// - public bool? GenerateClientRequestId { get; set; } - - /// - /// Gets the ICatalogOperations. - /// - public virtual ICatalogOperations Catalog { get; private set; } - - /// - /// Initializes a new instance of the DataLakeAnalyticsCatalogManagementClient class. - /// - /// - /// HttpClient to be used - /// - /// - /// True: will dispose the provided httpClient on calling DataLakeAnalyticsCatalogManagementClient.Dispose(). False: will not dispose provided httpClient - protected DataLakeAnalyticsCatalogManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) - { - Initialize(); - } - - /// - /// Initializes a new instance of the DataLakeAnalyticsCatalogManagementClient class. - /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// - protected DataLakeAnalyticsCatalogManagementClient(params DelegatingHandler[] handlers) : base(handlers) - { - Initialize(); - } - - /// - /// Initializes a new instance of the DataLakeAnalyticsCatalogManagementClient class. - /// - /// - /// Optional. The http client handler used to handle http transport. - /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// - protected DataLakeAnalyticsCatalogManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) - { - Initialize(); - } - - /// - /// Initializes a new instance of the DataLakeAnalyticsCatalogManagementClient class. - /// - /// - /// Required. Credentials needed for the client to connect to Azure. - /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// - /// - /// Thrown when a required parameter is null - /// - internal DataLakeAnalyticsCatalogManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) - { - if (credentials == null) - { - throw new System.ArgumentNullException("credentials"); - } - Credentials = credentials; - if (Credentials != null) - { - Credentials.InitializeServiceClient(this); - } - } - - /// - /// Initializes a new instance of the DataLakeAnalyticsCatalogManagementClient class. - /// - /// - /// Required. Credentials needed for the client to connect to Azure. - /// - /// - /// HttpClient to be used - /// - /// - /// True: will dispose the provided httpClient on calling DataLakeAnalyticsCatalogManagementClient.Dispose(). False: will not dispose provided httpClient - /// - /// Thrown when a required parameter is null - /// - internal DataLakeAnalyticsCatalogManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) - { - if (credentials == null) - { - throw new System.ArgumentNullException("credentials"); - } - Credentials = credentials; - if (Credentials != null) - { - Credentials.InitializeServiceClient(this); - } - } - - /// - /// Initializes a new instance of the DataLakeAnalyticsCatalogManagementClient class. - /// - /// - /// Required. Credentials needed for the client to connect to Azure. - /// - /// - /// Optional. The http client handler used to handle http transport. - /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// - /// - /// Thrown when a required parameter is null - /// - internal DataLakeAnalyticsCatalogManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) - { - if (credentials == null) - { - throw new System.ArgumentNullException("credentials"); - } - Credentials = credentials; - if (Credentials != null) - { - Credentials.InitializeServiceClient(this); - } - } - - /// - /// An optional partial-method to perform custom initialization. - /// - partial void CustomInitialize(); - /// - /// Initializes client properties. - /// - private void Initialize() - { - Catalog = new CatalogOperations(this); - BaseUri = "https://{accountName}.{adlaCatalogDnsSuffix}"; - ApiVersion = "2016-11-01"; - AdlaCatalogDnsSuffix = "azuredatalakeanalytics.net"; - AcceptLanguage = "en-US"; - LongRunningOperationRetryTimeout = 30; - GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings - { - Formatting = Newtonsoft.Json.Formatting.Indented, - DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, - NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, - ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List - { - new Iso8601TimeSpanConverter() - } - }; - DeserializationSettings = new JsonSerializerSettings - { - DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, - NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, - ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List - { - new Iso8601TimeSpanConverter() - } - }; - CustomInitialize(); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/DataLakeAnalyticsJobManagementClient.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/DataLakeAnalyticsJobManagementClient.cs deleted file mode 100644 index cc8b0a3364f2..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/DataLakeAnalyticsJobManagementClient.cs +++ /dev/null @@ -1,262 +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.DataLake.Analytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; - using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - - /// - /// Creates an Azure Data Lake Analytics job client. - /// - public partial class DataLakeAnalyticsJobManagementClient : ServiceClient, IDataLakeAnalyticsJobManagementClient, IAzureClient - { - /// - /// The base URI of the service. - /// - internal string BaseUri {get; set;} - - /// - /// Gets or sets json serialization settings. - /// - public JsonSerializerSettings SerializationSettings { get; private set; } - - /// - /// Gets or sets json deserialization settings. - /// - public JsonSerializerSettings DeserializationSettings { get; private set; } - - /// - /// Credentials needed for the client to connect to Azure. - /// - public ServiceClientCredentials Credentials { get; private set; } - - /// - /// The DNS suffix used as the base for all Azure Data Lake Analytics Job - /// service requests. - /// - public string AdlaJobDnsSuffix { get; set; } - - /// - /// Client Api Version. - /// - public string ApiVersion { get; private set; } - - /// - /// The preferred language for the response. - /// - public string AcceptLanguage { get; set; } - - /// - /// The retry timeout in seconds for Long Running Operations. Default value is - /// 30. - /// - public int? LongRunningOperationRetryTimeout { get; set; } - - /// - /// Whether a unique x-ms-client-request-id should be generated. When set to - /// true a unique x-ms-client-request-id value is generated and included in - /// each request. Default is true. - /// - public bool? GenerateClientRequestId { get; set; } - - /// - /// Gets the IJobOperations. - /// - public virtual IJobOperations Job { get; private set; } - - /// - /// Gets the IPipelineOperations. - /// - public virtual IPipelineOperations Pipeline { get; private set; } - - /// - /// Gets the IRecurrenceOperations. - /// - public virtual IRecurrenceOperations Recurrence { get; private set; } - - /// - /// Initializes a new instance of the DataLakeAnalyticsJobManagementClient class. - /// - /// - /// HttpClient to be used - /// - /// - /// True: will dispose the provided httpClient on calling DataLakeAnalyticsJobManagementClient.Dispose(). False: will not dispose provided httpClient - protected DataLakeAnalyticsJobManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) - { - Initialize(); - } - - /// - /// Initializes a new instance of the DataLakeAnalyticsJobManagementClient class. - /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// - protected DataLakeAnalyticsJobManagementClient(params DelegatingHandler[] handlers) : base(handlers) - { - Initialize(); - } - - /// - /// Initializes a new instance of the DataLakeAnalyticsJobManagementClient class. - /// - /// - /// Optional. The http client handler used to handle http transport. - /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// - protected DataLakeAnalyticsJobManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) - { - Initialize(); - } - - /// - /// Initializes a new instance of the DataLakeAnalyticsJobManagementClient class. - /// - /// - /// Required. Credentials needed for the client to connect to Azure. - /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// - /// - /// Thrown when a required parameter is null - /// - internal DataLakeAnalyticsJobManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) - { - if (credentials == null) - { - throw new System.ArgumentNullException("credentials"); - } - Credentials = credentials; - if (Credentials != null) - { - Credentials.InitializeServiceClient(this); - } - } - - /// - /// Initializes a new instance of the DataLakeAnalyticsJobManagementClient class. - /// - /// - /// Required. Credentials needed for the client to connect to Azure. - /// - /// - /// HttpClient to be used - /// - /// - /// True: will dispose the provided httpClient on calling DataLakeAnalyticsJobManagementClient.Dispose(). False: will not dispose provided httpClient - /// - /// Thrown when a required parameter is null - /// - internal DataLakeAnalyticsJobManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) - { - if (credentials == null) - { - throw new System.ArgumentNullException("credentials"); - } - Credentials = credentials; - if (Credentials != null) - { - Credentials.InitializeServiceClient(this); - } - } - - /// - /// Initializes a new instance of the DataLakeAnalyticsJobManagementClient class. - /// - /// - /// Required. Credentials needed for the client to connect to Azure. - /// - /// - /// Optional. The http client handler used to handle http transport. - /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// - /// - /// Thrown when a required parameter is null - /// - internal DataLakeAnalyticsJobManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) - { - if (credentials == null) - { - throw new System.ArgumentNullException("credentials"); - } - Credentials = credentials; - if (Credentials != null) - { - Credentials.InitializeServiceClient(this); - } - } - - /// - /// An optional partial-method to perform custom initialization. - /// - partial void CustomInitialize(); - /// - /// Initializes client properties. - /// - private void Initialize() - { - Job = new JobOperations(this); - Pipeline = new PipelineOperations(this); - Recurrence = new RecurrenceOperations(this); - BaseUri = "https://{accountName}.{adlaJobDnsSuffix}"; - AdlaJobDnsSuffix = "azuredatalakeanalytics.net"; - ApiVersion = "2017-09-01-preview"; - AcceptLanguage = "en-US"; - LongRunningOperationRetryTimeout = 30; - GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings - { - Formatting = Newtonsoft.Json.Formatting.Indented, - DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, - NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, - ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List - { - new Iso8601TimeSpanConverter() - } - }; - DeserializationSettings = new JsonSerializerSettings - { - DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, - DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, - NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, - ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List - { - new Iso8601TimeSpanConverter() - } - }; - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); - CustomInitialize(); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/DataLakeStoreAccountsOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/DataLakeStoreAccountsOperations.cs index 59a55f12dc81..f884d4f4347a 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/DataLakeStoreAccountsOperations.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/DataLakeStoreAccountsOperations.cs @@ -80,7 +80,7 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -215,14 +215,13 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -232,10 +231,6 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien } 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); @@ -302,7 +297,7 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -428,14 +423,13 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -445,10 +439,6 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien } 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); @@ -494,7 +484,7 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -616,14 +606,13 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -633,10 +622,6 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien } 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); @@ -700,7 +685,7 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -819,14 +804,13 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -836,10 +820,6 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien } 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); @@ -880,7 +860,7 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -976,14 +956,13 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -993,10 +972,6 @@ internal DataLakeStoreAccountsOperations(DataLakeAnalyticsAccountManagementClien } 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/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/FirewallRulesOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/FirewallRulesOperations.cs index 1026918b64ba..4841e4d54199 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/FirewallRulesOperations.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/FirewallRulesOperations.cs @@ -66,7 +66,7 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -182,14 +182,13 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient 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 ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -199,10 +198,6 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient 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); @@ -269,7 +264,7 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -406,14 +401,13 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient 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 ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -423,10 +417,6 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient 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); @@ -489,7 +479,7 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -611,14 +601,13 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient 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 ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -628,10 +617,6 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient 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); @@ -697,7 +682,7 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -826,14 +811,13 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient 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 ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -843,10 +827,6 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient 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); @@ -910,7 +890,7 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1029,14 +1009,13 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient 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 ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1046,10 +1025,6 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient 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 +1064,7 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1185,14 +1160,13 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient 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 ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1202,10 +1176,6 @@ internal FirewallRulesOperations(DataLakeAnalyticsAccountManagementClient 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/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IAccountsOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IAccountsOperations.cs index 21d939d3f03c..a5b61d5acdfb 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IAccountsOperations.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IAccountsOperations.cs @@ -48,7 +48,7 @@ public partial interface IAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -85,7 +85,7 @@ public partial interface IAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -115,7 +115,7 @@ public partial interface IAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -140,7 +140,7 @@ public partial interface IAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -170,7 +170,7 @@ public partial interface IAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -196,7 +196,7 @@ public partial interface IAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -219,7 +219,7 @@ public partial interface IAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -249,7 +249,7 @@ public partial interface IAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -279,7 +279,7 @@ public partial interface IAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -305,7 +305,7 @@ public partial interface IAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -326,7 +326,7 @@ public partial interface IAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -350,7 +350,7 @@ public partial interface IAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/ICatalogOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/ICatalogOperations.cs deleted file mode 100644 index 42991f9df1c6..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/ICatalogOperations.cs +++ /dev/null @@ -1,2312 +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.DataLake.Analytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// CatalogOperations operations. - /// - public partial interface ICatalogOperations - { - /// - /// Creates the specified secret for use with external data sources in - /// the specified database. This is deprecated and will be removed in - /// the next release. Please use CreateCredential instead. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database in which to create the secret. - /// - /// - /// The name of the secret. - /// - /// - /// The parameters required to create the secret (name and password) - /// - /// - /// 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 - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - Task CreateSecretWithHttpMessagesAsync(string accountName, string databaseName, string secretName, DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the specified secret in the specified database. This is - /// deprecated and will be removed in the next release. Please use - /// GetCredential instead. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the secret. - /// - /// - /// The name of the secret to get - /// - /// - /// 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 - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - Task> GetSecretWithHttpMessagesAsync(string accountName, string databaseName, string secretName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Modifies the specified secret for use with external data sources in - /// the specified database. This is deprecated and will be removed in - /// the next release. Please use UpdateCredential instead. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the secret. - /// - /// - /// The name of the secret. - /// - /// - /// The parameters required to modify the secret (name and password) - /// - /// - /// 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 - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - Task UpdateSecretWithHttpMessagesAsync(string accountName, string databaseName, string secretName, DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes the specified secret in the specified database. This is - /// deprecated and will be removed in the next release. Please use - /// DeleteCredential instead. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the secret. - /// - /// - /// The name of the secret to delete - /// - /// - /// 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 - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - Task DeleteSecretWithHttpMessagesAsync(string accountName, string databaseName, string secretName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes all secrets in the specified database. This is deprecated - /// and will be removed in the next release. In the future, please only - /// drop individual credentials using DeleteCredential - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the secret. - /// - /// - /// 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 - /// - [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] - Task DeleteAllSecretsWithHttpMessagesAsync(string accountName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Creates the specified credential for use with external data sources - /// in the specified database. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database in which to create the credential. Note: - /// This is NOT an external database name, but the name of an existing - /// U-SQL database that should contain the new credential object. - /// - /// - /// The name of the credential. - /// - /// - /// The parameters required to create the credential (name and - /// password) - /// - /// - /// 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 CreateCredentialWithHttpMessagesAsync(string accountName, string databaseName, string credentialName, DataLakeAnalyticsCatalogCredentialCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the specified credential from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the schema. - /// - /// - /// The name of the credential. - /// - /// - /// 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> GetCredentialWithHttpMessagesAsync(string accountName, string databaseName, string credentialName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Modifies the specified credential for use with external data - /// sources in the specified database - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the credential. - /// - /// - /// The name of the credential. - /// - /// - /// The parameters required to modify the credential (name and - /// password) - /// - /// - /// 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 UpdateCredentialWithHttpMessagesAsync(string accountName, string databaseName, string credentialName, DataLakeAnalyticsCatalogCredentialUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Deletes the specified credential in the specified database - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the credential. - /// - /// - /// The name of the credential to delete - /// - /// - /// The parameters to delete a credential if the current user is not - /// the account owner. - /// - /// - /// Indicates if the delete should be a cascading delete (which deletes - /// all resources dependent on the credential as well as the - /// credential) or not. If false will fail if there are any resources - /// relying on the credential. - /// - /// - /// 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 DeleteCredentialWithHttpMessagesAsync(string accountName, string databaseName, string credentialName, DataLakeAnalyticsCatalogCredentialDeleteParameters parameters = default(DataLakeAnalyticsCatalogCredentialDeleteParameters), bool? cascade = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of credentials from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the schema. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListCredentialsWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the specified external data source from the Data Lake - /// Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the external data source. - /// - /// - /// The name of the external data source. - /// - /// - /// 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> GetExternalDataSourceWithHttpMessagesAsync(string accountName, string databaseName, string externalDataSourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of external data sources from the Data Lake - /// Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the external data sources. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListExternalDataSourcesWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the specified procedure from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the procedure. - /// - /// - /// The name of the schema containing the procedure. - /// - /// - /// The name of the procedure. - /// - /// - /// 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> GetProcedureWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string procedureName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of procedures from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the procedures. - /// - /// - /// The name of the schema containing the procedures. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListProceduresWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the specified table from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table. - /// - /// - /// The name of the schema containing the table. - /// - /// - /// The name of the table. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetTableWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of table fragments from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table fragments. - /// - /// - /// The name of the schema containing the table fragments. - /// - /// - /// The name of the table containing the table fragments. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListTableFragmentsWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of tables from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the tables. - /// - /// - /// The name of the schema containing the tables. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// The basic switch indicates what level of information to return when - /// listing tables. When basic is true, only database_name, - /// schema_name, table_name and version are returned for each table, - /// otherwise all table metadata is returned. By default, it is false. - /// Optional. - /// - /// - /// 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>> ListTablesWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), bool? basic = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of all table statistics within the specified - /// schema from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the statistics. - /// - /// - /// The name of the schema containing the statistics. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListTableStatisticsByDatabaseAndSchemaWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the specified table type from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table type. - /// - /// - /// The name of the schema containing the table type. - /// - /// - /// The name of the table type to retrieve. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetTableTypeWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of table types from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table types. - /// - /// - /// The name of the schema containing the table types. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListTableTypesWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the specified package from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the package. - /// - /// - /// The name of the schema containing the package. - /// - /// - /// The name of the package. - /// - /// - /// 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> GetPackageWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string packageName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of packages from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the packages. - /// - /// - /// The name of the schema containing the packages. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListPackagesWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the specified view from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the view. - /// - /// - /// The name of the schema containing the view. - /// - /// - /// The name of the view. - /// - /// - /// 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> GetViewWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string viewName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of views from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the views. - /// - /// - /// The name of the schema containing the views. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListViewsWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the specified table statistics from the Data Lake - /// Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the statistics. - /// - /// - /// The name of the schema containing the statistics. - /// - /// - /// The name of the table containing the statistics. - /// - /// - /// The name of the table statistics. - /// - /// - /// 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> GetTableStatisticWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableName, string statisticsName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of table statistics from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the statistics. - /// - /// - /// The name of the schema containing the statistics. - /// - /// - /// The name of the table containing the statistics. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListTableStatisticsWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves a preview set of rows in given partition. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the partition. - /// - /// - /// The name of the schema containing the partition. - /// - /// - /// The name of the table containing the partition. - /// - /// - /// The name of the table partition. - /// - /// - /// The maximum number of preview rows to be retrieved.Rows returned - /// may be less than or equal to this number depending on row sizes and - /// number of rows in the partition. - /// - /// - /// The maximum number of columns to be retrieved. - /// - /// - /// 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> PreviewTablePartitionWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableName, string partitionName, long? maxRows = default(long?), long? maxColumns = default(long?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the specified table partition from the Data Lake - /// Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the partition. - /// - /// - /// The name of the schema containing the partition. - /// - /// - /// The name of the table containing the partition. - /// - /// - /// The name of the table partition. - /// - /// - /// 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> GetTablePartitionWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableName, string partitionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves a preview set of rows in given table. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table. - /// - /// - /// The name of the schema containing the table. - /// - /// - /// The name of the table. - /// - /// - /// The maximum number of preview rows to be retrieved. Rows returned - /// may be less than or equal to this number depending on row sizes and - /// number of rows in the table. - /// - /// - /// The maximum number of columns to be retrieved. - /// - /// - /// 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> PreviewTableWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableName, long? maxRows = default(long?), long? maxColumns = default(long?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of table partitions from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the partitions. - /// - /// - /// The name of the schema containing the partitions. - /// - /// - /// The name of the table containing the partitions. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListTablePartitionsWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of types within the specified database and - /// schema from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the types. - /// - /// - /// The name of the schema containing the types. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListTypesWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the specified table valued function from the Data Lake - /// Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table valued function. - /// - /// - /// The name of the schema containing the table valued function. - /// - /// - /// The name of the tableValuedFunction. - /// - /// - /// 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> GetTableValuedFunctionWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, string tableValuedFunctionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of table valued functions from the Data Lake - /// Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table valued functions. - /// - /// - /// The name of the schema containing the table valued functions. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListTableValuedFunctionsWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the specified assembly from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the assembly. - /// - /// - /// The name of the assembly. - /// - /// - /// 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> GetAssemblyWithHttpMessagesAsync(string accountName, string databaseName, string assemblyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of assemblies from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the assembly. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListAssembliesWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the specified schema from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the schema. - /// - /// - /// The name of the schema. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetSchemaWithHttpMessagesAsync(string accountName, string databaseName, string schemaName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of schemas from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the schema. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListSchemasWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of all statistics in a database from the Data - /// Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table statistics. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListTableStatisticsByDatabaseWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of all tables in a database from the Data Lake - /// Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the tables. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// The basic switch indicates what level of information to return when - /// listing tables. When basic is true, only database_name, - /// schema_name, table_name and version are returned for each table, - /// otherwise all table metadata is returned. By default, it is false - /// - /// - /// 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>> ListTablesByDatabaseWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), bool? basic = false, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of all table valued functions in a database from - /// the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the table valued functions. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListTableValuedFunctionsByDatabaseWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of all views in a database from the Data Lake - /// Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database containing the views. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListViewsByDatabaseWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of access control list (ACL) entries for the - /// database from the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListAclsByDatabaseWithHttpMessagesAsync(string accountName, string databaseName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of access control list (ACL) entries for the - /// Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListAclsWithHttpMessagesAsync(string accountName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the specified database from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetDatabaseWithHttpMessagesAsync(string accountName, string databaseName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of databases from the Data Lake Analytics - /// catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// 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>> ListDatabasesWithHttpMessagesAsync(string accountName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Grants an access control list (ACL) entry to the Data Lake - /// Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// Parameters supplied to create or update an access control list - /// (ACL) entry for a Data Lake Analytics catalog. - /// - /// - /// 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 GrantAclWithHttpMessagesAsync(string accountName, AclCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Grants an access control list (ACL) entry to the database from the - /// Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database. - /// - /// - /// Parameters supplied to create or update an access control list - /// (ACL) entry for a database. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task GrantAclToDatabaseWithHttpMessagesAsync(string accountName, string databaseName, AclCreateOrUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Revokes an access control list (ACL) entry from the Data Lake - /// Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// Parameters supplied to delete an access control list (ACL) entry - /// from a Data Lake Analytics catalog. - /// - /// - /// 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 RevokeAclWithHttpMessagesAsync(string accountName, AclDeleteParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Revokes an access control list (ACL) entry for the database from - /// the Data Lake Analytics catalog. - /// - /// - /// The Azure Data Lake Analytics account upon which to execute catalog - /// operations. - /// - /// - /// The name of the database. - /// - /// - /// Parameters supplied to delete an access control list (ACL) entry - /// for a database. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task RevokeAclFromDatabaseWithHttpMessagesAsync(string accountName, string databaseName, AclDeleteParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of credentials from the Data Lake Analytics - /// catalog. - /// - /// - /// 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>> ListCredentialsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of external data sources from the Data Lake - /// Analytics catalog. - /// - /// - /// 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>> ListExternalDataSourcesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of procedures from the Data Lake Analytics - /// catalog. - /// - /// - /// 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>> ListProceduresNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of table fragments from the Data Lake Analytics - /// catalog. - /// - /// - /// 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>> ListTableFragmentsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of tables from the Data Lake Analytics catalog. - /// - /// - /// 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>> ListTablesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of all table statistics within the specified - /// schema from the Data Lake Analytics catalog. - /// - /// - /// 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>> ListTableStatisticsByDatabaseAndSchemaNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of table types from the Data Lake Analytics - /// catalog. - /// - /// - /// 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>> ListTableTypesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of packages from the Data Lake Analytics - /// catalog. - /// - /// - /// 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>> ListPackagesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of views from the Data Lake Analytics catalog. - /// - /// - /// 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>> ListViewsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of table statistics from the Data Lake Analytics - /// catalog. - /// - /// - /// 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>> ListTableStatisticsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of table partitions from the Data Lake Analytics - /// catalog. - /// - /// - /// 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>> ListTablePartitionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of types within the specified database and - /// schema from the Data Lake Analytics catalog. - /// - /// - /// 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>> ListTypesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of table valued functions from the Data Lake - /// Analytics catalog. - /// - /// - /// 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>> ListTableValuedFunctionsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of assemblies from the Data Lake Analytics - /// catalog. - /// - /// - /// 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>> ListAssembliesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of schemas from the Data Lake Analytics catalog. - /// - /// - /// 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>> ListSchemasNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of all statistics in a database from the Data - /// Lake Analytics catalog. - /// - /// - /// 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>> ListTableStatisticsByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of all tables in a database from the Data Lake - /// Analytics catalog. - /// - /// - /// 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>> ListTablesByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of all table valued functions in a database from - /// the Data Lake Analytics catalog. - /// - /// - /// 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>> ListTableValuedFunctionsByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of all views in a database from the Data Lake - /// Analytics catalog. - /// - /// - /// 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>> ListViewsByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of access control list (ACL) entries for the - /// database from the Data Lake Analytics catalog. - /// - /// - /// 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>> ListAclsByDatabaseNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of access control list (ACL) entries for the - /// Data Lake Analytics catalog. - /// - /// - /// 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>> ListAclsNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Retrieves the list of databases from the Data Lake Analytics - /// catalog. - /// - /// - /// 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>> ListDatabasesNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IComputePoliciesOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IComputePoliciesOperations.cs index c3f10d50b906..1a8c458c8875 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IComputePoliciesOperations.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IComputePoliciesOperations.cs @@ -40,7 +40,7 @@ public partial interface IComputePoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -75,7 +75,7 @@ public partial interface IComputePoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -103,7 +103,7 @@ public partial interface IComputePoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -134,7 +134,7 @@ public partial interface IComputePoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -163,7 +163,7 @@ public partial interface IComputePoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -184,7 +184,7 @@ public partial interface IComputePoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IDataLakeAnalyticsCatalogManagementClient.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IDataLakeAnalyticsCatalogManagementClient.cs deleted file mode 100644 index 61afb09109ba..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IDataLakeAnalyticsCatalogManagementClient.cs +++ /dev/null @@ -1,78 +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.DataLake.Analytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - - /// - /// Creates an Azure Data Lake Analytics catalog client. - /// - public partial interface IDataLakeAnalyticsCatalogManagementClient : System.IDisposable - { - /// - /// The base URI of the service. - /// - - /// - /// Gets or sets json serialization settings. - /// - JsonSerializerSettings SerializationSettings { get; } - - /// - /// Gets or sets json deserialization settings. - /// - JsonSerializerSettings DeserializationSettings { get; } - - /// - /// Credentials needed for the client to connect to Azure. - /// - ServiceClientCredentials Credentials { get; } - - /// - /// Client Api Version. - /// - string ApiVersion { get; } - - /// - /// Gets the DNS suffix used as the base for all Azure Data Lake - /// Analytics Catalog service requests. - /// - string AdlaCatalogDnsSuffix { get; set; } - - /// - /// The preferred language for the response. - /// - string AcceptLanguage { get; set; } - - /// - /// The retry timeout in seconds for Long Running Operations. Default - /// value is 30. - /// - int? LongRunningOperationRetryTimeout { get; set; } - - /// - /// Whether a unique x-ms-client-request-id should be generated. When - /// set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. - /// - bool? GenerateClientRequestId { get; set; } - - - /// - /// Gets the ICatalogOperations. - /// - ICatalogOperations Catalog { get; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IDataLakeAnalyticsJobManagementClient.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IDataLakeAnalyticsJobManagementClient.cs deleted file mode 100644 index c6de3353119c..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IDataLakeAnalyticsJobManagementClient.cs +++ /dev/null @@ -1,88 +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.DataLake.Analytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using Newtonsoft.Json; - - /// - /// Creates an Azure Data Lake Analytics job client. - /// - public partial interface IDataLakeAnalyticsJobManagementClient : System.IDisposable - { - /// - /// The base URI of the service. - /// - - /// - /// Gets or sets json serialization settings. - /// - JsonSerializerSettings SerializationSettings { get; } - - /// - /// Gets or sets json deserialization settings. - /// - JsonSerializerSettings DeserializationSettings { get; } - - /// - /// Credentials needed for the client to connect to Azure. - /// - ServiceClientCredentials Credentials { get; } - - /// - /// The DNS suffix used as the base for all Azure Data Lake Analytics - /// Job service requests. - /// - string AdlaJobDnsSuffix { get; set; } - - /// - /// Client Api Version. - /// - string ApiVersion { get; } - - /// - /// The preferred language for the response. - /// - string AcceptLanguage { get; set; } - - /// - /// The retry timeout in seconds for Long Running Operations. Default - /// value is 30. - /// - int? LongRunningOperationRetryTimeout { get; set; } - - /// - /// Whether a unique x-ms-client-request-id should be generated. When - /// set to true a unique x-ms-client-request-id value is generated and - /// included in each request. Default is true. - /// - bool? GenerateClientRequestId { get; set; } - - - /// - /// Gets the IJobOperations. - /// - IJobOperations Job { get; } - - /// - /// Gets the IPipelineOperations. - /// - IPipelineOperations Pipeline { get; } - - /// - /// Gets the IRecurrenceOperations. - /// - IRecurrenceOperations Recurrence { get; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IDataLakeStoreAccountsOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IDataLakeStoreAccountsOperations.cs index b121d521c517..a346ca88c95a 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IDataLakeStoreAccountsOperations.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IDataLakeStoreAccountsOperations.cs @@ -54,7 +54,7 @@ public partial interface IDataLakeStoreAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -86,7 +86,7 @@ public partial interface IDataLakeStoreAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -112,7 +112,7 @@ public partial interface IDataLakeStoreAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -141,7 +141,7 @@ public partial interface IDataLakeStoreAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -162,7 +162,7 @@ public partial interface IDataLakeStoreAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IFirewallRulesOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IFirewallRulesOperations.cs index 02f5cc0238ce..5359511fd1f0 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IFirewallRulesOperations.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IFirewallRulesOperations.cs @@ -39,7 +39,7 @@ public partial interface IFirewallRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -72,7 +72,7 @@ public partial interface IFirewallRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -100,7 +100,7 @@ public partial interface IFirewallRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -131,7 +131,7 @@ public partial interface IFirewallRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -160,7 +160,7 @@ public partial interface IFirewallRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -180,7 +180,7 @@ public partial interface IFirewallRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IJobOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IJobOperations.cs deleted file mode 100644 index 849feaa69e20..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IJobOperations.cs +++ /dev/null @@ -1,376 +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.DataLake.Analytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// JobOperations operations. - /// - public partial interface IJobOperations - { - /// - /// Lists the jobs, if any, associated with the specified Data Lake - /// Analytics account. The response includes a link to the next page of - /// results, if any. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just - /// those requested, e.g. Categories?$select=CategoryName,Description. - /// Optional. - /// - /// - /// The Boolean value of true or false to request a count of the - /// matching resources included with the resources in the response, - /// e.g. Categories?$count=true. Optional. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string accountName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Submits a job to the specified Data Lake Analytics account. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs - /// submitted to the service. - /// - /// - /// The parameters to submit a job. - /// - /// - /// 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> CreateWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, CreateJobParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the job information for the specified job ID. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// JobInfo ID. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates the job information for the specified job ID. (Only for use - /// internally with Scope job type.) - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs - /// submitted to the service. - /// - /// - /// The parameters to update a job. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, UpdateJobParameters parameters = default(UpdateJobParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets statistics of the specified job. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job Information ID. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> GetStatisticsWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the job debug data information specified by the job ID. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs - /// submitted to the service. - /// - /// - /// 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> GetDebugDataPathWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Cancels the running job specified by the job ID. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs - /// submitted to the service. - /// - /// - /// 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 CancelWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Pauses the specified job and places it back in the job queue, - /// behind other jobs of equal or higher importance, based on priority. - /// (Only for use internally with Scope job type.) - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs - /// submitted to the service. - /// - /// - /// 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 YieldOperationWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Builds (compiles) the specified job in the specified Data Lake - /// Analytics account for job correctness and validation. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// The parameters to build a job. - /// - /// - /// 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> BuildWithHttpMessagesAsync(string accountName, BuildJobParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates the job information for the specified job ID. (Only for use - /// internally with Scope job type.) - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs - /// submitted to the service. - /// - /// - /// The parameters to update a job. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> BeginUpdateWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, UpdateJobParameters parameters = default(UpdateJobParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Cancels the running job specified by the job ID. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs - /// submitted to the service. - /// - /// - /// 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 BeginCancelWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Pauses the specified job and places it back in the job queue, - /// behind other jobs of equal or higher importance, based on priority. - /// (Only for use internally with Scope job type.) - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs - /// submitted to the service. - /// - /// - /// 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 BeginYieldOperationWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists the jobs, if any, associated with the specified Data Lake - /// Analytics account. The response includes a link to the next page of - /// results, if any. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/ILocationsOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/ILocationsOperations.cs index e0edd17c25fd..6d33adc023f2 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/ILocationsOperations.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/ILocationsOperations.cs @@ -36,7 +36,7 @@ public partial interface ILocationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IOperations.cs index 2bba0812e57c..76c2703813eb 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IOperations.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IOperations.cs @@ -32,7 +32,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IPipelineOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IPipelineOperations.cs deleted file mode 100644 index de45d79a6992..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IPipelineOperations.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.DataLake.Analytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// PipelineOperations operations. - /// - public partial interface IPipelineOperations - { - /// - /// Lists all pipelines. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// The start date for when to get the list of pipelines. The - /// startDateTime and endDateTime can be no more than 30 days apart. - /// - /// - /// The end date for when to get the list of pipelines. The - /// startDateTime and endDateTime can be no more than 30 days apart. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string accountName, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the Pipeline information for the specified pipeline ID. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Pipeline ID. - /// - /// - /// The start date for when to get the pipeline and aggregate its data. - /// The startDateTime and endDateTime can be no more than 30 days - /// apart. - /// - /// - /// The end date for when to get the pipeline and aggregate its data. - /// The startDateTime and endDateTime can be no more than 30 days - /// apart. - /// - /// - /// 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 accountName, System.Guid pipelineIdentity, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all pipelines. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IRecurrenceOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IRecurrenceOperations.cs deleted file mode 100644 index f9d6cc9419d5..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IRecurrenceOperations.cs +++ /dev/null @@ -1,113 +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.DataLake.Analytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// RecurrenceOperations operations. - /// - public partial interface IRecurrenceOperations - { - /// - /// Lists all recurrences. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// The start date for when to get the list of recurrences. The - /// startDateTime and endDateTime can be no more than 30 days apart. - /// - /// - /// The end date for when to get the list of recurrences. The - /// startDateTime and endDateTime can be no more than 30 days apart. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(string accountName, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the recurrence information for the specified recurrence ID. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Recurrence ID. - /// - /// - /// The start date for when to get the recurrence and aggregate its - /// data. The startDateTime and endDateTime can be no more than 30 days - /// apart. - /// - /// - /// The end date for when to get recurrence and aggregate its data. The - /// startDateTime and endDateTime can be no more than 30 days apart. - /// - /// - /// 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 accountName, System.Guid recurrenceIdentity, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists all recurrences. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IStorageAccountsOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IStorageAccountsOperations.cs index ef1d1cce639f..fa10a7a23d0f 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IStorageAccountsOperations.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/IStorageAccountsOperations.cs @@ -54,7 +54,7 @@ public partial interface IStorageAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -87,7 +87,7 @@ public partial interface IStorageAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -114,7 +114,7 @@ public partial interface IStorageAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -147,7 +147,7 @@ public partial interface IStorageAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -173,7 +173,7 @@ public partial interface IStorageAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -202,7 +202,7 @@ public partial interface IStorageAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -235,7 +235,7 @@ public partial interface IStorageAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -269,7 +269,7 @@ public partial interface IStorageAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -293,7 +293,7 @@ public partial interface IStorageAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -318,7 +318,7 @@ public partial interface IStorageAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -341,7 +341,7 @@ public partial interface IStorageAccountsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/JobOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/JobOperations.cs deleted file mode 100644 index 4fbfbbcdc23d..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/JobOperations.cs +++ /dev/null @@ -1,2067 +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.DataLake.Analytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - 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; - - /// - /// JobOperations operations. - /// - internal partial class JobOperations : IServiceOperations, IJobOperations - { - /// - /// Initializes a new instance of the JobOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal JobOperations(DataLakeAnalyticsJobManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the DataLakeAnalyticsJobManagementClient - /// - public DataLakeAnalyticsJobManagementClient Client { get; private set; } - - /// - /// Lists the jobs, if any, associated with the specified Data Lake Analytics - /// account. The response includes a link to the next page of results, if any. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListWithHttpMessagesAsync(string accountName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaJobDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaJobDnsSuffix"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("select", select); - tracingParameters.Add("count", count); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "jobs"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaJobDnsSuffix}", Client.AdlaJobDnsSuffix); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (select != null) - { - _queryParameters.Add(string.Format("$select={0}", System.Uri.EscapeDataString(select))); - } - if (count != null) - { - _queryParameters.Add(string.Format("$count={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(count, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Submits a job to the specified Data Lake Analytics account. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// The parameters to submit a job. - /// - /// - /// 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> CreateWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, CreateJobParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaJobDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaJobDnsSuffix"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("jobIdentity", jobIdentity); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "jobs/{jobIdentity}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaJobDnsSuffix}", Client.AdlaJobDnsSuffix); - _url = _url.Replace("{jobIdentity}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobIdentity, Client.SerializationSettings).Trim('"'))); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the job information for the specified job ID. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// JobInfo ID. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaJobDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaJobDnsSuffix"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("jobIdentity", jobIdentity); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "jobs/{jobIdentity}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaJobDnsSuffix}", Client.AdlaJobDnsSuffix); - _url = _url.Replace("{jobIdentity}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobIdentity, Client.SerializationSettings).Trim('"'))); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Updates the job information for the specified job ID. (Only for use - /// internally with Scope job type.) - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// The parameters to update a job. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task> UpdateWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, UpdateJobParameters parameters = default(UpdateJobParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send Request - AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(accountName, jobIdentity, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets statistics of the specified job. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job Information ID. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetStatisticsWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaJobDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaJobDnsSuffix"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("jobIdentity", jobIdentity); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetStatistics", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "jobs/{jobIdentity}/GetStatistics"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaJobDnsSuffix}", Client.AdlaJobDnsSuffix); - _url = _url.Replace("{jobIdentity}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobIdentity, Client.SerializationSettings).Trim('"'))); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the job debug data information specified by the job ID. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// 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> GetDebugDataPathWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaJobDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaJobDnsSuffix"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("jobIdentity", jobIdentity); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetDebugDataPath", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "jobs/{jobIdentity}/GetDebugDataPath"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaJobDnsSuffix}", Client.AdlaJobDnsSuffix); - _url = _url.Replace("{jobIdentity}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobIdentity, Client.SerializationSettings).Trim('"'))); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Cancels the running job specified by the job ID. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task CancelWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginCancelWithHttpMessagesAsync(accountName, jobIdentity, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Pauses the specified job and places it back in the job queue, behind other - /// jobs of equal or higher importance, based on priority. (Only for use - /// internally with Scope job type.) - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task YieldOperationWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginYieldOperationWithHttpMessagesAsync(accountName, jobIdentity, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Builds (compiles) the specified job in the specified Data Lake Analytics - /// account for job correctness and validation. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// The parameters to build a job. - /// - /// - /// 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> BuildWithHttpMessagesAsync(string accountName, BuildJobParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaJobDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaJobDnsSuffix"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - if (parameters != null) - { - parameters.Validate(); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Build", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "buildJob"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaJobDnsSuffix}", Client.AdlaJobDnsSuffix); - 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(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Updates the job information for the specified job ID. (Only for use - /// internally with Scope job type.) - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// The parameters to update a job. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> BeginUpdateWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, UpdateJobParameters parameters = default(UpdateJobParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaJobDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaJobDnsSuffix"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("jobIdentity", jobIdentity); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "jobs/{jobIdentity}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaJobDnsSuffix}", Client.AdlaJobDnsSuffix); - _url = _url.Replace("{jobIdentity}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobIdentity, Client.SerializationSettings).Trim('"'))); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Cancels the running job specified by the job ID. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// 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 BeginCancelWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaJobDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaJobDnsSuffix"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("jobIdentity", jobIdentity); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCancel", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "jobs/{jobIdentity}/CancelJob"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaJobDnsSuffix}", Client.AdlaJobDnsSuffix); - _url = _url.Replace("{jobIdentity}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobIdentity, Client.SerializationSettings).Trim('"'))); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("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 && (int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Pauses the specified job and places it back in the job queue, behind other - /// jobs of equal or higher importance, based on priority. (Only for use - /// internally with Scope job type.) - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// 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 BeginYieldOperationWithHttpMessagesAsync(string accountName, System.Guid jobIdentity, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaJobDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaJobDnsSuffix"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("jobIdentity", jobIdentity); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginYieldOperation", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "jobs/{jobIdentity}/YieldJob"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaJobDnsSuffix}", Client.AdlaJobDnsSuffix); - _url = _url.Replace("{jobIdentity}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(jobIdentity, Client.SerializationSettings).Trim('"'))); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("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 && (int)_statusCode != 202 && (int)_statusCode != 204) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists the jobs, if any, associated with the specified Data Lake Analytics - /// account. The response includes a link to the next page of results, if any. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/JobOperationsExtensions.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/JobOperationsExtensions.cs deleted file mode 100644 index 2d8c1ee357b6..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/JobOperationsExtensions.cs +++ /dev/null @@ -1,598 +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.DataLake.Analytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for JobOperations. - /// - public static partial class JobOperationsExtensions - { - /// - /// Lists the jobs, if any, associated with the specified Data Lake Analytics - /// account. The response includes a link to the next page of results, if any. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - public static IPage List(this IJobOperations operations, string accountName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?)) - { - return operations.ListAsync(accountName, odataQuery, select, count).GetAwaiter().GetResult(); - } - - /// - /// Lists the jobs, if any, associated with the specified Data Lake Analytics - /// account. The response includes a link to the next page of results, if any. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// OData Select statement. Limits the properties on each entry to just those - /// requested, e.g. Categories?$select=CategoryName,Description. Optional. - /// - /// - /// The Boolean value of true or false to request a count of the matching - /// resources included with the resources in the response, e.g. - /// Categories?$count=true. Optional. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IJobOperations operations, string accountName, ODataQuery odataQuery = default(ODataQuery), string select = default(string), bool? count = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(accountName, odataQuery, select, count, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Submits a job to the specified Data Lake Analytics account. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// The parameters to submit a job. - /// - public static JobInformation Create(this IJobOperations operations, string accountName, System.Guid jobIdentity, CreateJobParameters parameters) - { - return operations.CreateAsync(accountName, jobIdentity, parameters).GetAwaiter().GetResult(); - } - - /// - /// Submits a job to the specified Data Lake Analytics account. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// The parameters to submit a job. - /// - /// - /// The cancellation token. - /// - public static async Task CreateAsync(this IJobOperations operations, string accountName, System.Guid jobIdentity, CreateJobParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateWithHttpMessagesAsync(accountName, jobIdentity, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the job information for the specified job ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// JobInfo ID. - /// - public static JobInformation Get(this IJobOperations operations, string accountName, System.Guid jobIdentity) - { - return operations.GetAsync(accountName, jobIdentity).GetAwaiter().GetResult(); - } - - /// - /// Gets the job information for the specified job ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// JobInfo ID. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IJobOperations operations, string accountName, System.Guid jobIdentity, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(accountName, jobIdentity, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates the job information for the specified job ID. (Only for use - /// internally with Scope job type.) - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// The parameters to update a job. - /// - public static JobInformation Update(this IJobOperations operations, string accountName, System.Guid jobIdentity, UpdateJobParameters parameters = default(UpdateJobParameters)) - { - return operations.UpdateAsync(accountName, jobIdentity, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates the job information for the specified job ID. (Only for use - /// internally with Scope job type.) - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// The parameters to update a job. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IJobOperations operations, string accountName, System.Guid jobIdentity, UpdateJobParameters parameters = default(UpdateJobParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(accountName, jobIdentity, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets statistics of the specified job. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job Information ID. - /// - public static JobStatistics GetStatistics(this IJobOperations operations, string accountName, System.Guid jobIdentity) - { - return operations.GetStatisticsAsync(accountName, jobIdentity).GetAwaiter().GetResult(); - } - - /// - /// Gets statistics of the specified job. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job Information ID. - /// - /// - /// The cancellation token. - /// - public static async Task GetStatisticsAsync(this IJobOperations operations, string accountName, System.Guid jobIdentity, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetStatisticsWithHttpMessagesAsync(accountName, jobIdentity, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the job debug data information specified by the job ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - public static JobDataPath GetDebugDataPath(this IJobOperations operations, string accountName, System.Guid jobIdentity) - { - return operations.GetDebugDataPathAsync(accountName, jobIdentity).GetAwaiter().GetResult(); - } - - /// - /// Gets the job debug data information specified by the job ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// The cancellation token. - /// - public static async Task GetDebugDataPathAsync(this IJobOperations operations, string accountName, System.Guid jobIdentity, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetDebugDataPathWithHttpMessagesAsync(accountName, jobIdentity, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Cancels the running job specified by the job ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - public static void Cancel(this IJobOperations operations, string accountName, System.Guid jobIdentity) - { - operations.CancelAsync(accountName, jobIdentity).GetAwaiter().GetResult(); - } - - /// - /// Cancels the running job specified by the job ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// The cancellation token. - /// - public static async Task CancelAsync(this IJobOperations operations, string accountName, System.Guid jobIdentity, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.CancelWithHttpMessagesAsync(accountName, jobIdentity, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Pauses the specified job and places it back in the job queue, behind other - /// jobs of equal or higher importance, based on priority. (Only for use - /// internally with Scope job type.) - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - public static void YieldOperation(this IJobOperations operations, string accountName, System.Guid jobIdentity) - { - operations.YieldOperationAsync(accountName, jobIdentity).GetAwaiter().GetResult(); - } - - /// - /// Pauses the specified job and places it back in the job queue, behind other - /// jobs of equal or higher importance, based on priority. (Only for use - /// internally with Scope job type.) - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// The cancellation token. - /// - public static async Task YieldOperationAsync(this IJobOperations operations, string accountName, System.Guid jobIdentity, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.YieldOperationWithHttpMessagesAsync(accountName, jobIdentity, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Builds (compiles) the specified job in the specified Data Lake Analytics - /// account for job correctness and validation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// The parameters to build a job. - /// - public static JobInformation Build(this IJobOperations operations, string accountName, BuildJobParameters parameters) - { - return operations.BuildAsync(accountName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Builds (compiles) the specified job in the specified Data Lake Analytics - /// account for job correctness and validation. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// The parameters to build a job. - /// - /// - /// The cancellation token. - /// - public static async Task BuildAsync(this IJobOperations operations, string accountName, BuildJobParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BuildWithHttpMessagesAsync(accountName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates the job information for the specified job ID. (Only for use - /// internally with Scope job type.) - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// The parameters to update a job. - /// - public static JobInformation BeginUpdate(this IJobOperations operations, string accountName, System.Guid jobIdentity, UpdateJobParameters parameters = default(UpdateJobParameters)) - { - return operations.BeginUpdateAsync(accountName, jobIdentity, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates the job information for the specified job ID. (Only for use - /// internally with Scope job type.) - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// The parameters to update a job. - /// - /// - /// The cancellation token. - /// - public static async Task BeginUpdateAsync(this IJobOperations operations, string accountName, System.Guid jobIdentity, UpdateJobParameters parameters = default(UpdateJobParameters), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(accountName, jobIdentity, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Cancels the running job specified by the job ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - public static void BeginCancel(this IJobOperations operations, string accountName, System.Guid jobIdentity) - { - operations.BeginCancelAsync(accountName, jobIdentity).GetAwaiter().GetResult(); - } - - /// - /// Cancels the running job specified by the job ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// The cancellation token. - /// - public static async Task BeginCancelAsync(this IJobOperations operations, string accountName, System.Guid jobIdentity, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginCancelWithHttpMessagesAsync(accountName, jobIdentity, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Pauses the specified job and places it back in the job queue, behind other - /// jobs of equal or higher importance, based on priority. (Only for use - /// internally with Scope job type.) - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - public static void BeginYieldOperation(this IJobOperations operations, string accountName, System.Guid jobIdentity) - { - operations.BeginYieldOperationAsync(accountName, jobIdentity).GetAwaiter().GetResult(); - } - - /// - /// Pauses the specified job and places it back in the job queue, behind other - /// jobs of equal or higher importance, based on priority. (Only for use - /// internally with Scope job type.) - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Job identifier. Uniquely identifies the job across all jobs submitted to - /// the service. - /// - /// - /// The cancellation token. - /// - public static async Task BeginYieldOperationAsync(this IJobOperations operations, string accountName, System.Guid jobIdentity, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginYieldOperationWithHttpMessagesAsync(accountName, jobIdentity, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Lists the jobs, if any, associated with the specified Data Lake Analytics - /// account. The response includes a link to the next page of results, if any. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IJobOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists the jobs, if any, associated with the specified Data Lake Analytics - /// account. The response includes a link to the next page of results, if any. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IJobOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/LocationsOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/LocationsOperations.cs index 533424b45c79..2b69f493b55d 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/LocationsOperations.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/LocationsOperations.cs @@ -63,7 +63,7 @@ internal LocationsOperations(DataLakeAnalyticsAccountManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -173,14 +173,13 @@ internal LocationsOperations(DataLakeAnalyticsAccountManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 404) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -190,10 +189,6 @@ internal LocationsOperations(DataLakeAnalyticsAccountManagementClient 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/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/Acl.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/Acl.cs deleted file mode 100644 index 813fbe52847f..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/Acl.cs +++ /dev/null @@ -1,79 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog access control list (ACL) entry. - /// - public partial class Acl - { - /// - /// Initializes a new instance of the Acl class. - /// - public Acl() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Acl class. - /// - /// the access control list (ACL) entry type. - /// UserObj and GroupObj denote the owning user and group, - /// respectively. Possible values include: 'UserObj', 'GroupObj', - /// 'Other', 'User', 'Group' - /// the Azure AD object ID of the user or - /// group being specified in the access control list (ACL) - /// entry. - /// the permission type of the access control - /// list (ACL) entry. Possible values include: 'None', 'Use', 'Create', - /// 'Drop', 'Alter', 'Write', 'All' - public Acl(string aceType = default(string), System.Guid? principalId = default(System.Guid?), string permission = default(string)) - { - AceType = aceType; - PrincipalId = principalId; - Permission = permission; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the access control list (ACL) entry type. UserObj and GroupObj - /// denote the owning user and group, respectively. Possible values - /// include: 'UserObj', 'GroupObj', 'Other', 'User', 'Group' - /// - [JsonProperty(PropertyName = "aceType")] - public string AceType { get; private set; } - - /// - /// Gets the Azure AD object ID of the user or group being specified in - /// the access control list (ACL) entry. - /// - [JsonProperty(PropertyName = "principalId")] - public System.Guid? PrincipalId { get; private set; } - - /// - /// Gets the permission type of the access control list (ACL) entry. - /// Possible values include: 'None', 'Use', 'Create', 'Drop', 'Alter', - /// 'Write', 'All' - /// - [JsonProperty(PropertyName = "permission")] - public string Permission { get; private set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/AclCreateOrUpdateParameters.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/AclCreateOrUpdateParameters.cs deleted file mode 100644 index 7badbc293e0d..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/AclCreateOrUpdateParameters.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.DataLake.Analytics.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// The parameters used to create or update an access control list (ACL) - /// entry. - /// - public partial class AclCreateOrUpdateParameters - { - /// - /// Initializes a new instance of the AclCreateOrUpdateParameters - /// class. - /// - public AclCreateOrUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AclCreateOrUpdateParameters - /// class. - /// - /// the access control list (ACL) entry type. - /// UserObj and GroupObj denote the owning user and group, - /// respectively. Possible values include: 'UserObj', 'GroupObj', - /// 'Other', 'User', 'Group' - /// the Azure AD object ID of the user or - /// group being specified in the access control list (ACL) - /// entry. - /// the permission type of the access control - /// list (ACL) entry. Possible values include: 'None', 'Use', 'Create', - /// 'Drop', 'Alter', 'Write', 'All' - public AclCreateOrUpdateParameters(string aceType, System.Guid principalId, string permission) - { - AceType = aceType; - PrincipalId = principalId; - Permission = permission; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the access control list (ACL) entry type. UserObj and - /// GroupObj denote the owning user and group, respectively. Possible - /// values include: 'UserObj', 'GroupObj', 'Other', 'User', 'Group' - /// - [JsonProperty(PropertyName = "aceType")] - public string AceType { get; set; } - - /// - /// Gets or sets the Azure AD object ID of the user or group being - /// specified in the access control list (ACL) entry. - /// - [JsonProperty(PropertyName = "principalId")] - public System.Guid PrincipalId { get; set; } - - /// - /// Gets or sets the permission type of the access control list (ACL) - /// entry. Possible values include: 'None', 'Use', 'Create', 'Drop', - /// 'Alter', 'Write', 'All' - /// - [JsonProperty(PropertyName = "permission")] - public string Permission { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (AceType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AceType"); - } - if (Permission == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Permission"); - } - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/AclDeleteParameters.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/AclDeleteParameters.cs deleted file mode 100644 index 57ef640ee37f..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/AclDeleteParameters.cs +++ /dev/null @@ -1,81 +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.DataLake.Analytics.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// The parameters used to delete an access control list (ACL) entry. - /// - public partial class AclDeleteParameters - { - /// - /// Initializes a new instance of the AclDeleteParameters class. - /// - public AclDeleteParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AclDeleteParameters class. - /// - /// the access control list (ACL) entry type. - /// UserObj and GroupObj denote the owning user and group, - /// respectively. Possible values include: 'UserObj', 'GroupObj', - /// 'Other', 'User', 'Group' - /// the Azure AD object ID of the user or - /// group being specified in the access control list (ACL) - /// entry. - public AclDeleteParameters(string aceType, System.Guid principalId) - { - AceType = aceType; - PrincipalId = principalId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the access control list (ACL) entry type. UserObj and - /// GroupObj denote the owning user and group, respectively. Possible - /// values include: 'UserObj', 'GroupObj', 'Other', 'User', 'Group' - /// - [JsonProperty(PropertyName = "aceType")] - public string AceType { get; set; } - - /// - /// Gets or sets the Azure AD object ID of the user or group being - /// specified in the access control list (ACL) entry. - /// - [JsonProperty(PropertyName = "principalId")] - public System.Guid PrincipalId { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (AceType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AceType"); - } - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/AclType.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/AclType.cs deleted file mode 100644 index e902e429d340..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/AclType.cs +++ /dev/null @@ -1,25 +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.DataLake.Analytics.Models -{ - - /// - /// Defines values for AclType. - /// - public static class AclType - { - public const string UserObj = "UserObj"; - public const string GroupObj = "GroupObj"; - public const string Other = "Other"; - public const string User = "User"; - public const string Group = "Group"; - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/BaseJobParameters.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/BaseJobParameters.cs deleted file mode 100644 index eaa39d3e96f4..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/BaseJobParameters.cs +++ /dev/null @@ -1,81 +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.DataLake.Analytics.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Data Lake Analytics Job Parameters base class for build and submit. - /// - public partial class BaseJobParameters - { - /// - /// Initializes a new instance of the BaseJobParameters class. - /// - public BaseJobParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BaseJobParameters class. - /// - /// The job type of the current job (Hive, USql, or - /// Scope (for internal use only)). Possible values include: 'USql', - /// 'Hive', 'Scope' - /// The job specific properties. - public BaseJobParameters(JobType type, CreateJobProperties properties) - { - Type = type; - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the job type of the current job (Hive, USql, or Scope - /// (for internal use only)). Possible values include: 'USql', 'Hive', - /// 'Scope' - /// - [JsonProperty(PropertyName = "type")] - public JobType Type { get; set; } - - /// - /// Gets or sets the job specific properties. - /// - [JsonProperty(PropertyName = "properties")] - public CreateJobProperties Properties { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Properties == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); - } - if (Properties != null) - { - Properties.Validate(); - } - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/BuildJobParameters.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/BuildJobParameters.cs deleted file mode 100644 index 4b3ba5539bc2..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/BuildJobParameters.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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The parameters used to build a new Data Lake Analytics job. - /// - public partial class BuildJobParameters : BaseJobParameters - { - /// - /// Initializes a new instance of the BuildJobParameters class. - /// - public BuildJobParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BuildJobParameters class. - /// - /// The job type of the current job (Hive, USql, or - /// Scope (for internal use only)). Possible values include: 'USql', - /// 'Hive', 'Scope' - /// The job specific properties. - /// The friendly name of the job to build. - public BuildJobParameters(JobType type, CreateJobProperties properties, string name = default(string)) - : base(type, properties) - { - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the friendly name of the job to build. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CatalogItem.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CatalogItem.cs deleted file mode 100644 index 08f043b304df..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CatalogItem.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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog item. - /// - public partial class CatalogItem - { - /// - /// Initializes a new instance of the CatalogItem class. - /// - public CatalogItem() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CatalogItem class. - /// - /// the name of the Data Lake - /// Analytics account. - /// the version of the catalog item. - public CatalogItem(string computeAccountName = default(string), System.Guid? version = default(System.Guid?)) - { - ComputeAccountName = computeAccountName; - Version = version; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the Data Lake Analytics account. - /// - [JsonProperty(PropertyName = "computeAccountName")] - public string ComputeAccountName { get; set; } - - /// - /// Gets or sets the version of the catalog item. - /// - [JsonProperty(PropertyName = "version")] - public System.Guid? Version { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CompileMode.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CompileMode.cs deleted file mode 100644 index b18dbd1237f2..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CompileMode.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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for CompileMode. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum CompileMode - { - [EnumMember(Value = "Semantic")] - Semantic, - [EnumMember(Value = "Full")] - Full, - [EnumMember(Value = "SingleBox")] - SingleBox - } - internal static class CompileModeEnumExtension - { - internal static string ToSerializedValue(this CompileMode? value) - { - return value == null ? null : ((CompileMode)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this CompileMode value) - { - switch( value ) - { - case CompileMode.Semantic: - return "Semantic"; - case CompileMode.Full: - return "Full"; - case CompileMode.SingleBox: - return "SingleBox"; - } - return null; - } - - internal static CompileMode? ParseCompileMode(this string value) - { - switch( value ) - { - case "Semantic": - return CompileMode.Semantic; - case "Full": - return CompileMode.Full; - case "SingleBox": - return CompileMode.SingleBox; - } - return null; - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CreateJobParameters.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CreateJobParameters.cs deleted file mode 100644 index dbd1fa60081d..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CreateJobParameters.cs +++ /dev/null @@ -1,138 +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.DataLake.Analytics.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The parameters used to submit a new Data Lake Analytics job. - /// - public partial class CreateJobParameters : BaseJobParameters - { - /// - /// Initializes a new instance of the CreateJobParameters class. - /// - public CreateJobParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CreateJobParameters class. - /// - /// The job type of the current job (Hive, USql, or - /// Scope (for internal use only)). Possible values include: 'USql', - /// 'Hive', 'Scope' - /// The job specific properties. - /// The friendly name of the job to submit. - /// The degree of parallelism to use - /// for this job. At most one of degreeOfParallelism and - /// degreeOfParallelismPercent should be specified. If none, a default - /// value of 1 will be used for degreeOfParallelism. - /// the degree of parallelism - /// in percentage used for this job. At most one of degreeOfParallelism - /// and degreeOfParallelismPercent should be specified. If none, a - /// default value of 1 will be used for degreeOfParallelism. - /// The priority value to use for the current - /// job. Lower numbers have a higher priority. By default, a job has a - /// priority of 1000. This must be greater than 0. - /// The list of log file name patterns to - /// find in the logFolder. '*' is the only matching character allowed. - /// Example format: jobExecution*.log or *mylog*.txt - /// The recurring job relationship information - /// properties. - public CreateJobParameters(JobType type, CreateJobProperties properties, string name, int? degreeOfParallelism = default(int?), double? degreeOfParallelismPercent = default(double?), int? priority = default(int?), IList logFilePatterns = default(IList), JobRelationshipProperties related = default(JobRelationshipProperties)) - : base(type, properties) - { - Name = name; - DegreeOfParallelism = degreeOfParallelism; - DegreeOfParallelismPercent = degreeOfParallelismPercent; - Priority = priority; - LogFilePatterns = logFilePatterns; - Related = related; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the friendly name of the job to submit. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the degree of parallelism to use for this job. At most - /// one of degreeOfParallelism and degreeOfParallelismPercent should be - /// specified. If none, a default value of 1 will be used for - /// degreeOfParallelism. - /// - [JsonProperty(PropertyName = "degreeOfParallelism")] - public int? DegreeOfParallelism { get; set; } - - /// - /// Gets or sets the degree of parallelism in percentage used for this - /// job. At most one of degreeOfParallelism and - /// degreeOfParallelismPercent should be specified. If none, a default - /// value of 1 will be used for degreeOfParallelism. - /// - [JsonProperty(PropertyName = "degreeOfParallelismPercent")] - public double? DegreeOfParallelismPercent { get; set; } - - /// - /// Gets or sets the priority value to use for the current job. Lower - /// numbers have a higher priority. By default, a job has a priority of - /// 1000. This must be greater than 0. - /// - [JsonProperty(PropertyName = "priority")] - public int? Priority { get; set; } - - /// - /// Gets or sets the list of log file name patterns to find in the - /// logFolder. '*' is the only matching character allowed. Example - /// format: jobExecution*.log or *mylog*.txt - /// - [JsonProperty(PropertyName = "logFilePatterns")] - public IList LogFilePatterns { get; set; } - - /// - /// Gets or sets the recurring job relationship information properties. - /// - [JsonProperty(PropertyName = "related")] - public JobRelationshipProperties Related { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (Related != null) - { - Related.Validate(); - } - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CreateJobProperties.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CreateJobProperties.cs deleted file mode 100644 index f34c71038e4b..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CreateJobProperties.cs +++ /dev/null @@ -1,78 +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.DataLake.Analytics.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// The common Data Lake Analytics job properties for job submission. - /// - public partial class CreateJobProperties - { - /// - /// Initializes a new instance of the CreateJobProperties class. - /// - public CreateJobProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CreateJobProperties class. - /// - /// The script to run. Please note that the - /// maximum script size is 3 MB. - /// The runtime version of the Data Lake - /// Analytics engine to use for the specific type of job being - /// run. - public CreateJobProperties(string script, string runtimeVersion = default(string)) - { - RuntimeVersion = runtimeVersion; - Script = script; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the runtime version of the Data Lake Analytics engine - /// to use for the specific type of job being run. - /// - [JsonProperty(PropertyName = "runtimeVersion")] - public string RuntimeVersion { get; set; } - - /// - /// Gets or sets the script to run. Please note that the maximum script - /// size is 3 MB. - /// - [JsonProperty(PropertyName = "script")] - public string Script { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Script == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Script"); - } - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CreateScopeJobParameters.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CreateScopeJobParameters.cs deleted file mode 100644 index 9010b697340f..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CreateScopeJobParameters.cs +++ /dev/null @@ -1,88 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The parameters used to submit a new Data Lake Analytics Scope job. - /// (Only for use internally with Scope job type.) - /// - public partial class CreateScopeJobParameters : CreateJobParameters - { - /// - /// Initializes a new instance of the CreateScopeJobParameters class. - /// - public CreateScopeJobParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CreateScopeJobParameters class. - /// - /// The job type of the current job (Hive, USql, or - /// Scope (for internal use only)). Possible values include: 'USql', - /// 'Hive', 'Scope' - /// The job specific properties. - /// The friendly name of the job to submit. - /// The degree of parallelism to use - /// for this job. At most one of degreeOfParallelism and - /// degreeOfParallelismPercent should be specified. If none, a default - /// value of 1 will be used for degreeOfParallelism. - /// the degree of parallelism - /// in percentage used for this job. At most one of degreeOfParallelism - /// and degreeOfParallelismPercent should be specified. If none, a - /// default value of 1 will be used for degreeOfParallelism. - /// The priority value to use for the current - /// job. Lower numbers have a higher priority. By default, a job has a - /// priority of 1000. This must be greater than 0. - /// The list of log file name patterns to - /// find in the logFolder. '*' is the only matching character allowed. - /// Example format: jobExecution*.log or *mylog*.txt - /// The recurring job relationship information - /// properties. - /// The key-value pairs used to add additional - /// metadata to the job information. - public CreateScopeJobParameters(JobType type, CreateJobProperties properties, string name, int? degreeOfParallelism = default(int?), double? degreeOfParallelismPercent = default(double?), int? priority = default(int?), IList logFilePatterns = default(IList), JobRelationshipProperties related = default(JobRelationshipProperties), IDictionary tags = default(IDictionary)) - : base(type, properties, name, degreeOfParallelism, degreeOfParallelismPercent, priority, logFilePatterns, related) - { - Tags = tags; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the key-value pairs used to add additional metadata to - /// the job information. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CreateScopeJobProperties.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CreateScopeJobProperties.cs deleted file mode 100644 index 2840488bf2ea..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CreateScopeJobProperties.cs +++ /dev/null @@ -1,83 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Scope job properties used when submitting Scope jobs. (Only for use - /// internally with Scope job type.) - /// - [Newtonsoft.Json.JsonObject("Scope")] - public partial class CreateScopeJobProperties : CreateJobProperties - { - /// - /// Initializes a new instance of the CreateScopeJobProperties class. - /// - public CreateScopeJobProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CreateScopeJobProperties class. - /// - /// The script to run. Please note that the - /// maximum script size is 3 MB. - /// The runtime version of the Data Lake - /// Analytics engine to use for the specific type of job being - /// run. - /// The list of resources that are required by - /// the job. - /// The list of email addresses, separated by - /// semi-colons, to notify when the job reaches a terminal - /// state. - public CreateScopeJobProperties(string script, string runtimeVersion = default(string), IList resources = default(IList), string notifier = default(string)) - : base(script, runtimeVersion) - { - Resources = resources; - Notifier = notifier; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the list of resources that are required by the job. - /// - [JsonProperty(PropertyName = "resources")] - public IList Resources { get; set; } - - /// - /// Gets or sets the list of email addresses, separated by semi-colons, - /// to notify when the job reaches a terminal state. - /// - [JsonProperty(PropertyName = "notifier")] - public string Notifier { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CreateUSqlJobProperties.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CreateUSqlJobProperties.cs deleted file mode 100644 index 89f6ea7f3041..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CreateUSqlJobProperties.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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// U-SQL job properties used when submitting U-SQL jobs. - /// - [Newtonsoft.Json.JsonObject("USql")] - public partial class CreateUSqlJobProperties : CreateJobProperties - { - /// - /// Initializes a new instance of the CreateUSqlJobProperties class. - /// - public CreateUSqlJobProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CreateUSqlJobProperties class. - /// - /// The script to run. Please note that the - /// maximum script size is 3 MB. - /// The runtime version of the Data Lake - /// Analytics engine to use for the specific type of job being - /// run. - /// The specific compilation mode for the job - /// used during execution. If this is not specified during submission, - /// the server will determine the optimal compilation mode. Possible - /// values include: 'Semantic', 'Full', 'SingleBox' - public CreateUSqlJobProperties(string script, string runtimeVersion = default(string), CompileMode? compileMode = default(CompileMode?)) - : base(script, runtimeVersion) - { - CompileMode = compileMode; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the specific compilation mode for the job used during - /// execution. If this is not specified during submission, the server - /// will determine the optimal compilation mode. Possible values - /// include: 'Semantic', 'Full', 'SingleBox' - /// - [JsonProperty(PropertyName = "compileMode")] - public CompileMode? CompileMode { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsAccount.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsAccount.cs index a9265529c44e..3c39628eda67 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsAccount.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsAccount.cs @@ -35,7 +35,7 @@ public DataLakeAnalyticsAccount() /// /// Initializes a new instance of the DataLakeAnalyticsAccount class. /// - /// The resource identifer. + /// The resource identifier. /// The resource name. /// The resource type. /// The resource location. @@ -57,10 +57,16 @@ public DataLakeAnalyticsAccount() /// Store account associated with this account. /// The list of Data Lake Store /// accounts associated with this account. + /// The list of Data Lake + /// Store accounts associated with this account. /// The list of Azure Blob Storage /// accounts associated with this account. /// The list of compute policies /// associated with this account. + /// The list of hiveMetastores associated + /// with this account. + /// The list of virtualNetwork rules + /// associated with this account. /// The list of firewall rules associated /// with this account. /// The current state of the IP address @@ -100,7 +106,10 @@ public DataLakeAnalyticsAccount() /// job for this account. /// The number of days that job /// metadata is retained. - public DataLakeAnalyticsAccount(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), System.Guid? accountId = default(System.Guid?), DataLakeAnalyticsAccountStatus? provisioningState = default(DataLakeAnalyticsAccountStatus?), DataLakeAnalyticsAccountState? state = default(DataLakeAnalyticsAccountState?), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), string endpoint = default(string), string defaultDataLakeStoreAccount = default(string), IList dataLakeStoreAccounts = default(IList), IList storageAccounts = default(IList), IList computePolicies = default(IList), IList firewallRules = default(IList), FirewallState? firewallState = default(FirewallState?), FirewallAllowAzureIpsState? firewallAllowAzureIps = default(FirewallAllowAzureIpsState?), TierType? newTier = default(TierType?), TierType? currentTier = default(TierType?), int? maxJobCount = default(int?), int? systemMaxJobCount = default(int?), int? maxDegreeOfParallelism = default(int?), int? systemMaxDegreeOfParallelism = default(int?), int? maxDegreeOfParallelismPerJob = default(int?), int? minPriorityPerJob = default(int?), int? queryStoreRetention = default(int?)) + /// The current state of the + /// DebugDataAccessLevel for this account. Possible values include: + /// 'All', 'Customer', 'None' + public DataLakeAnalyticsAccount(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), System.Guid? accountId = default(System.Guid?), DataLakeAnalyticsAccountStatus? provisioningState = default(DataLakeAnalyticsAccountStatus?), DataLakeAnalyticsAccountState? state = default(DataLakeAnalyticsAccountState?), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? lastModifiedTime = default(System.DateTime?), string endpoint = default(string), string defaultDataLakeStoreAccount = default(string), IList dataLakeStoreAccounts = default(IList), IList publicDataLakeStoreAccounts = default(IList), IList storageAccounts = default(IList), IList computePolicies = default(IList), IList hiveMetastores = default(IList), IList virtualNetworkRules = default(IList), IList firewallRules = default(IList), FirewallState? firewallState = default(FirewallState?), FirewallAllowAzureIpsState? firewallAllowAzureIps = default(FirewallAllowAzureIpsState?), TierType? newTier = default(TierType?), TierType? currentTier = default(TierType?), int? maxJobCount = default(int?), int? systemMaxJobCount = default(int?), int? maxDegreeOfParallelism = default(int?), int? systemMaxDegreeOfParallelism = default(int?), int? maxDegreeOfParallelismPerJob = default(int?), int? minPriorityPerJob = default(int?), int? queryStoreRetention = default(int?), DebugDataAccessLevel? debugDataAccessLevel = default(DebugDataAccessLevel?)) : base(id, name, type, location, tags) { AccountId = accountId; @@ -111,8 +120,11 @@ public DataLakeAnalyticsAccount() Endpoint = endpoint; DefaultDataLakeStoreAccount = defaultDataLakeStoreAccount; DataLakeStoreAccounts = dataLakeStoreAccounts; + PublicDataLakeStoreAccounts = publicDataLakeStoreAccounts; StorageAccounts = storageAccounts; ComputePolicies = computePolicies; + HiveMetastores = hiveMetastores; + VirtualNetworkRules = virtualNetworkRules; FirewallRules = firewallRules; FirewallState = firewallState; FirewallAllowAzureIps = firewallAllowAzureIps; @@ -125,6 +137,7 @@ public DataLakeAnalyticsAccount() MaxDegreeOfParallelismPerJob = maxDegreeOfParallelismPerJob; MinPriorityPerJob = minPriorityPerJob; QueryStoreRetention = queryStoreRetention; + DebugDataAccessLevel = debugDataAccessLevel; CustomInit(); } @@ -188,6 +201,13 @@ public DataLakeAnalyticsAccount() [JsonProperty(PropertyName = "properties.dataLakeStoreAccounts")] public IList DataLakeStoreAccounts { get; private set; } + /// + /// Gets or sets the list of Data Lake Store accounts associated with + /// this account. + /// + [JsonProperty(PropertyName = "properties.publicDataLakeStoreAccounts")] + public IList PublicDataLakeStoreAccounts { get; set; } + /// /// Gets the list of Azure Blob Storage accounts associated with this /// account. @@ -201,6 +221,18 @@ public DataLakeAnalyticsAccount() [JsonProperty(PropertyName = "properties.computePolicies")] public IList ComputePolicies { get; private set; } + /// + /// Gets the list of hiveMetastores associated with this account. + /// + [JsonProperty(PropertyName = "properties.hiveMetastores")] + public IList HiveMetastores { get; private set; } + + /// + /// Gets the list of virtualNetwork rules associated with this account. + /// + [JsonProperty(PropertyName = "properties.virtualNetworkRules")] + public IList VirtualNetworkRules { get; private set; } + /// /// Gets the list of firewall rules associated with this account. /// @@ -208,31 +240,31 @@ public DataLakeAnalyticsAccount() public IList FirewallRules { get; private set; } /// - /// Gets the current state of the IP address firewall for this account. - /// Possible values include: 'Enabled', 'Disabled' + /// Gets or sets the current state of the IP address firewall for this + /// account. Possible values include: 'Enabled', 'Disabled' /// [JsonProperty(PropertyName = "properties.firewallState")] - public FirewallState? FirewallState { get; private set; } + public FirewallState? FirewallState { get; set; } /// - /// Gets the current state of allowing or disallowing IPs originating - /// within Azure through the firewall. If the firewall is disabled, - /// this is not enforced. Possible values include: 'Enabled', + /// Gets or sets the current state of allowing or disallowing IPs + /// originating within Azure through the firewall. If the firewall is + /// disabled, this is not enforced. Possible values include: 'Enabled', /// 'Disabled' /// [JsonProperty(PropertyName = "properties.firewallAllowAzureIps")] - public FirewallAllowAzureIpsState? FirewallAllowAzureIps { get; private set; } + public FirewallAllowAzureIpsState? FirewallAllowAzureIps { get; set; } /// - /// Gets the commitment tier for the next month. Possible values - /// include: 'Consumption', 'Commitment_100AUHours', + /// Gets or sets the commitment tier for the next month. Possible + /// values include: 'Consumption', 'Commitment_100AUHours', /// 'Commitment_500AUHours', 'Commitment_1000AUHours', /// 'Commitment_5000AUHours', 'Commitment_10000AUHours', /// 'Commitment_50000AUHours', 'Commitment_100000AUHours', /// 'Commitment_500000AUHours' /// [JsonProperty(PropertyName = "properties.newTier")] - public TierType? NewTier { get; private set; } + public TierType? NewTier { get; set; } /// /// Gets the commitment tier in use for the current month. Possible @@ -246,11 +278,11 @@ public DataLakeAnalyticsAccount() public TierType? CurrentTier { get; private set; } /// - /// Gets the maximum supported jobs running under the account at the - /// same time. + /// Gets or sets the maximum supported jobs running under the account + /// at the same time. /// [JsonProperty(PropertyName = "properties.maxJobCount")] - public int? MaxJobCount { get; private set; } + public int? MaxJobCount { get; set; } /// /// Gets the system defined maximum supported jobs running under the @@ -261,10 +293,11 @@ public DataLakeAnalyticsAccount() public int? SystemMaxJobCount { get; private set; } /// - /// Gets the maximum supported degree of parallelism for this account. + /// Gets or sets the maximum supported degree of parallelism for this + /// account. /// [JsonProperty(PropertyName = "properties.maxDegreeOfParallelism")] - public int? MaxDegreeOfParallelism { get; private set; } + public int? MaxDegreeOfParallelism { get; set; } /// /// Gets the system defined maximum supported degree of parallelism for @@ -275,11 +308,11 @@ public DataLakeAnalyticsAccount() public int? SystemMaxDegreeOfParallelism { get; private set; } /// - /// Gets the maximum supported degree of parallelism per job for this - /// account. + /// Gets or sets the maximum supported degree of parallelism per job + /// for this account. /// [JsonProperty(PropertyName = "properties.maxDegreeOfParallelismPerJob")] - public int? MaxDegreeOfParallelismPerJob { get; private set; } + public int? MaxDegreeOfParallelismPerJob { get; set; } /// /// Gets the minimum supported priority per job for this account. @@ -288,10 +321,17 @@ public DataLakeAnalyticsAccount() public int? MinPriorityPerJob { get; private set; } /// - /// Gets the number of days that job metadata is retained. + /// Gets or sets the number of days that job metadata is retained. /// [JsonProperty(PropertyName = "properties.queryStoreRetention")] - public int? QueryStoreRetention { get; private set; } + public int? QueryStoreRetention { get; set; } + + /// + /// Gets the current state of the DebugDataAccessLevel for this + /// account. Possible values include: 'All', 'Customer', 'None' + /// + [JsonProperty(PropertyName = "properties.debugDataAccessLevel")] + public DebugDataAccessLevel? DebugDataAccessLevel { get; private set; } /// /// Validate the object. diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsAccountBasic.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsAccountBasic.cs index 118d7f497941..f5ef8d64ddf4 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsAccountBasic.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsAccountBasic.cs @@ -37,7 +37,7 @@ public DataLakeAnalyticsAccountBasic() /// Initializes a new instance of the DataLakeAnalyticsAccountBasic /// class. /// - /// The resource identifer. + /// The resource identifier. /// The resource name. /// The resource type. /// The resource location. diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsCatalogCredentialCreateParameters.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsCatalogCredentialCreateParameters.cs deleted file mode 100644 index 13afc67085cb..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsCatalogCredentialCreateParameters.cs +++ /dev/null @@ -1,99 +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.DataLake.Analytics.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Data Lake Analytics catalog credential creation parameters. - /// - public partial class DataLakeAnalyticsCatalogCredentialCreateParameters - { - /// - /// Initializes a new instance of the - /// DataLakeAnalyticsCatalogCredentialCreateParameters class. - /// - public DataLakeAnalyticsCatalogCredentialCreateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// DataLakeAnalyticsCatalogCredentialCreateParameters class. - /// - /// the password for the credential and user - /// with access to the data source. - /// the URI identifier for the data source this - /// credential can connect to in the format - /// <hostname>:<port> - /// the object identifier for the user associated - /// with this credential with access to the data source. - public DataLakeAnalyticsCatalogCredentialCreateParameters(string password, string uri, string userId) - { - Password = password; - Uri = uri; - UserId = userId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the password for the credential and user with access - /// to the data source. - /// - [JsonProperty(PropertyName = "password")] - public string Password { get; set; } - - /// - /// Gets or sets the URI identifier for the data source this credential - /// can connect to in the format - /// &lt;hostname&gt;:&lt;port&gt; - /// - [JsonProperty(PropertyName = "uri")] - public string Uri { get; set; } - - /// - /// Gets or sets the object identifier for the user associated with - /// this credential with access to the data source. - /// - [JsonProperty(PropertyName = "userId")] - public string UserId { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Password == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Password"); - } - if (Uri == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Uri"); - } - if (UserId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "UserId"); - } - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsCatalogCredentialDeleteParameters.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsCatalogCredentialDeleteParameters.cs deleted file mode 100644 index 9b4359d6ac59..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsCatalogCredentialDeleteParameters.cs +++ /dev/null @@ -1,57 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Data Lake Analytics catalog credential deletion parameters. - /// - public partial class DataLakeAnalyticsCatalogCredentialDeleteParameters - { - /// - /// Initializes a new instance of the - /// DataLakeAnalyticsCatalogCredentialDeleteParameters class. - /// - public DataLakeAnalyticsCatalogCredentialDeleteParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// DataLakeAnalyticsCatalogCredentialDeleteParameters class. - /// - /// the current password for the credential and - /// user with access to the data source. This is required if the - /// requester is not the account owner. - public DataLakeAnalyticsCatalogCredentialDeleteParameters(string password = default(string)) - { - Password = password; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the current password for the credential and user with - /// access to the data source. This is required if the requester is not - /// the account owner. - /// - [JsonProperty(PropertyName = "password")] - public string Password { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsCatalogCredentialUpdateParameters.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsCatalogCredentialUpdateParameters.cs deleted file mode 100644 index b0f3144fb9e6..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsCatalogCredentialUpdateParameters.cs +++ /dev/null @@ -1,89 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Data Lake Analytics catalog credential update parameters. - /// - public partial class DataLakeAnalyticsCatalogCredentialUpdateParameters - { - /// - /// Initializes a new instance of the - /// DataLakeAnalyticsCatalogCredentialUpdateParameters class. - /// - public DataLakeAnalyticsCatalogCredentialUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// DataLakeAnalyticsCatalogCredentialUpdateParameters class. - /// - /// the current password for the credential and - /// user with access to the data source. This is required if the - /// requester is not the account owner. - /// the new password for the credential and - /// user with access to the data source. - /// the URI identifier for the data source this - /// credential can connect to in the format - /// <hostname>:<port> - /// the object identifier for the user associated - /// with this credential with access to the data source. - public DataLakeAnalyticsCatalogCredentialUpdateParameters(string password = default(string), string newPassword = default(string), string uri = default(string), string userId = default(string)) - { - Password = password; - NewPassword = newPassword; - Uri = uri; - UserId = userId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the current password for the credential and user with - /// access to the data source. This is required if the requester is not - /// the account owner. - /// - [JsonProperty(PropertyName = "password")] - public string Password { get; set; } - - /// - /// Gets or sets the new password for the credential and user with - /// access to the data source. - /// - [JsonProperty(PropertyName = "newPassword")] - public string NewPassword { get; set; } - - /// - /// Gets or sets the URI identifier for the data source this credential - /// can connect to in the format - /// &lt;hostname&gt;:&lt;port&gt; - /// - [JsonProperty(PropertyName = "uri")] - public string Uri { get; set; } - - /// - /// Gets or sets the object identifier for the user associated with - /// this credential with access to the data source. - /// - [JsonProperty(PropertyName = "userId")] - public string UserId { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters.cs deleted file mode 100644 index 51674f9f0bb7..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters.cs +++ /dev/null @@ -1,80 +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.DataLake.Analytics.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Data Lake Analytics catalog secret creation and update parameters. This - /// is deprecated and will be removed in the next release. Please use - /// DataLakeAnalyticsCatalogCredentialCreateOrUpdateParameters instead. - /// - public partial class DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters - { - /// - /// Initializes a new instance of the - /// DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters class. - /// - public DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters class. - /// - /// the password for the secret to pass - /// in - /// the URI identifier for the secret in the format - /// <hostname>:<port> - public DataLakeAnalyticsCatalogSecretCreateOrUpdateParameters(string password, string uri = default(string)) - { - Password = password; - Uri = uri; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the password for the secret to pass in - /// - [JsonProperty(PropertyName = "password")] - public string Password { get; set; } - - /// - /// Gets or sets the URI identifier for the secret in the format - /// &lt;hostname&gt;:&lt;port&gt; - /// - [JsonProperty(PropertyName = "uri")] - public string Uri { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Password == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Password"); - } - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DdlName.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DdlName.cs deleted file mode 100644 index 6f83c247ce1a..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DdlName.cs +++ /dev/null @@ -1,83 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics DDL name item. - /// - public partial class DdlName - { - /// - /// Initializes a new instance of the DdlName class. - /// - public DdlName() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the DdlName class. - /// - /// the name of the table associated with this - /// database and schema. - /// the name of the table associated with this - /// database and schema. - /// the name of the table associated with this - /// database and schema. - /// the name of the table associated with this - /// database and schema. - public DdlName(string firstPart = default(string), string secondPart = default(string), string thirdPart = default(string), string server = default(string)) - { - FirstPart = firstPart; - SecondPart = secondPart; - ThirdPart = thirdPart; - Server = server; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the table associated with this database - /// and schema. - /// - [JsonProperty(PropertyName = "firstPart")] - public string FirstPart { get; set; } - - /// - /// Gets or sets the name of the table associated with this database - /// and schema. - /// - [JsonProperty(PropertyName = "secondPart")] - public string SecondPart { get; set; } - - /// - /// Gets or sets the name of the table associated with this database - /// and schema. - /// - [JsonProperty(PropertyName = "thirdPart")] - public string ThirdPart { get; set; } - - /// - /// Gets or sets the name of the table associated with this database - /// and schema. - /// - [JsonProperty(PropertyName = "server")] - public string Server { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DebugDataAccessLevel.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DebugDataAccessLevel.cs new file mode 100644 index 000000000000..45bfc0ff4256 --- /dev/null +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/DebugDataAccessLevel.cs @@ -0,0 +1,66 @@ +// +// 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.DataLake.Analytics.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for DebugDataAccessLevel. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum DebugDataAccessLevel + { + [EnumMember(Value = "All")] + All, + [EnumMember(Value = "Customer")] + Customer, + [EnumMember(Value = "None")] + None + } + internal static class DebugDataAccessLevelEnumExtension + { + internal static string ToSerializedValue(this DebugDataAccessLevel? value) + { + return value == null ? null : ((DebugDataAccessLevel)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this DebugDataAccessLevel value) + { + switch( value ) + { + case DebugDataAccessLevel.All: + return "All"; + case DebugDataAccessLevel.Customer: + return "Customer"; + case DebugDataAccessLevel.None: + return "None"; + } + return null; + } + + internal static DebugDataAccessLevel? ParseDebugDataAccessLevel(this string value) + { + switch( value ) + { + case "All": + return DebugDataAccessLevel.All; + case "Customer": + return DebugDataAccessLevel.Customer; + case "None": + return DebugDataAccessLevel.None; + } + return null; + } + } +} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/Diagnostics.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/Diagnostics.cs deleted file mode 100644 index 27d86c09c405..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/Diagnostics.cs +++ /dev/null @@ -1,96 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Error diagnostic information for failed jobs. - /// - public partial class Diagnostics - { - /// - /// Initializes a new instance of the Diagnostics class. - /// - public Diagnostics() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Diagnostics class. - /// - /// The error message. - /// The severity of the error. Possible values - /// include: 'Warning', 'Error', 'Info', 'SevereWarning', 'Deprecated', - /// 'UserWarning' - /// The line number the error occurred - /// on. - /// The column where the error - /// occurred. - /// The starting index of the error. - /// The ending index of the error. - public Diagnostics(string message = default(string), SeverityTypes? severity = default(SeverityTypes?), int? lineNumber = default(int?), int? columnNumber = default(int?), int? start = default(int?), int? end = default(int?)) - { - Message = message; - Severity = severity; - LineNumber = lineNumber; - ColumnNumber = columnNumber; - Start = start; - End = end; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the error message. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } - - /// - /// Gets the severity of the error. Possible values include: 'Warning', - /// 'Error', 'Info', 'SevereWarning', 'Deprecated', 'UserWarning' - /// - [JsonProperty(PropertyName = "severity")] - public SeverityTypes? Severity { get; private set; } - - /// - /// Gets the line number the error occurred on. - /// - [JsonProperty(PropertyName = "lineNumber")] - public int? LineNumber { get; private set; } - - /// - /// Gets the column where the error occurred. - /// - [JsonProperty(PropertyName = "columnNumber")] - public int? ColumnNumber { get; private set; } - - /// - /// Gets the starting index of the error. - /// - [JsonProperty(PropertyName = "start")] - public int? Start { get; private set; } - - /// - /// Gets the ending index of the error. - /// - [JsonProperty(PropertyName = "end")] - public int? End { get; private set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/EntityId.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/EntityId.cs deleted file mode 100644 index b23066fbcbd3..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/EntityId.cs +++ /dev/null @@ -1,62 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog entity identifier object. - /// - public partial class EntityId - { - /// - /// Initializes a new instance of the EntityId class. - /// - public EntityId() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the EntityId class. - /// - /// the name of the external table associated with - /// this database, schema and table. - /// the version of the external data - /// source. - public EntityId(DdlName name = default(DdlName), System.Guid? version = default(System.Guid?)) - { - Name = name; - Version = version; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the external table associated with this - /// database, schema and table. - /// - [JsonProperty(PropertyName = "name")] - public DdlName Name { get; set; } - - /// - /// Gets or sets the version of the external data source. - /// - [JsonProperty(PropertyName = "version")] - public System.Guid? Version { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/TypeFieldInfo.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ErrorAdditionalInfo.cs similarity index 56% rename from sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/TypeFieldInfo.cs rename to sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ErrorAdditionalInfo.cs index e2c5a36501c5..7a0ea5f7dfa2 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/TypeFieldInfo.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ErrorAdditionalInfo.cs @@ -14,28 +14,27 @@ namespace Microsoft.Azure.Management.DataLake.Analytics.Models using System.Linq; /// - /// A Data Lake Analytics catalog type field information item. + /// The resource management error additional info. /// - public partial class TypeFieldInfo + public partial class ErrorAdditionalInfo { /// - /// Initializes a new instance of the TypeFieldInfo class. + /// Initializes a new instance of the ErrorAdditionalInfo class. /// - public TypeFieldInfo() + public ErrorAdditionalInfo() { CustomInit(); } /// - /// Initializes a new instance of the TypeFieldInfo class. + /// Initializes a new instance of the ErrorAdditionalInfo class. /// - /// the name of the field associated with this - /// type. - /// the type of the field. - public TypeFieldInfo(string name = default(string), string type = default(string)) + /// The additional info type. + /// The additional info. + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) { - Name = name; Type = type; + Info = info; CustomInit(); } @@ -45,16 +44,16 @@ public TypeFieldInfo() partial void CustomInit(); /// - /// Gets or sets the name of the field associated with this type. + /// Gets the additional info type. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } /// - /// Gets or sets the type of the field. + /// Gets the additional info. /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } + [JsonProperty(PropertyName = "info")] + public object Info { get; private set; } } } diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ErrorDetail.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ErrorDetail.cs new file mode 100644 index 000000000000..19d1a9fc4c07 --- /dev/null +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ErrorDetail.cs @@ -0,0 +1,85 @@ +// +// 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.DataLake.Analytics.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The error detail. + /// + public partial class ErrorDetail + { + /// + /// Initializes a new instance of the ErrorDetail class. + /// + public ErrorDetail() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetail class. + /// + /// The error code. + /// The error message. + /// The error target. + /// The error details. + /// The error additional info. + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) + { + Code = code; + Message = message; + Target = target; + Details = details; + AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error code. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the error target. + /// + [JsonProperty(PropertyName = "target")] + public string Target { get; private set; } + + /// + /// Gets the error details. + /// + [JsonProperty(PropertyName = "details")] + public IList Details { get; private set; } + + /// + /// Gets the error additional info. + /// + [JsonProperty(PropertyName = "additionalInfo")] + public IList AdditionalInfo { get; private set; } + + } +} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlAssemblyDependencyInfo.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ErrorResponse.cs similarity index 55% rename from sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlAssemblyDependencyInfo.cs rename to sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ErrorResponse.cs index 9cbb06f244dc..524313f0ac5b 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlAssemblyDependencyInfo.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ErrorResponse.cs @@ -14,25 +14,30 @@ namespace Microsoft.Azure.Management.DataLake.Analytics.Models using System.Linq; /// - /// A Data Lake Analytics catalog U-SQL dependency information item. + /// Error response /// - public partial class USqlAssemblyDependencyInfo + /// + /// Common error response for all Azure Resource Manager APIs to return + /// error details for failed operations. (This also follows the OData error + /// response format.). + /// + public partial class ErrorResponse { /// - /// Initializes a new instance of the USqlAssemblyDependencyInfo class. + /// Initializes a new instance of the ErrorResponse class. /// - public USqlAssemblyDependencyInfo() + public ErrorResponse() { CustomInit(); } /// - /// Initializes a new instance of the USqlAssemblyDependencyInfo class. + /// Initializes a new instance of the ErrorResponse class. /// - /// the EntityId of the dependency. - public USqlAssemblyDependencyInfo(EntityId entityId = default(EntityId)) + /// The error object. + public ErrorResponse(ErrorDetail error = default(ErrorDetail)) { - EntityId = entityId; + Error = error; CustomInit(); } @@ -42,10 +47,10 @@ public USqlAssemblyDependencyInfo() partial void CustomInit(); /// - /// Gets or sets the EntityId of the dependency. + /// Gets or sets the error object. /// - [JsonProperty(PropertyName = "entityId")] - public EntityId EntityId { get; set; } + [JsonProperty(PropertyName = "error")] + public ErrorDetail Error { get; set; } } } diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ErrorResponseException.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ErrorResponseException.cs new file mode 100644 index 000000000000..38af23bcb151 --- /dev/null +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ErrorResponseException.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataLake.Analytics.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with ErrorResponse + /// information. + /// + public partial class ErrorResponseException : RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponse Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + public ErrorResponseException() + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + public ErrorResponseException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseException class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ExternalTable.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ExternalTable.cs deleted file mode 100644 index 5df240c45480..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ExternalTable.cs +++ /dev/null @@ -1,62 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog external table item. - /// - public partial class ExternalTable - { - /// - /// Initializes a new instance of the ExternalTable class. - /// - public ExternalTable() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ExternalTable class. - /// - /// the name of the table associated with this - /// database and schema. - /// the data source associated with this - /// external table. - public ExternalTable(string tableName = default(string), EntityId dataSource = default(EntityId)) - { - TableName = tableName; - DataSource = dataSource; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the table associated with this database - /// and schema. - /// - [JsonProperty(PropertyName = "tableName")] - public string TableName { get; set; } - - /// - /// Gets or sets the data source associated with this external table. - /// - [JsonProperty(PropertyName = "dataSource")] - public EntityId DataSource { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/FileType.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/FileType.cs deleted file mode 100644 index 1f5ca8432ca6..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/FileType.cs +++ /dev/null @@ -1,23 +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.DataLake.Analytics.Models -{ - - /// - /// Defines values for FileType. - /// - public static class FileType - { - public const string Assembly = "Assembly"; - public const string Resource = "Resource"; - public const string Nodeploy = "Nodeploy"; - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/HiveJobProperties.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/HiveJobProperties.cs deleted file mode 100644 index 2556b0792d5c..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/HiveJobProperties.cs +++ /dev/null @@ -1,97 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Hive job properties used when retrieving Hive jobs. - /// - [Newtonsoft.Json.JsonObject("Hive")] - public partial class HiveJobProperties : JobProperties - { - /// - /// Initializes a new instance of the HiveJobProperties class. - /// - public HiveJobProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the HiveJobProperties class. - /// - /// The script to run. Please note that the - /// maximum script size is 3 MB. - /// The runtime version of the Data Lake - /// Analytics engine to use for the specific type of job being - /// run. - /// The Hive logs location. - /// The location of Hive job output files - /// (both execution output and results). - /// The number of statements that will be - /// run based on the script. - /// The number of statements that - /// have been run based on the script. - public HiveJobProperties(string script, string runtimeVersion = default(string), string logsLocation = default(string), string outputLocation = default(string), int? statementCount = default(int?), int? executedStatementCount = default(int?)) - : base(script, runtimeVersion) - { - LogsLocation = logsLocation; - OutputLocation = outputLocation; - StatementCount = statementCount; - ExecutedStatementCount = executedStatementCount; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the Hive logs location. - /// - [JsonProperty(PropertyName = "logsLocation")] - public string LogsLocation { get; private set; } - - /// - /// Gets the location of Hive job output files (both execution output - /// and results). - /// - [JsonProperty(PropertyName = "outputLocation")] - public string OutputLocation { get; private set; } - - /// - /// Gets the number of statements that will be run based on the script. - /// - [JsonProperty(PropertyName = "statementCount")] - public int? StatementCount { get; private set; } - - /// - /// Gets the number of statements that have been run based on the - /// script. - /// - [JsonProperty(PropertyName = "executedStatementCount")] - public int? ExecutedStatementCount { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/HiveMetastore.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/HiveMetastore.cs new file mode 100644 index 000000000000..0c347077e02f --- /dev/null +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/HiveMetastore.cs @@ -0,0 +1,101 @@ +// +// 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.DataLake.Analytics.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + [Rest.Serialization.JsonTransformation] + public partial class HiveMetastore : SubResource + { + /// + /// Initializes a new instance of the HiveMetastore class. + /// + public HiveMetastore() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HiveMetastore class. + /// + /// The resource identifier. + /// The resource name. + /// The resource type. + /// The serverUri for the Hive + /// MetaStore + /// The databaseName for the Hive + /// MetaStore + /// The runtimeVersion for the Hive + /// MetaStore + /// The userName for the Hive MetaStore + /// The password for the Hive MetaStore + /// The current state of + /// the NestedResource. Possible values include: 'Succeeded', + /// 'Canceled', 'Failed' + public HiveMetastore(string id = default(string), string name = default(string), string type = default(string), string serverUri = default(string), string databaseName = default(string), string runtimeVersion = default(string), string userName = default(string), string password = default(string), NestedResourceProvisioningState? nestedResourceProvisioningState = default(NestedResourceProvisioningState?)) + : base(id, name, type) + { + ServerUri = serverUri; + DatabaseName = databaseName; + RuntimeVersion = runtimeVersion; + UserName = userName; + Password = password; + NestedResourceProvisioningState = nestedResourceProvisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the serverUri for the Hive MetaStore + /// + [JsonProperty(PropertyName = "properties.serverUri")] + public string ServerUri { get; private set; } + + /// + /// Gets the databaseName for the Hive MetaStore + /// + [JsonProperty(PropertyName = "properties.databaseName")] + public string DatabaseName { get; private set; } + + /// + /// Gets the runtimeVersion for the Hive MetaStore + /// + [JsonProperty(PropertyName = "properties.runtimeVersion")] + public string RuntimeVersion { get; private set; } + + /// + /// Gets the userName for the Hive MetaStore + /// + [JsonProperty(PropertyName = "properties.userName")] + public string UserName { get; private set; } + + /// + /// Gets the password for the Hive MetaStore + /// + [JsonProperty(PropertyName = "properties.password")] + public string Password { get; private set; } + + /// + /// Gets the current state of the NestedResource. Possible values + /// include: 'Succeeded', 'Canceled', 'Failed' + /// + [JsonProperty(PropertyName = "properties.nestedResourceProvisioningState")] + public NestedResourceProvisioningState? NestedResourceProvisioningState { get; private set; } + + } +} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/HiveMetastoreListResult.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/HiveMetastoreListResult.cs new file mode 100644 index 000000000000..48430126b0b6 --- /dev/null +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/HiveMetastoreListResult.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataLake.Analytics.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Data Lake Analytics HiveMetastore list information. + /// + public partial class HiveMetastoreListResult + { + /// + /// Initializes a new instance of the HiveMetastoreListResult class. + /// + public HiveMetastoreListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HiveMetastoreListResult class. + /// + /// The results of the list operation. + /// The link (url) to the next page of + /// results. + public HiveMetastoreListResult(IList value = default(IList), string nextLink = default(string)) + { + Value = value; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the results of the list operation. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; private set; } + + /// + /// Gets the link (url) to the next page of results. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; private set; } + + } +} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobDataPath.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobDataPath.cs deleted file mode 100644 index 17b801810ff4..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobDataPath.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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A Data Lake Analytics job data path item. - /// - public partial class JobDataPath - { - /// - /// Initializes a new instance of the JobDataPath class. - /// - public JobDataPath() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the JobDataPath class. - /// - /// The ID of the job this data is for. - /// The command that this job data relates - /// to. - /// The list of paths to all of the job - /// data. - public JobDataPath(System.Guid? jobId = default(System.Guid?), string command = default(string), IList paths = default(IList)) - { - JobId = jobId; - Command = command; - Paths = paths; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the ID of the job this data is for. - /// - [JsonProperty(PropertyName = "jobId")] - public System.Guid? JobId { get; private set; } - - /// - /// Gets the command that this job data relates to. - /// - [JsonProperty(PropertyName = "command")] - public string Command { get; private set; } - - /// - /// Gets the list of paths to all of the job data. - /// - [JsonProperty(PropertyName = "paths")] - public IList Paths { get; private set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobErrorDetails.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobErrorDetails.cs deleted file mode 100644 index d13472ac7148..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobErrorDetails.cs +++ /dev/null @@ -1,176 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The Data Lake Analytics job error details. - /// - public partial class JobErrorDetails - { - /// - /// Initializes a new instance of the JobErrorDetails class. - /// - public JobErrorDetails() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the JobErrorDetails class. - /// - /// The specific identifier for the type of error - /// encountered in the job. - /// The severity level of the failure. Possible - /// values include: 'Warning', 'Error', 'Info', 'SevereWarning', - /// 'Deprecated', 'UserWarning' - /// The ultimate source of the failure (usually - /// either SYSTEM or USER). - /// The user friendly error message for the - /// failure. - /// The error message description. - /// The details of the error message. - /// The specific line number in the job where - /// the error occurred. - /// The start offset in the job where the - /// error was found - /// The end offset in the job where the error - /// was found. - /// The recommended resolution for the - /// failure, if any. - /// The path to any supplemental error files, if - /// any. - /// The link to MSDN or Azure help for this type - /// of error, if any. - /// The internal diagnostic stack - /// trace if the user requesting the job error details has sufficient - /// permissions it will be retrieved, otherwise it will be - /// empty. - /// The inner error of this specific job error - /// message, if any. - public JobErrorDetails(string errorId = default(string), SeverityTypes? severity = default(SeverityTypes?), string source = default(string), string message = default(string), string description = default(string), string details = default(string), int? lineNumber = default(int?), int? startOffset = default(int?), int? endOffset = default(int?), string resolution = default(string), string filePath = default(string), string helpLink = default(string), string internalDiagnostics = default(string), JobInnerError innerError = default(JobInnerError)) - { - ErrorId = errorId; - Severity = severity; - Source = source; - Message = message; - Description = description; - Details = details; - LineNumber = lineNumber; - StartOffset = startOffset; - EndOffset = endOffset; - Resolution = resolution; - FilePath = filePath; - HelpLink = helpLink; - InternalDiagnostics = internalDiagnostics; - InnerError = innerError; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the specific identifier for the type of error encountered in - /// the job. - /// - [JsonProperty(PropertyName = "errorId")] - public string ErrorId { get; private set; } - - /// - /// Gets the severity level of the failure. Possible values include: - /// 'Warning', 'Error', 'Info', 'SevereWarning', 'Deprecated', - /// 'UserWarning' - /// - [JsonProperty(PropertyName = "severity")] - public SeverityTypes? Severity { get; private set; } - - /// - /// Gets the ultimate source of the failure (usually either SYSTEM or - /// USER). - /// - [JsonProperty(PropertyName = "source")] - public string Source { get; private set; } - - /// - /// Gets the user friendly error message for the failure. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } - - /// - /// Gets the error message description. - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; private set; } - - /// - /// Gets the details of the error message. - /// - [JsonProperty(PropertyName = "details")] - public string Details { get; private set; } - - /// - /// Gets the specific line number in the job where the error occurred. - /// - [JsonProperty(PropertyName = "lineNumber")] - public int? LineNumber { get; private set; } - - /// - /// Gets the start offset in the job where the error was found - /// - [JsonProperty(PropertyName = "startOffset")] - public int? StartOffset { get; private set; } - - /// - /// Gets the end offset in the job where the error was found. - /// - [JsonProperty(PropertyName = "endOffset")] - public int? EndOffset { get; private set; } - - /// - /// Gets the recommended resolution for the failure, if any. - /// - [JsonProperty(PropertyName = "resolution")] - public string Resolution { get; private set; } - - /// - /// Gets the path to any supplemental error files, if any. - /// - [JsonProperty(PropertyName = "filePath")] - public string FilePath { get; private set; } - - /// - /// Gets the link to MSDN or Azure help for this type of error, if any. - /// - [JsonProperty(PropertyName = "helpLink")] - public string HelpLink { get; private set; } - - /// - /// Gets the internal diagnostic stack trace if the user requesting the - /// job error details has sufficient permissions it will be retrieved, - /// otherwise it will be empty. - /// - [JsonProperty(PropertyName = "internalDiagnostics")] - public string InternalDiagnostics { get; private set; } - - /// - /// Gets the inner error of this specific job error message, if any. - /// - [JsonProperty(PropertyName = "innerError")] - public JobInnerError InnerError { get; private set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobInformation.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobInformation.cs deleted file mode 100644 index e806593b7532..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobInformation.cs +++ /dev/null @@ -1,134 +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.DataLake.Analytics.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The extended Data Lake Analytics job information properties returned - /// when retrieving a specific job. - /// - public partial class JobInformation : JobInformationBasic - { - /// - /// Initializes a new instance of the JobInformation class. - /// - public JobInformation() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the JobInformation class. - /// - /// The friendly name of the job. - /// The job type of the current job (Hive, USql, or - /// Scope (for internal use only)). Possible values include: 'USql', - /// 'Hive', 'Scope' - /// The job specific properties. - /// The job's unique identifier (a GUID). - /// The user or account that submitted the - /// job. - /// The degree of parallelism used - /// for this job. - /// the degree of parallelism - /// in percentage used for this job. - /// The priority value for the current job. - /// Lower numbers have a higher priority. By default, a job has a - /// priority of 1000. This must be greater than 0. - /// The time the job was submitted to the - /// service. - /// The start time of the job. - /// The completion time of the job. - /// The job state. When the job is in the Ended - /// state, refer to Result and ErrorMessage for details. Possible - /// values include: 'Accepted', 'Compiling', 'Ended', 'New', 'Queued', - /// 'Running', 'Scheduling', 'Starting', 'Paused', - /// 'WaitingForCapacity', 'Yielded', 'Finalizing' - /// The result of job execution or the current - /// result of the running job. Possible values include: 'None', - /// 'Succeeded', 'Cancelled', 'Failed' - /// The log folder path to use in the following - /// format: - /// adl://<accountName>.azuredatalakestore.net/system/jobservice/jobs/Usql/2016/03/13/17/18/5fe51957-93bc-4de0-8ddc-c5a4753b068b/logs/. - /// The list of log file name patterns to - /// find in the logFolder. '*' is the only matching character allowed. - /// Example format: jobExecution*.log or *mylog*.txt - /// The recurring job relationship information - /// properties. - /// The key-value pairs used to add additional - /// metadata to the job information. (Only for use internally with - /// Scope job type.) - /// the name of hierarchy queue node - /// this job is assigned to, Null if job has not been assigned yet or - /// the account doesn't have hierarchy queue. - /// The error message details for the job, - /// if the job failed. - /// The job state audit records, - /// indicating when various operations have been performed on this - /// job. - public JobInformation(string name, JobType type, JobProperties properties, System.Guid? jobId = default(System.Guid?), string submitter = default(string), int? degreeOfParallelism = default(int?), double? degreeOfParallelismPercent = default(double?), int? priority = default(int?), System.DateTimeOffset? submitTime = default(System.DateTimeOffset?), System.DateTimeOffset? startTime = default(System.DateTimeOffset?), System.DateTimeOffset? endTime = default(System.DateTimeOffset?), JobState? state = default(JobState?), JobResult? result = default(JobResult?), string logFolder = default(string), IList logFilePatterns = default(IList), JobRelationshipProperties related = default(JobRelationshipProperties), IDictionary tags = default(IDictionary), string hierarchyQueueNode = default(string), IList errorMessage = default(IList), IList stateAuditRecords = default(IList)) - : base(name, type, jobId, submitter, degreeOfParallelism, degreeOfParallelismPercent, priority, submitTime, startTime, endTime, state, result, logFolder, logFilePatterns, related, tags, hierarchyQueueNode) - { - ErrorMessage = errorMessage; - StateAuditRecords = stateAuditRecords; - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the error message details for the job, if the job failed. - /// - [JsonProperty(PropertyName = "errorMessage")] - public IList ErrorMessage { get; private set; } - - /// - /// Gets the job state audit records, indicating when various - /// operations have been performed on this job. - /// - [JsonProperty(PropertyName = "stateAuditRecords")] - public IList StateAuditRecords { get; private set; } - - /// - /// Gets or sets the job specific properties. - /// - [JsonProperty(PropertyName = "properties")] - public JobProperties Properties { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - if (Properties == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Properties"); - } - if (Properties != null) - { - Properties.Validate(); - } - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobInformationBasic.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobInformationBasic.cs deleted file mode 100644 index d688aacf4bb4..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobInformationBasic.cs +++ /dev/null @@ -1,238 +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.DataLake.Analytics.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The common Data Lake Analytics job information properties. - /// - public partial class JobInformationBasic - { - /// - /// Initializes a new instance of the JobInformationBasic class. - /// - public JobInformationBasic() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the JobInformationBasic class. - /// - /// The friendly name of the job. - /// The job type of the current job (Hive, USql, or - /// Scope (for internal use only)). Possible values include: 'USql', - /// 'Hive', 'Scope' - /// The job's unique identifier (a GUID). - /// The user or account that submitted the - /// job. - /// The degree of parallelism used - /// for this job. - /// the degree of parallelism - /// in percentage used for this job. - /// The priority value for the current job. - /// Lower numbers have a higher priority. By default, a job has a - /// priority of 1000. This must be greater than 0. - /// The time the job was submitted to the - /// service. - /// The start time of the job. - /// The completion time of the job. - /// The job state. When the job is in the Ended - /// state, refer to Result and ErrorMessage for details. Possible - /// values include: 'Accepted', 'Compiling', 'Ended', 'New', 'Queued', - /// 'Running', 'Scheduling', 'Starting', 'Paused', - /// 'WaitingForCapacity', 'Yielded', 'Finalizing' - /// The result of job execution or the current - /// result of the running job. Possible values include: 'None', - /// 'Succeeded', 'Cancelled', 'Failed' - /// The log folder path to use in the following - /// format: - /// adl://<accountName>.azuredatalakestore.net/system/jobservice/jobs/Usql/2016/03/13/17/18/5fe51957-93bc-4de0-8ddc-c5a4753b068b/logs/. - /// The list of log file name patterns to - /// find in the logFolder. '*' is the only matching character allowed. - /// Example format: jobExecution*.log or *mylog*.txt - /// The recurring job relationship information - /// properties. - /// The key-value pairs used to add additional - /// metadata to the job information. (Only for use internally with - /// Scope job type.) - /// the name of hierarchy queue node - /// this job is assigned to, Null if job has not been assigned yet or - /// the account doesn't have hierarchy queue. - public JobInformationBasic(string name, JobType type, System.Guid? jobId = default(System.Guid?), string submitter = default(string), int? degreeOfParallelism = default(int?), double? degreeOfParallelismPercent = default(double?), int? priority = default(int?), System.DateTimeOffset? submitTime = default(System.DateTimeOffset?), System.DateTimeOffset? startTime = default(System.DateTimeOffset?), System.DateTimeOffset? endTime = default(System.DateTimeOffset?), JobState? state = default(JobState?), JobResult? result = default(JobResult?), string logFolder = default(string), IList logFilePatterns = default(IList), JobRelationshipProperties related = default(JobRelationshipProperties), IDictionary tags = default(IDictionary), string hierarchyQueueNode = default(string)) - { - JobId = jobId; - Name = name; - Type = type; - Submitter = submitter; - DegreeOfParallelism = degreeOfParallelism; - DegreeOfParallelismPercent = degreeOfParallelismPercent; - Priority = priority; - SubmitTime = submitTime; - StartTime = startTime; - EndTime = endTime; - State = state; - Result = result; - LogFolder = logFolder; - LogFilePatterns = logFilePatterns; - Related = related; - Tags = tags; - HierarchyQueueNode = hierarchyQueueNode; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the job's unique identifier (a GUID). - /// - [JsonProperty(PropertyName = "jobId")] - public System.Guid? JobId { get; private set; } - - /// - /// Gets or sets the friendly name of the job. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the job type of the current job (Hive, USql, or Scope - /// (for internal use only)). Possible values include: 'USql', 'Hive', - /// 'Scope' - /// - [JsonProperty(PropertyName = "type")] - public JobType Type { get; set; } - - /// - /// Gets the user or account that submitted the job. - /// - [JsonProperty(PropertyName = "submitter")] - public string Submitter { get; private set; } - - /// - /// Gets or sets the degree of parallelism used for this job. - /// - [JsonProperty(PropertyName = "degreeOfParallelism")] - public int? DegreeOfParallelism { get; set; } - - /// - /// Gets the degree of parallelism in percentage used for this job. - /// - [JsonProperty(PropertyName = "degreeOfParallelismPercent")] - public double? DegreeOfParallelismPercent { get; private set; } - - /// - /// Gets or sets the priority value for the current job. Lower numbers - /// have a higher priority. By default, a job has a priority of 1000. - /// This must be greater than 0. - /// - [JsonProperty(PropertyName = "priority")] - public int? Priority { get; set; } - - /// - /// Gets the time the job was submitted to the service. - /// - [JsonProperty(PropertyName = "submitTime")] - public System.DateTimeOffset? SubmitTime { get; private set; } - - /// - /// Gets the start time of the job. - /// - [JsonProperty(PropertyName = "startTime")] - public System.DateTimeOffset? StartTime { get; private set; } - - /// - /// Gets the completion time of the job. - /// - [JsonProperty(PropertyName = "endTime")] - public System.DateTimeOffset? EndTime { get; private set; } - - /// - /// Gets the job state. When the job is in the Ended state, refer to - /// Result and ErrorMessage for details. Possible values include: - /// 'Accepted', 'Compiling', 'Ended', 'New', 'Queued', 'Running', - /// 'Scheduling', 'Starting', 'Paused', 'WaitingForCapacity', - /// 'Yielded', 'Finalizing' - /// - [JsonProperty(PropertyName = "state")] - public JobState? State { get; private set; } - - /// - /// Gets the result of job execution or the current result of the - /// running job. Possible values include: 'None', 'Succeeded', - /// 'Cancelled', 'Failed' - /// - [JsonProperty(PropertyName = "result")] - public JobResult? Result { get; private set; } - - /// - /// Gets the log folder path to use in the following format: - /// adl://&lt;accountName&gt;.azuredatalakestore.net/system/jobservice/jobs/Usql/2016/03/13/17/18/5fe51957-93bc-4de0-8ddc-c5a4753b068b/logs/. - /// - [JsonProperty(PropertyName = "logFolder")] - public string LogFolder { get; private set; } - - /// - /// Gets or sets the list of log file name patterns to find in the - /// logFolder. '*' is the only matching character allowed. Example - /// format: jobExecution*.log or *mylog*.txt - /// - [JsonProperty(PropertyName = "logFilePatterns")] - public IList LogFilePatterns { get; set; } - - /// - /// Gets or sets the recurring job relationship information properties. - /// - [JsonProperty(PropertyName = "related")] - public JobRelationshipProperties Related { get; set; } - - /// - /// Gets or sets the key-value pairs used to add additional metadata to - /// the job information. (Only for use internally with Scope job type.) - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - /// - /// Gets the name of hierarchy queue node this job is assigned to, Null - /// if job has not been assigned yet or the account doesn't have - /// hierarchy queue. - /// - [JsonProperty(PropertyName = "hierarchyQueueNode")] - public string HierarchyQueueNode { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Name == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); - } - if (Related != null) - { - Related.Validate(); - } - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobInnerError.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobInnerError.cs deleted file mode 100644 index 1f756a8b8178..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobInnerError.cs +++ /dev/null @@ -1,156 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The Data Lake Analytics job error details. - /// - public partial class JobInnerError - { - /// - /// Initializes a new instance of the JobInnerError class. - /// - public JobInnerError() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the JobInnerError class. - /// - /// The specific identifier for the type of error - /// encountered in the job. - /// The severity level of the failure. Possible - /// values include: 'Warning', 'Error', 'Info', 'SevereWarning', - /// 'Deprecated', 'UserWarning' - /// The ultimate source of the failure (usually - /// either SYSTEM or USER). - /// The user friendly error message for the - /// failure. - /// The error message description. - /// The details of the error message. - /// The diagnostic error code. - /// The component that failed. - /// The recommended resolution for the - /// failure, if any. - /// The link to MSDN or Azure help for this type - /// of error, if any. - /// The internal diagnostic stack - /// trace if the user requesting the job error details has sufficient - /// permissions it will be retrieved, otherwise it will be - /// empty. - /// The inner error of this specific job error - /// message, if any. - public JobInnerError(string errorId = default(string), SeverityTypes? severity = default(SeverityTypes?), string source = default(string), string message = default(string), string description = default(string), string details = default(string), int? diagnosticCode = default(int?), string component = default(string), string resolution = default(string), string helpLink = default(string), string internalDiagnostics = default(string), JobInnerError innerError = default(JobInnerError)) - { - ErrorId = errorId; - Severity = severity; - Source = source; - Message = message; - Description = description; - Details = details; - DiagnosticCode = diagnosticCode; - Component = component; - Resolution = resolution; - HelpLink = helpLink; - InternalDiagnostics = internalDiagnostics; - InnerError = innerError; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the specific identifier for the type of error encountered in - /// the job. - /// - [JsonProperty(PropertyName = "errorId")] - public string ErrorId { get; private set; } - - /// - /// Gets the severity level of the failure. Possible values include: - /// 'Warning', 'Error', 'Info', 'SevereWarning', 'Deprecated', - /// 'UserWarning' - /// - [JsonProperty(PropertyName = "severity")] - public SeverityTypes? Severity { get; private set; } - - /// - /// Gets the ultimate source of the failure (usually either SYSTEM or - /// USER). - /// - [JsonProperty(PropertyName = "source")] - public string Source { get; private set; } - - /// - /// Gets the user friendly error message for the failure. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } - - /// - /// Gets the error message description. - /// - [JsonProperty(PropertyName = "description")] - public string Description { get; private set; } - - /// - /// Gets the details of the error message. - /// - [JsonProperty(PropertyName = "details")] - public string Details { get; private set; } - - /// - /// Gets the diagnostic error code. - /// - [JsonProperty(PropertyName = "diagnosticCode")] - public int? DiagnosticCode { get; private set; } - - /// - /// Gets the component that failed. - /// - [JsonProperty(PropertyName = "component")] - public string Component { get; private set; } - - /// - /// Gets the recommended resolution for the failure, if any. - /// - [JsonProperty(PropertyName = "resolution")] - public string Resolution { get; private set; } - - /// - /// Gets the link to MSDN or Azure help for this type of error, if any. - /// - [JsonProperty(PropertyName = "helpLink")] - public string HelpLink { get; private set; } - - /// - /// Gets the internal diagnostic stack trace if the user requesting the - /// job error details has sufficient permissions it will be retrieved, - /// otherwise it will be empty. - /// - [JsonProperty(PropertyName = "internalDiagnostics")] - public string InternalDiagnostics { get; private set; } - - /// - /// Gets the inner error of this specific job error message, if any. - /// - [JsonProperty(PropertyName = "innerError")] - public JobInnerError InnerError { get; private set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobPipelineInformation.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobPipelineInformation.cs deleted file mode 100644 index b5692b466fc0..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobPipelineInformation.cs +++ /dev/null @@ -1,178 +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.DataLake.Analytics.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Job Pipeline Information, showing the relationship of jobs and - /// recurrences of those jobs in a pipeline. - /// - public partial class JobPipelineInformation - { - /// - /// Initializes a new instance of the JobPipelineInformation class. - /// - public JobPipelineInformation() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the JobPipelineInformation class. - /// - /// The job relationship pipeline identifier - /// (a GUID). - /// The friendly name of the job - /// relationship pipeline, which does not need to be unique. - /// The pipeline uri, unique, links to the - /// originating service for this pipeline. - /// The number of jobs in this pipeline - /// that have failed. - /// The number of jobs in this pipeline - /// that have been canceled. - /// The number of jobs in this pipeline - /// that have succeeded. - /// The number of job execution hours that - /// resulted in failed jobs. - /// The number of job execution hours - /// that resulted in canceled jobs. - /// The number of job execution hours - /// that resulted in successful jobs. - /// The last time a job in this pipeline - /// was submitted. - /// The list of recurrence identifiers representing - /// each run of this pipeline. - /// The list of recurrence identifiers - /// representing each run of this pipeline. - public JobPipelineInformation(System.Guid? pipelineId = default(System.Guid?), string pipelineName = default(string), string pipelineUri = default(string), int? numJobsFailed = default(int?), int? numJobsCanceled = default(int?), int? numJobsSucceeded = default(int?), double? auHoursFailed = default(double?), double? auHoursCanceled = default(double?), double? auHoursSucceeded = default(double?), System.DateTimeOffset? lastSubmitTime = default(System.DateTimeOffset?), IList runs = default(IList), IList recurrences = default(IList)) - { - PipelineId = pipelineId; - PipelineName = pipelineName; - PipelineUri = pipelineUri; - NumJobsFailed = numJobsFailed; - NumJobsCanceled = numJobsCanceled; - NumJobsSucceeded = numJobsSucceeded; - AuHoursFailed = auHoursFailed; - AuHoursCanceled = auHoursCanceled; - AuHoursSucceeded = auHoursSucceeded; - LastSubmitTime = lastSubmitTime; - Runs = runs; - Recurrences = recurrences; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the job relationship pipeline identifier (a GUID). - /// - [JsonProperty(PropertyName = "pipelineId")] - public System.Guid? PipelineId { get; private set; } - - /// - /// Gets the friendly name of the job relationship pipeline, which does - /// not need to be unique. - /// - [JsonProperty(PropertyName = "pipelineName")] - public string PipelineName { get; private set; } - - /// - /// Gets the pipeline uri, unique, links to the originating service for - /// this pipeline. - /// - [JsonProperty(PropertyName = "pipelineUri")] - public string PipelineUri { get; private set; } - - /// - /// Gets the number of jobs in this pipeline that have failed. - /// - [JsonProperty(PropertyName = "numJobsFailed")] - public int? NumJobsFailed { get; private set; } - - /// - /// Gets the number of jobs in this pipeline that have been canceled. - /// - [JsonProperty(PropertyName = "numJobsCanceled")] - public int? NumJobsCanceled { get; private set; } - - /// - /// Gets the number of jobs in this pipeline that have succeeded. - /// - [JsonProperty(PropertyName = "numJobsSucceeded")] - public int? NumJobsSucceeded { get; private set; } - - /// - /// Gets the number of job execution hours that resulted in failed - /// jobs. - /// - [JsonProperty(PropertyName = "auHoursFailed")] - public double? AuHoursFailed { get; private set; } - - /// - /// Gets the number of job execution hours that resulted in canceled - /// jobs. - /// - [JsonProperty(PropertyName = "auHoursCanceled")] - public double? AuHoursCanceled { get; private set; } - - /// - /// Gets the number of job execution hours that resulted in successful - /// jobs. - /// - [JsonProperty(PropertyName = "auHoursSucceeded")] - public double? AuHoursSucceeded { get; private set; } - - /// - /// Gets the last time a job in this pipeline was submitted. - /// - [JsonProperty(PropertyName = "lastSubmitTime")] - public System.DateTimeOffset? LastSubmitTime { get; private set; } - - /// - /// Gets the list of recurrence identifiers representing each run of - /// this pipeline. - /// - [JsonProperty(PropertyName = "runs")] - public IList Runs { get; private set; } - - /// - /// Gets the list of recurrence identifiers representing each run of - /// this pipeline. - /// - [JsonProperty(PropertyName = "recurrences")] - public IList Recurrences { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (PipelineName != null) - { - if (PipelineName.Length > 260) - { - throw new ValidationException(ValidationRules.MaxLength, "PipelineName", 260); - } - } - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobPipelineRunInformation.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobPipelineRunInformation.cs deleted file mode 100644 index 00b60575dd25..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobPipelineRunInformation.cs +++ /dev/null @@ -1,62 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Run info for a specific job pipeline. - /// - public partial class JobPipelineRunInformation - { - /// - /// Initializes a new instance of the JobPipelineRunInformation class. - /// - public JobPipelineRunInformation() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the JobPipelineRunInformation class. - /// - /// The run identifier of an instance of pipeline - /// executions (a GUID). - /// The time this instance was last - /// submitted. - public JobPipelineRunInformation(System.Guid? runId = default(System.Guid?), System.DateTimeOffset? lastSubmitTime = default(System.DateTimeOffset?)) - { - RunId = runId; - LastSubmitTime = lastSubmitTime; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the run identifier of an instance of pipeline executions (a - /// GUID). - /// - [JsonProperty(PropertyName = "runId")] - public System.Guid? RunId { get; private set; } - - /// - /// Gets the time this instance was last submitted. - /// - [JsonProperty(PropertyName = "lastSubmitTime")] - public System.DateTimeOffset? LastSubmitTime { get; private set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobProperties.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobProperties.cs deleted file mode 100644 index ab7e1b20cd8d..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobProperties.cs +++ /dev/null @@ -1,78 +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.DataLake.Analytics.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// The common Data Lake Analytics job properties. - /// - public partial class JobProperties - { - /// - /// Initializes a new instance of the JobProperties class. - /// - public JobProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the JobProperties class. - /// - /// The script to run. Please note that the - /// maximum script size is 3 MB. - /// The runtime version of the Data Lake - /// Analytics engine to use for the specific type of job being - /// run. - public JobProperties(string script, string runtimeVersion = default(string)) - { - RuntimeVersion = runtimeVersion; - Script = script; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the runtime version of the Data Lake Analytics engine - /// to use for the specific type of job being run. - /// - [JsonProperty(PropertyName = "runtimeVersion")] - public string RuntimeVersion { get; set; } - - /// - /// Gets or sets the script to run. Please note that the maximum script - /// size is 3 MB. - /// - [JsonProperty(PropertyName = "script")] - public string Script { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Script == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Script"); - } - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobRecurrenceInformation.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobRecurrenceInformation.cs deleted file mode 100644 index 66923eb45420..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobRecurrenceInformation.cs +++ /dev/null @@ -1,132 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Recurrence job information for a specific recurrence. - /// - public partial class JobRecurrenceInformation - { - /// - /// Initializes a new instance of the JobRecurrenceInformation class. - /// - public JobRecurrenceInformation() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the JobRecurrenceInformation class. - /// - /// The recurrence identifier (a GUID), - /// unique per activity/script, regardless of iterations. This is - /// something to link different occurrences of the same job - /// together. - /// The recurrence name, user friendly - /// name for the correlation between jobs. - /// The number of jobs in this recurrence - /// that have failed. - /// The number of jobs in this recurrence - /// that have been canceled. - /// The number of jobs in this - /// recurrence that have succeeded. - /// The number of job execution hours that - /// resulted in failed jobs. - /// The number of job execution hours - /// that resulted in canceled jobs. - /// The number of job execution hours - /// that resulted in successful jobs. - /// The last time a job in this recurrence - /// was submitted. - public JobRecurrenceInformation(System.Guid? recurrenceId = default(System.Guid?), string recurrenceName = default(string), int? numJobsFailed = default(int?), int? numJobsCanceled = default(int?), int? numJobsSucceeded = default(int?), double? auHoursFailed = default(double?), double? auHoursCanceled = default(double?), double? auHoursSucceeded = default(double?), System.DateTimeOffset? lastSubmitTime = default(System.DateTimeOffset?)) - { - RecurrenceId = recurrenceId; - RecurrenceName = recurrenceName; - NumJobsFailed = numJobsFailed; - NumJobsCanceled = numJobsCanceled; - NumJobsSucceeded = numJobsSucceeded; - AuHoursFailed = auHoursFailed; - AuHoursCanceled = auHoursCanceled; - AuHoursSucceeded = auHoursSucceeded; - LastSubmitTime = lastSubmitTime; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the recurrence identifier (a GUID), unique per - /// activity/script, regardless of iterations. This is something to - /// link different occurrences of the same job together. - /// - [JsonProperty(PropertyName = "recurrenceId")] - public System.Guid? RecurrenceId { get; private set; } - - /// - /// Gets the recurrence name, user friendly name for the correlation - /// between jobs. - /// - [JsonProperty(PropertyName = "recurrenceName")] - public string RecurrenceName { get; private set; } - - /// - /// Gets the number of jobs in this recurrence that have failed. - /// - [JsonProperty(PropertyName = "numJobsFailed")] - public int? NumJobsFailed { get; private set; } - - /// - /// Gets the number of jobs in this recurrence that have been canceled. - /// - [JsonProperty(PropertyName = "numJobsCanceled")] - public int? NumJobsCanceled { get; private set; } - - /// - /// Gets the number of jobs in this recurrence that have succeeded. - /// - [JsonProperty(PropertyName = "numJobsSucceeded")] - public int? NumJobsSucceeded { get; private set; } - - /// - /// Gets the number of job execution hours that resulted in failed - /// jobs. - /// - [JsonProperty(PropertyName = "auHoursFailed")] - public double? AuHoursFailed { get; private set; } - - /// - /// Gets the number of job execution hours that resulted in canceled - /// jobs. - /// - [JsonProperty(PropertyName = "auHoursCanceled")] - public double? AuHoursCanceled { get; private set; } - - /// - /// Gets the number of job execution hours that resulted in successful - /// jobs. - /// - [JsonProperty(PropertyName = "auHoursSucceeded")] - public double? AuHoursSucceeded { get; private set; } - - /// - /// Gets the last time a job in this recurrence was submitted. - /// - [JsonProperty(PropertyName = "lastSubmitTime")] - public System.DateTimeOffset? LastSubmitTime { get; private set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobRelationshipProperties.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobRelationshipProperties.cs deleted file mode 100644 index 7d4bdc181a6f..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobRelationshipProperties.cs +++ /dev/null @@ -1,130 +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.DataLake.Analytics.Models -{ - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Linq; - - /// - /// Job relationship information properties including pipeline information, - /// correlation information, etc. - /// - public partial class JobRelationshipProperties - { - /// - /// Initializes a new instance of the JobRelationshipProperties class. - /// - public JobRelationshipProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the JobRelationshipProperties class. - /// - /// The recurrence identifier (a GUID), - /// unique per activity/script, regardless of iterations. This is - /// something to link different occurrences of the same job - /// together. - /// The job relationship pipeline identifier - /// (a GUID). - /// The friendly name of the job - /// relationship pipeline, which does not need to be unique. - /// The pipeline uri, unique, links to the - /// originating service for this pipeline. - /// The run identifier (a GUID), unique identifier - /// of the iteration of this pipeline. - /// The recurrence name, user friendly - /// name for the correlation between jobs. - public JobRelationshipProperties(System.Guid recurrenceId, System.Guid? pipelineId = default(System.Guid?), string pipelineName = default(string), string pipelineUri = default(string), System.Guid? runId = default(System.Guid?), string recurrenceName = default(string)) - { - PipelineId = pipelineId; - PipelineName = pipelineName; - PipelineUri = pipelineUri; - RunId = runId; - RecurrenceId = recurrenceId; - RecurrenceName = recurrenceName; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the job relationship pipeline identifier (a GUID). - /// - [JsonProperty(PropertyName = "pipelineId")] - public System.Guid? PipelineId { get; set; } - - /// - /// Gets or sets the friendly name of the job relationship pipeline, - /// which does not need to be unique. - /// - [JsonProperty(PropertyName = "pipelineName")] - public string PipelineName { get; set; } - - /// - /// Gets or sets the pipeline uri, unique, links to the originating - /// service for this pipeline. - /// - [JsonProperty(PropertyName = "pipelineUri")] - public string PipelineUri { get; set; } - - /// - /// Gets or sets the run identifier (a GUID), unique identifier of the - /// iteration of this pipeline. - /// - [JsonProperty(PropertyName = "runId")] - public System.Guid? RunId { get; set; } - - /// - /// Gets or sets the recurrence identifier (a GUID), unique per - /// activity/script, regardless of iterations. This is something to - /// link different occurrences of the same job together. - /// - [JsonProperty(PropertyName = "recurrenceId")] - public System.Guid RecurrenceId { get; set; } - - /// - /// Gets or sets the recurrence name, user friendly name for the - /// correlation between jobs. - /// - [JsonProperty(PropertyName = "recurrenceName")] - public string RecurrenceName { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (PipelineName != null) - { - if (PipelineName.Length > 260) - { - throw new ValidationException(ValidationRules.MaxLength, "PipelineName", 260); - } - } - if (RecurrenceName != null) - { - if (RecurrenceName.Length > 260) - { - throw new ValidationException(ValidationRules.MaxLength, "RecurrenceName", 260); - } - } - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobResource.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobResource.cs deleted file mode 100644 index 57c857af29d9..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobResource.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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The Data Lake Analytics job resources. - /// - public partial class JobResource - { - /// - /// Initializes a new instance of the JobResource class. - /// - public JobResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the JobResource class. - /// - /// The name of the resource. - /// The path to the resource. - /// The job resource type. Possible values include: - /// 'VertexResource', 'JobManagerResource', 'StatisticsResource', - /// 'VertexResourceInUserFolder', 'JobManagerResourceInUserFolder', - /// 'StatisticsResourceInUserFolder' - public JobResource(string name = default(string), string resourcePath = default(string), JobResourceType? type = default(JobResourceType?)) - { - Name = name; - ResourcePath = resourcePath; - Type = type; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the resource. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the path to the resource. - /// - [JsonProperty(PropertyName = "resourcePath")] - public string ResourcePath { get; set; } - - /// - /// Gets or sets the job resource type. Possible values include: - /// 'VertexResource', 'JobManagerResource', 'StatisticsResource', - /// 'VertexResourceInUserFolder', 'JobManagerResourceInUserFolder', - /// 'StatisticsResourceInUserFolder' - /// - [JsonProperty(PropertyName = "type")] - public JobResourceType? Type { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobResourceType.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobResourceType.cs deleted file mode 100644 index a0b215a08ef5..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobResourceType.cs +++ /dev/null @@ -1,84 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for JobResourceType. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum JobResourceType - { - [EnumMember(Value = "VertexResource")] - VertexResource, - [EnumMember(Value = "JobManagerResource")] - JobManagerResource, - [EnumMember(Value = "StatisticsResource")] - StatisticsResource, - [EnumMember(Value = "VertexResourceInUserFolder")] - VertexResourceInUserFolder, - [EnumMember(Value = "JobManagerResourceInUserFolder")] - JobManagerResourceInUserFolder, - [EnumMember(Value = "StatisticsResourceInUserFolder")] - StatisticsResourceInUserFolder - } - internal static class JobResourceTypeEnumExtension - { - internal static string ToSerializedValue(this JobResourceType? value) - { - return value == null ? null : ((JobResourceType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this JobResourceType value) - { - switch( value ) - { - case JobResourceType.VertexResource: - return "VertexResource"; - case JobResourceType.JobManagerResource: - return "JobManagerResource"; - case JobResourceType.StatisticsResource: - return "StatisticsResource"; - case JobResourceType.VertexResourceInUserFolder: - return "VertexResourceInUserFolder"; - case JobResourceType.JobManagerResourceInUserFolder: - return "JobManagerResourceInUserFolder"; - case JobResourceType.StatisticsResourceInUserFolder: - return "StatisticsResourceInUserFolder"; - } - return null; - } - - internal static JobResourceType? ParseJobResourceType(this string value) - { - switch( value ) - { - case "VertexResource": - return JobResourceType.VertexResource; - case "JobManagerResource": - return JobResourceType.JobManagerResource; - case "StatisticsResource": - return JobResourceType.StatisticsResource; - case "VertexResourceInUserFolder": - return JobResourceType.VertexResourceInUserFolder; - case "JobManagerResourceInUserFolder": - return JobResourceType.JobManagerResourceInUserFolder; - case "StatisticsResourceInUserFolder": - return JobResourceType.StatisticsResourceInUserFolder; - } - return null; - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobState.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobState.cs deleted file mode 100644 index 7ac3b96d7549..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobState.cs +++ /dev/null @@ -1,120 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for JobState. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum JobState - { - [EnumMember(Value = "Accepted")] - Accepted, - [EnumMember(Value = "Compiling")] - Compiling, - [EnumMember(Value = "Ended")] - Ended, - [EnumMember(Value = "New")] - New, - [EnumMember(Value = "Queued")] - Queued, - [EnumMember(Value = "Running")] - Running, - [EnumMember(Value = "Scheduling")] - Scheduling, - [EnumMember(Value = "Starting")] - Starting, - [EnumMember(Value = "Paused")] - Paused, - [EnumMember(Value = "WaitingForCapacity")] - WaitingForCapacity, - [EnumMember(Value = "Yielded")] - Yielded, - [EnumMember(Value = "Finalizing")] - Finalizing - } - internal static class JobStateEnumExtension - { - internal static string ToSerializedValue(this JobState? value) - { - return value == null ? null : ((JobState)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this JobState value) - { - switch( value ) - { - case JobState.Accepted: - return "Accepted"; - case JobState.Compiling: - return "Compiling"; - case JobState.Ended: - return "Ended"; - case JobState.New: - return "New"; - case JobState.Queued: - return "Queued"; - case JobState.Running: - return "Running"; - case JobState.Scheduling: - return "Scheduling"; - case JobState.Starting: - return "Starting"; - case JobState.Paused: - return "Paused"; - case JobState.WaitingForCapacity: - return "WaitingForCapacity"; - case JobState.Yielded: - return "Yielded"; - case JobState.Finalizing: - return "Finalizing"; - } - return null; - } - - internal static JobState? ParseJobState(this string value) - { - switch( value ) - { - case "Accepted": - return JobState.Accepted; - case "Compiling": - return JobState.Compiling; - case "Ended": - return JobState.Ended; - case "New": - return JobState.New; - case "Queued": - return JobState.Queued; - case "Running": - return JobState.Running; - case "Scheduling": - return JobState.Scheduling; - case "Starting": - return JobState.Starting; - case "Paused": - return JobState.Paused; - case "WaitingForCapacity": - return JobState.WaitingForCapacity; - case "Yielded": - return JobState.Yielded; - case "Finalizing": - return JobState.Finalizing; - } - return null; - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobStateAuditRecord.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobStateAuditRecord.cs deleted file mode 100644 index 42ab2aab535b..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobStateAuditRecord.cs +++ /dev/null @@ -1,78 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The Data Lake Analytics job state audit records for tracking the - /// lifecycle of a job. - /// - public partial class JobStateAuditRecord - { - /// - /// Initializes a new instance of the JobStateAuditRecord class. - /// - public JobStateAuditRecord() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the JobStateAuditRecord class. - /// - /// The new state the job is in. - /// The time stamp that the state change took - /// place. - /// The user who requests the - /// change. - /// The details of the audit log. - public JobStateAuditRecord(string newState = default(string), System.DateTimeOffset? timeStamp = default(System.DateTimeOffset?), string requestedByUser = default(string), string details = default(string)) - { - NewState = newState; - TimeStamp = timeStamp; - RequestedByUser = requestedByUser; - Details = details; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the new state the job is in. - /// - [JsonProperty(PropertyName = "newState")] - public string NewState { get; private set; } - - /// - /// Gets the time stamp that the state change took place. - /// - [JsonProperty(PropertyName = "timeStamp")] - public System.DateTimeOffset? TimeStamp { get; private set; } - - /// - /// Gets the user who requests the change. - /// - [JsonProperty(PropertyName = "requestedByUser")] - public string RequestedByUser { get; private set; } - - /// - /// Gets the details of the audit log. - /// - [JsonProperty(PropertyName = "details")] - public string Details { get; private set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobStatistics.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobStatistics.cs deleted file mode 100644 index eb63ce65db47..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobStatistics.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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The Data Lake Analytics job execution statistics. - /// - public partial class JobStatistics - { - /// - /// Initializes a new instance of the JobStatistics class. - /// - public JobStatistics() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the JobStatistics class. - /// - /// The last update time for the - /// statistics. - /// The job finalizing start - /// time. - /// The list of stages for the job. - public JobStatistics(System.DateTimeOffset? lastUpdateTimeUtc = default(System.DateTimeOffset?), System.DateTimeOffset? finalizingTimeUtc = default(System.DateTimeOffset?), IList stages = default(IList)) - { - LastUpdateTimeUtc = lastUpdateTimeUtc; - FinalizingTimeUtc = finalizingTimeUtc; - Stages = stages; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the last update time for the statistics. - /// - [JsonProperty(PropertyName = "lastUpdateTimeUtc")] - public System.DateTimeOffset? LastUpdateTimeUtc { get; private set; } - - /// - /// Gets the job finalizing start time. - /// - [JsonProperty(PropertyName = "finalizingTimeUtc")] - public System.DateTimeOffset? FinalizingTimeUtc { get; private set; } - - /// - /// Gets the list of stages for the job. - /// - [JsonProperty(PropertyName = "stages")] - public IList Stages { get; private set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobStatisticsVertex.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobStatisticsVertex.cs deleted file mode 100644 index 93a1e6f98af3..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobStatisticsVertex.cs +++ /dev/null @@ -1,86 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The detailed information for a vertex. - /// - public partial class JobStatisticsVertex - { - /// - /// Initializes a new instance of the JobStatisticsVertex class. - /// - public JobStatisticsVertex() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the JobStatisticsVertex class. - /// - /// The name of the vertex. - /// The id of the vertex. - /// The amount of execution time of the - /// vertex. - /// The amount of data read of the vertex, in - /// bytes. - /// The amount of peak memory usage of the - /// vertex, in bytes. - public JobStatisticsVertex(string name = default(string), System.Guid? vertexId = default(System.Guid?), System.TimeSpan? executionTime = default(System.TimeSpan?), long? dataRead = default(long?), long? peakMemUsage = default(long?)) - { - Name = name; - VertexId = vertexId; - ExecutionTime = executionTime; - DataRead = dataRead; - PeakMemUsage = peakMemUsage; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the name of the vertex. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets the id of the vertex. - /// - [JsonProperty(PropertyName = "vertexId")] - public System.Guid? VertexId { get; private set; } - - /// - /// Gets the amount of execution time of the vertex. - /// - [JsonProperty(PropertyName = "executionTime")] - public System.TimeSpan? ExecutionTime { get; private set; } - - /// - /// Gets the amount of data read of the vertex, in bytes. - /// - [JsonProperty(PropertyName = "dataRead")] - public long? DataRead { get; private set; } - - /// - /// Gets the amount of peak memory usage of the vertex, in bytes. - /// - [JsonProperty(PropertyName = "peakMemUsage")] - public long? PeakMemUsage { get; private set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobStatisticsVertexStage.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobStatisticsVertexStage.cs deleted file mode 100644 index dca4d5ae577e..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobStatisticsVertexStage.cs +++ /dev/null @@ -1,336 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The Data Lake Analytics job statistics vertex stage information. - /// - public partial class JobStatisticsVertexStage - { - /// - /// Initializes a new instance of the JobStatisticsVertexStage class. - /// - public JobStatisticsVertexStage() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the JobStatisticsVertexStage class. - /// - /// The amount of data read, in bytes. - /// The amount of data read across - /// multiple pods, in bytes. - /// The amount of data read in one pod, - /// in bytes. - /// The amount of data remaining to be read, - /// in bytes. - /// The amount of data written, in - /// bytes. - /// The number of duplicates that - /// were discarded. - /// The number of failures that occurred in - /// this stage. - /// The maximum amount of data read in - /// a single vertex, in bytes. - /// The minimum amount of data read in - /// a single vertex, in bytes. - /// The number of read failures in this - /// stage. - /// The number of vertices that were - /// revoked during this stage. - /// The number of currently running vertices - /// in this stage. - /// The number of currently scheduled - /// vertices in this stage. - /// The name of this stage in job - /// execution. - /// The number of vertices that succeeded - /// in this stage. - /// The amount of temporary data written, - /// in bytes. - /// The total vertex count for this - /// stage. - /// The amount of time that failed - /// vertices took up in this stage. - /// The current progress of this stage, as - /// a percentage. - /// The amount of time all successful - /// vertices took in this stage. - /// The sum of the peak memory usage of - /// all the vertices in the stage, in bytes. - /// The sum of the total execution - /// time of all the vertices in the stage. - /// the vertex with the maximum amount - /// of data read. - /// the vertex with the maximum - /// execution time. - /// the vertex with the maximum - /// peak memory usage. - /// The estimated vertex CPU - /// core count. - /// The estimated vertex - /// peak CPU core count. - /// The estimated vertex memory - /// size, in bytes. - /// The statistics - /// information for the allocated container CPU core count. - /// The statistics information - /// for the allocated container memory size. - /// The statistics information for - /// the used vertex CPU core count. - /// The statistics information for - /// the used vertex peak memory size. - public JobStatisticsVertexStage(long? dataRead = default(long?), long? dataReadCrossPod = default(long?), long? dataReadIntraPod = default(long?), long? dataToRead = default(long?), long? dataWritten = default(long?), int? duplicateDiscardCount = default(int?), int? failedCount = default(int?), long? maxVertexDataRead = default(long?), long? minVertexDataRead = default(long?), int? readFailureCount = default(int?), int? revocationCount = default(int?), int? runningCount = default(int?), int? scheduledCount = default(int?), string stageName = default(string), int? succeededCount = default(int?), long? tempDataWritten = default(long?), int? totalCount = default(int?), System.TimeSpan? totalFailedTime = default(System.TimeSpan?), int? totalProgress = default(int?), System.TimeSpan? totalSucceededTime = default(System.TimeSpan?), long? totalPeakMemUsage = default(long?), System.TimeSpan? totalExecutionTime = default(System.TimeSpan?), JobStatisticsVertex maxDataReadVertex = default(JobStatisticsVertex), JobStatisticsVertex maxExecutionTimeVertex = default(JobStatisticsVertex), JobStatisticsVertex maxPeakMemUsageVertex = default(JobStatisticsVertex), int? estimatedVertexCpuCoreCount = default(int?), int? estimatedVertexPeakCpuCoreCount = default(int?), long? estimatedVertexMemSize = default(long?), ResourceUsageStatistics allocatedContainerCpuCoreCount = default(ResourceUsageStatistics), ResourceUsageStatistics allocatedContainerMemSize = default(ResourceUsageStatistics), ResourceUsageStatistics usedVertexCpuCoreCount = default(ResourceUsageStatistics), ResourceUsageStatistics usedVertexPeakMemSize = default(ResourceUsageStatistics)) - { - DataRead = dataRead; - DataReadCrossPod = dataReadCrossPod; - DataReadIntraPod = dataReadIntraPod; - DataToRead = dataToRead; - DataWritten = dataWritten; - DuplicateDiscardCount = duplicateDiscardCount; - FailedCount = failedCount; - MaxVertexDataRead = maxVertexDataRead; - MinVertexDataRead = minVertexDataRead; - ReadFailureCount = readFailureCount; - RevocationCount = revocationCount; - RunningCount = runningCount; - ScheduledCount = scheduledCount; - StageName = stageName; - SucceededCount = succeededCount; - TempDataWritten = tempDataWritten; - TotalCount = totalCount; - TotalFailedTime = totalFailedTime; - TotalProgress = totalProgress; - TotalSucceededTime = totalSucceededTime; - TotalPeakMemUsage = totalPeakMemUsage; - TotalExecutionTime = totalExecutionTime; - MaxDataReadVertex = maxDataReadVertex; - MaxExecutionTimeVertex = maxExecutionTimeVertex; - MaxPeakMemUsageVertex = maxPeakMemUsageVertex; - EstimatedVertexCpuCoreCount = estimatedVertexCpuCoreCount; - EstimatedVertexPeakCpuCoreCount = estimatedVertexPeakCpuCoreCount; - EstimatedVertexMemSize = estimatedVertexMemSize; - AllocatedContainerCpuCoreCount = allocatedContainerCpuCoreCount; - AllocatedContainerMemSize = allocatedContainerMemSize; - UsedVertexCpuCoreCount = usedVertexCpuCoreCount; - UsedVertexPeakMemSize = usedVertexPeakMemSize; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the amount of data read, in bytes. - /// - [JsonProperty(PropertyName = "dataRead")] - public long? DataRead { get; private set; } - - /// - /// Gets the amount of data read across multiple pods, in bytes. - /// - [JsonProperty(PropertyName = "dataReadCrossPod")] - public long? DataReadCrossPod { get; private set; } - - /// - /// Gets the amount of data read in one pod, in bytes. - /// - [JsonProperty(PropertyName = "dataReadIntraPod")] - public long? DataReadIntraPod { get; private set; } - - /// - /// Gets the amount of data remaining to be read, in bytes. - /// - [JsonProperty(PropertyName = "dataToRead")] - public long? DataToRead { get; private set; } - - /// - /// Gets the amount of data written, in bytes. - /// - [JsonProperty(PropertyName = "dataWritten")] - public long? DataWritten { get; private set; } - - /// - /// Gets the number of duplicates that were discarded. - /// - [JsonProperty(PropertyName = "duplicateDiscardCount")] - public int? DuplicateDiscardCount { get; private set; } - - /// - /// Gets the number of failures that occurred in this stage. - /// - [JsonProperty(PropertyName = "failedCount")] - public int? FailedCount { get; private set; } - - /// - /// Gets the maximum amount of data read in a single vertex, in bytes. - /// - [JsonProperty(PropertyName = "maxVertexDataRead")] - public long? MaxVertexDataRead { get; private set; } - - /// - /// Gets the minimum amount of data read in a single vertex, in bytes. - /// - [JsonProperty(PropertyName = "minVertexDataRead")] - public long? MinVertexDataRead { get; private set; } - - /// - /// Gets the number of read failures in this stage. - /// - [JsonProperty(PropertyName = "readFailureCount")] - public int? ReadFailureCount { get; private set; } - - /// - /// Gets the number of vertices that were revoked during this stage. - /// - [JsonProperty(PropertyName = "revocationCount")] - public int? RevocationCount { get; private set; } - - /// - /// Gets the number of currently running vertices in this stage. - /// - [JsonProperty(PropertyName = "runningCount")] - public int? RunningCount { get; private set; } - - /// - /// Gets the number of currently scheduled vertices in this stage. - /// - [JsonProperty(PropertyName = "scheduledCount")] - public int? ScheduledCount { get; private set; } - - /// - /// Gets the name of this stage in job execution. - /// - [JsonProperty(PropertyName = "stageName")] - public string StageName { get; private set; } - - /// - /// Gets the number of vertices that succeeded in this stage. - /// - [JsonProperty(PropertyName = "succeededCount")] - public int? SucceededCount { get; private set; } - - /// - /// Gets the amount of temporary data written, in bytes. - /// - [JsonProperty(PropertyName = "tempDataWritten")] - public long? TempDataWritten { get; private set; } - - /// - /// Gets the total vertex count for this stage. - /// - [JsonProperty(PropertyName = "totalCount")] - public int? TotalCount { get; private set; } - - /// - /// Gets the amount of time that failed vertices took up in this stage. - /// - [JsonProperty(PropertyName = "totalFailedTime")] - public System.TimeSpan? TotalFailedTime { get; private set; } - - /// - /// Gets the current progress of this stage, as a percentage. - /// - [JsonProperty(PropertyName = "totalProgress")] - public int? TotalProgress { get; private set; } - - /// - /// Gets the amount of time all successful vertices took in this stage. - /// - [JsonProperty(PropertyName = "totalSucceededTime")] - public System.TimeSpan? TotalSucceededTime { get; private set; } - - /// - /// Gets the sum of the peak memory usage of all the vertices in the - /// stage, in bytes. - /// - [JsonProperty(PropertyName = "totalPeakMemUsage")] - public long? TotalPeakMemUsage { get; private set; } - - /// - /// Gets the sum of the total execution time of all the vertices in the - /// stage. - /// - [JsonProperty(PropertyName = "totalExecutionTime")] - public System.TimeSpan? TotalExecutionTime { get; private set; } - - /// - /// Gets or sets the vertex with the maximum amount of data read. - /// - [JsonProperty(PropertyName = "maxDataReadVertex")] - public JobStatisticsVertex MaxDataReadVertex { get; set; } - - /// - /// Gets or sets the vertex with the maximum execution time. - /// - [JsonProperty(PropertyName = "maxExecutionTimeVertex")] - public JobStatisticsVertex MaxExecutionTimeVertex { get; set; } - - /// - /// Gets or sets the vertex with the maximum peak memory usage. - /// - [JsonProperty(PropertyName = "maxPeakMemUsageVertex")] - public JobStatisticsVertex MaxPeakMemUsageVertex { get; set; } - - /// - /// Gets the estimated vertex CPU core count. - /// - [JsonProperty(PropertyName = "estimatedVertexCpuCoreCount")] - public int? EstimatedVertexCpuCoreCount { get; private set; } - - /// - /// Gets the estimated vertex peak CPU core count. - /// - [JsonProperty(PropertyName = "estimatedVertexPeakCpuCoreCount")] - public int? EstimatedVertexPeakCpuCoreCount { get; private set; } - - /// - /// Gets the estimated vertex memory size, in bytes. - /// - [JsonProperty(PropertyName = "estimatedVertexMemSize")] - public long? EstimatedVertexMemSize { get; private set; } - - /// - /// Gets or sets the statistics information for the allocated container - /// CPU core count. - /// - [JsonProperty(PropertyName = "allocatedContainerCpuCoreCount")] - public ResourceUsageStatistics AllocatedContainerCpuCoreCount { get; set; } - - /// - /// Gets or sets the statistics information for the allocated container - /// memory size. - /// - [JsonProperty(PropertyName = "allocatedContainerMemSize")] - public ResourceUsageStatistics AllocatedContainerMemSize { get; set; } - - /// - /// Gets or sets the statistics information for the used vertex CPU - /// core count. - /// - [JsonProperty(PropertyName = "usedVertexCpuCoreCount")] - public ResourceUsageStatistics UsedVertexCpuCoreCount { get; set; } - - /// - /// Gets or sets the statistics information for the used vertex peak - /// memory size. - /// - [JsonProperty(PropertyName = "usedVertexPeakMemSize")] - public ResourceUsageStatistics UsedVertexPeakMemSize { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobType.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobType.cs deleted file mode 100644 index 103d7cc945da..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobType.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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for JobType. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum JobType - { - [EnumMember(Value = "USql")] - USql, - [EnumMember(Value = "Hive")] - Hive, - [EnumMember(Value = "Scope")] - Scope - } - internal static class JobTypeEnumExtension - { - internal static string ToSerializedValue(this JobType? value) - { - return value == null ? null : ((JobType)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this JobType value) - { - switch( value ) - { - case JobType.USql: - return "USql"; - case JobType.Hive: - return "Hive"; - case JobType.Scope: - return "Scope"; - } - return null; - } - - internal static JobType? ParseJobType(this string value) - { - switch( value ) - { - case "USql": - return JobType.USql; - case "Hive": - return JobType.Hive; - case "Scope": - return JobType.Scope; - } - return null; - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobResult.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/NestedResourceProvisioningState.cs similarity index 50% rename from sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobResult.cs rename to sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/NestedResourceProvisioningState.cs index 7274c149bcd9..300c43b8a589 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/JobResult.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/NestedResourceProvisioningState.cs @@ -16,55 +16,49 @@ namespace Microsoft.Azure.Management.DataLake.Analytics.Models using System.Runtime.Serialization; /// - /// Defines values for JobResult. + /// Defines values for NestedResourceProvisioningState. /// [JsonConverter(typeof(StringEnumConverter))] - public enum JobResult + public enum NestedResourceProvisioningState { - [EnumMember(Value = "None")] - None, [EnumMember(Value = "Succeeded")] Succeeded, - [EnumMember(Value = "Cancelled")] - Cancelled, + [EnumMember(Value = "Canceled")] + Canceled, [EnumMember(Value = "Failed")] Failed } - internal static class JobResultEnumExtension + internal static class NestedResourceProvisioningStateEnumExtension { - internal static string ToSerializedValue(this JobResult? value) + internal static string ToSerializedValue(this NestedResourceProvisioningState? value) { - return value == null ? null : ((JobResult)value).ToSerializedValue(); + return value == null ? null : ((NestedResourceProvisioningState)value).ToSerializedValue(); } - internal static string ToSerializedValue(this JobResult value) + internal static string ToSerializedValue(this NestedResourceProvisioningState value) { switch( value ) { - case JobResult.None: - return "None"; - case JobResult.Succeeded: + case NestedResourceProvisioningState.Succeeded: return "Succeeded"; - case JobResult.Cancelled: - return "Cancelled"; - case JobResult.Failed: + case NestedResourceProvisioningState.Canceled: + return "Canceled"; + case NestedResourceProvisioningState.Failed: return "Failed"; } return null; } - internal static JobResult? ParseJobResult(this string value) + internal static NestedResourceProvisioningState? ParseNestedResourceProvisioningState(this string value) { switch( value ) { - case "None": - return JobResult.None; case "Succeeded": - return JobResult.Succeeded; - case "Cancelled": - return JobResult.Cancelled; + return NestedResourceProvisioningState.Succeeded; + case "Canceled": + return NestedResourceProvisioningState.Canceled; case "Failed": - return JobResult.Failed; + return NestedResourceProvisioningState.Failed; } return null; } diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/Operation.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/Operation.cs index ab1106fd5a71..8e09d6f0f3ee 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/Operation.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/Operation.cs @@ -32,12 +32,15 @@ public Operation() /// The name of the operation. /// The display information for the /// operation. + /// The OperationMetaPropertyInfo for the + /// operation. /// The intended executor of the operation. /// Possible values include: 'user', 'system', 'user,system' - public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay), string origin = default(string)) + public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay), OperationMetaPropertyInfo properties = default(OperationMetaPropertyInfo), string origin = default(string)) { Name = name; Display = display; + Properties = properties; Origin = origin; CustomInit(); } @@ -59,6 +62,12 @@ public Operation() [JsonProperty(PropertyName = "display")] public OperationDisplay Display { get; private set; } + /// + /// Gets the OperationMetaPropertyInfo for the operation. + /// + [JsonProperty(PropertyName = "properties")] + public OperationMetaPropertyInfo Properties { get; private set; } + /// /// Gets the intended executor of the operation. Possible values /// include: 'user', 'system', 'user,system' diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/OperationMetaLogSpecification.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/OperationMetaLogSpecification.cs new file mode 100644 index 000000000000..87bc6341af38 --- /dev/null +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/OperationMetaLogSpecification.cs @@ -0,0 +1,69 @@ +// +// 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.DataLake.Analytics.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class OperationMetaLogSpecification + { + /// + /// Initializes a new instance of the OperationMetaLogSpecification + /// class. + /// + public OperationMetaLogSpecification() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationMetaLogSpecification + /// class. + /// + /// The name for + /// OperationMetaLogSpecification. + /// The displayName for + /// OperationMetaLogSpecification. + /// The blobDuration for + /// OperationMetaLogSpecification. + public OperationMetaLogSpecification(string name = default(string), string displayName = default(string), string blobDuration = default(string)) + { + Name = name; + DisplayName = displayName; + BlobDuration = blobDuration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name for OperationMetaLogSpecification. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the displayName for OperationMetaLogSpecification. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets the blobDuration for OperationMetaLogSpecification. + /// + [JsonProperty(PropertyName = "blobDuration")] + public string BlobDuration { get; set; } + + } +} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/OperationMetaMetricAvailabilitiesSpecification.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/OperationMetaMetricAvailabilitiesSpecification.cs new file mode 100644 index 000000000000..af60e5df69fc --- /dev/null +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/OperationMetaMetricAvailabilitiesSpecification.cs @@ -0,0 +1,62 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataLake.Analytics.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class OperationMetaMetricAvailabilitiesSpecification + { + /// + /// Initializes a new instance of the + /// OperationMetaMetricAvailabilitiesSpecification class. + /// + public OperationMetaMetricAvailabilitiesSpecification() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// OperationMetaMetricAvailabilitiesSpecification class. + /// + /// The timegrain for + /// OperationMetaMetricAvailabilitiesSpecification. + /// The blobDuration for + /// OperationMetaMetricAvailabilitiesSpecification. + public OperationMetaMetricAvailabilitiesSpecification(string timeGrain = default(string), string blobDuration = default(string)) + { + TimeGrain = timeGrain; + BlobDuration = blobDuration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the timegrain for + /// OperationMetaMetricAvailabilitiesSpecification. + /// + [JsonProperty(PropertyName = "timeGrain")] + public string TimeGrain { get; set; } + + /// + /// Gets or sets the blobDuration for + /// OperationMetaMetricAvailabilitiesSpecification. + /// + [JsonProperty(PropertyName = "blobDuration")] + public string BlobDuration { get; set; } + + } +} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/OperationMetaMetricSpecification.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/OperationMetaMetricSpecification.cs new file mode 100644 index 000000000000..6d51dba9636e --- /dev/null +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/OperationMetaMetricSpecification.cs @@ -0,0 +1,100 @@ +// +// 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.DataLake.Analytics.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class OperationMetaMetricSpecification + { + /// + /// Initializes a new instance of the OperationMetaMetricSpecification + /// class. + /// + public OperationMetaMetricSpecification() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationMetaMetricSpecification + /// class. + /// + /// The name for + /// OperationMetaMetricSpecification. + /// The displayName for + /// OperationMetaMetricSpecification. + /// The displayName for + /// OperationMetaMetricSpecification. + /// The unit for + /// OperationMetaMetricSpecification. + /// The aggregationType for + /// OperationMetaMetricSpecification. + /// The availabilities for + /// OperationMetaMetricSpecification. + public OperationMetaMetricSpecification(string name = default(string), string displayDescription = default(string), string displayName = default(string), string unit = default(string), string aggregationType = default(string), IList availabilities = default(IList)) + { + Name = name; + DisplayDescription = displayDescription; + DisplayName = displayName; + Unit = unit; + AggregationType = aggregationType; + Availabilities = availabilities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name for OperationMetaMetricSpecification. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the displayName for OperationMetaMetricSpecification. + /// + [JsonProperty(PropertyName = "displayDescription")] + public string DisplayDescription { get; set; } + + /// + /// Gets or sets the displayName for OperationMetaMetricSpecification. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets the unit for OperationMetaMetricSpecification. + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; set; } + + /// + /// Gets or sets the aggregationType for + /// OperationMetaMetricSpecification. + /// + [JsonProperty(PropertyName = "aggregationType")] + public string AggregationType { get; set; } + + /// + /// Gets or sets the availabilities for + /// OperationMetaMetricSpecification. + /// + [JsonProperty(PropertyName = "availabilities")] + public IList Availabilities { get; set; } + + } +} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CatalogItemList.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/OperationMetaPropertyInfo.cs similarity index 52% rename from sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CatalogItemList.cs rename to sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/OperationMetaPropertyInfo.cs index 7e9a131d67c4..69ccd98e6f0c 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/CatalogItemList.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/OperationMetaPropertyInfo.cs @@ -13,27 +13,24 @@ namespace Microsoft.Azure.Management.DataLake.Analytics.Models using Newtonsoft.Json; using System.Linq; - /// - /// A Data Lake Analytics catalog item list. - /// - public partial class CatalogItemList + public partial class OperationMetaPropertyInfo { /// - /// Initializes a new instance of the CatalogItemList class. + /// Initializes a new instance of the OperationMetaPropertyInfo class. /// - public CatalogItemList() + public OperationMetaPropertyInfo() { CustomInit(); } /// - /// Initializes a new instance of the CatalogItemList class. + /// Initializes a new instance of the OperationMetaPropertyInfo class. /// - /// the link to the next page of - /// results. - public CatalogItemList(string nextLink = default(string)) + /// The operations + /// OperationMetaServiceSpecification. + public OperationMetaPropertyInfo(OperationMetaServiceSpecification serviceSpecification = default(OperationMetaServiceSpecification)) { - NextLink = nextLink; + ServiceSpecification = serviceSpecification; CustomInit(); } @@ -43,10 +40,10 @@ public CatalogItemList() partial void CustomInit(); /// - /// Gets or sets the link to the next page of results. + /// Gets or sets the operations OperationMetaServiceSpecification. /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; set; } + [JsonProperty(PropertyName = "serviceSpecification")] + public OperationMetaServiceSpecification ServiceSpecification { get; set; } } } diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/OperationMetaServiceSpecification.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/OperationMetaServiceSpecification.cs new file mode 100644 index 000000000000..5bd20287e12b --- /dev/null +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/OperationMetaServiceSpecification.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataLake.Analytics.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class OperationMetaServiceSpecification + { + /// + /// Initializes a new instance of the OperationMetaServiceSpecification + /// class. + /// + public OperationMetaServiceSpecification() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationMetaServiceSpecification + /// class. + /// + /// The metricSpecifications for + /// OperationMetaServiceSpecification. + /// The logSpecifications for + /// OperationMetaServiceSpecification. + public OperationMetaServiceSpecification(IList metricSpecifications = default(IList), IList logSpecifications = default(IList)) + { + MetricSpecifications = metricSpecifications; + LogSpecifications = logSpecifications; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the metricSpecifications for + /// OperationMetaServiceSpecification. + /// + [JsonProperty(PropertyName = "metricSpecifications")] + public IList MetricSpecifications { get; set; } + + /// + /// Gets or sets the logSpecifications for + /// OperationMetaServiceSpecification. + /// + [JsonProperty(PropertyName = "logSpecifications")] + public IList LogSpecifications { get; set; } + + } +} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/PermissionType.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/PermissionType.cs deleted file mode 100644 index 8e647cb7998d..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/PermissionType.cs +++ /dev/null @@ -1,27 +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.DataLake.Analytics.Models -{ - - /// - /// Defines values for PermissionType. - /// - public static class PermissionType - { - public const string None = "None"; - public const string Use = "Use"; - public const string Create = "Create"; - public const string Drop = "Drop"; - public const string Alter = "Alter"; - public const string Write = "Write"; - public const string All = "All"; - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/Resource.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/Resource.cs index 0ddbae16860e..b02fe6d38174 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/Resource.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/Resource.cs @@ -33,7 +33,7 @@ public Resource() /// /// Initializes a new instance of the Resource class. /// - /// The resource identifer. + /// The resource identifier. /// The resource name. /// The resource type. /// The resource location. @@ -54,7 +54,7 @@ public Resource() partial void CustomInit(); /// - /// Gets the resource identifer. + /// Gets the resource identifier. /// [JsonProperty(PropertyName = "id")] public string Id { get; private set; } diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ResourceUsageStatistics.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ResourceUsageStatistics.cs deleted file mode 100644 index 884c590db493..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ResourceUsageStatistics.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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The statistics information for resource usage. - /// - public partial class ResourceUsageStatistics - { - /// - /// Initializes a new instance of the ResourceUsageStatistics class. - /// - public ResourceUsageStatistics() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ResourceUsageStatistics class. - /// - /// The average value. - /// The minimum value. - /// The maximum value. - public ResourceUsageStatistics(double? average = default(double?), long? minimum = default(long?), long? maximum = default(long?)) - { - Average = average; - Minimum = minimum; - Maximum = maximum; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the average value. - /// - [JsonProperty(PropertyName = "average")] - public double? Average { get; private set; } - - /// - /// Gets the minimum value. - /// - [JsonProperty(PropertyName = "minimum")] - public long? Minimum { get; private set; } - - /// - /// Gets the maximum value. - /// - [JsonProperty(PropertyName = "maximum")] - public long? Maximum { get; private set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ScopeJobProperties.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ScopeJobProperties.cs deleted file mode 100644 index e88c93e1fb40..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ScopeJobProperties.cs +++ /dev/null @@ -1,160 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Scope job properties used when submitting and retrieving Scope jobs. - /// (Only for use internally with Scope job type.) - /// - [Newtonsoft.Json.JsonObject("Scope")] - public partial class ScopeJobProperties : JobProperties - { - /// - /// Initializes a new instance of the ScopeJobProperties class. - /// - public ScopeJobProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ScopeJobProperties class. - /// - /// The script to run. Please note that the - /// maximum script size is 3 MB. - /// The runtime version of the Data Lake - /// Analytics engine to use for the specific type of job being - /// run. - /// The list of resources that are required by - /// the job. - /// The algebra file path after the job - /// has completed. - /// The list of email addresses, separated by - /// semi-colons, to notify when the job reaches a terminal - /// state. - /// The total time this job spent - /// compiling. This value should not be set by the user and will be - /// ignored if it is. - /// The total time this job spent queued. - /// This value should not be set by the user and will be ignored if it - /// is. - /// The total time this job spent - /// executing. This value should not be set by the user and will be - /// ignored if it is. - /// The total time this job spent paused. - /// This value should not be set by the user and will be ignored if it - /// is. - /// The ID used to identify the job - /// manager coordinating job execution. This value should not be set by - /// the user and will be ignored if it is. - /// The ID used to identify the yarn - /// application executing the job. This value should not be set by the - /// user and will be ignored if it is. - public ScopeJobProperties(string script, string runtimeVersion = default(string), IList resources = default(IList), string userAlgebraPath = default(string), string notifier = default(string), System.TimeSpan? totalCompilationTime = default(System.TimeSpan?), System.TimeSpan? totalQueuedTime = default(System.TimeSpan?), System.TimeSpan? totalRunningTime = default(System.TimeSpan?), System.TimeSpan? totalPausedTime = default(System.TimeSpan?), string rootProcessNodeId = default(string), string yarnApplicationId = default(string)) - : base(script, runtimeVersion) - { - Resources = resources; - UserAlgebraPath = userAlgebraPath; - Notifier = notifier; - TotalCompilationTime = totalCompilationTime; - TotalQueuedTime = totalQueuedTime; - TotalRunningTime = totalRunningTime; - TotalPausedTime = totalPausedTime; - RootProcessNodeId = rootProcessNodeId; - YarnApplicationId = yarnApplicationId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the list of resources that are required by the job. - /// - [JsonProperty(PropertyName = "resources")] - public IList Resources { get; private set; } - - /// - /// Gets the algebra file path after the job has completed. - /// - [JsonProperty(PropertyName = "userAlgebraPath")] - public string UserAlgebraPath { get; private set; } - - /// - /// Gets or sets the list of email addresses, separated by semi-colons, - /// to notify when the job reaches a terminal state. - /// - [JsonProperty(PropertyName = "notifier")] - public string Notifier { get; set; } - - /// - /// Gets the total time this job spent compiling. This value should not - /// be set by the user and will be ignored if it is. - /// - [JsonProperty(PropertyName = "totalCompilationTime")] - public System.TimeSpan? TotalCompilationTime { get; private set; } - - /// - /// Gets the total time this job spent queued. This value should not be - /// set by the user and will be ignored if it is. - /// - [JsonProperty(PropertyName = "totalQueuedTime")] - public System.TimeSpan? TotalQueuedTime { get; private set; } - - /// - /// Gets the total time this job spent executing. This value should not - /// be set by the user and will be ignored if it is. - /// - [JsonProperty(PropertyName = "totalRunningTime")] - public System.TimeSpan? TotalRunningTime { get; private set; } - - /// - /// Gets the total time this job spent paused. This value should not be - /// set by the user and will be ignored if it is. - /// - [JsonProperty(PropertyName = "totalPausedTime")] - public System.TimeSpan? TotalPausedTime { get; private set; } - - /// - /// Gets the ID used to identify the job manager coordinating job - /// execution. This value should not be set by the user and will be - /// ignored if it is. - /// - [JsonProperty(PropertyName = "rootProcessNodeId")] - public string RootProcessNodeId { get; private set; } - - /// - /// Gets the ID used to identify the yarn application executing the - /// job. This value should not be set by the user and will be ignored - /// if it is. - /// - [JsonProperty(PropertyName = "yarnApplicationId")] - public string YarnApplicationId { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ScopeJobResource.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ScopeJobResource.cs deleted file mode 100644 index 4495f7e7488a..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/ScopeJobResource.cs +++ /dev/null @@ -1,59 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The Scope job resources. (Only for use internally with Scope job type.) - /// - public partial class ScopeJobResource - { - /// - /// Initializes a new instance of the ScopeJobResource class. - /// - public ScopeJobResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ScopeJobResource class. - /// - /// The name of the resource. - /// The path to the resource. - public ScopeJobResource(string name = default(string), string path = default(string)) - { - Name = name; - Path = path; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the resource. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the path to the resource. - /// - [JsonProperty(PropertyName = "path")] - public string Path { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/SeverityTypes.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/SeverityTypes.cs deleted file mode 100644 index 07f0f5621e65..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/SeverityTypes.cs +++ /dev/null @@ -1,84 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; - - /// - /// Defines values for SeverityTypes. - /// - [JsonConverter(typeof(StringEnumConverter))] - public enum SeverityTypes - { - [EnumMember(Value = "Warning")] - Warning, - [EnumMember(Value = "Error")] - Error, - [EnumMember(Value = "Info")] - Info, - [EnumMember(Value = "SevereWarning")] - SevereWarning, - [EnumMember(Value = "Deprecated")] - Deprecated, - [EnumMember(Value = "UserWarning")] - UserWarning - } - internal static class SeverityTypesEnumExtension - { - internal static string ToSerializedValue(this SeverityTypes? value) - { - return value == null ? null : ((SeverityTypes)value).ToSerializedValue(); - } - - internal static string ToSerializedValue(this SeverityTypes value) - { - switch( value ) - { - case SeverityTypes.Warning: - return "Warning"; - case SeverityTypes.Error: - return "Error"; - case SeverityTypes.Info: - return "Info"; - case SeverityTypes.SevereWarning: - return "SevereWarning"; - case SeverityTypes.Deprecated: - return "Deprecated"; - case SeverityTypes.UserWarning: - return "UserWarning"; - } - return null; - } - - internal static SeverityTypes? ParseSeverityTypes(this string value) - { - switch( value ) - { - case "Warning": - return SeverityTypes.Warning; - case "Error": - return SeverityTypes.Error; - case "Info": - return SeverityTypes.Info; - case "SevereWarning": - return SeverityTypes.SevereWarning; - case "Deprecated": - return SeverityTypes.Deprecated; - case "UserWarning": - return SeverityTypes.UserWarning; - } - return null; - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlAssembly.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlAssembly.cs deleted file mode 100644 index 009850b89617..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlAssembly.cs +++ /dev/null @@ -1,111 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL Assembly. - /// - public partial class USqlAssembly : CatalogItem - { - /// - /// Initializes a new instance of the USqlAssembly class. - /// - public USqlAssembly() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlAssembly class. - /// - /// the name of the Data Lake - /// Analytics account. - /// the version of the catalog item. - /// the name of the database. - /// the name of the assembly. - /// the name of the CLR. - /// the switch indicating if this assembly is - /// visible or not. - /// the switch indicating if this assembly - /// is user defined or not. - /// the list of files associated with the - /// assembly - /// the list of dependencies associated with - /// the assembly - public USqlAssembly(string computeAccountName = default(string), System.Guid? version = default(System.Guid?), string databaseName = default(string), string name = default(string), string clrName = default(string), bool? isVisible = default(bool?), bool? isUserDefined = default(bool?), IList files = default(IList), IList dependencies = default(IList)) - : base(computeAccountName, version) - { - DatabaseName = databaseName; - Name = name; - ClrName = clrName; - IsVisible = isVisible; - IsUserDefined = isUserDefined; - Files = files; - Dependencies = dependencies; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the database. - /// - [JsonProperty(PropertyName = "databaseName")] - public string DatabaseName { get; set; } - - /// - /// Gets or sets the name of the assembly. - /// - [JsonProperty(PropertyName = "assemblyName")] - public string Name { get; set; } - - /// - /// Gets or sets the name of the CLR. - /// - [JsonProperty(PropertyName = "clrName")] - public string ClrName { get; set; } - - /// - /// Gets or sets the switch indicating if this assembly is visible or - /// not. - /// - [JsonProperty(PropertyName = "isVisible")] - public bool? IsVisible { get; set; } - - /// - /// Gets or sets the switch indicating if this assembly is user defined - /// or not. - /// - [JsonProperty(PropertyName = "isUserDefined")] - public bool? IsUserDefined { get; set; } - - /// - /// Gets or sets the list of files associated with the assembly - /// - [JsonProperty(PropertyName = "files")] - public IList Files { get; set; } - - /// - /// Gets or sets the list of dependencies associated with the assembly - /// - [JsonProperty(PropertyName = "dependencies")] - public IList Dependencies { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlAssemblyClr.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlAssemblyClr.cs deleted file mode 100644 index 9f2f6aa2f8cd..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlAssemblyClr.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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL assembly CLR item. - /// - public partial class USqlAssemblyClr : CatalogItem - { - /// - /// Initializes a new instance of the USqlAssemblyClr class. - /// - public USqlAssemblyClr() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlAssemblyClr class. - /// - /// the name of the Data Lake - /// Analytics account. - /// the version of the catalog item. - /// the name of the database. - /// the name of the assembly. - /// the name of the CLR. - public USqlAssemblyClr(string computeAccountName = default(string), System.Guid? version = default(System.Guid?), string databaseName = default(string), string name = default(string), string clrName = default(string)) - : base(computeAccountName, version) - { - DatabaseName = databaseName; - Name = name; - ClrName = clrName; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the database. - /// - [JsonProperty(PropertyName = "databaseName")] - public string DatabaseName { get; set; } - - /// - /// Gets or sets the name of the assembly. - /// - [JsonProperty(PropertyName = "assemblyClrName")] - public string Name { get; set; } - - /// - /// Gets or sets the name of the CLR. - /// - [JsonProperty(PropertyName = "clrName")] - public string ClrName { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlAssemblyFileInfo.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlAssemblyFileInfo.cs deleted file mode 100644 index b3005843cdc9..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlAssemblyFileInfo.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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL assembly file information item. - /// - public partial class USqlAssemblyFileInfo - { - /// - /// Initializes a new instance of the USqlAssemblyFileInfo class. - /// - public USqlAssemblyFileInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlAssemblyFileInfo class. - /// - /// the assembly file type. Possible values include: - /// 'Assembly', 'Resource', 'Nodeploy' - /// the the original path to the assembly - /// file. - /// the the content path to the assembly - /// file. - public USqlAssemblyFileInfo(string type = default(string), string originalPath = default(string), string contentPath = default(string)) - { - Type = type; - OriginalPath = originalPath; - ContentPath = contentPath; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the assembly file type. Possible values include: - /// 'Assembly', 'Resource', 'Nodeploy' - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - /// - /// Gets or sets the the original path to the assembly file. - /// - [JsonProperty(PropertyName = "originalPath")] - public string OriginalPath { get; set; } - - /// - /// Gets or sets the the content path to the assembly file. - /// - [JsonProperty(PropertyName = "contentPath")] - public string ContentPath { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlCredential.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlCredential.cs deleted file mode 100644 index 0b88dc0e7424..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlCredential.cs +++ /dev/null @@ -1,55 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL credential item. - /// - public partial class USqlCredential : CatalogItem - { - /// - /// Initializes a new instance of the USqlCredential class. - /// - public USqlCredential() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlCredential class. - /// - /// the name of the Data Lake - /// Analytics account. - /// the version of the catalog item. - /// the name of the credential. - public USqlCredential(string computeAccountName = default(string), System.Guid? version = default(System.Guid?), string name = default(string)) - : base(computeAccountName, version) - { - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the credential. - /// - [JsonProperty(PropertyName = "credentialName")] - public string Name { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlDatabase.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlDatabase.cs deleted file mode 100644 index f25d730443ed..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlDatabase.cs +++ /dev/null @@ -1,55 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL database item. - /// - public partial class USqlDatabase : CatalogItem - { - /// - /// Initializes a new instance of the USqlDatabase class. - /// - public USqlDatabase() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlDatabase class. - /// - /// the name of the Data Lake - /// Analytics account. - /// the version of the catalog item. - /// the name of the database. - public USqlDatabase(string computeAccountName = default(string), System.Guid? version = default(System.Guid?), string name = default(string)) - : base(computeAccountName, version) - { - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the database. - /// - [JsonProperty(PropertyName = "databaseName")] - public string Name { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlDirectedColumn.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlDirectedColumn.cs deleted file mode 100644 index b472b3701ec9..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlDirectedColumn.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL directed column item. - /// - public partial class USqlDirectedColumn - { - /// - /// Initializes a new instance of the USqlDirectedColumn class. - /// - public USqlDirectedColumn() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlDirectedColumn class. - /// - /// the name of the index in the table. - /// the switch indicating if the index is - /// descending or not. - public USqlDirectedColumn(string name = default(string), bool? descending = default(bool?)) - { - Name = name; - Descending = descending; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the index in the table. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the switch indicating if the index is descending or - /// not. - /// - [JsonProperty(PropertyName = "descending")] - public bool? Descending { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlDistributionInfo.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlDistributionInfo.cs deleted file mode 100644 index 978c316b1cec..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlDistributionInfo.cs +++ /dev/null @@ -1,80 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL distribution information object. - /// - public partial class USqlDistributionInfo - { - /// - /// Initializes a new instance of the USqlDistributionInfo class. - /// - public USqlDistributionInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlDistributionInfo class. - /// - /// the type of this distribution. - /// the list of directed columns in the - /// distribution - /// the count of indices using this - /// distribution. - /// the dynamic count of indices using this - /// distribution. - public USqlDistributionInfo(int? type = default(int?), IList keys = default(IList), int? count = default(int?), int? dynamicCount = default(int?)) - { - Type = type; - Keys = keys; - Count = count; - DynamicCount = dynamicCount; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the type of this distribution. - /// - [JsonProperty(PropertyName = "type")] - public int? Type { get; set; } - - /// - /// Gets or sets the list of directed columns in the distribution - /// - [JsonProperty(PropertyName = "keys")] - public IList Keys { get; set; } - - /// - /// Gets or sets the count of indices using this distribution. - /// - [JsonProperty(PropertyName = "count")] - public int? Count { get; set; } - - /// - /// Gets or sets the dynamic count of indices using this distribution. - /// - [JsonProperty(PropertyName = "dynamicCount")] - public int? DynamicCount { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlExternalDataSource.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlExternalDataSource.cs deleted file mode 100644 index 181879a2ca29..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlExternalDataSource.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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL external datasource item. - /// - public partial class USqlExternalDataSource : CatalogItem - { - /// - /// Initializes a new instance of the USqlExternalDataSource class. - /// - public USqlExternalDataSource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlExternalDataSource class. - /// - /// the name of the Data Lake - /// Analytics account. - /// the version of the catalog item. - /// the name of the database. - /// the name of the external data source. - /// the name of the provider for the external - /// data source. - /// the name of the provider string for - /// the external data source. - /// the list of types to push down from the - /// external data source. - public USqlExternalDataSource(string computeAccountName = default(string), System.Guid? version = default(System.Guid?), string databaseName = default(string), string name = default(string), string provider = default(string), string providerString = default(string), IList pushdownTypes = default(IList)) - : base(computeAccountName, version) - { - DatabaseName = databaseName; - Name = name; - Provider = provider; - ProviderString = providerString; - PushdownTypes = pushdownTypes; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the database. - /// - [JsonProperty(PropertyName = "databaseName")] - public string DatabaseName { get; set; } - - /// - /// Gets or sets the name of the external data source. - /// - [JsonProperty(PropertyName = "externalDataSourceName")] - public string Name { get; set; } - - /// - /// Gets or sets the name of the provider for the external data source. - /// - [JsonProperty(PropertyName = "provider")] - public string Provider { get; set; } - - /// - /// Gets or sets the name of the provider string for the external data - /// source. - /// - [JsonProperty(PropertyName = "providerString")] - public string ProviderString { get; set; } - - /// - /// Gets or sets the list of types to push down from the external data - /// source. - /// - [JsonProperty(PropertyName = "pushdownTypes")] - public IList PushdownTypes { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlIndex.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlIndex.cs deleted file mode 100644 index 631cd4a02822..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlIndex.cs +++ /dev/null @@ -1,135 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL table index item. - /// - public partial class USqlIndex - { - /// - /// Initializes a new instance of the USqlIndex class. - /// - public USqlIndex() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlIndex class. - /// - /// the name of the index in the table. - /// the list of directed columns in the - /// index - /// the list of columns in the index - /// the distributions info of the - /// index - /// partition function ID for the - /// index. - /// the list of partition keys in the - /// index - /// the list of full paths to the streams - /// that contain this index in the DataLake account. - /// the switch indicating if this index is - /// a columnstore index. - /// the ID of this index within the - /// table. - /// the switch indicating if this index is a - /// unique index. - public USqlIndex(string name = default(string), IList indexKeys = default(IList), IList columns = default(IList), USqlDistributionInfo distributionInfo = default(USqlDistributionInfo), System.Guid? partitionFunction = default(System.Guid?), IList partitionKeyList = default(IList), IList streamNames = default(IList), bool? isColumnstore = default(bool?), int? indexId = default(int?), bool? isUnique = default(bool?)) - { - Name = name; - IndexKeys = indexKeys; - Columns = columns; - DistributionInfo = distributionInfo; - PartitionFunction = partitionFunction; - PartitionKeyList = partitionKeyList; - StreamNames = streamNames; - IsColumnstore = isColumnstore; - IndexId = indexId; - IsUnique = isUnique; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the index in the table. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the list of directed columns in the index - /// - [JsonProperty(PropertyName = "indexKeys")] - public IList IndexKeys { get; set; } - - /// - /// Gets or sets the list of columns in the index - /// - [JsonProperty(PropertyName = "columns")] - public IList Columns { get; set; } - - /// - /// Gets or sets the distributions info of the index - /// - [JsonProperty(PropertyName = "distributionInfo")] - public USqlDistributionInfo DistributionInfo { get; set; } - - /// - /// Gets or sets partition function ID for the index. - /// - [JsonProperty(PropertyName = "partitionFunction")] - public System.Guid? PartitionFunction { get; set; } - - /// - /// Gets or sets the list of partition keys in the index - /// - [JsonProperty(PropertyName = "partitionKeyList")] - public IList PartitionKeyList { get; set; } - - /// - /// Gets or sets the list of full paths to the streams that contain - /// this index in the DataLake account. - /// - [JsonProperty(PropertyName = "streamNames")] - public IList StreamNames { get; set; } - - /// - /// Gets or sets the switch indicating if this index is a columnstore - /// index. - /// - [JsonProperty(PropertyName = "isColumnstore")] - public bool? IsColumnstore { get; set; } - - /// - /// Gets or sets the ID of this index within the table. - /// - [JsonProperty(PropertyName = "indexId")] - public int? IndexId { get; set; } - - /// - /// Gets or sets the switch indicating if this index is a unique index. - /// - [JsonProperty(PropertyName = "isUnique")] - public bool? IsUnique { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlJobProperties.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlJobProperties.cs deleted file mode 100644 index 47dbb3f6ed05..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlJobProperties.cs +++ /dev/null @@ -1,199 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// U-SQL job properties used when retrieving U-SQL jobs. - /// - [Newtonsoft.Json.JsonObject("USql")] - public partial class USqlJobProperties : JobProperties - { - /// - /// Initializes a new instance of the USqlJobProperties class. - /// - public USqlJobProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlJobProperties class. - /// - /// The script to run. Please note that the - /// maximum script size is 3 MB. - /// The runtime version of the Data Lake - /// Analytics engine to use for the specific type of job being - /// run. - /// The list of resources that are required by - /// the job. - /// The job specific statistics. - /// The job specific debug data - /// locations. - /// The diagnostics for the job. - /// The algebra file path after the job - /// has completed. - /// The total time this job spent - /// compiling. This value should not be set by the user and will be - /// ignored if it is. - /// The total time this job spent queued. - /// This value should not be set by the user and will be ignored if it - /// is. - /// The total time this job spent - /// executing. This value should not be set by the user and will be - /// ignored if it is. - /// The total time this job spent paused. - /// This value should not be set by the user and will be ignored if it - /// is. - /// The ID used to identify the job - /// manager coordinating job execution. This value should not be set by - /// the user and will be ignored if it is. - /// The ID used to identify the yarn - /// application executing the job. This value should not be set by the - /// user and will be ignored if it is. - /// The timestamp (in ticks) for - /// the yarn application executing the job. This value should not be - /// set by the user and will be ignored if it is. - /// The specific compilation mode for the job - /// used during execution. If this is not specified during submission, - /// the server will determine the optimal compilation mode. Possible - /// values include: 'Semantic', 'Full', 'SingleBox' - public USqlJobProperties(string script, string runtimeVersion = default(string), IList resources = default(IList), JobStatistics statistics = default(JobStatistics), JobDataPath debugData = default(JobDataPath), IList diagnostics = default(IList), string algebraFilePath = default(string), System.TimeSpan? totalCompilationTime = default(System.TimeSpan?), System.TimeSpan? totalQueuedTime = default(System.TimeSpan?), System.TimeSpan? totalRunningTime = default(System.TimeSpan?), System.TimeSpan? totalPausedTime = default(System.TimeSpan?), string rootProcessNodeId = default(string), string yarnApplicationId = default(string), long? yarnApplicationTimeStamp = default(long?), CompileMode? compileMode = default(CompileMode?)) - : base(script, runtimeVersion) - { - Resources = resources; - Statistics = statistics; - DebugData = debugData; - Diagnostics = diagnostics; - AlgebraFilePath = algebraFilePath; - TotalCompilationTime = totalCompilationTime; - TotalQueuedTime = totalQueuedTime; - TotalRunningTime = totalRunningTime; - TotalPausedTime = totalPausedTime; - RootProcessNodeId = rootProcessNodeId; - YarnApplicationId = yarnApplicationId; - YarnApplicationTimeStamp = yarnApplicationTimeStamp; - CompileMode = compileMode; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the list of resources that are required by the job. - /// - [JsonProperty(PropertyName = "resources")] - public IList Resources { get; private set; } - - /// - /// Gets or sets the job specific statistics. - /// - [JsonProperty(PropertyName = "statistics")] - public JobStatistics Statistics { get; set; } - - /// - /// Gets or sets the job specific debug data locations. - /// - [JsonProperty(PropertyName = "debugData")] - public JobDataPath DebugData { get; set; } - - /// - /// Gets the diagnostics for the job. - /// - [JsonProperty(PropertyName = "diagnostics")] - public IList Diagnostics { get; private set; } - - /// - /// Gets the algebra file path after the job has completed. - /// - [JsonProperty(PropertyName = "algebraFilePath")] - public string AlgebraFilePath { get; private set; } - - /// - /// Gets the total time this job spent compiling. This value should not - /// be set by the user and will be ignored if it is. - /// - [JsonProperty(PropertyName = "totalCompilationTime")] - public System.TimeSpan? TotalCompilationTime { get; private set; } - - /// - /// Gets the total time this job spent queued. This value should not be - /// set by the user and will be ignored if it is. - /// - [JsonProperty(PropertyName = "totalQueuedTime")] - public System.TimeSpan? TotalQueuedTime { get; private set; } - - /// - /// Gets the total time this job spent executing. This value should not - /// be set by the user and will be ignored if it is. - /// - [JsonProperty(PropertyName = "totalRunningTime")] - public System.TimeSpan? TotalRunningTime { get; private set; } - - /// - /// Gets the total time this job spent paused. This value should not be - /// set by the user and will be ignored if it is. - /// - [JsonProperty(PropertyName = "totalPausedTime")] - public System.TimeSpan? TotalPausedTime { get; private set; } - - /// - /// Gets the ID used to identify the job manager coordinating job - /// execution. This value should not be set by the user and will be - /// ignored if it is. - /// - [JsonProperty(PropertyName = "rootProcessNodeId")] - public string RootProcessNodeId { get; private set; } - - /// - /// Gets the ID used to identify the yarn application executing the - /// job. This value should not be set by the user and will be ignored - /// if it is. - /// - [JsonProperty(PropertyName = "yarnApplicationId")] - public string YarnApplicationId { get; private set; } - - /// - /// Gets the timestamp (in ticks) for the yarn application executing - /// the job. This value should not be set by the user and will be - /// ignored if it is. - /// - [JsonProperty(PropertyName = "yarnApplicationTimeStamp")] - public long? YarnApplicationTimeStamp { get; private set; } - - /// - /// Gets the specific compilation mode for the job used during - /// execution. If this is not specified during submission, the server - /// will determine the optimal compilation mode. Possible values - /// include: 'Semantic', 'Full', 'SingleBox' - /// - [JsonProperty(PropertyName = "compileMode")] - public CompileMode? CompileMode { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public override void Validate() - { - base.Validate(); - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlPackage.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlPackage.cs deleted file mode 100644 index 6634f2ecd3d6..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlPackage.cs +++ /dev/null @@ -1,82 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL package item. - /// - public partial class USqlPackage : CatalogItem - { - /// - /// Initializes a new instance of the USqlPackage class. - /// - public USqlPackage() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlPackage class. - /// - /// the name of the Data Lake - /// Analytics account. - /// the version of the catalog item. - /// the name of the database containing the - /// package. - /// the name of the schema associated with - /// this package and database. - /// the name of the package. - /// the definition of the package. - public USqlPackage(string computeAccountName = default(string), System.Guid? version = default(System.Guid?), string databaseName = default(string), string schemaName = default(string), string name = default(string), string definition = default(string)) - : base(computeAccountName, version) - { - DatabaseName = databaseName; - SchemaName = schemaName; - Name = name; - Definition = definition; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the database containing the package. - /// - [JsonProperty(PropertyName = "databaseName")] - public string DatabaseName { get; set; } - - /// - /// Gets or sets the name of the schema associated with this package - /// and database. - /// - [JsonProperty(PropertyName = "schemaName")] - public string SchemaName { get; set; } - - /// - /// Gets or sets the name of the package. - /// - [JsonProperty(PropertyName = "packageName")] - public string Name { get; set; } - - /// - /// Gets or sets the definition of the package. - /// - [JsonProperty(PropertyName = "definition")] - public string Definition { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlProcedure.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlProcedure.cs deleted file mode 100644 index d9403f39f4e6..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlProcedure.cs +++ /dev/null @@ -1,82 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL procedure item. - /// - public partial class USqlProcedure : CatalogItem - { - /// - /// Initializes a new instance of the USqlProcedure class. - /// - public USqlProcedure() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlProcedure class. - /// - /// the name of the Data Lake - /// Analytics account. - /// the version of the catalog item. - /// the name of the database. - /// the name of the schema associated with - /// this procedure and database. - /// the name of the procedure. - /// the defined query of the - /// procedure. - public USqlProcedure(string computeAccountName = default(string), System.Guid? version = default(System.Guid?), string databaseName = default(string), string schemaName = default(string), string name = default(string), string definition = default(string)) - : base(computeAccountName, version) - { - DatabaseName = databaseName; - SchemaName = schemaName; - Name = name; - Definition = definition; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the database. - /// - [JsonProperty(PropertyName = "databaseName")] - public string DatabaseName { get; set; } - - /// - /// Gets or sets the name of the schema associated with this procedure - /// and database. - /// - [JsonProperty(PropertyName = "schemaName")] - public string SchemaName { get; set; } - - /// - /// Gets or sets the name of the procedure. - /// - [JsonProperty(PropertyName = "procName")] - public string Name { get; set; } - - /// - /// Gets or sets the defined query of the procedure. - /// - [JsonProperty(PropertyName = "definition")] - public string Definition { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlSchema.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlSchema.cs deleted file mode 100644 index bd93c8ebc5fe..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlSchema.cs +++ /dev/null @@ -1,63 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL schema item. - /// - public partial class USqlSchema : CatalogItem - { - /// - /// Initializes a new instance of the USqlSchema class. - /// - public USqlSchema() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlSchema class. - /// - /// the name of the Data Lake - /// Analytics account. - /// the version of the catalog item. - /// the name of the database. - /// the name of the schema. - public USqlSchema(string computeAccountName = default(string), System.Guid? version = default(System.Guid?), string databaseName = default(string), string name = default(string)) - : base(computeAccountName, version) - { - DatabaseName = databaseName; - Name = name; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the database. - /// - [JsonProperty(PropertyName = "databaseName")] - public string DatabaseName { get; set; } - - /// - /// Gets or sets the name of the schema. - /// - [JsonProperty(PropertyName = "schemaName")] - public string Name { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlSecret.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlSecret.cs deleted file mode 100644 index e4bb7ec5ad36..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlSecret.cs +++ /dev/null @@ -1,93 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL secret item. - /// - public partial class USqlSecret : CatalogItem - { - /// - /// Initializes a new instance of the USqlSecret class. - /// - public USqlSecret() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlSecret class. - /// - /// the name of the Data Lake - /// Analytics account. - /// the version of the catalog item. - /// the name of the database. - /// the name of the secret. - /// the creation time of the credential - /// object. This is the only information returned about a secret from a - /// GET. - /// the URI identifier for the secret in the format - /// <hostname>:<port> - /// the password for the secret to pass - /// in - public USqlSecret(string computeAccountName = default(string), System.Guid? version = default(System.Guid?), string databaseName = default(string), string name = default(string), System.DateTimeOffset? creationTime = default(System.DateTimeOffset?), string uri = default(string), string password = default(string)) - : base(computeAccountName, version) - { - DatabaseName = databaseName; - Name = name; - CreationTime = creationTime; - Uri = uri; - Password = password; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the database. - /// - [JsonProperty(PropertyName = "databaseName")] - public string DatabaseName { get; set; } - - /// - /// Gets or sets the name of the secret. - /// - [JsonProperty(PropertyName = "secretName")] - public string Name { get; set; } - - /// - /// Gets or sets the creation time of the credential object. This is - /// the only information returned about a secret from a GET. - /// - [JsonProperty(PropertyName = "creationTime")] - public System.DateTimeOffset? CreationTime { get; set; } - - /// - /// Gets or sets the URI identifier for the secret in the format - /// &lt;hostname&gt;:&lt;port&gt; - /// - [JsonProperty(PropertyName = "uri")] - public string Uri { get; set; } - - /// - /// Gets or sets the password for the secret to pass in - /// - [JsonProperty(PropertyName = "password")] - public string Password { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTable.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTable.cs deleted file mode 100644 index 94d9440754a9..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTable.cs +++ /dev/null @@ -1,118 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL table item. - /// - public partial class USqlTable : CatalogItem - { - /// - /// Initializes a new instance of the USqlTable class. - /// - public USqlTable() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlTable class. - /// - /// the name of the Data Lake - /// Analytics account. - /// the version of the catalog item. - /// the name of the database. - /// the name of the schema associated with - /// this table and database. - /// the name of the table. - /// the list of columns in this table - /// the list of indices in this table - /// the list of partition keys in the - /// table - /// the external table associated with the - /// table. - /// the distributions info of the - /// table - public USqlTable(string computeAccountName = default(string), System.Guid? version = default(System.Guid?), string databaseName = default(string), string schemaName = default(string), string name = default(string), IList columnList = default(IList), IList indexList = default(IList), IList partitionKeyList = default(IList), ExternalTable externalTable = default(ExternalTable), USqlDistributionInfo distributionInfo = default(USqlDistributionInfo)) - : base(computeAccountName, version) - { - DatabaseName = databaseName; - SchemaName = schemaName; - Name = name; - ColumnList = columnList; - IndexList = indexList; - PartitionKeyList = partitionKeyList; - ExternalTable = externalTable; - DistributionInfo = distributionInfo; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the database. - /// - [JsonProperty(PropertyName = "databaseName")] - public string DatabaseName { get; set; } - - /// - /// Gets or sets the name of the schema associated with this table and - /// database. - /// - [JsonProperty(PropertyName = "schemaName")] - public string SchemaName { get; set; } - - /// - /// Gets or sets the name of the table. - /// - [JsonProperty(PropertyName = "tableName")] - public string Name { get; set; } - - /// - /// Gets or sets the list of columns in this table - /// - [JsonProperty(PropertyName = "columnList")] - public IList ColumnList { get; set; } - - /// - /// Gets or sets the list of indices in this table - /// - [JsonProperty(PropertyName = "indexList")] - public IList IndexList { get; set; } - - /// - /// Gets or sets the list of partition keys in the table - /// - [JsonProperty(PropertyName = "partitionKeyList")] - public IList PartitionKeyList { get; set; } - - /// - /// Gets or sets the external table associated with the table. - /// - [JsonProperty(PropertyName = "externalTable")] - public ExternalTable ExternalTable { get; set; } - - /// - /// Gets or sets the distributions info of the table - /// - [JsonProperty(PropertyName = "distributionInfo")] - public USqlDistributionInfo DistributionInfo { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTableColumn.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTableColumn.cs deleted file mode 100644 index ec2a350dec56..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTableColumn.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL table column item. - /// - public partial class USqlTableColumn - { - /// - /// Initializes a new instance of the USqlTableColumn class. - /// - public USqlTableColumn() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlTableColumn class. - /// - /// the name of the column in the table. - /// the object type of the specified column (such as - /// System.String). - public USqlTableColumn(string name = default(string), string type = default(string)) - { - Name = name; - Type = type; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the column in the table. - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } - - /// - /// Gets or sets the object type of the specified column (such as - /// System.String). - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTableFragment.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTableFragment.cs deleted file mode 100644 index 117a01b8215a..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTableFragment.cs +++ /dev/null @@ -1,107 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL table fragment item. - /// - public partial class USqlTableFragment - { - /// - /// Initializes a new instance of the USqlTableFragment class. - /// - public USqlTableFragment() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlTableFragment class. - /// - /// the parent object Id of the table fragment. - /// The parent could be a table or table partition. - /// the version of the catalog item. - /// the ordinal of the index which contains the - /// table fragment. - /// the data size of the table fragment in - /// bytes. - /// the number of rows in the table - /// fragment. - /// the creation time of the table - /// fragment. - /// the relative path for the table fragment - /// location. - public USqlTableFragment(System.Guid? parentId = default(System.Guid?), System.Guid? fragmentId = default(System.Guid?), int? indexId = default(int?), long? size = default(long?), long? rowCount = default(long?), System.DateTimeOffset? createDate = default(System.DateTimeOffset?), string streamPath = default(string)) - { - ParentId = parentId; - FragmentId = fragmentId; - IndexId = indexId; - Size = size; - RowCount = rowCount; - CreateDate = createDate; - StreamPath = streamPath; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the parent object Id of the table fragment. The parent - /// could be a table or table partition. - /// - [JsonProperty(PropertyName = "parentId")] - public System.Guid? ParentId { get; set; } - - /// - /// Gets or sets the version of the catalog item. - /// - [JsonProperty(PropertyName = "fragmentId")] - public System.Guid? FragmentId { get; set; } - - /// - /// Gets or sets the ordinal of the index which contains the table - /// fragment. - /// - [JsonProperty(PropertyName = "indexId")] - public int? IndexId { get; set; } - - /// - /// Gets or sets the data size of the table fragment in bytes. - /// - [JsonProperty(PropertyName = "size")] - public long? Size { get; set; } - - /// - /// Gets or sets the number of rows in the table fragment. - /// - [JsonProperty(PropertyName = "rowCount")] - public long? RowCount { get; set; } - - /// - /// Gets or sets the creation time of the table fragment. - /// - [JsonProperty(PropertyName = "createDate")] - public System.DateTimeOffset? CreateDate { get; set; } - - /// - /// Gets or sets the relative path for the table fragment location. - /// - [JsonProperty(PropertyName = "streamPath")] - public string StreamPath { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTablePartition.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTablePartition.cs deleted file mode 100644 index 4a81a14a6472..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTablePartition.cs +++ /dev/null @@ -1,109 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL table partition item. - /// - public partial class USqlTablePartition : CatalogItem - { - /// - /// Initializes a new instance of the USqlTablePartition class. - /// - public USqlTablePartition() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlTablePartition class. - /// - /// the name of the Data Lake - /// Analytics account. - /// the version of the catalog item. - /// the name of the database. - /// the name of the schema associated with - /// this table partition and database. - /// the name of the table partition. - /// the Ddl object of the partition's - /// parent. - /// the index ID for this partition. - /// the list of labels associated with this - /// partition. - /// the creation time of the partition - public USqlTablePartition(string computeAccountName = default(string), System.Guid? version = default(System.Guid?), string databaseName = default(string), string schemaName = default(string), string name = default(string), DdlName parentName = default(DdlName), int? indexId = default(int?), IList label = default(IList), System.DateTimeOffset? createDate = default(System.DateTimeOffset?)) - : base(computeAccountName, version) - { - DatabaseName = databaseName; - SchemaName = schemaName; - Name = name; - ParentName = parentName; - IndexId = indexId; - Label = label; - CreateDate = createDate; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the database. - /// - [JsonProperty(PropertyName = "databaseName")] - public string DatabaseName { get; set; } - - /// - /// Gets or sets the name of the schema associated with this table - /// partition and database. - /// - [JsonProperty(PropertyName = "schemaName")] - public string SchemaName { get; set; } - - /// - /// Gets or sets the name of the table partition. - /// - [JsonProperty(PropertyName = "partitionName")] - public string Name { get; set; } - - /// - /// Gets or sets the Ddl object of the partition's parent. - /// - [JsonProperty(PropertyName = "parentName")] - public DdlName ParentName { get; set; } - - /// - /// Gets or sets the index ID for this partition. - /// - [JsonProperty(PropertyName = "indexId")] - public int? IndexId { get; set; } - - /// - /// Gets or sets the list of labels associated with this partition. - /// - [JsonProperty(PropertyName = "label")] - public IList Label { get; set; } - - /// - /// Gets or sets the creation time of the partition - /// - [JsonProperty(PropertyName = "createDate")] - public System.DateTimeOffset? CreateDate { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTablePreview.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTablePreview.cs deleted file mode 100644 index 399a5e11d7c8..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTablePreview.cs +++ /dev/null @@ -1,101 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A Data Lake Analytics catalog table or partition preview rows item. - /// - public partial class USqlTablePreview - { - /// - /// Initializes a new instance of the USqlTablePreview class. - /// - public USqlTablePreview() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlTablePreview class. - /// - /// the total number of rows in the table - /// or partition. - /// the total number of columns in the - /// table or partition. - /// the rows of the table or partition preview, - /// where each row is an array of string representations the row's - /// values. Note: Byte arrays will appear as base-64 encoded values, - /// SqlMap and SqlArray objects will appear as escaped JSON objects, - /// and DateTime objects will appear as ISO formatted UTC - /// date-times. - /// true if the amount of data in the response - /// is less than expected due to the preview operation's size - /// limitations. This can occur if the requested rows or row counts are - /// too large. - /// the schema of the table or partition. - public USqlTablePreview(long? totalRowCount = default(long?), long? totalColumnCount = default(long?), IList> rows = default(IList>), bool? truncated = default(bool?), IList schema = default(IList)) - { - TotalRowCount = totalRowCount; - TotalColumnCount = totalColumnCount; - Rows = rows; - Truncated = truncated; - Schema = schema; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the total number of rows in the table or partition. - /// - [JsonProperty(PropertyName = "totalRowCount")] - public long? TotalRowCount { get; set; } - - /// - /// Gets or sets the total number of columns in the table or partition. - /// - [JsonProperty(PropertyName = "totalColumnCount")] - public long? TotalColumnCount { get; set; } - - /// - /// Gets or sets the rows of the table or partition preview, where each - /// row is an array of string representations the row's values. Note: - /// Byte arrays will appear as base-64 encoded values, SqlMap and - /// SqlArray objects will appear as escaped JSON objects, and DateTime - /// objects will appear as ISO formatted UTC date-times. - /// - [JsonProperty(PropertyName = "rows")] - public IList> Rows { get; set; } - - /// - /// Gets or sets true if the amount of data in the response is less - /// than expected due to the preview operation's size limitations. This - /// can occur if the requested rows or row counts are too large. - /// - [JsonProperty(PropertyName = "truncated")] - public bool? Truncated { get; set; } - - /// - /// Gets or sets the schema of the table or partition. - /// - [JsonProperty(PropertyName = "schema")] - public IList Schema { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTableStatistics.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTableStatistics.cs deleted file mode 100644 index dc8f0067b330..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTableStatistics.cs +++ /dev/null @@ -1,166 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL table statistics item. - /// - public partial class USqlTableStatistics : CatalogItem - { - /// - /// Initializes a new instance of the USqlTableStatistics class. - /// - public USqlTableStatistics() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlTableStatistics class. - /// - /// the name of the Data Lake - /// Analytics account. - /// the version of the catalog item. - /// the name of the database. - /// the name of the schema associated with - /// this table and database. - /// the name of the table. - /// the name of the table statistics. - /// the name of the user statistics. - /// the path to the statistics data. - /// the creation time of the - /// statistics. - /// the last time the statistics were - /// updated. - /// the switch indicating if these - /// statistics are user created. - /// the switch indicating if these - /// statistics are automatically created. - /// the switch indicating if these statistics - /// have a filter. - /// the filter definition for the - /// statistics. - /// the list of column names associated with - /// these statistics. - public USqlTableStatistics(string computeAccountName = default(string), System.Guid? version = default(System.Guid?), string databaseName = default(string), string schemaName = default(string), string tableName = default(string), string name = default(string), string userStatName = default(string), string statDataPath = default(string), System.DateTimeOffset? createTime = default(System.DateTimeOffset?), System.DateTimeOffset? updateTime = default(System.DateTimeOffset?), bool? isUserCreated = default(bool?), bool? isAutoCreated = default(bool?), bool? hasFilter = default(bool?), string filterDefinition = default(string), IList colNames = default(IList)) - : base(computeAccountName, version) - { - DatabaseName = databaseName; - SchemaName = schemaName; - TableName = tableName; - Name = name; - UserStatName = userStatName; - StatDataPath = statDataPath; - CreateTime = createTime; - UpdateTime = updateTime; - IsUserCreated = isUserCreated; - IsAutoCreated = isAutoCreated; - HasFilter = hasFilter; - FilterDefinition = filterDefinition; - ColNames = colNames; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the database. - /// - [JsonProperty(PropertyName = "databaseName")] - public string DatabaseName { get; set; } - - /// - /// Gets or sets the name of the schema associated with this table and - /// database. - /// - [JsonProperty(PropertyName = "schemaName")] - public string SchemaName { get; set; } - - /// - /// Gets or sets the name of the table. - /// - [JsonProperty(PropertyName = "tableName")] - public string TableName { get; set; } - - /// - /// Gets or sets the name of the table statistics. - /// - [JsonProperty(PropertyName = "statisticsName")] - public string Name { get; set; } - - /// - /// Gets or sets the name of the user statistics. - /// - [JsonProperty(PropertyName = "userStatName")] - public string UserStatName { get; set; } - - /// - /// Gets or sets the path to the statistics data. - /// - [JsonProperty(PropertyName = "statDataPath")] - public string StatDataPath { get; set; } - - /// - /// Gets or sets the creation time of the statistics. - /// - [JsonProperty(PropertyName = "createTime")] - public System.DateTimeOffset? CreateTime { get; set; } - - /// - /// Gets or sets the last time the statistics were updated. - /// - [JsonProperty(PropertyName = "updateTime")] - public System.DateTimeOffset? UpdateTime { get; set; } - - /// - /// Gets or sets the switch indicating if these statistics are user - /// created. - /// - [JsonProperty(PropertyName = "isUserCreated")] - public bool? IsUserCreated { get; set; } - - /// - /// Gets or sets the switch indicating if these statistics are - /// automatically created. - /// - [JsonProperty(PropertyName = "isAutoCreated")] - public bool? IsAutoCreated { get; set; } - - /// - /// Gets or sets the switch indicating if these statistics have a - /// filter. - /// - [JsonProperty(PropertyName = "hasFilter")] - public bool? HasFilter { get; set; } - - /// - /// Gets or sets the filter definition for the statistics. - /// - [JsonProperty(PropertyName = "filterDefinition")] - public string FilterDefinition { get; set; } - - /// - /// Gets or sets the list of column names associated with these - /// statistics. - /// - [JsonProperty(PropertyName = "colNames")] - public IList ColNames { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTableType.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTableType.cs deleted file mode 100644 index ece650633e9d..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTableType.cs +++ /dev/null @@ -1,81 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL table type item. - /// - public partial class USqlTableType : USqlType - { - /// - /// Initializes a new instance of the USqlTableType class. - /// - public USqlTableType() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlTableType class. - /// - /// the name of the Data Lake - /// Analytics account. - /// the version of the catalog item. - /// the name of the database. - /// the name of the schema associated with - /// this table and database. - /// the name of type for this type. - /// the type family for this type. - /// the C# name for this type. - /// the fully qualified C# name for this - /// type. - /// the system type ID for this - /// type. - /// the user type ID for this type. - /// the schema ID for this type. - /// the principal ID for this type. - /// the the switch indicating if this type is - /// nullable. - /// the the switch indicating if this type - /// is user defined. - /// the the switch indicating if this type - /// is an assembly type. - /// the the switch indicating if this type is - /// a table type. - /// the the switch indicating if this type - /// is a complex type. - /// the type field information associated with - /// this table type. - public USqlTableType(string computeAccountName = default(string), System.Guid? version = default(System.Guid?), string databaseName = default(string), string schemaName = default(string), string name = default(string), string typeFamily = default(string), string cSharpName = default(string), string fullCSharpName = default(string), int? systemTypeId = default(int?), int? userTypeId = default(int?), int? schemaId = default(int?), int? principalId = default(int?), bool? isNullable = default(bool?), bool? isUserDefined = default(bool?), bool? isAssemblyType = default(bool?), bool? isTableType = default(bool?), bool? isComplexType = default(bool?), IList columns = default(IList)) - : base(computeAccountName, version, databaseName, schemaName, name, typeFamily, cSharpName, fullCSharpName, systemTypeId, userTypeId, schemaId, principalId, isNullable, isUserDefined, isAssemblyType, isTableType, isComplexType) - { - Columns = columns; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the type field information associated with this table type. - /// - [JsonProperty(PropertyName = "columns")] - public IList Columns { get; private set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTableValuedFunction.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTableValuedFunction.cs deleted file mode 100644 index 3ef4a8a144b3..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlTableValuedFunction.cs +++ /dev/null @@ -1,81 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL table valued function item. - /// - public partial class USqlTableValuedFunction : CatalogItem - { - /// - /// Initializes a new instance of the USqlTableValuedFunction class. - /// - public USqlTableValuedFunction() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlTableValuedFunction class. - /// - /// the name of the Data Lake - /// Analytics account. - /// the version of the catalog item. - /// the name of the database. - /// the name of the schema associated with - /// this database. - /// the name of the table valued function. - /// the definition of the table valued - /// function. - public USqlTableValuedFunction(string computeAccountName = default(string), System.Guid? version = default(System.Guid?), string databaseName = default(string), string schemaName = default(string), string name = default(string), string definition = default(string)) - : base(computeAccountName, version) - { - DatabaseName = databaseName; - SchemaName = schemaName; - Name = name; - Definition = definition; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the database. - /// - [JsonProperty(PropertyName = "databaseName")] - public string DatabaseName { get; set; } - - /// - /// Gets or sets the name of the schema associated with this database. - /// - [JsonProperty(PropertyName = "schemaName")] - public string SchemaName { get; set; } - - /// - /// Gets or sets the name of the table valued function. - /// - [JsonProperty(PropertyName = "tvfName")] - public string Name { get; set; } - - /// - /// Gets or sets the definition of the table valued function. - /// - [JsonProperty(PropertyName = "definition")] - public string Definition { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlType.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlType.cs deleted file mode 100644 index 1101da938f97..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlType.cs +++ /dev/null @@ -1,180 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL type item. - /// - public partial class USqlType : CatalogItem - { - /// - /// Initializes a new instance of the USqlType class. - /// - public USqlType() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlType class. - /// - /// the name of the Data Lake - /// Analytics account. - /// the version of the catalog item. - /// the name of the database. - /// the name of the schema associated with - /// this table and database. - /// the name of type for this type. - /// the type family for this type. - /// the C# name for this type. - /// the fully qualified C# name for this - /// type. - /// the system type ID for this - /// type. - /// the user type ID for this type. - /// the schema ID for this type. - /// the principal ID for this type. - /// the the switch indicating if this type is - /// nullable. - /// the the switch indicating if this type - /// is user defined. - /// the the switch indicating if this type - /// is an assembly type. - /// the the switch indicating if this type is - /// a table type. - /// the the switch indicating if this type - /// is a complex type. - public USqlType(string computeAccountName = default(string), System.Guid? version = default(System.Guid?), string databaseName = default(string), string schemaName = default(string), string name = default(string), string typeFamily = default(string), string cSharpName = default(string), string fullCSharpName = default(string), int? systemTypeId = default(int?), int? userTypeId = default(int?), int? schemaId = default(int?), int? principalId = default(int?), bool? isNullable = default(bool?), bool? isUserDefined = default(bool?), bool? isAssemblyType = default(bool?), bool? isTableType = default(bool?), bool? isComplexType = default(bool?)) - : base(computeAccountName, version) - { - DatabaseName = databaseName; - SchemaName = schemaName; - Name = name; - TypeFamily = typeFamily; - CSharpName = cSharpName; - FullCSharpName = fullCSharpName; - SystemTypeId = systemTypeId; - UserTypeId = userTypeId; - SchemaId = schemaId; - PrincipalId = principalId; - IsNullable = isNullable; - IsUserDefined = isUserDefined; - IsAssemblyType = isAssemblyType; - IsTableType = isTableType; - IsComplexType = isComplexType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the database. - /// - [JsonProperty(PropertyName = "databaseName")] - public string DatabaseName { get; set; } - - /// - /// Gets or sets the name of the schema associated with this table and - /// database. - /// - [JsonProperty(PropertyName = "schemaName")] - public string SchemaName { get; set; } - - /// - /// Gets or sets the name of type for this type. - /// - [JsonProperty(PropertyName = "typeName")] - public string Name { get; set; } - - /// - /// Gets or sets the type family for this type. - /// - [JsonProperty(PropertyName = "typeFamily")] - public string TypeFamily { get; set; } - - /// - /// Gets or sets the C# name for this type. - /// - [JsonProperty(PropertyName = "cSharpName")] - public string CSharpName { get; set; } - - /// - /// Gets or sets the fully qualified C# name for this type. - /// - [JsonProperty(PropertyName = "fullCSharpName")] - public string FullCSharpName { get; set; } - - /// - /// Gets or sets the system type ID for this type. - /// - [JsonProperty(PropertyName = "systemTypeId")] - public int? SystemTypeId { get; set; } - - /// - /// Gets or sets the user type ID for this type. - /// - [JsonProperty(PropertyName = "userTypeId")] - public int? UserTypeId { get; set; } - - /// - /// Gets or sets the schema ID for this type. - /// - [JsonProperty(PropertyName = "schemaId")] - public int? SchemaId { get; set; } - - /// - /// Gets or sets the principal ID for this type. - /// - [JsonProperty(PropertyName = "principalId")] - public int? PrincipalId { get; set; } - - /// - /// Gets or sets the the switch indicating if this type is nullable. - /// - [JsonProperty(PropertyName = "isNullable")] - public bool? IsNullable { get; set; } - - /// - /// Gets or sets the the switch indicating if this type is user - /// defined. - /// - [JsonProperty(PropertyName = "isUserDefined")] - public bool? IsUserDefined { get; set; } - - /// - /// Gets or sets the the switch indicating if this type is an assembly - /// type. - /// - [JsonProperty(PropertyName = "isAssemblyType")] - public bool? IsAssemblyType { get; set; } - - /// - /// Gets or sets the the switch indicating if this type is a table - /// type. - /// - [JsonProperty(PropertyName = "isTableType")] - public bool? IsTableType { get; set; } - - /// - /// Gets or sets the the switch indicating if this type is a complex - /// type. - /// - [JsonProperty(PropertyName = "isComplexType")] - public bool? IsComplexType { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlView.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlView.cs deleted file mode 100644 index 59c76e6b76de..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/USqlView.cs +++ /dev/null @@ -1,81 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// A Data Lake Analytics catalog U-SQL view item. - /// - public partial class USqlView : CatalogItem - { - /// - /// Initializes a new instance of the USqlView class. - /// - public USqlView() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the USqlView class. - /// - /// the name of the Data Lake - /// Analytics account. - /// the version of the catalog item. - /// the name of the database. - /// the name of the schema associated with - /// this view and database. - /// the name of the view. - /// the defined query of the view. - public USqlView(string computeAccountName = default(string), System.Guid? version = default(System.Guid?), string databaseName = default(string), string schemaName = default(string), string name = default(string), string definition = default(string)) - : base(computeAccountName, version) - { - DatabaseName = databaseName; - SchemaName = schemaName; - Name = name; - Definition = definition; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the name of the database. - /// - [JsonProperty(PropertyName = "databaseName")] - public string DatabaseName { get; set; } - - /// - /// Gets or sets the name of the schema associated with this view and - /// database. - /// - [JsonProperty(PropertyName = "schemaName")] - public string SchemaName { get; set; } - - /// - /// Gets or sets the name of the view. - /// - [JsonProperty(PropertyName = "viewName")] - public string Name { get; set; } - - /// - /// Gets or sets the defined query of the view. - /// - [JsonProperty(PropertyName = "definition")] - public string Definition { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/UpdateJobParameters.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/UpdateJobParameters.cs deleted file mode 100644 index e309750d05bf..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/UpdateJobParameters.cs +++ /dev/null @@ -1,88 +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.DataLake.Analytics.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// The parameters that can be used to update existing Data Lake Analytics - /// job information properties. (Only for use internally with Scope job - /// type.) - /// - public partial class UpdateJobParameters - { - /// - /// Initializes a new instance of the UpdateJobParameters class. - /// - public UpdateJobParameters() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the UpdateJobParameters class. - /// - /// The degree of parallelism used - /// for this job. - /// the degree of parallelism - /// in percentage used for this job. - /// The priority value for the current job. - /// Lower numbers have a higher priority. By default, a job has a - /// priority of 1000. This must be greater than 0. - /// The key-value pairs used to add additional - /// metadata to the job information. - public UpdateJobParameters(int? degreeOfParallelism = default(int?), double? degreeOfParallelismPercent = default(double?), int? priority = default(int?), IDictionary tags = default(IDictionary)) - { - DegreeOfParallelism = degreeOfParallelism; - DegreeOfParallelismPercent = degreeOfParallelismPercent; - Priority = priority; - Tags = tags; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets the degree of parallelism used for this job. - /// - [JsonProperty(PropertyName = "degreeOfParallelism")] - public int? DegreeOfParallelism { get; set; } - - /// - /// Gets or sets the degree of parallelism in percentage used for this - /// job. - /// - [JsonProperty(PropertyName = "degreeOfParallelismPercent")] - public double? DegreeOfParallelismPercent { get; set; } - - /// - /// Gets or sets the priority value for the current job. Lower numbers - /// have a higher priority. By default, a job has a priority of 1000. - /// This must be greater than 0. - /// - [JsonProperty(PropertyName = "priority")] - public int? Priority { get; set; } - - /// - /// Gets or sets the key-value pairs used to add additional metadata to - /// the job information. - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/VirtualNetworkRule.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/VirtualNetworkRule.cs new file mode 100644 index 000000000000..845129140df2 --- /dev/null +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/VirtualNetworkRule.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataLake.Analytics.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Data Lake Analytics VirtualNetwork Rule information. + /// + [Rest.Serialization.JsonTransformation] + public partial class VirtualNetworkRule : SubResource + { + /// + /// Initializes a new instance of the VirtualNetworkRule class. + /// + public VirtualNetworkRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualNetworkRule class. + /// + /// The resource identifier. + /// The resource name. + /// The resource type. + /// The resource identifier for the + /// subnet + /// The current state of the + /// VirtualNetwork Rule. Possible values include: 'Active', + /// 'NetworkSourceDeleted', 'Failed' + public VirtualNetworkRule(string id = default(string), string name = default(string), string type = default(string), string subnetId = default(string), VirtualNetworkRuleState? virtualNetworkRuleState = default(VirtualNetworkRuleState?)) + : base(id, name, type) + { + SubnetId = subnetId; + VirtualNetworkRuleState = virtualNetworkRuleState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the resource identifier for the subnet + /// + [JsonProperty(PropertyName = "properties.subnetId")] + public string SubnetId { get; private set; } + + /// + /// Gets the current state of the VirtualNetwork Rule. Possible values + /// include: 'Active', 'NetworkSourceDeleted', 'Failed' + /// + [JsonProperty(PropertyName = "properties.virtualNetworkRuleState")] + public VirtualNetworkRuleState? VirtualNetworkRuleState { get; private set; } + + } +} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/VirtualNetworkRuleListResult.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/VirtualNetworkRuleListResult.cs new file mode 100644 index 000000000000..f5a169a41ef8 --- /dev/null +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/VirtualNetworkRuleListResult.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataLake.Analytics.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Data Lake Analytics VirtualNetwork rule list information. + /// + public partial class VirtualNetworkRuleListResult + { + /// + /// Initializes a new instance of the VirtualNetworkRuleListResult + /// class. + /// + public VirtualNetworkRuleListResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VirtualNetworkRuleListResult + /// class. + /// + /// The results of the list operation. + /// The link (url) to the next page of + /// results. + public VirtualNetworkRuleListResult(IList value = default(IList), string nextLink = default(string)) + { + Value = value; + NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the results of the list operation. + /// + [JsonProperty(PropertyName = "value")] + public IList Value { get; private set; } + + /// + /// Gets the link (url) to the next page of results. + /// + [JsonProperty(PropertyName = "nextLink")] + public string NextLink { get; private set; } + + } +} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/VirtualNetworkRuleState.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/VirtualNetworkRuleState.cs new file mode 100644 index 000000000000..f3eefa292a16 --- /dev/null +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Models/VirtualNetworkRuleState.cs @@ -0,0 +1,66 @@ +// +// 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.DataLake.Analytics.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for VirtualNetworkRuleState. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum VirtualNetworkRuleState + { + [EnumMember(Value = "Active")] + Active, + [EnumMember(Value = "NetworkSourceDeleted")] + NetworkSourceDeleted, + [EnumMember(Value = "Failed")] + Failed + } + internal static class VirtualNetworkRuleStateEnumExtension + { + internal static string ToSerializedValue(this VirtualNetworkRuleState? value) + { + return value == null ? null : ((VirtualNetworkRuleState)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this VirtualNetworkRuleState value) + { + switch( value ) + { + case VirtualNetworkRuleState.Active: + return "Active"; + case VirtualNetworkRuleState.NetworkSourceDeleted: + return "NetworkSourceDeleted"; + case VirtualNetworkRuleState.Failed: + return "Failed"; + } + return null; + } + + internal static VirtualNetworkRuleState? ParseVirtualNetworkRuleState(this string value) + { + switch( value ) + { + case "Active": + return VirtualNetworkRuleState.Active; + case "NetworkSourceDeleted": + return VirtualNetworkRuleState.NetworkSourceDeleted; + case "Failed": + return VirtualNetworkRuleState.Failed; + } + return null; + } + } +} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Operations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Operations.cs index 2f2803fef569..a68fc61f4d49 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Operations.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/Operations.cs @@ -59,7 +59,7 @@ internal Operations(DataLakeAnalyticsAccountManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -158,14 +158,13 @@ internal Operations(DataLakeAnalyticsAccountManagementClient 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 ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -175,10 +174,6 @@ internal Operations(DataLakeAnalyticsAccountManagementClient 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/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/PipelineOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/PipelineOperations.cs deleted file mode 100644 index edfe19785344..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/PipelineOperations.cs +++ /dev/null @@ -1,642 +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.DataLake.Analytics -{ - 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; - - /// - /// PipelineOperations operations. - /// - internal partial class PipelineOperations : IServiceOperations, IPipelineOperations - { - /// - /// Initializes a new instance of the PipelineOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal PipelineOperations(DataLakeAnalyticsJobManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the DataLakeAnalyticsJobManagementClient - /// - public DataLakeAnalyticsJobManagementClient Client { get; private set; } - - /// - /// Lists all pipelines. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// The start date for when to get the list of pipelines. The startDateTime and - /// endDateTime can be no more than 30 days apart. - /// - /// - /// The end date for when to get the list of pipelines. The startDateTime and - /// endDateTime can be no more than 30 days apart. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListWithHttpMessagesAsync(string accountName, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaJobDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaJobDnsSuffix"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("startDateTime", startDateTime); - tracingParameters.Add("endDateTime", endDateTime); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "pipelines"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaJobDnsSuffix}", Client.AdlaJobDnsSuffix); - List _queryParameters = new List(); - if (startDateTime != null) - { - _queryParameters.Add(string.Format("startDateTime={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(startDateTime, Client.SerializationSettings).Trim('"')))); - } - if (endDateTime != null) - { - _queryParameters.Add(string.Format("endDateTime={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(endDateTime, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the Pipeline information for the specified pipeline ID. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Pipeline ID. - /// - /// - /// The start date for when to get the pipeline and aggregate its data. The - /// startDateTime and endDateTime can be no more than 30 days apart. - /// - /// - /// The end date for when to get the pipeline and aggregate its data. The - /// startDateTime and endDateTime can be no more than 30 days apart. - /// - /// - /// 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 accountName, System.Guid pipelineIdentity, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaJobDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaJobDnsSuffix"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("pipelineIdentity", pipelineIdentity); - tracingParameters.Add("startDateTime", startDateTime); - tracingParameters.Add("endDateTime", endDateTime); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "pipelines/{pipelineIdentity}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaJobDnsSuffix}", Client.AdlaJobDnsSuffix); - _url = _url.Replace("{pipelineIdentity}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(pipelineIdentity, Client.SerializationSettings).Trim('"'))); - List _queryParameters = new List(); - if (startDateTime != null) - { - _queryParameters.Add(string.Format("startDateTime={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(startDateTime, Client.SerializationSettings).Trim('"')))); - } - if (endDateTime != null) - { - _queryParameters.Add(string.Format("endDateTime={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(endDateTime, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists all pipelines. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/PipelineOperationsExtensions.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/PipelineOperationsExtensions.cs deleted file mode 100644 index 724eccd3941a..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/PipelineOperationsExtensions.cs +++ /dev/null @@ -1,165 +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.DataLake.Analytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for PipelineOperations. - /// - public static partial class PipelineOperationsExtensions - { - /// - /// Lists all pipelines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// The start date for when to get the list of pipelines. The startDateTime and - /// endDateTime can be no more than 30 days apart. - /// - /// - /// The end date for when to get the list of pipelines. The startDateTime and - /// endDateTime can be no more than 30 days apart. - /// - public static IPage List(this IPipelineOperations operations, string accountName, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?)) - { - return operations.ListAsync(accountName, startDateTime, endDateTime).GetAwaiter().GetResult(); - } - - /// - /// Lists all pipelines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// The start date for when to get the list of pipelines. The startDateTime and - /// endDateTime can be no more than 30 days apart. - /// - /// - /// The end date for when to get the list of pipelines. The startDateTime and - /// endDateTime can be no more than 30 days apart. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IPipelineOperations operations, string accountName, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(accountName, startDateTime, endDateTime, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the Pipeline information for the specified pipeline ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Pipeline ID. - /// - /// - /// The start date for when to get the pipeline and aggregate its data. The - /// startDateTime and endDateTime can be no more than 30 days apart. - /// - /// - /// The end date for when to get the pipeline and aggregate its data. The - /// startDateTime and endDateTime can be no more than 30 days apart. - /// - public static JobPipelineInformation Get(this IPipelineOperations operations, string accountName, System.Guid pipelineIdentity, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?)) - { - return operations.GetAsync(accountName, pipelineIdentity, startDateTime, endDateTime).GetAwaiter().GetResult(); - } - - /// - /// Gets the Pipeline information for the specified pipeline ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Pipeline ID. - /// - /// - /// The start date for when to get the pipeline and aggregate its data. The - /// startDateTime and endDateTime can be no more than 30 days apart. - /// - /// - /// The end date for when to get the pipeline and aggregate its data. The - /// startDateTime and endDateTime can be no more than 30 days apart. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IPipelineOperations operations, string accountName, System.Guid pipelineIdentity, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(accountName, pipelineIdentity, startDateTime, endDateTime, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all pipelines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IPipelineOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all pipelines. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IPipelineOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/RecurrenceOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/RecurrenceOperations.cs deleted file mode 100644 index f33f53c95f72..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/RecurrenceOperations.cs +++ /dev/null @@ -1,642 +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.DataLake.Analytics -{ - 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; - - /// - /// RecurrenceOperations operations. - /// - internal partial class RecurrenceOperations : IServiceOperations, IRecurrenceOperations - { - /// - /// Initializes a new instance of the RecurrenceOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal RecurrenceOperations(DataLakeAnalyticsJobManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the DataLakeAnalyticsJobManagementClient - /// - public DataLakeAnalyticsJobManagementClient Client { get; private set; } - - /// - /// Lists all recurrences. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// The start date for when to get the list of recurrences. The startDateTime - /// and endDateTime can be no more than 30 days apart. - /// - /// - /// The end date for when to get the list of recurrences. The startDateTime and - /// endDateTime can be no more than 30 days apart. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListWithHttpMessagesAsync(string accountName, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaJobDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaJobDnsSuffix"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("startDateTime", startDateTime); - tracingParameters.Add("endDateTime", endDateTime); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "recurrences"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaJobDnsSuffix}", Client.AdlaJobDnsSuffix); - List _queryParameters = new List(); - if (startDateTime != null) - { - _queryParameters.Add(string.Format("startDateTime={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(startDateTime, Client.SerializationSettings).Trim('"')))); - } - if (endDateTime != null) - { - _queryParameters.Add(string.Format("endDateTime={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(endDateTime, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Gets the recurrence information for the specified recurrence ID. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Recurrence ID. - /// - /// - /// The start date for when to get the recurrence and aggregate its data. The - /// startDateTime and endDateTime can be no more than 30 days apart. - /// - /// - /// The end date for when to get recurrence and aggregate its data. The - /// startDateTime and endDateTime can be no more than 30 days apart. - /// - /// - /// 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 accountName, System.Guid recurrenceIdentity, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (Client.AdlaJobDnsSuffix == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AdlaJobDnsSuffix"); - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("recurrenceIdentity", recurrenceIdentity); - tracingParameters.Add("startDateTime", startDateTime); - tracingParameters.Add("endDateTime", endDateTime); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri; - var _url = _baseUrl + (_baseUrl.EndsWith("/") ? "" : "/") + "recurrences/{recurrenceIdentity}"; - _url = _url.Replace("{accountName}", accountName); - _url = _url.Replace("{adlaJobDnsSuffix}", Client.AdlaJobDnsSuffix); - _url = _url.Replace("{recurrenceIdentity}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(recurrenceIdentity, Client.SerializationSettings).Trim('"'))); - List _queryParameters = new List(); - if (startDateTime != null) - { - _queryParameters.Add(string.Format("startDateTime={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(startDateTime, Client.SerializationSettings).Trim('"')))); - } - if (endDateTime != null) - { - _queryParameters.Add(string.Format("endDateTime={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(endDateTime, Client.SerializationSettings).Trim('"')))); - } - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Lists all recurrences. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse>(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/RecurrenceOperationsExtensions.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/RecurrenceOperationsExtensions.cs deleted file mode 100644 index 5ee91050ecc8..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/RecurrenceOperationsExtensions.cs +++ /dev/null @@ -1,165 +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.DataLake.Analytics -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for RecurrenceOperations. - /// - public static partial class RecurrenceOperationsExtensions - { - /// - /// Lists all recurrences. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// The start date for when to get the list of recurrences. The startDateTime - /// and endDateTime can be no more than 30 days apart. - /// - /// - /// The end date for when to get the list of recurrences. The startDateTime and - /// endDateTime can be no more than 30 days apart. - /// - public static IPage List(this IRecurrenceOperations operations, string accountName, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?)) - { - return operations.ListAsync(accountName, startDateTime, endDateTime).GetAwaiter().GetResult(); - } - - /// - /// Lists all recurrences. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// The start date for when to get the list of recurrences. The startDateTime - /// and endDateTime can be no more than 30 days apart. - /// - /// - /// The end date for when to get the list of recurrences. The startDateTime and - /// endDateTime can be no more than 30 days apart. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IRecurrenceOperations operations, string accountName, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(accountName, startDateTime, endDateTime, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the recurrence information for the specified recurrence ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Recurrence ID. - /// - /// - /// The start date for when to get the recurrence and aggregate its data. The - /// startDateTime and endDateTime can be no more than 30 days apart. - /// - /// - /// The end date for when to get recurrence and aggregate its data. The - /// startDateTime and endDateTime can be no more than 30 days apart. - /// - public static JobRecurrenceInformation Get(this IRecurrenceOperations operations, string accountName, System.Guid recurrenceIdentity, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?)) - { - return operations.GetAsync(accountName, recurrenceIdentity, startDateTime, endDateTime).GetAwaiter().GetResult(); - } - - /// - /// Gets the recurrence information for the specified recurrence ID. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The Azure Data Lake Analytics account to execute job operations on. - /// - /// - /// Recurrence ID. - /// - /// - /// The start date for when to get the recurrence and aggregate its data. The - /// startDateTime and endDateTime can be no more than 30 days apart. - /// - /// - /// The end date for when to get recurrence and aggregate its data. The - /// startDateTime and endDateTime can be no more than 30 days apart. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IRecurrenceOperations operations, string accountName, System.Guid recurrenceIdentity, System.DateTimeOffset? startDateTime = default(System.DateTimeOffset?), System.DateTimeOffset? endDateTime = default(System.DateTimeOffset?), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(accountName, recurrenceIdentity, startDateTime, endDateTime, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists all recurrences. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IRecurrenceOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists all recurrences. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IRecurrenceOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/SdkInfo_DataLakeAnalyticsAccountManagementClient.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/SdkInfo_DataLakeAnalyticsAccountManagementClient.cs index bc78810fcd4a..9333a36ac5cc 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/SdkInfo_DataLakeAnalyticsAccountManagementClient.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/SdkInfo_DataLakeAnalyticsAccountManagementClient.cs @@ -29,16 +29,5 @@ public static IEnumerable> ApiInfo_DataLakeAnalyti }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/datalake-analytics/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\code\\AzureSDK\\azure-sdk-for-net\\src\\SDKs"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "6a18208aed692f02215a2ea50736c0a8d5ac7329"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/SdkInfo_DataLakeAnalyticsCatalogManagementClient.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/SdkInfo_DataLakeAnalyticsCatalogManagementClient.cs deleted file mode 100644 index f6569074446e..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/SdkInfo_DataLakeAnalyticsCatalogManagementClient.cs +++ /dev/null @@ -1,27 +0,0 @@ - -// -// 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.DataLake.Analytics -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_DataLakeAnalyticsCatalogManagementClient - { - get - { - return new Tuple[] - { - new Tuple("DataLakeAnalyticsCatalogManagementClient", "Catalog", "2016-11-01"), - }.AsEnumerable(); - } - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/SdkInfo_DataLakeAnalyticsJobManagementClient.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/SdkInfo_DataLakeAnalyticsJobManagementClient.cs deleted file mode 100644 index 0155470cb343..000000000000 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/SdkInfo_DataLakeAnalyticsJobManagementClient.cs +++ /dev/null @@ -1,29 +0,0 @@ - -// -// 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.DataLake.Analytics -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_DataLakeAnalyticsJobManagementClient - { - get - { - return new Tuple[] - { - new Tuple("DataLakeAnalyticsJobManagementClient", "Job", "2017-09-01-preview"), - new Tuple("DataLakeAnalyticsJobManagementClient", "Pipeline", "2017-09-01-preview"), - new Tuple("DataLakeAnalyticsJobManagementClient", "Recurrence", "2017-09-01-preview"), - }.AsEnumerable(); - } - } - } -} diff --git a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/StorageAccountsOperations.cs b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/StorageAccountsOperations.cs index d01948778fca..5340ab3f19f6 100644 --- a/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/StorageAccountsOperations.cs +++ b/sdk/datalake-analytics/Microsoft.Azure.Management.DataLake.Analytics/src/Generated/StorageAccountsOperations.cs @@ -80,7 +80,7 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -215,14 +215,13 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -232,10 +231,6 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie } 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); @@ -303,7 +298,7 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -437,14 +432,13 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -454,10 +448,6 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie } 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); @@ -503,7 +493,7 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -625,14 +615,13 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -642,10 +631,6 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie } 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); @@ -713,7 +698,7 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -839,14 +824,13 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -856,10 +840,6 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie } 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); @@ -905,7 +885,7 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1024,14 +1004,13 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1041,10 +1020,6 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie } 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); @@ -1091,7 +1066,7 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1213,14 +1188,13 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1230,10 +1204,6 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie } 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); @@ -1301,7 +1271,7 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1429,14 +1399,13 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1446,10 +1415,6 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie } 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); @@ -1518,7 +1483,7 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1646,14 +1611,13 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1663,10 +1627,6 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie } 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); @@ -1725,7 +1685,7 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1821,14 +1781,13 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1838,10 +1797,6 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie } 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); @@ -1900,7 +1855,7 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1996,14 +1951,13 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2013,10 +1967,6 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie } 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); @@ -2074,7 +2024,7 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2170,14 +2120,13 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(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); + ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2187,10 +2136,6 @@ internal StorageAccountsOperations(DataLakeAnalyticsAccountManagementClient clie } 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);