From 46b1c0615712caa016ef6a02a9b93953c7af4269 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 4 Aug 2021 01:09:43 +0000 Subject: [PATCH] CodeGen from PR 15483 in Azure/azure-rest-api-specs Merge 632c1616594e0b6de7119de5eb1a419886d74080 into 57e30b59a95ea35181d547a97528adbf82360ae7 --- .../src/Generated/FunctionsOperations.cs | 90 +- .../src/Generated/IFunctionsOperations.cs | 18 +- .../src/Generated/IInputsOperations.cs | 16 +- .../src/Generated/IOperations.cs | 4 +- .../src/Generated/IOutputsOperations.cs | 16 +- .../src/Generated/IStreamingJobsOperations.cs | 28 +- .../src/Generated/ISubscriptionsOperations.cs | 260 +++- .../Generated/ITransformationsOperations.cs | 6 +- .../src/Generated/InputsOperations.cs | 77 +- ...reSqlReferenceInputDataSourceProperties.cs | 3 + .../src/Generated/Models/CompileQuery.cs | 129 ++ .../src/Generated/Models/FunctionBinding.cs | 2 - .../Generated/Models/FunctionProperties.cs | 1 - ...tionRetrieveDefaultDefinitionParameters.cs | 2 - .../src/Generated/Models/InputProperties.cs | 1 - .../src/Generated/Models/OutputDataSource.cs | 2 - .../Generated/Models/QueryCompilationError.cs | 101 ++ .../Models/QueryCompilationResult.cs | 88 ++ .../src/Generated/Models/QueryFunction.cs | 115 ++ .../src/Generated/Models/QueryInput.cs | 78 ++ .../Generated/Models/QueryTestingResult.cs | 65 + .../Models/QueryTestingResultException.cs | 62 + .../Models/QueryTestingResultStatus.cs | 44 + .../Generated/Models/RawOutputDatasource.cs | 64 + .../Models/RawReferenceInputDataSource.cs | 75 ++ .../Models/RawStreamInputDataSource.cs | 73 ++ .../Models/ReferenceInputDataSource.cs | 2 - .../src/Generated/Models/Resource.cs | 3 + .../src/Generated/Models/SampleInput.cs | 96 ++ .../src/Generated/Models/SampleInputResult.cs | 88 ++ .../Models/SampleInputResultException.cs | 62 + .../Models/SampleInputResultStatus.cs | 33 + .../src/Generated/Models/Serialization.cs | 2 - .../Generated/Models/StreamInputDataSource.cs | 2 - .../src/Generated/Models/StreamingJob.cs | 6 +- .../Generated/Models/TestDatasourceResult.cs | 55 + .../Models/TestDatasourceResultException.cs | 62 + .../Models/TestDatasourceResultStatus.cs | 28 + .../src/Generated/Models/TestInput.cs | 69 + .../src/Generated/Models/TestOutput.cs | 65 + .../src/Generated/Models/TestQuery.cs | 81 ++ .../Generated/Models/TestQueryDiagnostics.cs | 74 ++ .../src/Generated/Operations.cs | 22 +- .../src/Generated/OutputsOperations.cs | 77 +- ...SdkInfo_StreamAnalyticsManagementClient.cs | 11 - .../src/Generated/StreamingJobsOperations.cs | 110 +- .../src/Generated/SubscriptionsOperations.cs | 1151 ++++++++++++++++- .../SubscriptionsOperationsExtensions.cs | 414 +++++- .../Generated/TransformationsOperations.cs | 33 +- 49 files changed, 3579 insertions(+), 387 deletions(-) create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CompileQuery.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryCompilationError.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryCompilationResult.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryFunction.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryInput.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryTestingResult.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryTestingResultException.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryTestingResultStatus.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/RawOutputDatasource.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/RawReferenceInputDataSource.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/RawStreamInputDataSource.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SampleInput.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SampleInputResult.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SampleInputResultException.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SampleInputResultStatus.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestDatasourceResult.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestDatasourceResultException.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestDatasourceResultStatus.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestInput.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestOutput.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestQuery.cs create mode 100644 sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestQueryDiagnostics.cs diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/FunctionsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/FunctionsOperations.cs index c94f1fdc45bdd..4f80b1a104699 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/FunctionsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/FunctionsOperations.cs @@ -83,7 +83,7 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -254,14 +254,13 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -271,10 +270,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -382,7 +377,7 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -544,14 +539,13 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -561,10 +555,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -640,7 +630,7 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -779,14 +769,13 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -796,10 +785,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -844,7 +829,7 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -986,14 +971,13 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1003,10 +987,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1085,7 +1065,7 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1226,14 +1206,13 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1243,10 +1222,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1350,7 +1325,7 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1423,7 +1398,7 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/functions/{functionName}/RetrieveDefaultDefinition").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/functions/{functionName}/retrieveDefaultDefinition").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); @@ -1499,14 +1474,13 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1516,10 +1490,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1593,7 +1563,7 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1742,14 +1712,13 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1759,10 +1728,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1819,7 +1784,7 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1915,14 +1880,13 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1932,10 +1896,6 @@ internal FunctionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IFunctionsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IFunctionsOperations.cs index 9897e987b83a4..49fe68aef8bc7 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IFunctionsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IFunctionsOperations.cs @@ -56,7 +56,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -100,7 +100,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -128,7 +128,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -153,7 +153,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -184,7 +184,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -224,7 +224,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -257,7 +257,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -297,7 +297,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -319,7 +319,7 @@ public partial interface IFunctionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IInputsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IInputsOperations.cs index 345445299276f..406fe2f8bd4ee 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IInputsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IInputsOperations.cs @@ -56,7 +56,7 @@ public partial interface IInputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -99,7 +99,7 @@ public partial interface IInputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -127,7 +127,7 @@ public partial interface IInputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -152,7 +152,7 @@ public partial interface IInputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -183,7 +183,7 @@ public partial interface IInputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -221,7 +221,7 @@ public partial interface IInputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -259,7 +259,7 @@ public partial interface IInputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -281,7 +281,7 @@ public partial interface IInputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IOperations.cs index 6a1409c3269e8..e7aabe0387150 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IOperations.cs @@ -32,7 +32,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -54,7 +54,7 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IOutputsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IOutputsOperations.cs index 6bb2591b06450..834704ee0888e 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IOutputsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IOutputsOperations.cs @@ -56,7 +56,7 @@ public partial interface IOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -99,7 +99,7 @@ public partial interface IOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -127,7 +127,7 @@ public partial interface IOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -152,7 +152,7 @@ public partial interface IOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -183,7 +183,7 @@ public partial interface IOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -221,7 +221,7 @@ public partial interface IOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -259,7 +259,7 @@ public partial interface IOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -281,7 +281,7 @@ public partial interface IOutputsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IStreamingJobsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IStreamingJobsOperations.cs index 0bf2575a402d6..14a4f56eaee3f 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IStreamingJobsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/IStreamingJobsOperations.cs @@ -53,7 +53,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -93,7 +93,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -118,7 +118,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -147,7 +147,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -176,7 +176,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -202,7 +202,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -231,7 +231,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -254,7 +254,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -291,7 +291,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -316,7 +316,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -342,7 +342,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -365,7 +365,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -384,7 +384,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -406,7 +406,7 @@ public partial interface IStreamingJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ISubscriptionsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ISubscriptionsOperations.cs index 5a0bdd1262f75..efffbaa3721b5 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ISubscriptionsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ISubscriptionsOperations.cs @@ -28,9 +28,9 @@ public partial interface ISubscriptionsOperations /// particular region. /// /// - /// The region in which to retrieve the subscription's quota - /// information. You can find out which regions Azure Stream Analytics - /// is supported in here: https://azure.microsoft.com/en-us/regions/ + /// The region to which the request is sent. You can find out which + /// regions Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ /// /// /// The headers that will be added to request. @@ -38,7 +38,7 @@ public partial interface ISubscriptionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -48,5 +48,257 @@ public partial interface ISubscriptionsOperations /// Thrown when a required parameter is null /// Task> ListQuotasWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Test the Stream Analytics query on a sample input. + /// + /// + /// The query testing object that defines the input, output, and + /// transformation for the query testing. + /// + /// + /// The region to which the request is sent. You can find out which + /// regions Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// 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> TestQueryMethodWithHttpMessagesAsync(TestQuery testQuery, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Compile the Stream Analytics query. + /// + /// + /// The query compilation object which defines the input, output, and + /// transformation for the query compilation. + /// + /// + /// The region to which the request is sent. You can find out which + /// regions Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// 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> CompileQueryMethodWithHttpMessagesAsync(CompileQuery compileQuery, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Sample the Stream Analytics input data. + /// + /// + /// Defines the necessary parameters for sampling the Stream Analytics + /// input data. + /// + /// + /// The region to which the request is sent. You can find out which + /// regions Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// 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> SampleInputMethodWithHttpMessagesAsync(SampleInput sampleInput, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Test the Stream Analytics input. + /// + /// + /// Defines the necessary parameters for testing the Stream Analytics + /// input. + /// + /// + /// The region to which the request is sent. You can find out which + /// regions Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// 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> TestInputMethodWithHttpMessagesAsync(TestInput testInput, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Test the Stream Analytics output. + /// + /// + /// Defines the necessary parameters for testing the Stream Analytics + /// output. + /// + /// + /// The region to which the request is sent. You can find out which + /// regions Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// 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> TestOutputMethodWithHttpMessagesAsync(TestOutput testOutput, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Test the Stream Analytics query on a sample input. + /// + /// + /// The query testing object that defines the input, output, and + /// transformation for the query testing. + /// + /// + /// The region to which the request is sent. You can find out which + /// regions Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// 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> BeginTestQueryMethodWithHttpMessagesAsync(TestQuery testQuery, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Sample the Stream Analytics input data. + /// + /// + /// Defines the necessary parameters for sampling the Stream Analytics + /// input data. + /// + /// + /// The region to which the request is sent. You can find out which + /// regions Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// 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> BeginSampleInputMethodWithHttpMessagesAsync(SampleInput sampleInput, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Test the Stream Analytics input. + /// + /// + /// Defines the necessary parameters for testing the Stream Analytics + /// input. + /// + /// + /// The region to which the request is sent. You can find out which + /// regions Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// 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> BeginTestInputMethodWithHttpMessagesAsync(TestInput testInput, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Test the Stream Analytics output. + /// + /// + /// Defines the necessary parameters for testing the Stream Analytics + /// output. + /// + /// + /// The region to which the request is sent. You can find out which + /// regions Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// 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> BeginTestOutputMethodWithHttpMessagesAsync(TestOutput testOutput, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ITransformationsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ITransformationsOperations.cs index 64a7516ef810d..13e93aaf668fa 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ITransformationsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/ITransformationsOperations.cs @@ -57,7 +57,7 @@ public partial interface ITransformationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -101,7 +101,7 @@ public partial interface ITransformationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -129,7 +129,7 @@ public partial interface ITransformationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/InputsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/InputsOperations.cs index c2f98caabf861..43862c695c45e 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/InputsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/InputsOperations.cs @@ -83,7 +83,7 @@ internal InputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -258,14 +258,13 @@ internal InputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -275,10 +274,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -386,7 +381,7 @@ internal InputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -548,14 +543,13 @@ internal InputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -565,10 +559,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -644,7 +634,7 @@ internal InputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -783,14 +773,13 @@ internal InputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -800,10 +789,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -848,7 +833,7 @@ internal InputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -990,14 +975,13 @@ internal InputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1007,10 +991,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1089,7 +1069,7 @@ internal InputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1230,14 +1210,13 @@ internal InputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1247,10 +1226,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1356,7 +1331,7 @@ internal InputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1509,14 +1484,13 @@ internal InputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1526,10 +1500,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1586,7 +1556,7 @@ internal InputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1682,14 +1652,13 @@ internal InputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1699,10 +1668,6 @@ internal InputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlReferenceInputDataSourceProperties.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlReferenceInputDataSourceProperties.cs index 01358220ee7e5..3349286a84fad 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlReferenceInputDataSourceProperties.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/AzureSqlReferenceInputDataSourceProperties.cs @@ -13,6 +13,9 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models using Newtonsoft.Json; using System.Linq; + /// + /// Describes Azure SQL database reference input data source properties. + /// public partial class AzureSqlReferenceInputDataSourceProperties { /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CompileQuery.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CompileQuery.cs new file mode 100644 index 0000000000000..29aedd3772fb1 --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/CompileQuery.cs @@ -0,0 +1,129 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StreamAnalytics.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The query compilation object which defines the input, output, and + /// transformation for the query compilation. + /// + public partial class CompileQuery + { + /// + /// Initializes a new instance of the CompileQuery class. + /// + public CompileQuery() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CompileQuery class. + /// + /// The query to compile. + /// Describes the type of the job. Valid values + /// are `Cloud` and 'Edge'. Possible values include: 'Cloud', + /// 'Edge' + /// The inputs for the query compilation. + /// The functions for the query + /// compilation. + /// The query to compile. Possible + /// values include: '1.0' + public CompileQuery(string query, string jobType, IList inputs = default(IList), IList functions = default(IList), string compatibilityLevel = default(string)) + { + Query = query; + Inputs = inputs; + Functions = functions; + JobType = jobType; + CompatibilityLevel = compatibilityLevel; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the query to compile. + /// + [JsonProperty(PropertyName = "query")] + public string Query { get; set; } + + /// + /// Gets or sets the inputs for the query compilation. + /// + [JsonProperty(PropertyName = "inputs")] + public IList Inputs { get; set; } + + /// + /// Gets or sets the functions for the query compilation. + /// + [JsonProperty(PropertyName = "functions")] + public IList Functions { get; set; } + + /// + /// Gets or sets describes the type of the job. Valid values are + /// `Cloud` and 'Edge'. Possible values include: 'Cloud', 'Edge' + /// + [JsonProperty(PropertyName = "jobType")] + public string JobType { get; set; } + + /// + /// Gets or sets the query to compile. Possible values include: '1.0' + /// + [JsonProperty(PropertyName = "compatibilityLevel")] + public string CompatibilityLevel { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Query == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Query"); + } + if (JobType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "JobType"); + } + if (Inputs != null) + { + foreach (var element in Inputs) + { + if (element != null) + { + element.Validate(); + } + } + } + if (Functions != null) + { + foreach (var element1 in Functions) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + } + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionBinding.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionBinding.cs index fd6097c6bbbe2..6fa105b54ec5d 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionBinding.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionBinding.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models { - using Newtonsoft.Json; using System.Linq; /// /// The physical binding of the function. For example, in the Azure Machine /// Learning web service’s case, this describes the endpoint. /// - [Newtonsoft.Json.JsonObject("FunctionBinding")] public partial class FunctionBinding { /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionProperties.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionProperties.cs index cc6cf33a721c6..c7b7748e0c35b 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionProperties.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionProperties.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models /// /// The properties that are associated with a function. /// - [Newtonsoft.Json.JsonObject("FunctionProperties")] [Rest.Serialization.JsonTransformation] public partial class FunctionProperties { diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionRetrieveDefaultDefinitionParameters.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionRetrieveDefaultDefinitionParameters.cs index 093b045881982..30923e68a81cd 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionRetrieveDefaultDefinitionParameters.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/FunctionRetrieveDefaultDefinitionParameters.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models { - using Newtonsoft.Json; using System.Linq; /// /// Parameters used to specify the type of function to retrieve the default /// definition for. /// - [Newtonsoft.Json.JsonObject("FunctionRetrieveDefaultDefinitionParameters")] public partial class FunctionRetrieveDefaultDefinitionParameters { /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/InputProperties.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/InputProperties.cs index fd618c6effe88..747958f68cb3a 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/InputProperties.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/InputProperties.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models /// /// The properties that are associated with an input. /// - [Newtonsoft.Json.JsonObject("InputProperties")] public partial class InputProperties { /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/OutputDataSource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/OutputDataSource.cs index 4a075fdc0034a..f43854f245b86 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/OutputDataSource.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/OutputDataSource.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models { - using Newtonsoft.Json; using System.Linq; /// /// Describes the data source that output will be written to. /// - [Newtonsoft.Json.JsonObject("OutputDataSource")] public partial class OutputDataSource { /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryCompilationError.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryCompilationError.cs new file mode 100644 index 0000000000000..badb006eae902 --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryCompilationError.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.StreamAnalytics.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// An error produced by the compiler. + /// + public partial class QueryCompilationError + { + /// + /// Initializes a new instance of the QueryCompilationError class. + /// + public QueryCompilationError() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QueryCompilationError class. + /// + /// The content of the error message. + /// Describes the error location in the + /// original query. Not set if isGlobal is true. + /// Describes the error location in the + /// original query. Not set if isGlobal is true. + /// Describes the error location in the original + /// query. Not set if isGlobal is true. + /// Describes the error location in the + /// original query. Not set if isGlobal is true. + /// Whether the error is not for a specific part + /// but for the entire query. + public QueryCompilationError(string message = default(string), int? startLine = default(int?), int? startColumn = default(int?), int? endLine = default(int?), int? endColumn = default(int?), bool? isGlobal = default(bool?)) + { + Message = message; + StartLine = startLine; + StartColumn = startColumn; + EndLine = endLine; + EndColumn = endColumn; + IsGlobal = isGlobal; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the content of the error message. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets describes the error location in the original query. Not set if + /// isGlobal is true. + /// + [JsonProperty(PropertyName = "startLine")] + public int? StartLine { get; private set; } + + /// + /// Gets describes the error location in the original query. Not set if + /// isGlobal is true. + /// + [JsonProperty(PropertyName = "startColumn")] + public int? StartColumn { get; private set; } + + /// + /// Gets describes the error location in the original query. Not set if + /// isGlobal is true. + /// + [JsonProperty(PropertyName = "endLine")] + public int? EndLine { get; private set; } + + /// + /// Gets describes the error location in the original query. Not set if + /// isGlobal is true. + /// + [JsonProperty(PropertyName = "endColumn")] + public int? EndColumn { get; private set; } + + /// + /// Gets whether the error is not for a specific part but for the + /// entire query. + /// + [JsonProperty(PropertyName = "isGlobal")] + public bool? IsGlobal { get; private set; } + + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryCompilationResult.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryCompilationResult.cs new file mode 100644 index 0000000000000..48603d6868f44 --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryCompilationResult.cs @@ -0,0 +1,88 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StreamAnalytics.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The result of the query compilation request. + /// + public partial class QueryCompilationResult + { + /// + /// Initializes a new instance of the QueryCompilationResult class. + /// + public QueryCompilationResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QueryCompilationResult class. + /// + /// Error messages produced by the + /// compiler. + /// Warning messages produced by the + /// compiler. + /// All input names used by the query. + /// All output names used by the query. + /// All function names used by the + /// query. + public QueryCompilationResult(IList errors = default(IList), IList warnings = default(IList), IList inputs = default(IList), IList outputs = default(IList), IList functions = default(IList)) + { + Errors = errors; + Warnings = warnings; + Inputs = inputs; + Outputs = outputs; + Functions = functions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets error messages produced by the compiler. + /// + [JsonProperty(PropertyName = "errors")] + public IList Errors { get; private set; } + + /// + /// Gets warning messages produced by the compiler. + /// + [JsonProperty(PropertyName = "warnings")] + public IList Warnings { get; private set; } + + /// + /// Gets all input names used by the query. + /// + [JsonProperty(PropertyName = "inputs")] + public IList Inputs { get; private set; } + + /// + /// Gets all output names used by the query. + /// + [JsonProperty(PropertyName = "outputs")] + public IList Outputs { get; private set; } + + /// + /// Gets all function names used by the query. + /// + [JsonProperty(PropertyName = "functions")] + public IList Functions { get; private set; } + + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryFunction.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryFunction.cs new file mode 100644 index 0000000000000..af285dc4151fb --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryFunction.cs @@ -0,0 +1,115 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StreamAnalytics.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// A function for the query compilation. + /// + public partial class QueryFunction + { + /// + /// Initializes a new instance of the QueryFunction class. + /// + public QueryFunction() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QueryFunction class. + /// + /// The name of the function. + /// The type of the function. + /// The type of the function binding. + /// The inputs for the function. + /// An output for the function. + public QueryFunction(string name, string type, string bindingType, IList inputs, FunctionOutput output) + { + Name = name; + Type = type; + BindingType = bindingType; + Inputs = inputs; + Output = output; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the function. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the type of the function. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets the type of the function binding. + /// + [JsonProperty(PropertyName = "bindingType")] + public string BindingType { get; set; } + + /// + /// Gets or sets the inputs for the function. + /// + [JsonProperty(PropertyName = "inputs")] + public IList Inputs { get; set; } + + /// + /// Gets or sets an output for the function. + /// + [JsonProperty(PropertyName = "output")] + public FunctionOutput Output { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } + if (BindingType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "BindingType"); + } + if (Inputs == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Inputs"); + } + if (Output == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Output"); + } + } + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryInput.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryInput.cs new file mode 100644 index 0000000000000..c80a5c6bb38a6 --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryInput.cs @@ -0,0 +1,78 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StreamAnalytics.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// An input for the query compilation. + /// + public partial class QueryInput + { + /// + /// Initializes a new instance of the QueryInput class. + /// + public QueryInput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QueryInput class. + /// + /// The name of the input. + /// The type of the input, can be Stream or + /// Reference. + public QueryInput(string name, string type) + { + 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 input. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the type of the input, can be Stream or Reference. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } + } + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryTestingResult.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryTestingResult.cs new file mode 100644 index 0000000000000..92d802b035e45 --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryTestingResult.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StreamAnalytics.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The result of the query testing request. + /// + public partial class QueryTestingResult : Error + { + /// + /// Initializes a new instance of the QueryTestingResult class. + /// + public QueryTestingResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QueryTestingResult class. + /// + /// Error definition properties. + /// The status of the query testing request. + /// Possible values include: 'Started', 'Success', 'CompilerError', + /// 'RuntimeError', 'Timeout', 'UnknownError' + /// The SAS URL to the outputs payload. + public QueryTestingResult(ErrorError errorProperty = default(ErrorError), string status = default(string), string outputUri = default(string)) + : base(errorProperty) + { + Status = status; + OutputUri = outputUri; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the status of the query testing request. Possible + /// values include: 'Started', 'Success', 'CompilerError', + /// 'RuntimeError', 'Timeout', 'UnknownError' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets the SAS URL to the outputs payload. + /// + [JsonProperty(PropertyName = "outputUri")] + public string OutputUri { get; private set; } + + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryTestingResultException.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryTestingResultException.cs new file mode 100644 index 0000000000000..c1150ef368145 --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryTestingResultException.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.StreamAnalytics.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with QueryTestingResult + /// information. + /// + public partial class QueryTestingResultException : 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 QueryTestingResult Body { get; set; } + + /// + /// Initializes a new instance of the QueryTestingResultException class. + /// + public QueryTestingResultException() + { + } + + /// + /// Initializes a new instance of the QueryTestingResultException class. + /// + /// The exception message. + public QueryTestingResultException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the QueryTestingResultException class. + /// + /// The exception message. + /// Inner exception. + public QueryTestingResultException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryTestingResultStatus.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryTestingResultStatus.cs new file mode 100644 index 0000000000000..9e5c5ec82dc12 --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/QueryTestingResultStatus.cs @@ -0,0 +1,44 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StreamAnalytics.Models +{ + + /// + /// Defines values for QueryTestingResultStatus. + /// + public static class QueryTestingResultStatus + { + /// + /// The query testing operation was initiated. + /// + public const string Started = "Started"; + /// + /// The query testing operation succeeded. + /// + public const string Success = "Success"; + /// + /// The query testing operation failed due to a compiler error. + /// + public const string CompilerError = "CompilerError"; + /// + /// The query testing operation failed due to a runtime error. + /// + public const string RuntimeError = "RuntimeError"; + /// + /// The query testing operation failed due to a timeout. + /// + public const string Timeout = "Timeout"; + /// + /// The query testing operation failed due to an unknown error . + /// + public const string UnknownError = "UnknownError"; + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/RawOutputDatasource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/RawOutputDatasource.cs new file mode 100644 index 0000000000000..7d2200467f876 --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/RawOutputDatasource.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.StreamAnalytics.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes a raw output data source. This data source type is only + /// applicable/usable when using the query testing API. You cannot create a + /// job with this data source type or add an output of this data source + /// type to an existing job. + /// + [Newtonsoft.Json.JsonObject("Raw")] + [Rest.Serialization.JsonTransformation] + public partial class RawOutputDatasource : OutputDataSource + { + /// + /// Initializes a new instance of the RawOutputDatasource class. + /// + public RawOutputDatasource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RawOutputDatasource class. + /// + /// The SAS URL to a blob where the output + /// should be written. If this property is not set, output data will be + /// written into a temporary storage, and a SAS URL to that temporary + /// storage will be included in the result. + public RawOutputDatasource(string payloadUri = default(string)) + { + PayloadUri = payloadUri; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the SAS URL to a blob where the output should be + /// written. If this property is not set, output data will be written + /// into a temporary storage, and a SAS URL to that temporary storage + /// will be included in the result. + /// + [JsonProperty(PropertyName = "properties.payloadUri")] + public string PayloadUri { get; set; } + + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/RawReferenceInputDataSource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/RawReferenceInputDataSource.cs new file mode 100644 index 0000000000000..6de859f83a2a4 --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/RawReferenceInputDataSource.cs @@ -0,0 +1,75 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StreamAnalytics.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes a raw input data source that contains reference data. This + /// data source type is only applicable/usable when using the query testing + /// API. You cannot create a job with this data source type or add an input + /// of this data source type to an existing job. + /// + [Newtonsoft.Json.JsonObject("Raw")] + [Rest.Serialization.JsonTransformation] + public partial class RawReferenceInputDataSource : ReferenceInputDataSource + { + /// + /// Initializes a new instance of the RawReferenceInputDataSource + /// class. + /// + public RawReferenceInputDataSource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RawReferenceInputDataSource + /// class. + /// + /// The JSON serialized content of the input + /// data. Either payload or payloadUri must be set, but not both. + /// + /// The SAS URL to a blob containing the JSON + /// serialized content of the input data. Either payload or payloadUri + /// must be set, but not both. + public RawReferenceInputDataSource(string payload = default(string), string payloadUri = default(string)) + { + Payload = payload; + PayloadUri = payloadUri; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the JSON serialized content of the input data. Either + /// payload or payloadUri must be set, but not both. + /// + [JsonProperty(PropertyName = "properties.payload")] + public string Payload { get; set; } + + /// + /// Gets or sets the SAS URL to a blob containing the JSON serialized + /// content of the input data. Either payload or payloadUri must be + /// set, but not both. + /// + [JsonProperty(PropertyName = "properties.payloadUri")] + public string PayloadUri { get; set; } + + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/RawStreamInputDataSource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/RawStreamInputDataSource.cs new file mode 100644 index 0000000000000..2aceb77dba007 --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/RawStreamInputDataSource.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StreamAnalytics.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes a raw input data source that contains stream data. This data + /// source type is only applicable/usable when using the query testing API. + /// You cannot create a job with this data source type or add an input of + /// this data source type to an existing job. + /// + [Newtonsoft.Json.JsonObject("Raw")] + [Rest.Serialization.JsonTransformation] + public partial class RawStreamInputDataSource : StreamInputDataSource + { + /// + /// Initializes a new instance of the RawStreamInputDataSource class. + /// + public RawStreamInputDataSource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RawStreamInputDataSource class. + /// + /// The JSON serialized content of the input + /// data. Either payload or payloadUri must be set, but not both. + /// + /// The SAS URL to a blob containing the JSON + /// serialized content of the input data. Either payload or payloadUri + /// must be set, but not both. + public RawStreamInputDataSource(string payload = default(string), string payloadUri = default(string)) + { + Payload = payload; + PayloadUri = payloadUri; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the JSON serialized content of the input data. Either + /// payload or payloadUri must be set, but not both. + /// + [JsonProperty(PropertyName = "properties.payload")] + public string Payload { get; set; } + + /// + /// Gets or sets the SAS URL to a blob containing the JSON serialized + /// content of the input data. Either payload or payloadUri must be + /// set, but not both. + /// + [JsonProperty(PropertyName = "properties.payloadUri")] + public string PayloadUri { get; set; } + + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ReferenceInputDataSource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ReferenceInputDataSource.cs index 346e95f5a40c1..32e223c231ef7 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ReferenceInputDataSource.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/ReferenceInputDataSource.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models { - using Newtonsoft.Json; using System.Linq; /// /// Describes an input data source that contains reference data. /// - [Newtonsoft.Json.JsonObject("ReferenceInputDataSource")] public partial class ReferenceInputDataSource { /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Resource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Resource.cs index 3d7700faf54b8..9b1248758b238 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Resource.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Resource.cs @@ -15,6 +15,9 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models using Newtonsoft.Json; using System.Linq; + /// + /// The base resource definition + /// public partial class Resource : IResource { /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SampleInput.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SampleInput.cs new file mode 100644 index 0000000000000..7030446f6159b --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SampleInput.cs @@ -0,0 +1,96 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StreamAnalytics.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The stream analytics input to sample. + /// + public partial class SampleInput + { + /// + /// Initializes a new instance of the SampleInput class. + /// + public SampleInput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SampleInput class. + /// + /// The stream analytics input to sample. + /// Defaults to the default ASA job + /// compatibility level. Today it is 1.2 + /// The SAS URI of the storage blob for service + /// to write the sampled events to. If this parameter is not provided, + /// service will write events to he system account and share a + /// temporary SAS URI to it. + /// Defaults to en-US. + public SampleInput(Input input = default(Input), string compatibilityLevel = default(string), string eventsUri = default(string), string dataLocale = default(string)) + { + Input = input; + CompatibilityLevel = compatibilityLevel; + EventsUri = eventsUri; + DataLocale = dataLocale; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the stream analytics input to sample. + /// + [JsonProperty(PropertyName = "input")] + public Input Input { get; set; } + + /// + /// Gets or sets defaults to the default ASA job compatibility level. + /// Today it is 1.2 + /// + [JsonProperty(PropertyName = "compatibilityLevel")] + public string CompatibilityLevel { get; set; } + + /// + /// Gets or sets the SAS URI of the storage blob for service to write + /// the sampled events to. If this parameter is not provided, service + /// will write events to he system account and share a temporary SAS + /// URI to it. + /// + [JsonProperty(PropertyName = "eventsUri")] + public string EventsUri { get; set; } + + /// + /// Gets or sets defaults to en-US. + /// + [JsonProperty(PropertyName = "dataLocale")] + public string DataLocale { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Input != null) + { + Input.Validate(); + } + } + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SampleInputResult.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SampleInputResult.cs new file mode 100644 index 0000000000000..2b08ef3c54d9f --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SampleInputResult.cs @@ -0,0 +1,88 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StreamAnalytics.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The result of the sample input request. + /// + public partial class SampleInputResult : Error + { + /// + /// Initializes a new instance of the SampleInputResult class. + /// + public SampleInputResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SampleInputResult class. + /// + /// Error definition properties. + /// The status of the sample input request. + /// Possible values include: 'ReadAllEventsInRange', + /// 'NoEventsFoundInRange', 'ErrorConnectingToInput' + /// Diagnostics messages. E.g. message + /// indicating some partitions from the input have no data. + /// A SAS URL to download the sampled + /// input data. + /// The timestamp for the last event in + /// the data. It is in DateTime format. + public SampleInputResult(ErrorError errorProperty = default(ErrorError), string status = default(string), IList diagnostics = default(IList), string eventsDownloadUrl = default(string), string lastArrivalTime = default(string)) + : base(errorProperty) + { + Status = status; + Diagnostics = diagnostics; + EventsDownloadUrl = eventsDownloadUrl; + LastArrivalTime = lastArrivalTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the status of the sample input request. Possible + /// values include: 'ReadAllEventsInRange', 'NoEventsFoundInRange', + /// 'ErrorConnectingToInput' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets diagnostics messages. E.g. message indicating some partitions + /// from the input have no data. + /// + [JsonProperty(PropertyName = "diagnostics")] + public IList Diagnostics { get; private set; } + + /// + /// Gets a SAS URL to download the sampled input data. + /// + [JsonProperty(PropertyName = "eventsDownloadUrl")] + public string EventsDownloadUrl { get; private set; } + + /// + /// Gets the timestamp for the last event in the data. It is in + /// DateTime format. + /// + [JsonProperty(PropertyName = "lastArrivalTime")] + public string LastArrivalTime { get; private set; } + + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SampleInputResultException.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SampleInputResultException.cs new file mode 100644 index 0000000000000..deafb37d296cc --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SampleInputResultException.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.StreamAnalytics.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with SampleInputResult + /// information. + /// + public partial class SampleInputResultException : 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 SampleInputResult Body { get; set; } + + /// + /// Initializes a new instance of the SampleInputResultException class. + /// + public SampleInputResultException() + { + } + + /// + /// Initializes a new instance of the SampleInputResultException class. + /// + /// The exception message. + public SampleInputResultException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the SampleInputResultException class. + /// + /// The exception message. + /// Inner exception. + public SampleInputResultException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SampleInputResultStatus.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SampleInputResultStatus.cs new file mode 100644 index 0000000000000..09c0fba4d094c --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/SampleInputResultStatus.cs @@ -0,0 +1,33 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StreamAnalytics.Models +{ + + /// + /// Defines values for SampleInputResultStatus. + /// + public static class SampleInputResultStatus + { + /// + /// The sample input operation successfully read all the events in the + /// range. + /// + public const string ReadAllEventsInRange = "ReadAllEventsInRange"; + /// + /// The sample input operation found no events in the range. + /// + public const string NoEventsFoundInRange = "NoEventsFoundInRange"; + /// + /// The sample input operation failed to connect to the input. + /// + public const string ErrorConnectingToInput = "ErrorConnectingToInput"; + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Serialization.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Serialization.cs index a81f9df828729..5655cb74f3498 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Serialization.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/Serialization.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models { - using Newtonsoft.Json; using System.Linq; /// /// Describes how data from an input is serialized or how data is /// serialized when written to an output. /// - [Newtonsoft.Json.JsonObject("Serialization")] public partial class Serialization { /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamInputDataSource.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamInputDataSource.cs index 830160b864378..0b4be6974476f 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamInputDataSource.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamInputDataSource.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.StreamAnalytics.Models { - using Newtonsoft.Json; using System.Linq; /// /// Describes an input data source that contains stream data. /// - [Newtonsoft.Json.JsonObject("StreamInputDataSource")] public partial class StreamInputDataSource { /// diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamingJob.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamingJob.cs index f555eac45025c..f589b50324de3 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamingJob.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/StreamingJob.cs @@ -350,13 +350,13 @@ public StreamingJob() public JobStorageAccount JobStorageAccount { get; set; } /// - /// Gets valid values are JobStorageAccount and SystemAccount. If set - /// to JobStorageAccount, this requires the user to also specify + /// Gets or sets valid values are JobStorageAccount and SystemAccount. + /// If set to JobStorageAccount, this requires the user to also specify /// jobStorageAccount property. Possible values include: /// 'SystemAccount', 'JobStorageAccount' /// [JsonProperty(PropertyName = "properties.contentStoragePolicy")] - public string ContentStoragePolicy { get; private set; } + public string ContentStoragePolicy { get; set; } /// /// Gets or sets the storage account where the custom code artifacts diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestDatasourceResult.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestDatasourceResult.cs new file mode 100644 index 0000000000000..b3626c08a8754 --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestDatasourceResult.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StreamAnalytics.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The result of the test input or output request. + /// + public partial class TestDatasourceResult : Error + { + /// + /// Initializes a new instance of the TestDatasourceResult class. + /// + public TestDatasourceResult() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TestDatasourceResult class. + /// + /// Error definition properties. + /// The status of the sample output request. + /// Possible values include: 'TestSucceeded', 'TestFailed' + public TestDatasourceResult(ErrorError errorProperty = default(ErrorError), string status = default(string)) + : base(errorProperty) + { + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the status of the sample output request. Possible + /// values include: 'TestSucceeded', 'TestFailed' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestDatasourceResultException.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestDatasourceResultException.cs new file mode 100644 index 0000000000000..fc4d36af67f9c --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestDatasourceResultException.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.StreamAnalytics.Models +{ + using Microsoft.Rest; + + /// + /// Exception thrown for an invalid response with TestDatasourceResult + /// information. + /// + public partial class TestDatasourceResultException : 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 TestDatasourceResult Body { get; set; } + + /// + /// Initializes a new instance of the TestDatasourceResultException class. + /// + public TestDatasourceResultException() + { + } + + /// + /// Initializes a new instance of the TestDatasourceResultException class. + /// + /// The exception message. + public TestDatasourceResultException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the TestDatasourceResultException class. + /// + /// The exception message. + /// Inner exception. + public TestDatasourceResultException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestDatasourceResultStatus.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestDatasourceResultStatus.cs new file mode 100644 index 0000000000000..58ce67b52100d --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestDatasourceResultStatus.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StreamAnalytics.Models +{ + + /// + /// Defines values for TestDatasourceResultStatus. + /// + public static class TestDatasourceResultStatus + { + /// + /// The test datasource operation succeeded. + /// + public const string TestSucceeded = "TestSucceeded"; + /// + /// The test datasource operation failed. + /// + public const string TestFailed = "TestFailed"; + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestInput.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestInput.cs new file mode 100644 index 0000000000000..32d868f18759f --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestInput.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.StreamAnalytics.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A stream analytics input. + /// + public partial class TestInput + { + /// + /// Initializes a new instance of the TestInput class. + /// + public TestInput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TestInput class. + /// + /// The stream analytics input to test. + public TestInput(Input input) + { + Input = input; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the stream analytics input to test. + /// + [JsonProperty(PropertyName = "input")] + public Input Input { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Input == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Input"); + } + if (Input != null) + { + Input.Validate(); + } + } + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestOutput.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestOutput.cs new file mode 100644 index 0000000000000..1f9c30dd9bfac --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestOutput.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StreamAnalytics.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A stream analytics output. + /// + public partial class TestOutput + { + /// + /// Initializes a new instance of the TestOutput class. + /// + public TestOutput() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TestOutput class. + /// + /// The stream analytics output to test. + public TestOutput(Output output) + { + Output = output; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the stream analytics output to test. + /// + [JsonProperty(PropertyName = "output")] + public Output Output { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Output == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Output"); + } + } + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestQuery.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestQuery.cs new file mode 100644 index 0000000000000..fabfc2504ca18 --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestQuery.cs @@ -0,0 +1,81 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StreamAnalytics.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The request object for query testing. + /// + public partial class TestQuery + { + /// + /// Initializes a new instance of the TestQuery class. + /// + public TestQuery() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TestQuery class. + /// + /// Stream analytics job object which + /// defines the input, output, and transformation for the query + /// testing. + /// Diagnostics information related to query + /// testing. + public TestQuery(StreamingJob streamingJob, TestQueryDiagnostics diagnostics = default(TestQueryDiagnostics)) + { + Diagnostics = diagnostics; + StreamingJob = streamingJob; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets diagnostics information related to query testing. + /// + [JsonProperty(PropertyName = "diagnostics")] + public TestQueryDiagnostics Diagnostics { get; set; } + + /// + /// Gets or sets stream analytics job object which defines the input, + /// output, and transformation for the query testing. + /// + [JsonProperty(PropertyName = "streamingJob")] + public StreamingJob StreamingJob { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (StreamingJob == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "StreamingJob"); + } + if (Diagnostics != null) + { + Diagnostics.Validate(); + } + } + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestQueryDiagnostics.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestQueryDiagnostics.cs new file mode 100644 index 0000000000000..af56bf9283186 --- /dev/null +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Models/TestQueryDiagnostics.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.StreamAnalytics.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Diagnostics information related to query testing. + /// + public partial class TestQueryDiagnostics + { + /// + /// Initializes a new instance of the TestQueryDiagnostics class. + /// + public TestQueryDiagnostics() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TestQueryDiagnostics class. + /// + /// The SAS URI to the container or + /// directory. + /// The path to the subdirectory. + public TestQueryDiagnostics(string writeUri, string path = default(string)) + { + WriteUri = writeUri; + Path = path; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the SAS URI to the container or directory. + /// + [JsonProperty(PropertyName = "writeUri")] + public string WriteUri { get; set; } + + /// + /// Gets or sets the path to the subdirectory. + /// + [JsonProperty(PropertyName = "path")] + public string Path { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (WriteUri == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "WriteUri"); + } + } + } +} diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Operations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Operations.cs index 99665656166da..6c43bdabcd76a 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Operations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/Operations.cs @@ -59,7 +59,7 @@ internal Operations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -150,14 +150,13 @@ internal Operations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -167,10 +166,6 @@ internal Operations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -227,7 +222,7 @@ internal Operations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -323,14 +318,13 @@ internal Operations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -340,10 +334,6 @@ internal Operations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/OutputsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/OutputsOperations.cs index 51a7d1d755121..a20ca5dab89e5 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/OutputsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/OutputsOperations.cs @@ -83,7 +83,7 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -254,14 +254,13 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -271,10 +270,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -382,7 +377,7 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -544,14 +539,13 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -561,10 +555,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -640,7 +630,7 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -779,14 +769,13 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -796,10 +785,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -844,7 +829,7 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -986,14 +971,13 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1003,10 +987,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1085,7 +1065,7 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1226,14 +1206,13 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1243,10 +1222,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1352,7 +1327,7 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1501,14 +1476,13 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1518,10 +1492,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1578,7 +1548,7 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1674,14 +1644,13 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1691,10 +1660,6 @@ internal OutputsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SdkInfo_StreamAnalyticsManagementClient.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SdkInfo_StreamAnalyticsManagementClient.cs index e4e8ff6a0c06d..9f1b5a9355843 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SdkInfo_StreamAnalyticsManagementClient.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SdkInfo_StreamAnalyticsManagementClient.cs @@ -31,16 +31,5 @@ public static IEnumerable> ApiInfo_StreamAnalytics }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/streamanalytics/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\Users\\shangsu\\azure\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "5325e1398eb73e5de8c8a251909763b9e4803150"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamingJobsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamingJobsOperations.cs index 68704afdce881..a9c7a3f116ac6 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamingJobsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/StreamingJobsOperations.cs @@ -115,7 +115,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -271,14 +271,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -288,10 +287,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -393,7 +388,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -534,14 +529,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -551,10 +545,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -631,7 +621,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -766,14 +756,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -783,10 +772,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -847,7 +832,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -961,14 +946,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -978,10 +962,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1104,7 +1084,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1269,14 +1249,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1286,10 +1265,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1380,7 +1355,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1513,14 +1488,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1530,10 +1504,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1579,7 +1549,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1719,14 +1689,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1736,10 +1705,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1782,7 +1747,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -1915,14 +1880,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1932,10 +1896,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -1974,7 +1934,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2070,14 +2030,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2087,10 +2046,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -2147,7 +2102,7 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -2243,14 +2198,13 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2260,10 +2214,6 @@ internal StreamingJobsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SubscriptionsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SubscriptionsOperations.cs index 7c38bf1c710df..197d6f1fb9ecb 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SubscriptionsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SubscriptionsOperations.cs @@ -55,8 +55,8 @@ internal SubscriptionsOperations(StreamAnalyticsManagementClient client) /// region. /// /// - /// The region in which to retrieve the subscription's quota information. You - /// can find out which regions Azure Stream Analytics is supported in here: + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: /// https://azure.microsoft.com/en-us/regions/ /// /// @@ -65,7 +65,7 @@ internal SubscriptionsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -180,14 +180,13 @@ internal SubscriptionsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -197,10 +196,6 @@ internal SubscriptionsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -245,5 +240,1141 @@ internal SubscriptionsOperations(StreamAnalyticsManagementClient client) return _result; } + /// + /// Test the Stream Analytics query on a sample input. + /// + /// + /// The query testing object that defines the input, output, and transformation + /// for the query testing. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> TestQueryMethodWithHttpMessagesAsync(TestQuery testQuery, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginTestQueryMethodWithHttpMessagesAsync(testQuery, location, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Compile the Stream Analytics query. + /// + /// + /// The query compilation object which defines the input, output, and + /// transformation for the query compilation. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> CompileQueryMethodWithHttpMessagesAsync(CompileQuery compileQuery, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (compileQuery == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "compileQuery"); + } + if (compileQuery != null) + { + compileQuery.Validate(); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2017-04-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("compileQuery", compileQuery); + tracingParameters.Add("location", location); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CompileQueryMethod", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/compileQuery").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("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(compileQuery != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(compileQuery, 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 ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Sample the Stream Analytics input data. + /// + /// + /// Defines the necessary parameters for sampling the Stream Analytics input + /// data. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> SampleInputMethodWithHttpMessagesAsync(SampleInput sampleInput, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginSampleInputMethodWithHttpMessagesAsync(sampleInput, location, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Test the Stream Analytics input. + /// + /// + /// Defines the necessary parameters for testing the Stream Analytics input. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> TestInputMethodWithHttpMessagesAsync(TestInput testInput, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginTestInputMethodWithHttpMessagesAsync(testInput, location, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Test the Stream Analytics output. + /// + /// + /// Defines the necessary parameters for testing the Stream Analytics output. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> TestOutputMethodWithHttpMessagesAsync(TestOutput testOutput, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginTestOutputMethodWithHttpMessagesAsync(testOutput, location, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Test the Stream Analytics query on a sample input. + /// + /// + /// The query testing object that defines the input, output, and transformation + /// for the query testing. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> BeginTestQueryMethodWithHttpMessagesAsync(TestQuery testQuery, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (testQuery == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "testQuery"); + } + if (testQuery != null) + { + testQuery.Validate(); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2017-04-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("testQuery", testQuery); + tracingParameters.Add("location", location); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginTestQueryMethod", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/testQuery").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("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(testQuery != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(testQuery, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Sample the Stream Analytics input data. + /// + /// + /// Defines the necessary parameters for sampling the Stream Analytics input + /// data. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> BeginSampleInputMethodWithHttpMessagesAsync(SampleInput sampleInput, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (sampleInput == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "sampleInput"); + } + if (sampleInput != null) + { + sampleInput.Validate(); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2017-04-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("sampleInput", sampleInput); + tracingParameters.Add("location", location); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginSampleInputMethod", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/sampleInput").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("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(sampleInput != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(sampleInput, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _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 == 202) + { + _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; + } + + /// + /// Test the Stream Analytics input. + /// + /// + /// Defines the necessary parameters for testing the Stream Analytics input. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> BeginTestInputMethodWithHttpMessagesAsync(TestInput testInput, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (testInput == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "testInput"); + } + if (testInput != null) + { + testInput.Validate(); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2017-04-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("testInput", testInput); + tracingParameters.Add("location", location); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginTestInputMethod", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/testInput").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("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(testInput != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(testInput, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _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 == 202) + { + _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; + } + + /// + /// Test the Stream Analytics output. + /// + /// + /// Defines the necessary parameters for testing the Stream Analytics output. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation 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> BeginTestOutputMethodWithHttpMessagesAsync(TestOutput testOutput, string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (testOutput == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "testOutput"); + } + if (testOutput != null) + { + testOutput.Validate(); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (Client.SubscriptionId.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + string apiVersion = "2017-04-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("testOutput", testOutput); + tracingParameters.Add("location", location); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginTestOutputMethod", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/testOutput").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("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(testOutput != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(testOutput, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202) + { + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _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 == 202) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SubscriptionsOperationsExtensions.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SubscriptionsOperationsExtensions.cs index 80741daed24b7..4622aa95116bd 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SubscriptionsOperationsExtensions.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/SubscriptionsOperationsExtensions.cs @@ -29,8 +29,8 @@ public static partial class SubscriptionsOperationsExtensions /// The operations group for this extension method. /// /// - /// The region in which to retrieve the subscription's quota information. You - /// can find out which regions Azure Stream Analytics is supported in here: + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: /// https://azure.microsoft.com/en-us/regions/ /// public static SubscriptionQuotasListResult ListQuotas(this ISubscriptionsOperations operations, string location) @@ -46,8 +46,8 @@ public static SubscriptionQuotasListResult ListQuotas(this ISubscriptionsOperati /// The operations group for this extension method. /// /// - /// The region in which to retrieve the subscription's quota information. You - /// can find out which regions Azure Stream Analytics is supported in here: + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: /// https://azure.microsoft.com/en-us/regions/ /// /// @@ -61,5 +61,411 @@ public static SubscriptionQuotasListResult ListQuotas(this ISubscriptionsOperati } } + /// + /// Test the Stream Analytics query on a sample input. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The query testing object that defines the input, output, and transformation + /// for the query testing. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + public static QueryTestingResult TestQueryMethod(this ISubscriptionsOperations operations, TestQuery testQuery, string location) + { + return operations.TestQueryMethodAsync(testQuery, location).GetAwaiter().GetResult(); + } + + /// + /// Test the Stream Analytics query on a sample input. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The query testing object that defines the input, output, and transformation + /// for the query testing. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// The cancellation token. + /// + public static async Task TestQueryMethodAsync(this ISubscriptionsOperations operations, TestQuery testQuery, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.TestQueryMethodWithHttpMessagesAsync(testQuery, location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Compile the Stream Analytics query. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The query compilation object which defines the input, output, and + /// transformation for the query compilation. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + public static QueryCompilationResult CompileQueryMethod(this ISubscriptionsOperations operations, CompileQuery compileQuery, string location) + { + return operations.CompileQueryMethodAsync(compileQuery, location).GetAwaiter().GetResult(); + } + + /// + /// Compile the Stream Analytics query. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The query compilation object which defines the input, output, and + /// transformation for the query compilation. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// The cancellation token. + /// + public static async Task CompileQueryMethodAsync(this ISubscriptionsOperations operations, CompileQuery compileQuery, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CompileQueryMethodWithHttpMessagesAsync(compileQuery, location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Sample the Stream Analytics input data. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Defines the necessary parameters for sampling the Stream Analytics input + /// data. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + public static SampleInputResult SampleInputMethod(this ISubscriptionsOperations operations, SampleInput sampleInput, string location) + { + return operations.SampleInputMethodAsync(sampleInput, location).GetAwaiter().GetResult(); + } + + /// + /// Sample the Stream Analytics input data. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Defines the necessary parameters for sampling the Stream Analytics input + /// data. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// The cancellation token. + /// + public static async Task SampleInputMethodAsync(this ISubscriptionsOperations operations, SampleInput sampleInput, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.SampleInputMethodWithHttpMessagesAsync(sampleInput, location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Test the Stream Analytics input. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Defines the necessary parameters for testing the Stream Analytics input. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + public static TestDatasourceResult TestInputMethod(this ISubscriptionsOperations operations, TestInput testInput, string location) + { + return operations.TestInputMethodAsync(testInput, location).GetAwaiter().GetResult(); + } + + /// + /// Test the Stream Analytics input. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Defines the necessary parameters for testing the Stream Analytics input. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// The cancellation token. + /// + public static async Task TestInputMethodAsync(this ISubscriptionsOperations operations, TestInput testInput, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.TestInputMethodWithHttpMessagesAsync(testInput, location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Test the Stream Analytics output. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Defines the necessary parameters for testing the Stream Analytics output. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + public static TestDatasourceResult TestOutputMethod(this ISubscriptionsOperations operations, TestOutput testOutput, string location) + { + return operations.TestOutputMethodAsync(testOutput, location).GetAwaiter().GetResult(); + } + + /// + /// Test the Stream Analytics output. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Defines the necessary parameters for testing the Stream Analytics output. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// The cancellation token. + /// + public static async Task TestOutputMethodAsync(this ISubscriptionsOperations operations, TestOutput testOutput, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.TestOutputMethodWithHttpMessagesAsync(testOutput, location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Test the Stream Analytics query on a sample input. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The query testing object that defines the input, output, and transformation + /// for the query testing. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + public static QueryTestingResult BeginTestQueryMethod(this ISubscriptionsOperations operations, TestQuery testQuery, string location) + { + return operations.BeginTestQueryMethodAsync(testQuery, location).GetAwaiter().GetResult(); + } + + /// + /// Test the Stream Analytics query on a sample input. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The query testing object that defines the input, output, and transformation + /// for the query testing. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// The cancellation token. + /// + public static async Task BeginTestQueryMethodAsync(this ISubscriptionsOperations operations, TestQuery testQuery, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginTestQueryMethodWithHttpMessagesAsync(testQuery, location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Sample the Stream Analytics input data. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Defines the necessary parameters for sampling the Stream Analytics input + /// data. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + public static SampleInputResult BeginSampleInputMethod(this ISubscriptionsOperations operations, SampleInput sampleInput, string location) + { + return operations.BeginSampleInputMethodAsync(sampleInput, location).GetAwaiter().GetResult(); + } + + /// + /// Sample the Stream Analytics input data. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Defines the necessary parameters for sampling the Stream Analytics input + /// data. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// The cancellation token. + /// + public static async Task BeginSampleInputMethodAsync(this ISubscriptionsOperations operations, SampleInput sampleInput, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginSampleInputMethodWithHttpMessagesAsync(sampleInput, location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Test the Stream Analytics input. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Defines the necessary parameters for testing the Stream Analytics input. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + public static TestDatasourceResult BeginTestInputMethod(this ISubscriptionsOperations operations, TestInput testInput, string location) + { + return operations.BeginTestInputMethodAsync(testInput, location).GetAwaiter().GetResult(); + } + + /// + /// Test the Stream Analytics input. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Defines the necessary parameters for testing the Stream Analytics input. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// The cancellation token. + /// + public static async Task BeginTestInputMethodAsync(this ISubscriptionsOperations operations, TestInput testInput, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginTestInputMethodWithHttpMessagesAsync(testInput, location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Test the Stream Analytics output. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Defines the necessary parameters for testing the Stream Analytics output. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + public static TestDatasourceResult BeginTestOutputMethod(this ISubscriptionsOperations operations, TestOutput testOutput, string location) + { + return operations.BeginTestOutputMethodAsync(testOutput, location).GetAwaiter().GetResult(); + } + + /// + /// Test the Stream Analytics output. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Defines the necessary parameters for testing the Stream Analytics output. + /// + /// + /// The region to which the request is sent. You can find out which regions + /// Azure Stream Analytics is supported in here: + /// https://azure.microsoft.com/en-us/regions/ + /// + /// + /// The cancellation token. + /// + public static async Task BeginTestOutputMethodAsync(this ISubscriptionsOperations operations, TestOutput testOutput, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginTestOutputMethodWithHttpMessagesAsync(testOutput, location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/TransformationsOperations.cs b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/TransformationsOperations.cs index 3969ceef4a452..2c18c4b7ec4cb 100644 --- a/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/TransformationsOperations.cs +++ b/sdk/streamanalytics/Microsoft.Azure.Management.StreamAnalytics/src/Generated/TransformationsOperations.cs @@ -83,7 +83,7 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -254,14 +254,13 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -271,10 +270,6 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -383,7 +378,7 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -545,14 +540,13 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -562,10 +556,6 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -641,7 +631,7 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -783,14 +773,13 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + Error _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -800,10 +789,6 @@ internal TransformationsOperations(StreamAnalyticsManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex);