diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertProcessingRulesOperations.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertProcessingRulesOperations.cs index 7a2e11b02e94..f59031d9219e 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertProcessingRulesOperations.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertProcessingRulesOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// AlertProcessingRulesOperations operations. /// - internal partial class AlertProcessingRulesOperations : IServiceOperations, IAlertProcessingRulesOperations + internal partial class AlertProcessingRulesOperations : Microsoft.Rest.IServiceOperations, IAlertProcessingRulesOperations { /// /// Initializes a new instance of the AlertProcessingRulesOperations class. @@ -36,13 +24,13 @@ internal partial class AlertProcessingRulesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal AlertProcessingRulesOperations(AlertsManagementClient client) + internal AlertProcessingRulesOperations (AlertsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,13 +47,13 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -74,36 +62,44 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task,AlertProcessingRulesListBySubscriptionHeaders>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task,AlertProcessingRulesListBySubscriptionHeaders>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } string apiVersion = "2021-08-08"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/actionRules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -113,25 +109,24 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -143,50 +138,51 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -196,9 +192,10 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse,AlertProcessingRulesListBySubscriptionHeaders>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse,AlertProcessingRulesListBySubscriptionHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -209,38 +206,42 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all alert processing rules in a resource group. /// @@ -253,13 +254,13 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -268,42 +269,51 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task,AlertProcessingRulesListByResourceGroupHeaders>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task,AlertProcessingRulesListByResourceGroupHeaders>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + string apiVersion = "2021-08-08"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -313,25 +323,24 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -343,50 +352,51 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -396,9 +406,10 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse,AlertProcessingRulesListByResourceGroupHeaders>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse,AlertProcessingRulesListByResourceGroupHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -409,38 +420,42 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get an alert processing rule by name. /// @@ -456,13 +471,13 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -471,48 +486,58 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByNameWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetByNameWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (alertProcessingRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "alertProcessingRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "alertProcessingRuleName"); } + string apiVersion = "2021-08-08"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("alertProcessingRuleName", alertProcessingRuleName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetByName", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetByName", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{alertProcessingRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{alertProcessingRuleName}", System.Uri.EscapeDataString(alertProcessingRuleName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -522,25 +547,24 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -552,50 +576,51 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -605,9 +630,10 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -618,38 +644,42 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Create or update an alert processing rule. /// @@ -668,13 +698,13 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -683,57 +713,67 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, AlertProcessingRule alertProcessingRule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, AlertProcessingRule alertProcessingRule, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (alertProcessingRule == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "alertProcessingRule"); } - if (Client.SubscriptionId != null) + if (alertProcessingRule != null) { - if (Client.SubscriptionId.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); - } + alertProcessingRule.Validate(); } - if (resourceGroupName == null) + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (alertProcessingRuleName == null) + if (this.Client.SubscriptionId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "alertProcessingRuleName"); + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (alertProcessingRule == null) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "alertProcessingRule"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - if (alertProcessingRule != null) + + if (alertProcessingRuleName == null) { - alertProcessingRule.Validate(); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "alertProcessingRuleName"); } + string apiVersion = "2021-08-08"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("alertProcessingRuleName", alertProcessingRuleName); - tracingParameters.Add("alertProcessingRule", alertProcessingRule); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("alertProcessingRule", alertProcessingRule); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{alertProcessingRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{alertProcessingRuleName}", System.Uri.EscapeDataString(alertProcessingRuleName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -743,25 +783,24 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -773,56 +812,57 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(alertProcessingRule != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(alertProcessingRule, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(alertProcessingRule, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -832,9 +872,10 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -845,16 +886,16 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } // Deserialize Response @@ -863,38 +904,42 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Delete an alert processing rule. /// @@ -910,10 +955,10 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -922,48 +967,58 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (alertProcessingRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "alertProcessingRuleName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "alertProcessingRuleName"); } + string apiVersion = "2021-08-08"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("alertProcessingRuleName", alertProcessingRuleName); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{alertProcessingRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{alertProcessingRuleName}", System.Uri.EscapeDataString(alertProcessingRuleName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -973,25 +1028,24 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1003,50 +1057,51 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1056,33 +1111,38 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationHeaderResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Enable, disable, or update tags for an alert processing rule. /// @@ -1101,13 +1161,13 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1116,53 +1176,63 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, PatchObject alertProcessingRulePatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, PatchObject alertProcessingRulePatch, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (alertProcessingRulePatch == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "alertProcessingRulePatch"); + } + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } + if (alertProcessingRuleName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "alertProcessingRuleName"); - } - if (alertProcessingRulePatch == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "alertProcessingRulePatch"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "alertProcessingRuleName"); } + string apiVersion = "2021-08-08"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("alertProcessingRuleName", alertProcessingRuleName); - tracingParameters.Add("alertProcessingRulePatch", alertProcessingRulePatch); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("alertProcessingRulePatch", alertProcessingRulePatch); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/actionRules/{alertProcessingRuleName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{alertProcessingRuleName}", System.Uri.EscapeDataString(alertProcessingRuleName)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1172,25 +1242,24 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1202,56 +1271,57 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(alertProcessingRulePatch != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(alertProcessingRulePatch, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(alertProcessingRulePatch, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1261,9 +1331,10 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1274,38 +1345,42 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all alert processing rules in a subscription. /// @@ -1318,13 +1393,13 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1333,51 +1408,53 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task,AlertProcessingRulesListBySubscriptionHeaders>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task,AlertProcessingRulesListBySubscriptionHeaders>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1389,50 +1466,51 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1442,9 +1520,10 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse,AlertProcessingRulesListBySubscriptionHeaders>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse,AlertProcessingRulesListBySubscriptionHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1455,38 +1534,42 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// List all alert processing rules in a resource group. /// @@ -1499,13 +1582,13 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1514,51 +1597,53 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task,AlertProcessingRulesListByResourceGroupHeaders>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task,AlertProcessingRulesListByResourceGroupHeaders>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1570,50 +1655,51 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1623,9 +1709,10 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse,AlertProcessingRulesListByResourceGroupHeaders>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse,AlertProcessingRulesListByResourceGroupHeaders>(); _result.Request = _httpRequest; _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); @@ -1636,37 +1723,41 @@ internal AlertProcessingRulesOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertProcessingRulesOperationsExtensions.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertProcessingRulesOperationsExtensions.cs index 08854f4e5149..c7ca9d5a7d20 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertProcessingRulesOperationsExtensions.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertProcessingRulesOperationsExtensions.cs @@ -1,327 +1,298 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for AlertProcessingRulesOperations. + /// Extension methods for AlertProcessingRulesOperations /// public static partial class AlertProcessingRulesOperationsExtensions { - /// - /// List all alert processing rules in a subscription. - /// - /// - /// The operations group for this extension method. - /// - public static IPage ListBySubscription(this IAlertProcessingRulesOperations operations) - { - return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); - } + /// + /// List all alert processing rules in a subscription. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscription(this IAlertProcessingRulesOperations operations) + { + return ((IAlertProcessingRulesOperations)operations).ListBySubscriptionAsync().GetAwaiter().GetResult(); + } - /// - /// List all alert processing rules in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionAsync(this IAlertProcessingRulesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List all alert processing rules in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionAsync(this IAlertProcessingRulesOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List all alert processing rules in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IAlertProcessingRulesOperations operations, string resourceGroupName) + { + return ((IAlertProcessingRulesOperations)operations).ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } - /// - /// List all alert processing rules in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - public static IPage ListByResourceGroup(this IAlertProcessingRulesOperations operations, string resourceGroupName) + /// + /// List all alert processing rules in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupAsync(this IAlertProcessingRulesOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get an alert processing rule by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name of the alert processing rule that needs to be fetched. + /// + public static AlertProcessingRule GetByName(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName) + { + return ((IAlertProcessingRulesOperations)operations).GetByNameAsync(resourceGroupName, alertProcessingRuleName).GetAwaiter().GetResult(); + } - /// - /// List all alert processing rules in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IAlertProcessingRulesOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get an alert processing rule by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name of the alert processing rule that needs to be fetched. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetByNameAsync(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetByNameWithHttpMessagesAsync(resourceGroupName, alertProcessingRuleName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Create or update an alert processing rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name of the alert processing rule that needs to be created/updated. + /// + public static AlertProcessingRule CreateOrUpdate(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, AlertProcessingRule alertProcessingRule) + { + return ((IAlertProcessingRulesOperations)operations).CreateOrUpdateAsync(resourceGroupName, alertProcessingRuleName, alertProcessingRule).GetAwaiter().GetResult(); + } - /// - /// Get an alert processing rule by name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name of the alert processing rule that needs to be fetched. - /// - public static AlertProcessingRule GetByName(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName) + /// + /// Create or update an alert processing rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name of the alert processing rule that needs to be created/updated. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, AlertProcessingRule alertProcessingRule, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, alertProcessingRuleName, alertProcessingRule, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetByNameAsync(resourceGroupName, alertProcessingRuleName).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Delete an alert processing rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name of the alert processing rule that needs to be deleted. + /// + public static AlertProcessingRulesDeleteHeaders Delete(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName) + { + return ((IAlertProcessingRulesOperations)operations).DeleteAsync(resourceGroupName, alertProcessingRuleName).GetAwaiter().GetResult(); + } - /// - /// Get an alert processing rule by name. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name of the alert processing rule that needs to be fetched. - /// - /// - /// The cancellation token. - /// - public static async Task GetByNameAsync(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Delete an alert processing rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name of the alert processing rule that needs to be deleted. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, alertProcessingRuleName, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetByNameWithHttpMessagesAsync(resourceGroupName, alertProcessingRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Headers; } + } + /// + /// Enable, disable, or update tags for an alert processing rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name that needs to be updated. + /// + public static AlertProcessingRule Update(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, PatchObject alertProcessingRulePatch) + { + return ((IAlertProcessingRulesOperations)operations).UpdateAsync(resourceGroupName, alertProcessingRuleName, alertProcessingRulePatch).GetAwaiter().GetResult(); + } - /// - /// Create or update an alert processing rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name of the alert processing rule that needs to be created/updated. - /// - /// - /// Alert processing rule to be created/updated. - /// - public static AlertProcessingRule CreateOrUpdate(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, AlertProcessingRule alertProcessingRule) + /// + /// Enable, disable, or update tags for an alert processing rule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Resource group name where the resource is created. + /// + /// + /// The name that needs to be updated. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task UpdateAsync(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, PatchObject alertProcessingRulePatch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, alertProcessingRuleName, alertProcessingRulePatch, null, cancellationToken).ConfigureAwait(false)) { - return operations.CreateOrUpdateAsync(resourceGroupName, alertProcessingRuleName, alertProcessingRule).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// List all alert processing rules in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListBySubscriptionNext(this IAlertProcessingRulesOperations operations, string nextPageLink) + { + return ((IAlertProcessingRulesOperations)operations).ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Create or update an alert processing rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name of the alert processing rule that needs to be created/updated. - /// - /// - /// Alert processing rule to be created/updated. - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, AlertProcessingRule alertProcessingRule, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List all alert processing rules in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListBySubscriptionNextAsync(this IAlertProcessingRulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, alertProcessingRuleName, alertProcessingRule, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List all alert processing rules in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IAlertProcessingRulesOperations operations, string nextPageLink) + { + return ((IAlertProcessingRulesOperations)operations).ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Delete an alert processing rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name of the alert processing rule that needs to be deleted. - /// - public static AlertProcessingRulesDeleteHeaders Delete(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName) + /// + /// List all alert processing rules in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListByResourceGroupNextAsync(this IAlertProcessingRulesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.DeleteAsync(resourceGroupName, alertProcessingRuleName).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Delete an alert processing rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name of the alert processing rule that needs to be deleted. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, alertProcessingRuleName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Headers; - } - } - - /// - /// Enable, disable, or update tags for an alert processing rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name that needs to be updated. - /// - /// - /// Parameters supplied to the operation. - /// - public static AlertProcessingRule Update(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, PatchObject alertProcessingRulePatch) - { - return operations.UpdateAsync(resourceGroupName, alertProcessingRuleName, alertProcessingRulePatch).GetAwaiter().GetResult(); - } - - /// - /// Enable, disable, or update tags for an alert processing rule. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Resource group name where the resource is created. - /// - /// - /// The name that needs to be updated. - /// - /// - /// Parameters supplied to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IAlertProcessingRulesOperations operations, string resourceGroupName, string alertProcessingRuleName, PatchObject alertProcessingRulePatch, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, alertProcessingRuleName, alertProcessingRulePatch, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List all alert processing rules in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListBySubscriptionNext(this IAlertProcessingRulesOperations operations, string nextPageLink) - { - return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List all alert processing rules in a subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListBySubscriptionNextAsync(this IAlertProcessingRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List all alert processing rules in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListByResourceGroupNext(this IAlertProcessingRulesOperations operations, string nextPageLink) - { - return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List all alert processing rules in a resource group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupNextAsync(this IAlertProcessingRulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertsManagementClient.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertsManagementClient.cs index 849fa654f73b..fcba544ba7e2 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertsManagementClient.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertsManagementClient.cs @@ -1,91 +1,76 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Serialization; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - public partial class AlertsManagementClient : ServiceClient, IAlertsManagementClient, IAzureClient + /// + /// APIs for Azure alert processing rules CRUD operations. + /// + public partial class AlertsManagementClient : Microsoft.Rest.ServiceClient, IAlertsManagementClient, IAzureClient { /// /// The base URI of the service. /// public System.Uri BaseUri { get; set; } - /// /// Gets or sets json serialization settings. /// - public JsonSerializerSettings SerializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public JsonSerializerSettings DeserializationSettings { get; private set; } - + public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public ServiceClientCredentials Credentials { get; private set; } + public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } /// /// The ID of the target subscription. /// - public string SubscriptionId { get; set; } + public string SubscriptionId { get; set;} /// /// The preferred language for the response. /// - public string AcceptLanguage { get; set; } + public string AcceptLanguage { get; set;} /// - /// The retry timeout in seconds for Long Running Operations. Default value is - /// 30. + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. /// - public int? LongRunningOperationRetryTimeout { get; set; } + public int? LongRunningOperationRetryTimeout { get; set;} /// - /// Whether a unique x-ms-client-request-id should be generated. When set to - /// true a unique x-ms-client-request-id value is generated and included in - /// each request. Default is true. + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. /// - public bool? GenerateClientRequestId { get; set; } + public bool? GenerateClientRequestId { get; set;} /// - /// Gets the IAlertProcessingRulesOperations. + /// Gets the IAlertProcessingRulesOperations /// public virtual IAlertProcessingRulesOperations AlertProcessingRules { get; private set; } - /// - /// Gets the ISmartGroupsOperations. + /// Gets the ISmartGroupsOperations /// public virtual ISmartGroupsOperations SmartGroups { get; private set; } - /// - /// Gets the IOperations. + /// Gets the IOperations /// public virtual IOperations Operations { get; private set; } - /// - /// Gets the IAlertsOperations. + /// Gets the IAlertsOperations /// public virtual IAlertsOperations Alerts { get; private set; } - /// /// Initializes a new instance of the AlertsManagementClient class. /// @@ -94,24 +79,22 @@ public partial class AlertsManagementClient : ServiceClient /// /// True: will dispose the provided httpClient on calling AlertsManagementClient.Dispose(). False: will not dispose provided httpClient - protected AlertsManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + protected AlertsManagementClient(System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the AlertsManagementClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected AlertsManagementClient(params DelegatingHandler[] handlers) : base(handlers) + protected AlertsManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - Initialize(); + this.Initialize(); } - /// - /// Initializes a new instance of the AlertsManagementClient class. + /// Initializes a new instance of the AlertsManagementClient class. /// /// /// Optional. The http client handler used to handle http transport. @@ -119,11 +102,10 @@ protected AlertsManagementClient(params DelegatingHandler[] handlers) : base(han /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected AlertsManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected AlertsManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - Initialize(); + this.Initialize(); } - /// /// Initializes a new instance of the AlertsManagementClient class. /// @@ -136,15 +118,14 @@ protected AlertsManagementClient(HttpClientHandler rootHandler, params Delegatin /// /// Thrown when a required parameter is null /// - protected AlertsManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + protected AlertsManagementClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the AlertsManagementClient class. /// @@ -160,15 +141,15 @@ protected AlertsManagementClient(System.Uri baseUri, params DelegatingHandler[] /// /// Thrown when a required parameter is null /// - protected AlertsManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected AlertsManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - BaseUri = baseUri; + + this.BaseUri = baseUri; } - /// /// Initializes a new instance of the AlertsManagementClient class. /// @@ -181,23 +162,23 @@ protected AlertsManagementClient(System.Uri baseUri, HttpClientHandler rootHandl /// /// Thrown when a required parameter is null /// - public AlertsManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public AlertsManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the AlertsManagementClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -208,23 +189,23 @@ public AlertsManagementClient(ServiceClientCredentials credentials, params Deleg /// /// Thrown when a required parameter is null /// - public AlertsManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + public AlertsManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the AlertsManagementClient class. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -236,26 +217,26 @@ public AlertsManagementClient(ServiceClientCredentials credentials, HttpClient h /// /// Thrown when a required parameter is null /// - public AlertsManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public AlertsManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - Credentials = credentials; - if (Credentials != null) + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the AlertsManagementClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// @@ -264,7 +245,7 @@ public AlertsManagementClient(ServiceClientCredentials credentials, HttpClientHa /// /// Thrown when a required parameter is null /// - public AlertsManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + public AlertsManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -274,33 +255,30 @@ public AlertsManagementClient(System.Uri baseUri, ServiceClientCredentials crede { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// Initializes a new instance of the AlertsManagementClient class. /// /// /// Optional. The base URI of the service. /// - /// + /// /// Required. Credentials needed for the client to connect to Azure. /// /// /// Optional. The http client handler used to handle http transport. /// - /// - /// Optional. The delegating handlers to add to the http client pipeline. - /// /// /// Thrown when a required parameter is null /// - public AlertsManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + public AlertsManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -310,66 +288,67 @@ public AlertsManagementClient(System.Uri baseUri, ServiceClientCredentials crede { throw new System.ArgumentNullException("credentials"); } - BaseUri = baseUri; - Credentials = credentials; - if (Credentials != null) + this.BaseUri = baseUri; + this.Credentials = credentials; + if (this.Credentials != null) { - Credentials.InitializeServiceClient(this); + this.Credentials.InitializeServiceClient(this); } + } - /// /// An optional partial-method to perform custom initialization. /// partial void CustomInitialize(); + /// /// Initializes client properties. /// private void Initialize() { - AlertProcessingRules = new AlertProcessingRulesOperations(this); - SmartGroups = new SmartGroupsOperations(this); - Operations = new Operations(this); - Alerts = new AlertsOperations(this); - BaseUri = new System.Uri("https://management.azure.com"); - AcceptLanguage = "en-US"; - LongRunningOperationRetryTimeout = 30; - GenerateClientRequestId = true; - SerializationSettings = new JsonSerializerSettings + this.AlertProcessingRules = new AlertProcessingRulesOperations(this); + this.SmartGroups = new SmartGroupsOperations(this); + this.Operations = new Operations(this); + this.Alerts = new AlertsOperations(this); + this.BaseUri = new System.Uri("https://management.azure.com"); + this.AcceptLanguage = "en-US"; + this.LongRunningOperationRetryTimeout = 30; + this.GenerateClientRequestId = true; + SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings = new JsonSerializerSettings + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new ReadOnlyJsonContractResolver(), - Converters = new List + ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + Converters = new System.Collections.Generic.List { - new Iso8601TimeSpanConverter() + new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("recurrenceType")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("recurrenceType")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("actionType")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("actionType")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("metadataIdentifier")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("metadataIdentifier")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("recurrenceType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("recurrenceType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("actionType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("actionType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("metadataIdentifier")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("metadataIdentifier")); CustomInitialize(); - DeserializationSettings.Converters.Add(new TransformationJsonConverter()); - DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertsOperations.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertsOperations.cs index 0e0903a4904c..46a1c9a85f3b 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertsOperations.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// AlertsOperations operations. /// - internal partial class AlertsOperations : IServiceOperations, IAlertsOperations + internal partial class AlertsOperations : Microsoft.Rest.IServiceOperations, IAlertsOperations { /// /// Initializes a new instance of the AlertsOperations class. @@ -36,13 +24,13 @@ internal partial class AlertsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal AlertsOperations(AlertsManagementClient client) + internal AlertsOperations (AlertsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -59,35 +47,49 @@ internal AlertsOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task> MetaDataWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> MetaDataWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - string apiVersion = "2019-05-05-preview"; + + string identifier = "MonitorServiceList"; + + + string apiVersion = "2019-05-05-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("identifier", identifier); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "MetaData", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "MetaData", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.AlertsManagement/alertsMetaData").ToString(); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -101,25 +103,24 @@ internal AlertsOperations(AlertsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -131,50 +132,51 @@ internal AlertsOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -184,9 +186,10 @@ internal AlertsOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -197,33 +200,34 @@ internal AlertsOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// List all existing alerts, where the results can be filtered on the basis of - /// multiple parameters (e.g. time range). The results can then be sorted on - /// the basis specific fields, with the default being lastModifiedDateTime. + /// List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime. /// /// - /// Filter by target resource( which is full ARM ID) Default value is select - /// all. + /// Filter by target resource( which is full ARM ID) Default value is select all. /// /// /// Filter by target resource type. Default value is select all. @@ -232,24 +236,16 @@ internal AlertsOperations(AlertsManagementClient client) /// Filter by target resource group name. Default value is select all. /// /// - /// Filter by monitor service which generates the alert instance. Default value - /// is select all. Possible values include: 'Application Insights', - /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog - /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log - /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', - /// 'VM Insights', 'Zabbix' + /// Filter by monitor service which generates the alert instance. Default value is select all. /// /// - /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default - /// value is to select all. Possible values include: 'Fired', 'Resolved' + /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all. /// /// - /// Filter by severity. Default value is select all. Possible values include: - /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' + /// Filter by severity. Default value is select all. /// /// /// Filter by state of the alert instance. Default value is to select all. - /// Possible values include: 'New', 'Acknowledged', 'Closed' /// /// /// Filter by specific alert rule. Default value is to select all. @@ -258,45 +254,28 @@ internal AlertsOperations(AlertsManagementClient client) /// Filter the alerts list by the Smart Group Id. Default value is none. /// /// - /// Include context which has contextual data specific to the monitor service. - /// Default value is false' + /// Include context which has contextual data specific to the monitor service. Default value is false' /// /// - /// Include egress config which would be used for displaying the content in - /// portal. Default value is 'false'. + /// Include egress config which would be used for displaying the content in portal. Default value is 'false'. /// /// - /// Determines number of alerts returned per page in response. Permissible - /// value is between 1 to 250. When the "includeContent" filter is selected, - /// maximum value allowed is 25. Default value is 25. + /// Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the "includeContent" filter is selected, maximum value allowed is 25. Default value is 25. /// /// - /// Sort the query results by input field, Default value is - /// 'lastModifiedDateTime'. Possible values include: 'name', 'severity', - /// 'alertState', 'monitorCondition', 'targetResource', 'targetResourceName', - /// 'targetResourceGroup', 'targetResourceType', 'startDateTime', - /// 'lastModifiedDateTime' + /// Sort the query results by input field, Default value is 'lastModifiedDateTime'. /// /// - /// Sort the query results order in either ascending or descending. Default - /// value is 'desc' for time fields and 'asc' for others. Possible values - /// include: 'asc', 'desc' + /// Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others. /// /// - /// This filter allows to selection of the fields(comma separated) which would - /// be part of the essential section. This would allow to project only the - /// required fields rather than getting entire content. Default is to fetch - /// all the fields in the essentials section. + /// This filter allows to selection of the fields(comma separated) which would be part of the essential section. This would allow to project only the required fields rather than getting entire content. Default is to fetch all the fields in the essentials section. /// /// /// Filter by time range by below listed values. Default value is 1 day. - /// Possible values include: '1h', '1d', '7d', '30d' /// /// - /// Filter by custom time range in the format - /// <start-time>/<end-time> where time is in (ISO-8601 format)'. - /// Permissible values is within 30 days from query time. Either timeRange or - /// customTimeRange could be used but not both. Default is none. + /// Filter by custom time range in the format <start-time>/<end-time> where time is in (ISO-8601 format)'. Permissible values is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none. /// /// /// Headers that will be added to request. @@ -304,13 +283,13 @@ internal AlertsOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -319,27 +298,48 @@ internal AlertsOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetAllWithHttpMessagesAsync(string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string smartGroupId = default(string), bool? includeContext = default(bool?), bool? includeEgressConfig = default(bool?), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), string select = default(string), string timeRange = default(string), string customTimeRange = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> GetAllWithHttpMessagesAsync(string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string smartGroupId = default(string), bool? includeContext = default(bool?), bool? includeEgressConfig = default(bool?), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), string select = default(string), string timeRange = default(string), string customTimeRange = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + + + + + + + + + + + + + + + + + string apiVersion = "2019-05-05-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("targetResource", targetResource); tracingParameters.Add("targetResourceType", targetResourceType); tracingParameters.Add("targetResourceGroup", targetResourceGroup); @@ -358,14 +358,18 @@ internal AlertsOperations(AlertsManagementClient client) tracingParameters.Add("timeRange", timeRange); tracingParameters.Add("customTimeRange", customTimeRange); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (targetResource != null) { _queryParameters.Add(string.Format("targetResource={0}", System.Uri.EscapeDataString(targetResource))); @@ -404,15 +408,15 @@ internal AlertsOperations(AlertsManagementClient client) } if (includeContext != null) { - _queryParameters.Add(string.Format("includeContext={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(includeContext, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("includeContext={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(includeContext, this.Client.SerializationSettings).Trim('"')))); } if (includeEgressConfig != null) { - _queryParameters.Add(string.Format("includeEgressConfig={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(includeEgressConfig, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("includeEgressConfig={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(includeEgressConfig, this.Client.SerializationSettings).Trim('"')))); } if (pageCount != null) { - _queryParameters.Add(string.Format("pageCount={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(pageCount, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("pageCount={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(pageCount, this.Client.SerializationSettings).Trim('"')))); } if (sortBy != null) { @@ -443,25 +447,24 @@ internal AlertsOperations(AlertsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -473,50 +476,51 @@ internal AlertsOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -526,9 +530,10 @@ internal AlertsOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -539,31 +544,32 @@ internal AlertsOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Get a specific alert. - /// - /// /// Get information related to a specific alert - /// + /// /// /// Unique ID of an alert instance. /// @@ -573,13 +579,13 @@ internal AlertsOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -588,42 +594,51 @@ internal AlertsOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByIdWithHttpMessagesAsync(string alertId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetByIdWithHttpMessagesAsync(string alertId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (alertId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "alertId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "alertId"); } + string apiVersion = "2019-05-05-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("alertId", alertId); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetById", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetById", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{alertId}", System.Uri.EscapeDataString(alertId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -633,25 +648,24 @@ internal AlertsOperations(AlertsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -663,50 +677,51 @@ internal AlertsOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -716,9 +731,10 @@ internal AlertsOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -729,25 +745,29 @@ internal AlertsOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Change the state of an alert. /// @@ -755,8 +775,7 @@ internal AlertsOperations(AlertsManagementClient client) /// Unique ID of an alert instance. /// /// - /// New state of the alert. Possible values include: 'New', 'Acknowledged', - /// 'Closed' + /// New state of the alert. /// /// /// reason of change alert state @@ -767,13 +786,13 @@ internal AlertsOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -782,48 +801,59 @@ internal AlertsOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ChangeStateWithHttpMessagesAsync(string alertId, string newState, Comments comment = default(Comments), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ChangeStateWithHttpMessagesAsync(string alertId, string newState, Comments comment = default(Comments), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (alertId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "alertId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "alertId"); } + if (newState == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "newState"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "newState"); } + string apiVersion = "2019-05-05-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("alertId", alertId); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("newState", newState); + tracingParameters.Add("comment", comment); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ChangeState", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ChangeState", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/changestate").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{alertId}", System.Uri.EscapeDataString(alertId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -837,25 +867,24 @@ internal AlertsOperations(AlertsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -867,56 +896,57 @@ internal AlertsOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; if(comment != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(comment, Client.SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(comment, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.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) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -926,9 +956,10 @@ internal AlertsOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -939,28 +970,31 @@ internal AlertsOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Get the history of an alert, which captures any monitor condition changes - /// (Fired/Resolved) and alert state changes (New/Acknowledged/Closed). + /// Get the history of an alert, which captures any monitor condition changes (Fired/Resolved) and alert state changes (New/Acknowledged/Closed). /// /// /// Unique ID of an alert instance. @@ -971,13 +1005,13 @@ internal AlertsOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -986,42 +1020,51 @@ internal AlertsOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetHistoryWithHttpMessagesAsync(string alertId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetHistoryWithHttpMessagesAsync(string alertId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (alertId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "alertId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "alertId"); } + string apiVersion = "2019-05-05-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("alertId", alertId); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetHistory", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetHistory", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/history").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{alertId}", System.Uri.EscapeDataString(alertId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -1031,25 +1074,24 @@ internal AlertsOperations(AlertsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1061,50 +1103,51 @@ internal AlertsOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1114,9 +1157,10 @@ internal AlertsOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1127,43 +1171,40 @@ internal AlertsOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Get a summarized count of your alerts grouped by various parameters (e.g. - /// grouping by 'Severity' returns the count of alerts for each severity). + /// Get a summarized count of your alerts grouped by various parameters (e.g. grouping by 'Severity' returns the count of alerts for each severity). /// /// - /// This parameter allows the result set to be grouped by input fields (Maximum - /// 2 comma separated fields supported). For example, groupby=severity or - /// groupby=severity,alertstate. Possible values include: 'severity', - /// 'alertState', 'monitorCondition', 'monitorService', 'signalType', - /// 'alertRule' + /// This parameter allows the result set to be grouped by input fields (Maximum 2 comma separated fields supported). For example, groupby=severity or groupby=severity,alertstate. /// /// - /// Include count of the SmartGroups as part of the summary. Default value is - /// 'false'. + /// Include count of the SmartGroups as part of the summary. Default value is 'false'. /// /// - /// Filter by target resource( which is full ARM ID) Default value is select - /// all. + /// Filter by target resource( which is full ARM ID) Default value is select all. /// /// /// Filter by target resource type. Default value is select all. @@ -1172,37 +1213,25 @@ internal AlertsOperations(AlertsManagementClient client) /// Filter by target resource group name. Default value is select all. /// /// - /// Filter by monitor service which generates the alert instance. Default value - /// is select all. Possible values include: 'Application Insights', - /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog - /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log - /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', - /// 'VM Insights', 'Zabbix' + /// Filter by monitor service which generates the alert instance. Default value is select all. /// /// - /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default - /// value is to select all. Possible values include: 'Fired', 'Resolved' + /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all. /// /// - /// Filter by severity. Default value is select all. Possible values include: - /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' + /// Filter by severity. Default value is select all. /// /// /// Filter by state of the alert instance. Default value is to select all. - /// Possible values include: 'New', 'Acknowledged', 'Closed' /// /// /// Filter by specific alert rule. Default value is to select all. /// /// /// Filter by time range by below listed values. Default value is 1 day. - /// Possible values include: '1h', '1d', '7d', '30d' /// /// - /// Filter by custom time range in the format - /// <start-time>/<end-time> where time is in (ISO-8601 format)'. - /// Permissible values is within 30 days from query time. Either timeRange or - /// customTimeRange could be used but not both. Default is none. + /// Filter by custom time range in the format <start-time>/<end-time> where time is in (ISO-8601 format)'. Permissible values is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none. /// /// /// Headers that will be added to request. @@ -1210,13 +1239,13 @@ internal AlertsOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1225,31 +1254,47 @@ internal AlertsOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetSummaryWithHttpMessagesAsync(string groupby, bool? includeSmartGroupsCount = default(bool?), string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string timeRange = default(string), string customTimeRange = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetSummaryWithHttpMessagesAsync(string groupby, bool? includeSmartGroupsCount = default(bool?), string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string timeRange = default(string), string customTimeRange = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (groupby == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "groupby"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "groupby"); } + + + + + + + + + + + + string apiVersion = "2019-05-05-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("groupby", groupby); tracingParameters.Add("includeSmartGroupsCount", includeSmartGroupsCount); tracingParameters.Add("targetResource", targetResource); @@ -1263,21 +1308,25 @@ internal AlertsOperations(AlertsManagementClient client) tracingParameters.Add("timeRange", timeRange); tracingParameters.Add("customTimeRange", customTimeRange); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetSummary", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetSummary", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alertsSummary").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (groupby != null) { _queryParameters.Add(string.Format("groupby={0}", System.Uri.EscapeDataString(groupby))); } if (includeSmartGroupsCount != null) { - _queryParameters.Add(string.Format("includeSmartGroupsCount={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(includeSmartGroupsCount, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("includeSmartGroupsCount={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(includeSmartGroupsCount, this.Client.SerializationSettings).Trim('"')))); } if (targetResource != null) { @@ -1328,25 +1377,24 @@ internal AlertsOperations(AlertsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1358,50 +1406,51 @@ internal AlertsOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1411,9 +1460,10 @@ internal AlertsOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1424,29 +1474,31 @@ internal AlertsOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// List all existing alerts, where the results can be filtered on the basis of - /// multiple parameters (e.g. time range). The results can then be sorted on - /// the basis specific fields, with the default being lastModifiedDateTime. + /// List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime. /// /// /// The NextLink from the previous successful call to List operation. @@ -1457,13 +1509,13 @@ internal AlertsOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -1472,51 +1524,53 @@ internal AlertsOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> GetAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1528,50 +1582,51 @@ internal AlertsOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1581,9 +1636,10 @@ internal AlertsOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1594,24 +1650,28 @@ internal AlertsOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertsOperationsExtensions.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertsOperationsExtensions.cs index 6a36cc299c71..f7a76293cac5 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertsOperationsExtensions.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/AlertsOperationsExtensions.cs @@ -1,539 +1,409 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for AlertsOperations. + /// Extension methods for AlertsOperations /// public static partial class AlertsOperationsExtensions { - /// - /// List alerts meta data information based on value of identifier parameter. - /// - /// - /// The operations group for this extension method. - /// - public static AlertsMetaData MetaData(this IAlertsOperations operations) - { - return operations.MetaDataAsync().GetAwaiter().GetResult(); - } - - /// - /// List alerts meta data information based on value of identifier parameter. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task MetaDataAsync(this IAlertsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.MetaDataWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List all existing alerts, where the results can be filtered on the basis of - /// multiple parameters (e.g. time range). The results can then be sorted on - /// the basis specific fields, with the default being lastModifiedDateTime. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Filter by target resource( which is full ARM ID) Default value is select - /// all. - /// - /// - /// Filter by target resource type. Default value is select all. - /// - /// - /// Filter by target resource group name. Default value is select all. - /// - /// - /// Filter by monitor service which generates the alert instance. Default value - /// is select all. Possible values include: 'Application Insights', - /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog - /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log - /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', - /// 'VM Insights', 'Zabbix' - /// - /// - /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default - /// value is to select all. Possible values include: 'Fired', 'Resolved' - /// - /// - /// Filter by severity. Default value is select all. Possible values include: - /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' - /// - /// - /// Filter by state of the alert instance. Default value is to select all. - /// Possible values include: 'New', 'Acknowledged', 'Closed' - /// - /// - /// Filter by specific alert rule. Default value is to select all. - /// - /// - /// Filter the alerts list by the Smart Group Id. Default value is none. - /// - /// - /// Include context which has contextual data specific to the monitor service. - /// Default value is false' - /// - /// - /// Include egress config which would be used for displaying the content in - /// portal. Default value is 'false'. - /// - /// - /// Determines number of alerts returned per page in response. Permissible - /// value is between 1 to 250. When the "includeContent" filter is selected, - /// maximum value allowed is 25. Default value is 25. - /// - /// - /// Sort the query results by input field, Default value is - /// 'lastModifiedDateTime'. Possible values include: 'name', 'severity', - /// 'alertState', 'monitorCondition', 'targetResource', 'targetResourceName', - /// 'targetResourceGroup', 'targetResourceType', 'startDateTime', - /// 'lastModifiedDateTime' - /// - /// - /// Sort the query results order in either ascending or descending. Default - /// value is 'desc' for time fields and 'asc' for others. Possible values - /// include: 'asc', 'desc' - /// - /// - /// This filter allows to selection of the fields(comma separated) which would - /// be part of the essential section. This would allow to project only the - /// required fields rather than getting entire content. Default is to fetch - /// all the fields in the essentials section. - /// - /// - /// Filter by time range by below listed values. Default value is 1 day. - /// Possible values include: '1h', '1d', '7d', '30d' - /// - /// - /// Filter by custom time range in the format - /// <start-time>/<end-time> where time is in (ISO-8601 format)'. - /// Permissible values is within 30 days from query time. Either timeRange or - /// customTimeRange could be used but not both. Default is none. - /// - public static IPage GetAll(this IAlertsOperations operations, string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string smartGroupId = default(string), bool? includeContext = default(bool?), bool? includeEgressConfig = default(bool?), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), string select = default(string), string timeRange = default(string), string customTimeRange = default(string)) - { - return operations.GetAllAsync(targetResource, targetResourceType, targetResourceGroup, monitorService, monitorCondition, severity, alertState, alertRule, smartGroupId, includeContext, includeEgressConfig, pageCount, sortBy, sortOrder, select, timeRange, customTimeRange).GetAwaiter().GetResult(); - } - - /// - /// List all existing alerts, where the results can be filtered on the basis of - /// multiple parameters (e.g. time range). The results can then be sorted on - /// the basis specific fields, with the default being lastModifiedDateTime. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Filter by target resource( which is full ARM ID) Default value is select - /// all. - /// - /// - /// Filter by target resource type. Default value is select all. - /// - /// - /// Filter by target resource group name. Default value is select all. - /// - /// - /// Filter by monitor service which generates the alert instance. Default value - /// is select all. Possible values include: 'Application Insights', - /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog - /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log - /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', - /// 'VM Insights', 'Zabbix' - /// - /// - /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default - /// value is to select all. Possible values include: 'Fired', 'Resolved' - /// - /// - /// Filter by severity. Default value is select all. Possible values include: - /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' - /// - /// - /// Filter by state of the alert instance. Default value is to select all. - /// Possible values include: 'New', 'Acknowledged', 'Closed' - /// - /// - /// Filter by specific alert rule. Default value is to select all. - /// - /// - /// Filter the alerts list by the Smart Group Id. Default value is none. - /// - /// - /// Include context which has contextual data specific to the monitor service. - /// Default value is false' - /// - /// - /// Include egress config which would be used for displaying the content in - /// portal. Default value is 'false'. - /// - /// - /// Determines number of alerts returned per page in response. Permissible - /// value is between 1 to 250. When the "includeContent" filter is selected, - /// maximum value allowed is 25. Default value is 25. - /// - /// - /// Sort the query results by input field, Default value is - /// 'lastModifiedDateTime'. Possible values include: 'name', 'severity', - /// 'alertState', 'monitorCondition', 'targetResource', 'targetResourceName', - /// 'targetResourceGroup', 'targetResourceType', 'startDateTime', - /// 'lastModifiedDateTime' - /// - /// - /// Sort the query results order in either ascending or descending. Default - /// value is 'desc' for time fields and 'asc' for others. Possible values - /// include: 'asc', 'desc' - /// - /// - /// This filter allows to selection of the fields(comma separated) which would - /// be part of the essential section. This would allow to project only the - /// required fields rather than getting entire content. Default is to fetch - /// all the fields in the essentials section. - /// - /// - /// Filter by time range by below listed values. Default value is 1 day. - /// Possible values include: '1h', '1d', '7d', '30d' - /// - /// - /// Filter by custom time range in the format - /// <start-time>/<end-time> where time is in (ISO-8601 format)'. - /// Permissible values is within 30 days from query time. Either timeRange or - /// customTimeRange could be used but not both. Default is none. - /// - /// - /// The cancellation token. - /// - public static async Task> GetAllAsync(this IAlertsOperations operations, string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string smartGroupId = default(string), bool? includeContext = default(bool?), bool? includeEgressConfig = default(bool?), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), string select = default(string), string timeRange = default(string), string customTimeRange = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAllWithHttpMessagesAsync(targetResource, targetResourceType, targetResourceGroup, monitorService, monitorCondition, severity, alertState, alertRule, smartGroupId, includeContext, includeEgressConfig, pageCount, sortBy, sortOrder, select, timeRange, customTimeRange, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get a specific alert. - /// - /// - /// Get information related to a specific alert - /// - /// - /// The operations group for this extension method. - /// - /// - /// Unique ID of an alert instance. - /// - public static Alert GetById(this IAlertsOperations operations, string alertId) - { - return operations.GetByIdAsync(alertId).GetAwaiter().GetResult(); - } + /// + /// List alerts meta data information based on value of identifier parameter. + /// + /// + /// The operations group for this extension method. + /// + public static AlertsMetaData MetaData(this IAlertsOperations operations) + { + return ((IAlertsOperations)operations).MetaDataAsync().GetAwaiter().GetResult(); + } - /// - /// Get a specific alert. - /// - /// - /// Get information related to a specific alert - /// - /// - /// The operations group for this extension method. - /// - /// - /// Unique ID of an alert instance. - /// - /// - /// The cancellation token. - /// - public static async Task GetByIdAsync(this IAlertsOperations operations, string alertId, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List alerts meta data information based on value of identifier parameter. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task MetaDataAsync(this IAlertsOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.MetaDataWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetByIdWithHttpMessagesAsync(alertId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Filter by target resource( which is full ARM ID) Default value is select all. + /// + /// + /// Filter by target resource type. Default value is select all. + /// + /// + /// Filter by target resource group name. Default value is select all. + /// + /// + /// Filter by monitor service which generates the alert instance. Default value is select all. + /// + /// + /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all. + /// + /// + /// Filter by severity. Default value is select all. + /// + /// + /// Filter by state of the alert instance. Default value is to select all. + /// + /// + /// Filter by specific alert rule. Default value is to select all. + /// + /// + /// Filter the alerts list by the Smart Group Id. Default value is none. + /// + /// + /// Include context which has contextual data specific to the monitor service. Default value is false' + /// + /// + /// Include egress config which would be used for displaying the content in portal. Default value is 'false'. + /// + /// + /// Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the "includeContent" filter is selected, maximum value allowed is 25. Default value is 25. + /// + /// + /// Sort the query results by input field, Default value is 'lastModifiedDateTime'. + /// + /// + /// Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others. + /// + /// + /// This filter allows to selection of the fields(comma separated) which would be part of the essential section. This would allow to project only the required fields rather than getting entire content. Default is to fetch all the fields in the essentials section. + /// + /// + /// Filter by time range by below listed values. Default value is 1 day. + /// + /// + /// Filter by custom time range in the format <start-time>/<end-time> where time is in (ISO-8601 format)'. Permissible values is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none. + /// + public static Microsoft.Rest.Azure.IPage GetAll(this IAlertsOperations operations, string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string smartGroupId = default(string), bool? includeContext = default(bool?), bool? includeEgressConfig = default(bool?), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), string select = default(string), string timeRange = default(string), string customTimeRange = default(string)) + { + return ((IAlertsOperations)operations).GetAllAsync(targetResource, targetResourceType, targetResourceGroup, monitorService, monitorCondition, severity, alertState, alertRule, smartGroupId, includeContext, includeEgressConfig, pageCount, sortBy, sortOrder, select, timeRange, customTimeRange).GetAwaiter().GetResult(); + } - /// - /// Change the state of an alert. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Unique ID of an alert instance. - /// - /// - /// New state of the alert. Possible values include: 'New', 'Acknowledged', - /// 'Closed' - /// - /// - /// reason of change alert state - /// - public static Alert ChangeState(this IAlertsOperations operations, string alertId, string newState, Comments comment = default(Comments)) + /// + /// List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Filter by target resource( which is full ARM ID) Default value is select all. + /// + /// + /// Filter by target resource type. Default value is select all. + /// + /// + /// Filter by target resource group name. Default value is select all. + /// + /// + /// Filter by monitor service which generates the alert instance. Default value is select all. + /// + /// + /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all. + /// + /// + /// Filter by severity. Default value is select all. + /// + /// + /// Filter by state of the alert instance. Default value is to select all. + /// + /// + /// Filter by specific alert rule. Default value is to select all. + /// + /// + /// Filter the alerts list by the Smart Group Id. Default value is none. + /// + /// + /// Include context which has contextual data specific to the monitor service. Default value is false' + /// + /// + /// Include egress config which would be used for displaying the content in portal. Default value is 'false'. + /// + /// + /// Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the "includeContent" filter is selected, maximum value allowed is 25. Default value is 25. + /// + /// + /// Sort the query results by input field, Default value is 'lastModifiedDateTime'. + /// + /// + /// Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others. + /// + /// + /// This filter allows to selection of the fields(comma separated) which would be part of the essential section. This would allow to project only the required fields rather than getting entire content. Default is to fetch all the fields in the essentials section. + /// + /// + /// Filter by time range by below listed values. Default value is 1 day. + /// + /// + /// Filter by custom time range in the format <start-time>/<end-time> where time is in (ISO-8601 format)'. Permissible values is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> GetAllAsync(this IAlertsOperations operations, string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string smartGroupId = default(string), bool? includeContext = default(bool?), bool? includeEgressConfig = default(bool?), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), string select = default(string), string timeRange = default(string), string customTimeRange = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAllWithHttpMessagesAsync(targetResource, targetResourceType, targetResourceGroup, monitorService, monitorCondition, severity, alertState, alertRule, smartGroupId, includeContext, includeEgressConfig, pageCount, sortBy, sortOrder, select, timeRange, customTimeRange, null, cancellationToken).ConfigureAwait(false)) { - return operations.ChangeStateAsync(alertId, newState, comment).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get information related to a specific alert + /// + /// + /// The operations group for this extension method. + /// + /// + /// Unique ID of an alert instance. + /// + public static Alert GetById(this IAlertsOperations operations, string alertId) + { + return ((IAlertsOperations)operations).GetByIdAsync(alertId).GetAwaiter().GetResult(); + } - /// - /// Change the state of an alert. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Unique ID of an alert instance. - /// - /// - /// New state of the alert. Possible values include: 'New', 'Acknowledged', - /// 'Closed' - /// - /// - /// reason of change alert state - /// - /// - /// The cancellation token. - /// - public static async Task ChangeStateAsync(this IAlertsOperations operations, string alertId, string newState, Comments comment = default(Comments), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get information related to a specific alert + /// + /// + /// The operations group for this extension method. + /// + /// + /// Unique ID of an alert instance. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetByIdAsync(this IAlertsOperations operations, string alertId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetByIdWithHttpMessagesAsync(alertId, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ChangeStateWithHttpMessagesAsync(alertId, newState, comment, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Change the state of an alert. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Unique ID of an alert instance. + /// + /// + /// New state of the alert. + /// + public static Alert ChangeState(this IAlertsOperations operations, string alertId, string newState, Comments comment = default(Comments)) + { + return ((IAlertsOperations)operations).ChangeStateAsync(alertId, newState, comment).GetAwaiter().GetResult(); + } - /// - /// Get the history of an alert, which captures any monitor condition changes - /// (Fired/Resolved) and alert state changes (New/Acknowledged/Closed). - /// - /// - /// The operations group for this extension method. - /// - /// - /// Unique ID of an alert instance. - /// - public static AlertModification GetHistory(this IAlertsOperations operations, string alertId) + /// + /// Change the state of an alert. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Unique ID of an alert instance. + /// + /// + /// New state of the alert. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ChangeStateAsync(this IAlertsOperations operations, string alertId, string newState, Comments comment = default(Comments), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ChangeStateWithHttpMessagesAsync(alertId, newState, comment, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetHistoryAsync(alertId).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get the history of an alert, which captures any monitor condition changes (Fired/Resolved) and alert state changes (New/Acknowledged/Closed). + /// + /// + /// The operations group for this extension method. + /// + /// + /// Unique ID of an alert instance. + /// + public static AlertModification GetHistory(this IAlertsOperations operations, string alertId) + { + return ((IAlertsOperations)operations).GetHistoryAsync(alertId).GetAwaiter().GetResult(); + } - /// - /// Get the history of an alert, which captures any monitor condition changes - /// (Fired/Resolved) and alert state changes (New/Acknowledged/Closed). - /// - /// - /// The operations group for this extension method. - /// - /// - /// Unique ID of an alert instance. - /// - /// - /// The cancellation token. - /// - public static async Task GetHistoryAsync(this IAlertsOperations operations, string alertId, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get the history of an alert, which captures any monitor condition changes (Fired/Resolved) and alert state changes (New/Acknowledged/Closed). + /// + /// + /// The operations group for this extension method. + /// + /// + /// Unique ID of an alert instance. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetHistoryAsync(this IAlertsOperations operations, string alertId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetHistoryWithHttpMessagesAsync(alertId, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetHistoryWithHttpMessagesAsync(alertId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Get a summarized count of your alerts grouped by various parameters (e.g. grouping by 'Severity' returns the count of alerts for each severity). + /// + /// + /// The operations group for this extension method. + /// + /// + /// This parameter allows the result set to be grouped by input fields (Maximum 2 comma separated fields supported). For example, groupby=severity or groupby=severity,alertstate. + /// + /// + /// Include count of the SmartGroups as part of the summary. Default value is 'false'. + /// + /// + /// Filter by target resource( which is full ARM ID) Default value is select all. + /// + /// + /// Filter by target resource type. Default value is select all. + /// + /// + /// Filter by target resource group name. Default value is select all. + /// + /// + /// Filter by monitor service which generates the alert instance. Default value is select all. + /// + /// + /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all. + /// + /// + /// Filter by severity. Default value is select all. + /// + /// + /// Filter by state of the alert instance. Default value is to select all. + /// + /// + /// Filter by specific alert rule. Default value is to select all. + /// + /// + /// Filter by time range by below listed values. Default value is 1 day. + /// + /// + /// Filter by custom time range in the format <start-time>/<end-time> where time is in (ISO-8601 format)'. Permissible values is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none. + /// + public static AlertsSummary GetSummary(this IAlertsOperations operations, string groupby, bool? includeSmartGroupsCount = default(bool?), string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string timeRange = default(string), string customTimeRange = default(string)) + { + return ((IAlertsOperations)operations).GetSummaryAsync(groupby, includeSmartGroupsCount, targetResource, targetResourceType, targetResourceGroup, monitorService, monitorCondition, severity, alertState, alertRule, timeRange, customTimeRange).GetAwaiter().GetResult(); + } - /// - /// Get a summarized count of your alerts grouped by various parameters (e.g. - /// grouping by 'Severity' returns the count of alerts for each severity). - /// - /// - /// The operations group for this extension method. - /// - /// - /// This parameter allows the result set to be grouped by input fields (Maximum - /// 2 comma separated fields supported). For example, groupby=severity or - /// groupby=severity,alertstate. Possible values include: 'severity', - /// 'alertState', 'monitorCondition', 'monitorService', 'signalType', - /// 'alertRule' - /// - /// - /// Include count of the SmartGroups as part of the summary. Default value is - /// 'false'. - /// - /// - /// Filter by target resource( which is full ARM ID) Default value is select - /// all. - /// - /// - /// Filter by target resource type. Default value is select all. - /// - /// - /// Filter by target resource group name. Default value is select all. - /// - /// - /// Filter by monitor service which generates the alert instance. Default value - /// is select all. Possible values include: 'Application Insights', - /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog - /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log - /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', - /// 'VM Insights', 'Zabbix' - /// - /// - /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default - /// value is to select all. Possible values include: 'Fired', 'Resolved' - /// - /// - /// Filter by severity. Default value is select all. Possible values include: - /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' - /// - /// - /// Filter by state of the alert instance. Default value is to select all. - /// Possible values include: 'New', 'Acknowledged', 'Closed' - /// - /// - /// Filter by specific alert rule. Default value is to select all. - /// - /// - /// Filter by time range by below listed values. Default value is 1 day. - /// Possible values include: '1h', '1d', '7d', '30d' - /// - /// - /// Filter by custom time range in the format - /// <start-time>/<end-time> where time is in (ISO-8601 format)'. - /// Permissible values is within 30 days from query time. Either timeRange or - /// customTimeRange could be used but not both. Default is none. - /// - public static AlertsSummary GetSummary(this IAlertsOperations operations, string groupby, bool? includeSmartGroupsCount = default(bool?), string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string timeRange = default(string), string customTimeRange = default(string)) + /// + /// Get a summarized count of your alerts grouped by various parameters (e.g. grouping by 'Severity' returns the count of alerts for each severity). + /// + /// + /// The operations group for this extension method. + /// + /// + /// This parameter allows the result set to be grouped by input fields (Maximum 2 comma separated fields supported). For example, groupby=severity or groupby=severity,alertstate. + /// + /// + /// Include count of the SmartGroups as part of the summary. Default value is 'false'. + /// + /// + /// Filter by target resource( which is full ARM ID) Default value is select all. + /// + /// + /// Filter by target resource type. Default value is select all. + /// + /// + /// Filter by target resource group name. Default value is select all. + /// + /// + /// Filter by monitor service which generates the alert instance. Default value is select all. + /// + /// + /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all. + /// + /// + /// Filter by severity. Default value is select all. + /// + /// + /// Filter by state of the alert instance. Default value is to select all. + /// + /// + /// Filter by specific alert rule. Default value is to select all. + /// + /// + /// Filter by time range by below listed values. Default value is 1 day. + /// + /// + /// Filter by custom time range in the format <start-time>/<end-time> where time is in (ISO-8601 format)'. Permissible values is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetSummaryAsync(this IAlertsOperations operations, string groupby, bool? includeSmartGroupsCount = default(bool?), string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string timeRange = default(string), string customTimeRange = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetSummaryWithHttpMessagesAsync(groupby, includeSmartGroupsCount, targetResource, targetResourceType, targetResourceGroup, monitorService, monitorCondition, severity, alertState, alertRule, timeRange, customTimeRange, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetSummaryAsync(groupby, includeSmartGroupsCount, targetResource, targetResourceType, targetResourceGroup, monitorService, monitorCondition, severity, alertState, alertRule, timeRange, customTimeRange).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage GetAllNext(this IAlertsOperations operations, string nextPageLink) + { + return ((IAlertsOperations)operations).GetAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Get a summarized count of your alerts grouped by various parameters (e.g. - /// grouping by 'Severity' returns the count of alerts for each severity). - /// - /// - /// The operations group for this extension method. - /// - /// - /// This parameter allows the result set to be grouped by input fields (Maximum - /// 2 comma separated fields supported). For example, groupby=severity or - /// groupby=severity,alertstate. Possible values include: 'severity', - /// 'alertState', 'monitorCondition', 'monitorService', 'signalType', - /// 'alertRule' - /// - /// - /// Include count of the SmartGroups as part of the summary. Default value is - /// 'false'. - /// - /// - /// Filter by target resource( which is full ARM ID) Default value is select - /// all. - /// - /// - /// Filter by target resource type. Default value is select all. - /// - /// - /// Filter by target resource group name. Default value is select all. - /// - /// - /// Filter by monitor service which generates the alert instance. Default value - /// is select all. Possible values include: 'Application Insights', - /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog - /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log - /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', - /// 'VM Insights', 'Zabbix' - /// - /// - /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default - /// value is to select all. Possible values include: 'Fired', 'Resolved' - /// - /// - /// Filter by severity. Default value is select all. Possible values include: - /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' - /// - /// - /// Filter by state of the alert instance. Default value is to select all. - /// Possible values include: 'New', 'Acknowledged', 'Closed' - /// - /// - /// Filter by specific alert rule. Default value is to select all. - /// - /// - /// Filter by time range by below listed values. Default value is 1 day. - /// Possible values include: '1h', '1d', '7d', '30d' - /// - /// - /// Filter by custom time range in the format - /// <start-time>/<end-time> where time is in (ISO-8601 format)'. - /// Permissible values is within 30 days from query time. Either timeRange or - /// customTimeRange could be used but not both. Default is none. - /// - /// - /// The cancellation token. - /// - public static async Task GetSummaryAsync(this IAlertsOperations operations, string groupby, bool? includeSmartGroupsCount = default(bool?), string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string timeRange = default(string), string customTimeRange = default(string), CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> GetAllNextAsync(this IAlertsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetSummaryWithHttpMessagesAsync(groupby, includeSmartGroupsCount, targetResource, targetResourceType, targetResourceGroup, monitorService, monitorCondition, severity, alertState, alertRule, timeRange, customTimeRange, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } - - /// - /// List all existing alerts, where the results can be filtered on the basis of - /// multiple parameters (e.g. time range). The results can then be sorted on - /// the basis specific fields, with the default being lastModifiedDateTime. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetAllNext(this IAlertsOperations operations, string nextPageLink) - { - return operations.GetAllNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List all existing alerts, where the results can be filtered on the basis of - /// multiple parameters (e.g. time range). The results can then be sorted on - /// the basis specific fields, with the default being lastModifiedDateTime. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetAllNextAsync(this IAlertsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/IAlertProcessingRulesOperations.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/IAlertProcessingRulesOperations.cs index 90853829feca..3d49f08979a6 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/IAlertProcessingRulesOperations.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/IAlertProcessingRulesOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// AlertProcessingRulesOperations operations. @@ -26,25 +16,29 @@ public partial interface IAlertProcessingRulesOperations /// /// List all alert processing rules in a subscription. /// + /// + /// List all alert processing rules in a subscription. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task,AlertProcessingRulesListBySubscriptionHeaders>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task,AlertProcessingRulesListBySubscriptionHeaders>> ListBySubscriptionWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List all alert processing rules in a resource group. /// + /// + /// List all alert processing rules in a resource group. + /// /// /// Resource group name where the resource is created. /// @@ -54,19 +48,20 @@ public partial interface IAlertProcessingRulesOperations /// /// 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,AlertProcessingRulesListByResourceGroupHeaders>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task,AlertProcessingRulesListByResourceGroupHeaders>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get an alert processing rule by name. /// + /// + /// Get an alert processing rule by name. + /// /// /// Resource group name where the resource is created. /// @@ -79,25 +74,25 @@ public partial interface IAlertProcessingRulesOperations /// /// 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> GetByNameWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetByNameWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Create or update an alert processing rule. /// + /// + /// Create or update an alert processing rule. + /// /// /// Resource group name where the resource is created. /// /// - /// The name of the alert processing rule that needs to be - /// created/updated. + /// The name of the alert processing rule that needs to be created/updated. /// /// /// Alert processing rule to be created/updated. @@ -108,19 +103,20 @@ public partial interface IAlertProcessingRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, AlertProcessingRule alertProcessingRule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, AlertProcessingRule alertProcessingRule, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Delete an alert processing rule. /// + /// + /// Delete an alert processing rule. + /// /// /// Resource group name where the resource is created. /// @@ -133,16 +129,17 @@ public partial interface IAlertProcessingRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when a required parameter is null - /// - Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Enable, disable, or update tags for an alert processing rule. /// + /// + /// Enable, disable, or update tags for an alert processing rule. + /// /// /// Resource group name where the resource is created. /// @@ -158,19 +155,20 @@ public partial interface IAlertProcessingRulesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, PatchObject alertProcessingRulePatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string alertProcessingRuleName, PatchObject alertProcessingRulePatch, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List all alert processing rules in a subscription. /// + /// + /// List all alert processing rules in a subscription. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -180,19 +178,20 @@ public partial interface IAlertProcessingRulesOperations /// /// 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,AlertProcessingRulesListBySubscriptionHeaders>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task,AlertProcessingRulesListBySubscriptionHeaders>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// List all alert processing rules in a resource group. /// + /// + /// List all alert processing rules in a resource group. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -202,15 +201,13 @@ public partial interface IAlertProcessingRulesOperations /// /// 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,AlertProcessingRulesListByResourceGroupHeaders>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task,AlertProcessingRulesListByResourceGroupHeaders>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/IAlertsManagementClient.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/IAlertsManagementClient.cs index 0e9fc81894ae..aa4b6fbee192 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/IAlertsManagementClient.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/IAlertsManagementClient.cs @@ -1,23 +1,18 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement { using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; /// + /// APIs for Azure alert processing rules CRUD operations. /// - public partial interface IAlertsManagementClient : System.IDisposable + public partial interface IAlertsManagementClient : System.IDisposable { /// /// The base URI of the service. @@ -27,61 +22,65 @@ public partial interface IAlertsManagementClient : System.IDisposable /// /// Gets or sets json serialization settings. /// - JsonSerializerSettings SerializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - JsonSerializerSettings DeserializationSettings { get; } + Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - ServiceClientCredentials Credentials { get; } + Microsoft.Rest.ServiceClientCredentials Credentials { get;} + /// /// The ID of the target subscription. /// - string SubscriptionId { get; set; } + string SubscriptionId { get; set;} + /// /// The preferred language for the response. /// - string AcceptLanguage { get; set; } + string AcceptLanguage { get; set;} + /// /// The retry timeout in seconds for Long Running Operations. Default /// value is 30. /// - int? LongRunningOperationRetryTimeout { get; set; } + int? LongRunningOperationRetryTimeout { get; set;} + /// - /// Whether a unique x-ms-client-request-id should be generated. When - /// set to true a unique x-ms-client-request-id value is generated and + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and /// included in each request. Default is true. /// - bool? GenerateClientRequestId { get; set; } + bool? GenerateClientRequestId { get; set;} /// - /// Gets the IAlertProcessingRulesOperations. + /// Gets the IAlertProcessingRulesOperations /// IAlertProcessingRulesOperations AlertProcessingRules { get; } /// - /// Gets the ISmartGroupsOperations. + /// Gets the ISmartGroupsOperations /// ISmartGroupsOperations SmartGroups { get; } /// - /// Gets the IOperations. + /// Gets the IOperations /// IOperations Operations { get; } /// - /// Gets the IAlertsOperations. + /// Gets the IAlertsOperations /// IAlertsOperations Alerts { get; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/IAlertsOperations.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/IAlertsOperations.cs index 0f34e3d82117..44165bb066bd 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/IAlertsOperations.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/IAlertsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// AlertsOperations operations. @@ -24,34 +14,33 @@ namespace Microsoft.Azure.Management.AlertsManagement public partial interface IAlertsOperations { /// - /// List alerts meta data information based on value of identifier - /// parameter. + /// List alerts meta data information based on value of identifier parameter. /// + /// + /// List alerts meta data information based on value of identifier parameter. + /// /// /// 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> MetaDataWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> MetaDataWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// List all existing alerts, where the results can be filtered on the - /// basis of multiple parameters (e.g. time range). The results can - /// then be sorted on the basis specific fields, with the default being - /// lastModifiedDateTime. + /// List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime. /// + /// + /// List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime. + /// /// - /// Filter by target resource( which is full ARM ID) Default value is - /// select all. + /// Filter by target resource( which is full ARM ID) Default value is select all. /// /// /// Filter by target resource type. Default value is select all. @@ -60,76 +49,46 @@ public partial interface IAlertsOperations /// Filter by target resource group name. Default value is select all. /// /// - /// Filter by monitor service which generates the alert instance. - /// Default value is select all. Possible values include: 'Application - /// Insights', 'ActivityLog Administrative', 'ActivityLog Security', - /// 'ActivityLog Recommendation', 'ActivityLog Policy', 'ActivityLog - /// Autoscale', 'Log Analytics', 'Nagios', 'Platform', 'SCOM', - /// 'ServiceHealth', 'SmartDetector', 'VM Insights', 'Zabbix' + /// Filter by monitor service which generates the alert instance. Default value is select all. /// /// - /// Filter by monitor condition which is either 'Fired' or 'Resolved'. - /// Default value is to select all. Possible values include: 'Fired', - /// 'Resolved' + /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all. /// /// - /// Filter by severity. Default value is select all. Possible values - /// include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' + /// Filter by severity. Default value is select all. /// /// - /// Filter by state of the alert instance. Default value is to select - /// all. Possible values include: 'New', 'Acknowledged', 'Closed' + /// Filter by state of the alert instance. Default value is to select all. /// /// /// Filter by specific alert rule. Default value is to select all. /// /// - /// Filter the alerts list by the Smart Group Id. Default value is - /// none. + /// Filter the alerts list by the Smart Group Id. Default value is none. /// /// - /// Include context which has contextual data specific to the monitor - /// service. Default value is false' + /// Include context which has contextual data specific to the monitor service. Default value is false' /// /// - /// Include egress config which would be used for displaying the - /// content in portal. Default value is 'false'. + /// Include egress config which would be used for displaying the content in portal. Default value is 'false'. /// /// - /// Determines number of alerts returned per page in response. - /// Permissible value is between 1 to 250. When the "includeContent" - /// filter is selected, maximum value allowed is 25. Default value is - /// 25. + /// Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the "includeContent" filter is selected, maximum value allowed is 25. Default value is 25. /// /// - /// Sort the query results by input field, Default value is - /// 'lastModifiedDateTime'. Possible values include: 'name', - /// 'severity', 'alertState', 'monitorCondition', 'targetResource', - /// 'targetResourceName', 'targetResourceGroup', 'targetResourceType', - /// 'startDateTime', 'lastModifiedDateTime' + /// Sort the query results by input field, Default value is 'lastModifiedDateTime'. /// /// - /// Sort the query results order in either ascending or descending. - /// Default value is 'desc' for time fields and 'asc' for others. - /// Possible values include: 'asc', 'desc' + /// Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others. /// /// - /// This filter allows to selection of the fields(comma separated) - /// which would be part of the essential section. This would allow to - /// project only the required fields rather than getting entire - /// content. Default is to fetch all the fields in the essentials - /// section. + /// This filter allows to selection of the fields(comma separated) which would be part of the essential section. This would allow to project only the required fields rather than getting entire content. Default is to fetch all the fields in the essentials section. /// /// - /// Filter by time range by below listed values. Default value is 1 - /// day. Possible values include: '1h', '1d', '7d', '30d' + /// Filter by time range by below listed values. Default value is 1 day. /// /// - /// Filter by custom time range in the format - /// <start-time>/<end-time> where time is in (ISO-8601 - /// format)'. Permissible values is within 30 days from query time. - /// Either timeRange or customTimeRange could be used but not both. - /// Default is none. + /// Filter by custom time range in the format <start-time>/<end-time> where time is in (ISO-8601 format)'. Permissible values is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none. /// /// /// The headers that will be added to request. @@ -137,18 +96,16 @@ public partial interface IAlertsOperations /// /// 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>> GetAllWithHttpMessagesAsync(string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string smartGroupId = default(string), bool? includeContext = default(bool?), bool? includeEgressConfig = default(bool?), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), string select = default(string), string timeRange = default(string), string customTimeRange = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> GetAllWithHttpMessagesAsync(string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string smartGroupId = default(string), bool? includeContext = default(bool?), bool? includeEgressConfig = default(bool?), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), string select = default(string), string timeRange = default(string), string customTimeRange = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get a specific alert. + /// Get information related to a specific alert /// /// /// Get information related to a specific alert @@ -162,25 +119,25 @@ public partial interface IAlertsOperations /// /// 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> GetByIdWithHttpMessagesAsync(string alertId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetByIdWithHttpMessagesAsync(string alertId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Change the state of an alert. /// + /// + /// Change the state of an alert. + /// /// /// Unique ID of an alert instance. /// /// - /// New state of the alert. Possible values include: 'New', - /// 'Acknowledged', 'Closed' + /// New state of the alert. /// /// /// reason of change alert state @@ -191,21 +148,20 @@ public partial interface IAlertsOperations /// /// 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> ChangeStateWithHttpMessagesAsync(string alertId, string newState, Comments comment = default(Comments), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ChangeStateWithHttpMessagesAsync(string alertId, string newState, Comments comment = default(Comments), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get the history of an alert, which captures any monitor condition - /// changes (Fired/Resolved) and alert state changes - /// (New/Acknowledged/Closed). + /// Get the history of an alert, which captures any monitor condition changes (Fired/Resolved) and alert state changes (New/Acknowledged/Closed). /// + /// + /// Get the history of an alert, which captures any monitor condition changes (Fired/Resolved) and alert state changes (New/Acknowledged/Closed). + /// /// /// Unique ID of an alert instance. /// @@ -215,35 +171,28 @@ public partial interface IAlertsOperations /// /// 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> GetHistoryWithHttpMessagesAsync(string alertId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetHistoryWithHttpMessagesAsync(string alertId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get a summarized count of your alerts grouped by various parameters - /// (e.g. grouping by 'Severity' returns the count of alerts for each - /// severity). + /// Get a summarized count of your alerts grouped by various parameters (e.g. grouping by 'Severity' returns the count of alerts for each severity). /// + /// + /// Get a summarized count of your alerts grouped by various parameters (e.g. grouping by 'Severity' returns the count of alerts for each severity). + /// /// - /// This parameter allows the result set to be grouped by input fields - /// (Maximum 2 comma separated fields supported). For example, - /// groupby=severity or groupby=severity,alertstate. Possible values - /// include: 'severity', 'alertState', 'monitorCondition', - /// 'monitorService', 'signalType', 'alertRule' + /// This parameter allows the result set to be grouped by input fields (Maximum 2 comma separated fields supported). For example, groupby=severity or groupby=severity,alertstate. /// /// - /// Include count of the SmartGroups as part of the summary. Default - /// value is 'false'. + /// Include count of the SmartGroups as part of the summary. Default value is 'false'. /// /// - /// Filter by target resource( which is full ARM ID) Default value is - /// select all. + /// Filter by target resource( which is full ARM ID) Default value is select all. /// /// /// Filter by target resource type. Default value is select all. @@ -252,39 +201,25 @@ public partial interface IAlertsOperations /// Filter by target resource group name. Default value is select all. /// /// - /// Filter by monitor service which generates the alert instance. - /// Default value is select all. Possible values include: 'Application - /// Insights', 'ActivityLog Administrative', 'ActivityLog Security', - /// 'ActivityLog Recommendation', 'ActivityLog Policy', 'ActivityLog - /// Autoscale', 'Log Analytics', 'Nagios', 'Platform', 'SCOM', - /// 'ServiceHealth', 'SmartDetector', 'VM Insights', 'Zabbix' + /// Filter by monitor service which generates the alert instance. Default value is select all. /// /// - /// Filter by monitor condition which is either 'Fired' or 'Resolved'. - /// Default value is to select all. Possible values include: 'Fired', - /// 'Resolved' + /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all. /// /// - /// Filter by severity. Default value is select all. Possible values - /// include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' + /// Filter by severity. Default value is select all. /// /// - /// Filter by state of the alert instance. Default value is to select - /// all. Possible values include: 'New', 'Acknowledged', 'Closed' + /// Filter by state of the alert instance. Default value is to select all. /// /// /// Filter by specific alert rule. Default value is to select all. /// /// - /// Filter by time range by below listed values. Default value is 1 - /// day. Possible values include: '1h', '1d', '7d', '30d' + /// Filter by time range by below listed values. Default value is 1 day. /// /// - /// Filter by custom time range in the format - /// <start-time>/<end-time> where time is in (ISO-8601 - /// format)'. Permissible values is within 30 days from query time. - /// Either timeRange or customTimeRange could be used but not both. - /// Default is none. + /// Filter by custom time range in the format <start-time>/<end-time> where time is in (ISO-8601 format)'. Permissible values is within 30 days from query time. Either timeRange or customTimeRange could be used but not both. Default is none. /// /// /// The headers that will be added to request. @@ -292,22 +227,20 @@ public partial interface IAlertsOperations /// /// 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> GetSummaryWithHttpMessagesAsync(string groupby, bool? includeSmartGroupsCount = default(bool?), string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string timeRange = default(string), string customTimeRange = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetSummaryWithHttpMessagesAsync(string groupby, bool? includeSmartGroupsCount = default(bool?), string targetResource = default(string), string targetResourceType = default(string), string targetResourceGroup = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string alertState = default(string), string alertRule = default(string), string timeRange = default(string), string customTimeRange = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// List all existing alerts, where the results can be filtered on the - /// basis of multiple parameters (e.g. time range). The results can - /// then be sorted on the basis specific fields, with the default being - /// lastModifiedDateTime. + /// List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime. /// + /// + /// List all existing alerts, where the results can be filtered on the basis of multiple parameters (e.g. time range). The results can then be sorted on the basis specific fields, with the default being lastModifiedDateTime. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -317,15 +250,13 @@ public partial interface IAlertsOperations /// /// 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>> GetAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> GetAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/IOperations.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/IOperations.cs index 687bb483e83f..351b61ca3004 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/IOperations.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/IOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// Operations operations. @@ -24,29 +14,31 @@ namespace Microsoft.Azure.Management.AlertsManagement public partial interface IOperations { /// - /// List all operations available through Azure Alerts Management - /// Resource Provider. + /// List all operations available through Azure Alerts Management Resource Provider. /// + /// + /// List all operations available through Azure Alerts Management Resource Provider. + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// List all operations available through Azure Alerts Management - /// Resource Provider. + /// List all operations available through Azure Alerts Management Resource Provider. /// + /// + /// List all operations available through Azure Alerts Management Resource Provider. + /// /// /// The NextLink from the previous successful call to List operation. /// @@ -56,15 +48,13 @@ public partial interface IOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when unable to deserialize the response /// - /// - /// Thrown when a required parameter is null - /// - Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/ISmartGroupsOperations.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/ISmartGroupsOperations.cs index 742317f9df52..6be17308dab5 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/ISmartGroupsOperations.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/ISmartGroupsOperations.cs @@ -1,22 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// SmartGroupsOperations operations. @@ -24,14 +14,13 @@ namespace Microsoft.Azure.Management.AlertsManagement public partial interface ISmartGroupsOperations { /// - /// Get all Smart Groups within a specified subscription + /// List all the Smart Groups within a specified subscription. /// /// - /// List all the Smart Groups within a specified subscription. + /// List all the Smart Groups within a specified subscription. /// /// - /// Filter by target resource( which is full ARM ID) Default value is - /// select all. + /// Filter by target resource( which is full ARM ID) Default value is select all. /// /// /// Filter by target resource group name. Default value is select all. @@ -40,45 +29,28 @@ public partial interface ISmartGroupsOperations /// Filter by target resource type. Default value is select all. /// /// - /// Filter by monitor service which generates the alert instance. - /// Default value is select all. Possible values include: 'Application - /// Insights', 'ActivityLog Administrative', 'ActivityLog Security', - /// 'ActivityLog Recommendation', 'ActivityLog Policy', 'ActivityLog - /// Autoscale', 'Log Analytics', 'Nagios', 'Platform', 'SCOM', - /// 'ServiceHealth', 'SmartDetector', 'VM Insights', 'Zabbix' + /// Filter by monitor service which generates the alert instance. Default value is select all. /// /// - /// Filter by monitor condition which is either 'Fired' or 'Resolved'. - /// Default value is to select all. Possible values include: 'Fired', - /// 'Resolved' + /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all. /// /// - /// Filter by severity. Default value is select all. Possible values - /// include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' + /// Filter by severity. Default value is select all. /// /// /// Filter by state of the smart group. Default value is to select all. - /// Possible values include: 'New', 'Acknowledged', 'Closed' /// /// - /// Filter by time range by below listed values. Default value is 1 - /// day. Possible values include: '1h', '1d', '7d', '30d' + /// Filter by time range by below listed values. Default value is 1 day. /// /// - /// Determines number of alerts returned per page in response. - /// Permissible value is between 1 to 250. When the "includeContent" - /// filter is selected, maximum value allowed is 25. Default value is - /// 25. + /// Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the "includeContent" filter is selected, maximum value allowed is 25. Default value is 25. /// /// - /// Sort the query results by input field. Default value is sort by - /// 'lastModifiedDateTime'. Possible values include: 'alertsCount', - /// 'state', 'severity', 'startDateTime', 'lastModifiedDateTime' + /// Sort the query results by input field. Default value is sort by 'lastModifiedDateTime'. /// /// - /// Sort the query results order in either ascending or descending. - /// Default value is 'desc' for time fields and 'asc' for others. - /// Possible values include: 'asc', 'desc' + /// Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others. /// /// /// The headers that will be added to request. @@ -86,16 +58,14 @@ public partial interface ISmartGroupsOperations /// /// 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>> GetAllWithHttpMessagesAsync(string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> GetAllWithHttpMessagesAsync(string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Get information related to a specific Smart Group. /// @@ -103,7 +73,7 @@ public partial interface ISmartGroupsOperations /// Get information related to a specific Smart Group. /// /// - /// Smart group unique id. + /// Smart group unique id. /// /// /// The headers that will be added to request. @@ -111,25 +81,25 @@ public partial interface ISmartGroupsOperations /// /// 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> GetByIdWithHttpMessagesAsync(string smartGroupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetByIdWithHttpMessagesAsync(string smartGroupId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// /// Change the state of a Smart Group. /// + /// + /// Change the state of a Smart Group. + /// /// - /// Smart group unique id. + /// Smart group unique id. /// /// - /// New state of the alert. Possible values include: 'New', - /// 'Acknowledged', 'Closed' + /// New state of the alert. /// /// /// The headers that will be added to request. @@ -137,22 +107,22 @@ public partial interface ISmartGroupsOperations /// /// 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> ChangeStateWithHttpMessagesAsync(string smartGroupId, string newState, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> ChangeStateWithHttpMessagesAsync(string smartGroupId, string newState, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get the history a smart group, which captures any Smart Group state - /// changes (New/Acknowledged/Closed) . + /// Get the history a smart group, which captures any Smart Group state changes (New/Acknowledged/Closed) . /// + /// + /// Get the history a smart group, which captures any Smart Group state changes (New/Acknowledged/Closed) . + /// /// - /// Smart group unique id. + /// Smart group unique id. /// /// /// The headers that will be added to request. @@ -160,21 +130,19 @@ public partial interface ISmartGroupsOperations /// /// 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> GetHistoryWithHttpMessagesAsync(string smartGroupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task> GetHistoryWithHttpMessagesAsync(string smartGroupId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// - /// Get all Smart Groups within a specified subscription + /// List all the Smart Groups within a specified subscription. /// /// - /// List all the Smart Groups within a specified subscription. + /// List all the Smart Groups within a specified subscription. /// /// /// The NextLink from the previous successful call to List operation. @@ -185,15 +153,13 @@ public partial interface ISmartGroupsOperations /// /// 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>> GetAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + System.Threading.Tasks.Task>> GetAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Action.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Action.cs index e4ed615f3537..9213a5b5a51c 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Action.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Action.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -34,4 +28,4 @@ public Action() partial void CustomInit(); } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ActionStatus.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ActionStatus.cs index 8fbfc2a14f72..6178c40dcab4 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ActionStatus.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ActionStatus.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,13 @@ public ActionStatus() /// /// Initializes a new instance of the ActionStatus class. /// - /// Value indicating whether alert is - /// suppressed. + + /// Value indicating whether alert is suppressed. + /// public ActionStatus(bool? isSuppressed = default(bool?)) + { - IsSuppressed = isSuppressed; + this.IsSuppressed = isSuppressed; CustomInit(); } @@ -42,11 +38,11 @@ public ActionStatus() /// partial void CustomInit(); + /// /// Gets or sets value indicating whether alert is suppressed. /// - [JsonProperty(PropertyName = "isSuppressed")] - public bool? IsSuppressed { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "isSuppressed")] + public bool? IsSuppressed {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ActionType.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ActionType.cs new file mode 100644 index 000000000000..b095e6359406 --- /dev/null +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ActionType.cs @@ -0,0 +1,19 @@ +// 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.AlertsManagement.Models +{ + + /// + /// Defines values for ActionType. + /// + + + public static class ActionType + { + public const string AddActionGroups = "AddActionGroups"; + public const string RemoveAllActionGroups = "RemoveAllActionGroups"; + } +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AddActionGroups.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AddActionGroups.cs index 33b1beb5c739..caf20ca719fb 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AddActionGroups.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AddActionGroups.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -33,11 +24,13 @@ public AddActionGroups() /// /// Initializes a new instance of the AddActionGroups class. /// - /// List of action group Ids to add to - /// alert processing rule. - public AddActionGroups(IList actionGroupIds) + + /// List of action group Ids to add to alert processing rule. + /// + public AddActionGroups(System.Collections.Generic.IList actionGroupIds) + { - ActionGroupIds = actionGroupIds; + this.ActionGroupIds = actionGroupIds; CustomInit(); } @@ -46,25 +39,25 @@ public AddActionGroups(IList actionGroupIds) /// partial void CustomInit(); + /// - /// Gets or sets list of action group Ids to add to alert processing - /// rule. + /// Gets or sets list of action group Ids to add to alert processing rule. /// - [JsonProperty(PropertyName = "actionGroupIds")] - public IList ActionGroupIds { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "actionGroupIds")] + public System.Collections.Generic.IList ActionGroupIds {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (ActionGroupIds == null) + if (this.ActionGroupIds == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "ActionGroupIds"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "ActionGroupIds"); } + } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Alert.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Alert.cs index 87e95ba5e776..2872c69cf3fe 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Alert.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Alert.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,23 @@ public Alert() /// /// Initializes a new instance of the Alert class. /// - /// Azure resource Id - /// Azure resource type - /// Azure resource name + + /// Azure resource Id + /// + + /// Azure resource type + /// + + /// Azure resource name + /// + + /// Alert property bag + /// public Alert(string id = default(string), string type = default(string), string name = default(string), AlertProperties properties = default(AlertProperties)) - : base(id, type, name) + + : base(id, type, name) { - Properties = properties; + this.Properties = properties; CustomInit(); } @@ -44,10 +48,11 @@ public Alert() /// partial void CustomInit(); + /// + /// Gets or sets alert property bag /// - [JsonProperty(PropertyName = "properties")] - public AlertProperties Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public AlertProperties Properties {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertModification.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertModification.cs index f2967d0fbc4d..6e56d98ba38f 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertModification.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertModification.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,23 @@ public AlertModification() /// /// Initializes a new instance of the AlertModification class. /// - /// Azure resource Id - /// Azure resource type - /// Azure resource name + + /// Azure resource Id + /// + + /// Azure resource type + /// + + /// Azure resource name + /// + + /// Properties of the alert modification item. + /// public AlertModification(string id = default(string), string type = default(string), string name = default(string), AlertModificationProperties properties = default(AlertModificationProperties)) - : base(id, type, name) + + : base(id, type, name) { - Properties = properties; + this.Properties = properties; CustomInit(); } @@ -44,10 +48,11 @@ public AlertModification() /// partial void CustomInit(); + /// + /// Gets or sets properties of the alert modification item. /// - [JsonProperty(PropertyName = "properties")] - public AlertModificationProperties Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public AlertModificationProperties Properties {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertModificationEvent.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertModificationEvent.cs index 9de11919ddf6..c416e9ab64ed 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertModificationEvent.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertModificationEvent.cs @@ -1,43 +1,36 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for AlertModificationEvent. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum AlertModificationEvent { - [EnumMember(Value = "AlertCreated")] + [System.Runtime.Serialization.EnumMember(Value = "AlertCreated")] AlertCreated, - [EnumMember(Value = "StateChange")] + [System.Runtime.Serialization.EnumMember(Value = "StateChange")] StateChange, - [EnumMember(Value = "MonitorConditionChange")] + [System.Runtime.Serialization.EnumMember(Value = "MonitorConditionChange")] MonitorConditionChange, - [EnumMember(Value = "SeverityChange")] + [System.Runtime.Serialization.EnumMember(Value = "SeverityChange")] SeverityChange, - [EnumMember(Value = "ActionRuleTriggered")] + [System.Runtime.Serialization.EnumMember(Value = "ActionRuleTriggered")] ActionRuleTriggered, - [EnumMember(Value = "ActionRuleSuppressed")] + [System.Runtime.Serialization.EnumMember(Value = "ActionRuleSuppressed")] ActionRuleSuppressed, - [EnumMember(Value = "ActionsTriggered")] + [System.Runtime.Serialization.EnumMember(Value = "ActionsTriggered")] ActionsTriggered, - [EnumMember(Value = "ActionsSuppressed")] + [System.Runtime.Serialization.EnumMember(Value = "ActionsSuppressed")] ActionsSuppressed, - [EnumMember(Value = "ActionsFailed")] + [System.Runtime.Serialization.EnumMember(Value = "ActionsFailed")] ActionsFailed } internal static class AlertModificationEventEnumExtension @@ -46,7 +39,6 @@ internal static string ToSerializedValue(this AlertModificationEvent? value) { return value == null ? null : ((AlertModificationEvent)value).ToSerializedValue(); } - internal static string ToSerializedValue(this AlertModificationEvent value) { switch( value ) @@ -72,7 +64,6 @@ internal static string ToSerializedValue(this AlertModificationEvent value) } return null; } - internal static AlertModificationEvent? ParseAlertModificationEvent(this string value) { switch( value ) @@ -99,4 +90,4 @@ internal static string ToSerializedValue(this AlertModificationEvent value) return null; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertModificationItem.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertModificationItem.cs index 4903ef0254bd..17871b136d8d 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertModificationItem.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertModificationItem.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,27 +23,40 @@ public AlertModificationItem() /// /// Initializes a new instance of the AlertModificationItem class. /// - /// Reason for the modification. + + /// Reason for the modification /// Possible values include: 'AlertCreated', 'StateChange', /// 'MonitorConditionChange', 'SeverityChange', 'ActionRuleTriggered', /// 'ActionRuleSuppressed', 'ActionsTriggered', 'ActionsSuppressed', /// 'ActionsFailed' - /// Old value - /// New value - /// Modified date and time - /// Modified user details (Principal client - /// name) - /// Modification comments - /// Description of the modification + + /// Old value + /// + + /// New value + /// + + /// Modified date and time + /// + + /// Modified user details (Principal client name) + /// + + /// Modification comments + /// + + /// Description of the modification + /// public AlertModificationItem(AlertModificationEvent? modificationEvent = default(AlertModificationEvent?), string oldValue = default(string), string newValue = default(string), string modifiedAt = default(string), string modifiedBy = default(string), string comments = default(string), string description = default(string)) + { - ModificationEvent = modificationEvent; - OldValue = oldValue; - NewValue = newValue; - ModifiedAt = modifiedAt; - ModifiedBy = modifiedBy; - Comments = comments; - Description = description; + this.ModificationEvent = modificationEvent; + this.OldValue = oldValue; + this.NewValue = newValue; + this.ModifiedAt = modifiedAt; + this.ModifiedBy = modifiedBy; + this.Comments = comments; + this.Description = description; CustomInit(); } @@ -58,50 +65,47 @@ public AlertModificationItem() /// partial void CustomInit(); + /// - /// Gets or sets reason for the modification. Possible values include: - /// 'AlertCreated', 'StateChange', 'MonitorConditionChange', - /// 'SeverityChange', 'ActionRuleTriggered', 'ActionRuleSuppressed', - /// 'ActionsTriggered', 'ActionsSuppressed', 'ActionsFailed' + /// Gets or sets reason for the modification Possible values include: 'AlertCreated', 'StateChange', 'MonitorConditionChange', 'SeverityChange', 'ActionRuleTriggered', 'ActionRuleSuppressed', 'ActionsTriggered', 'ActionsSuppressed', 'ActionsFailed' /// - [JsonProperty(PropertyName = "modificationEvent")] - public AlertModificationEvent? ModificationEvent { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "modificationEvent")] + public AlertModificationEvent? ModificationEvent {get; set; } /// /// Gets or sets old value /// - [JsonProperty(PropertyName = "oldValue")] - public string OldValue { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "oldValue")] + public string OldValue {get; set; } /// /// Gets or sets new value /// - [JsonProperty(PropertyName = "newValue")] - public string NewValue { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "newValue")] + public string NewValue {get; set; } /// /// Gets or sets modified date and time /// - [JsonProperty(PropertyName = "modifiedAt")] - public string ModifiedAt { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "modifiedAt")] + public string ModifiedAt {get; set; } /// /// Gets or sets modified user details (Principal client name) /// - [JsonProperty(PropertyName = "modifiedBy")] - public string ModifiedBy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "modifiedBy")] + public string ModifiedBy {get; set; } /// /// Gets or sets modification comments /// - [JsonProperty(PropertyName = "comments")] - public string Comments { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "comments")] + public string Comments {get; set; } /// /// Gets or sets description of the modification /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertModificationProperties.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertModificationProperties.cs index b264053c64e4..434b9eaf7923 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertModificationProperties.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertModificationProperties.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models public partial class AlertModificationProperties { /// - /// Initializes a new instance of the AlertModificationProperties - /// class. + /// Initializes a new instance of the AlertModificationProperties class. /// public AlertModificationProperties() { @@ -30,16 +21,19 @@ public AlertModificationProperties() } /// - /// Initializes a new instance of the AlertModificationProperties - /// class. + /// Initializes a new instance of the AlertModificationProperties class. /// - /// Unique Id of the alert for which the history - /// is being retrieved - /// Modification details - public AlertModificationProperties(string alertId = default(string), IList modifications = default(IList)) + + /// Unique Id of the alert for which the history is being retrieved + /// + + /// Modification details + /// + public AlertModificationProperties(string alertId = default(string), System.Collections.Generic.IList modifications = default(System.Collections.Generic.IList)) + { - AlertId = alertId; - Modifications = modifications; + this.AlertId = alertId; + this.Modifications = modifications; CustomInit(); } @@ -48,18 +42,17 @@ public AlertModificationProperties() /// partial void CustomInit(); + /// - /// Gets unique Id of the alert for which the history is being - /// retrieved + /// Gets unique Id of the alert for which the history is being retrieved /// - [JsonProperty(PropertyName = "alertId")] - public string AlertId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "alertId")] + public string AlertId {get; private set; } /// /// Gets or sets modification details /// - [JsonProperty(PropertyName = "modifications")] - public IList Modifications { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "modifications")] + public System.Collections.Generic.IList Modifications {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRule.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRule.cs index d9b1220a6a60..b697184fbc75 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRule.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRule.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,18 +24,33 @@ public AlertProcessingRule() /// /// Initializes a new instance of the AlertProcessingRule class. /// - /// Resource location - /// Azure resource Id - /// Azure resource type - /// Azure resource name - /// Resource tags - /// Alert processing rule properties. - /// Alert processing rule system data. - public AlertProcessingRule(string location, string id = default(string), string type = default(string), string name = default(string), IDictionary tags = default(IDictionary), AlertProcessingRuleProperties properties = default(AlertProcessingRuleProperties), SystemData systemData = default(SystemData)) - : base(location, id, type, name, tags) + + /// Azure resource Id + /// + + /// Azure resource type + /// + + /// Azure resource name + /// + + /// Resource location + /// + + /// Resource tags + /// + + /// Alert processing rule properties. + /// + + /// Alert processing rule system data. + /// + public AlertProcessingRule(string location, string id = default(string), string type = default(string), string name = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), AlertProcessingRuleProperties properties = default(AlertProcessingRuleProperties), SystemData systemData = default(SystemData)) + + : base(location, id, type, name, tags) { - Properties = properties; - SystemData = systemData; + this.Properties = properties; + this.SystemData = systemData; CustomInit(); } @@ -52,31 +59,32 @@ public AlertProcessingRule() /// partial void CustomInit(); + /// /// Gets or sets alert processing rule properties. /// - [JsonProperty(PropertyName = "properties")] - public AlertProcessingRuleProperties Properties { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public AlertProcessingRuleProperties Properties {get; set; } /// - /// Gets or sets alert processing rule system data. + /// Gets alert processing rule system data. /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); - if (Properties != null) + if (this.Properties != null) { - Properties.Validate(); + this.Properties.Validate(); } + } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRuleProperties.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRuleProperties.cs index b7df1748ca80..7d3f407ea642 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRuleProperties.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRuleProperties.cs @@ -1,30 +1,20 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// Alert processing rule properties defining scopes, conditions and - /// scheduling logic for alert processing rule. + /// Alert processing rule properties defining scopes, conditions and scheduling + /// logic for alert processing rule. /// public partial class AlertProcessingRuleProperties { /// - /// Initializes a new instance of the AlertProcessingRuleProperties - /// class. + /// Initializes a new instance of the AlertProcessingRuleProperties class. /// public AlertProcessingRuleProperties() { @@ -32,28 +22,35 @@ public AlertProcessingRuleProperties() } /// - /// Initializes a new instance of the AlertProcessingRuleProperties - /// class. + /// Initializes a new instance of the AlertProcessingRuleProperties class. /// - /// Scopes on which alert processing rule will - /// apply. - /// Actions to be applied. - /// Conditions on which alerts will be - /// filtered. - /// Scheduling for alert processing - /// rule. - /// Description of alert processing - /// rule. - /// Indicates if the given alert processing rule - /// is enabled or disabled. - public AlertProcessingRuleProperties(IList scopes, IList actions, IList conditions = default(IList), Schedule schedule = default(Schedule), string description = default(string), bool? enabled = default(bool?)) + + /// Scopes on which alert processing rule will apply. + /// + + /// Conditions on which alerts will be filtered. + /// + + /// Scheduling for alert processing rule. + /// + + /// Actions to be applied. + /// + + /// Description of alert processing rule. + /// + + /// Indicates if the given alert processing rule is enabled or disabled. + /// + public AlertProcessingRuleProperties(System.Collections.Generic.IList scopes, System.Collections.Generic.IList actions, System.Collections.Generic.IList conditions = default(System.Collections.Generic.IList), Schedule schedule = default(Schedule), string description = default(string), bool? enabled = default(bool?)) + { - Scopes = scopes; - Conditions = conditions; - Schedule = schedule; - Actions = actions; - Description = description; - Enabled = enabled; + this.Scopes = scopes; + this.Conditions = conditions; + this.Schedule = schedule; + this.Actions = actions; + this.Description = description; + this.Enabled = enabled; CustomInit(); } @@ -62,63 +59,67 @@ public AlertProcessingRuleProperties() /// partial void CustomInit(); + /// /// Gets or sets scopes on which alert processing rule will apply. /// - [JsonProperty(PropertyName = "scopes")] - public IList Scopes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "scopes")] + public System.Collections.Generic.IList Scopes {get; set; } /// /// Gets or sets conditions on which alerts will be filtered. /// - [JsonProperty(PropertyName = "conditions")] - public IList Conditions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "conditions")] + public System.Collections.Generic.IList Conditions {get; set; } /// /// Gets or sets scheduling for alert processing rule. /// - [JsonProperty(PropertyName = "schedule")] - public Schedule Schedule { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "schedule")] + public Schedule Schedule {get; set; } /// /// Gets or sets actions to be applied. /// - [JsonProperty(PropertyName = "actions")] - public IList Actions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "actions")] + public System.Collections.Generic.IList Actions {get; set; } /// /// Gets or sets description of alert processing rule. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } /// - /// Gets or sets indicates if the given alert processing rule is - /// enabled or disabled. + /// Gets or sets indicates if the given alert processing rule is enabled or + /// disabled. /// - [JsonProperty(PropertyName = "enabled")] - public bool? Enabled { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Scopes == null) + if (this.Scopes == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Scopes"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Scopes"); } - if (Actions == null) + if (this.Actions == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Actions"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Actions"); } - if (Schedule != null) + + + if (this.Schedule != null) { - Schedule.Validate(); + this.Schedule.Validate(); } + + } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesCreateOrUpdateHeaders.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesCreateOrUpdateHeaders.cs index 0400450e8e84..999a4060552e 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesCreateOrUpdateHeaders.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesCreateOrUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for CreateOrUpdate operation. - /// public partial class AlertProcessingRulesCreateOrUpdateHeaders { /// - /// Initializes a new instance of the - /// AlertProcessingRulesCreateOrUpdateHeaders class. + /// Initializes a new instance of the AlertProcessingRulesCreateOrUpdateHeaders class. /// public AlertProcessingRulesCreateOrUpdateHeaders() { @@ -28,13 +18,15 @@ public AlertProcessingRulesCreateOrUpdateHeaders() } /// - /// Initializes a new instance of the - /// AlertProcessingRulesCreateOrUpdateHeaders class. + /// Initializes a new instance of the AlertProcessingRulesCreateOrUpdateHeaders class. /// - /// Service generated Request ID. - public AlertProcessingRulesCreateOrUpdateHeaders(string xMsRequestId = default(string)) + + /// + /// + public AlertProcessingRulesCreateOrUpdateHeaders(string xmsRequestId = default(string)) + { - XMsRequestId = xMsRequestId; + this.XMSRequestId = xmsRequestId; CustomInit(); } @@ -43,11 +35,11 @@ public AlertProcessingRulesCreateOrUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets service generated Request ID. + /// Gets or sets /// - [JsonProperty(PropertyName = "x-ms-request-id")] - public string XMsRequestId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "x-ms-request-id")] + public string XMSRequestId {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesDeleteHeaders.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesDeleteHeaders.cs index 51586fd9cd72..b20025d6a079 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesDeleteHeaders.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesDeleteHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Delete operation. - /// public partial class AlertProcessingRulesDeleteHeaders { /// - /// Initializes a new instance of the AlertProcessingRulesDeleteHeaders - /// class. + /// Initializes a new instance of the AlertProcessingRulesDeleteHeaders class. /// public AlertProcessingRulesDeleteHeaders() { @@ -28,13 +18,15 @@ public AlertProcessingRulesDeleteHeaders() } /// - /// Initializes a new instance of the AlertProcessingRulesDeleteHeaders - /// class. + /// Initializes a new instance of the AlertProcessingRulesDeleteHeaders class. /// - /// Service generated Request ID. - public AlertProcessingRulesDeleteHeaders(string xMsRequestId = default(string)) + + /// + /// + public AlertProcessingRulesDeleteHeaders(string xmsRequestId = default(string)) + { - XMsRequestId = xMsRequestId; + this.XMSRequestId = xmsRequestId; CustomInit(); } @@ -43,11 +35,11 @@ public AlertProcessingRulesDeleteHeaders() /// partial void CustomInit(); + /// - /// Gets or sets service generated Request ID. + /// Gets or sets /// - [JsonProperty(PropertyName = "x-ms-request-id")] - public string XMsRequestId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "x-ms-request-id")] + public string XMSRequestId {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesGetByNameHeaders.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesGetByNameHeaders.cs index 16eff36904dd..c396b7c833db 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesGetByNameHeaders.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesGetByNameHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for GetByName operation. - /// public partial class AlertProcessingRulesGetByNameHeaders { /// - /// Initializes a new instance of the - /// AlertProcessingRulesGetByNameHeaders class. + /// Initializes a new instance of the AlertProcessingRulesGetByNameHeaders class. /// public AlertProcessingRulesGetByNameHeaders() { @@ -28,13 +18,15 @@ public AlertProcessingRulesGetByNameHeaders() } /// - /// Initializes a new instance of the - /// AlertProcessingRulesGetByNameHeaders class. + /// Initializes a new instance of the AlertProcessingRulesGetByNameHeaders class. /// - /// Service generated Request ID. - public AlertProcessingRulesGetByNameHeaders(string xMsRequestId = default(string)) + + /// + /// + public AlertProcessingRulesGetByNameHeaders(string xmsRequestId = default(string)) + { - XMsRequestId = xMsRequestId; + this.XMSRequestId = xmsRequestId; CustomInit(); } @@ -43,11 +35,11 @@ public AlertProcessingRulesGetByNameHeaders() /// partial void CustomInit(); + /// - /// Gets or sets service generated Request ID. + /// Gets or sets /// - [JsonProperty(PropertyName = "x-ms-request-id")] - public string XMsRequestId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "x-ms-request-id")] + public string XMSRequestId {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesListByResourceGroupHeaders.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesListByResourceGroupHeaders.cs index a392ad9f0287..97dcfe1231b3 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesListByResourceGroupHeaders.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesListByResourceGroupHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for ListByResourceGroup operation. - /// public partial class AlertProcessingRulesListByResourceGroupHeaders { /// - /// Initializes a new instance of the - /// AlertProcessingRulesListByResourceGroupHeaders class. + /// Initializes a new instance of the AlertProcessingRulesListByResourceGroupHeaders class. /// public AlertProcessingRulesListByResourceGroupHeaders() { @@ -28,13 +18,15 @@ public AlertProcessingRulesListByResourceGroupHeaders() } /// - /// Initializes a new instance of the - /// AlertProcessingRulesListByResourceGroupHeaders class. + /// Initializes a new instance of the AlertProcessingRulesListByResourceGroupHeaders class. /// - /// Service generated Request ID. - public AlertProcessingRulesListByResourceGroupHeaders(string xMsRequestId = default(string)) + + /// + /// + public AlertProcessingRulesListByResourceGroupHeaders(string xmsRequestId = default(string)) + { - XMsRequestId = xMsRequestId; + this.XMSRequestId = xmsRequestId; CustomInit(); } @@ -43,11 +35,11 @@ public AlertProcessingRulesListByResourceGroupHeaders() /// partial void CustomInit(); + /// - /// Gets or sets service generated Request ID. + /// Gets or sets /// - [JsonProperty(PropertyName = "x-ms-request-id")] - public string XMsRequestId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "x-ms-request-id")] + public string XMSRequestId {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesListBySubscriptionHeaders.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesListBySubscriptionHeaders.cs index 4935b594934f..0b7d1c7e4bc7 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesListBySubscriptionHeaders.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesListBySubscriptionHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for ListBySubscription operation. - /// public partial class AlertProcessingRulesListBySubscriptionHeaders { /// - /// Initializes a new instance of the - /// AlertProcessingRulesListBySubscriptionHeaders class. + /// Initializes a new instance of the AlertProcessingRulesListBySubscriptionHeaders class. /// public AlertProcessingRulesListBySubscriptionHeaders() { @@ -28,13 +18,15 @@ public AlertProcessingRulesListBySubscriptionHeaders() } /// - /// Initializes a new instance of the - /// AlertProcessingRulesListBySubscriptionHeaders class. + /// Initializes a new instance of the AlertProcessingRulesListBySubscriptionHeaders class. /// - /// Service generated Request ID. - public AlertProcessingRulesListBySubscriptionHeaders(string xMsRequestId = default(string)) + + /// + /// + public AlertProcessingRulesListBySubscriptionHeaders(string xmsRequestId = default(string)) + { - XMsRequestId = xMsRequestId; + this.XMSRequestId = xmsRequestId; CustomInit(); } @@ -43,11 +35,11 @@ public AlertProcessingRulesListBySubscriptionHeaders() /// partial void CustomInit(); + /// - /// Gets or sets service generated Request ID. + /// Gets or sets /// - [JsonProperty(PropertyName = "x-ms-request-id")] - public string XMsRequestId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "x-ms-request-id")] + public string XMSRequestId {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesUpdateHeaders.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesUpdateHeaders.cs index 657eeedee094..3bf56f32330d 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesUpdateHeaders.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProcessingRulesUpdateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for Update operation. - /// public partial class AlertProcessingRulesUpdateHeaders { /// - /// Initializes a new instance of the AlertProcessingRulesUpdateHeaders - /// class. + /// Initializes a new instance of the AlertProcessingRulesUpdateHeaders class. /// public AlertProcessingRulesUpdateHeaders() { @@ -28,13 +18,15 @@ public AlertProcessingRulesUpdateHeaders() } /// - /// Initializes a new instance of the AlertProcessingRulesUpdateHeaders - /// class. + /// Initializes a new instance of the AlertProcessingRulesUpdateHeaders class. /// - /// Service generated Request ID. - public AlertProcessingRulesUpdateHeaders(string xMsRequestId = default(string)) + + /// + /// + public AlertProcessingRulesUpdateHeaders(string xmsRequestId = default(string)) + { - XMsRequestId = xMsRequestId; + this.XMSRequestId = xmsRequestId; CustomInit(); } @@ -43,11 +35,11 @@ public AlertProcessingRulesUpdateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets service generated Request ID. + /// Gets or sets /// - [JsonProperty(PropertyName = "x-ms-request-id")] - public string XMsRequestId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "x-ms-request-id")] + public string XMSRequestId {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProperties.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProperties.cs index 7cd6c04a5007..4186e9d9709c 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProperties.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertProperties.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,11 +23,22 @@ public AlertProperties() /// /// Initializes a new instance of the AlertProperties class. /// + + /// This object contains consistent fields across different monitor services. + /// + + /// Information specific to the monitor service that gives more contextual + /// details about the alert. + /// + + /// Config which would be used for displaying the data in portal. + /// public AlertProperties(Essentials essentials = default(Essentials), object context = default(object), object egressConfig = default(object)) + { - Essentials = essentials; - Context = context; - EgressConfig = egressConfig; + this.Essentials = essentials; + this.Context = context; + this.EgressConfig = egressConfig; CustomInit(); } @@ -42,20 +47,25 @@ public AlertProperties() /// partial void CustomInit(); + /// + /// Gets or sets this object contains consistent fields across different + /// monitor services. /// - [JsonProperty(PropertyName = "essentials")] - public Essentials Essentials { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "essentials")] + public Essentials Essentials {get; set; } /// + /// Gets information specific to the monitor service that gives more contextual + /// details about the alert. /// - [JsonProperty(PropertyName = "context")] - public object Context { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "context")] + public object Context {get; private set; } /// + /// Gets config which would be used for displaying the data in portal. /// - [JsonProperty(PropertyName = "egressConfig")] - public object EgressConfig { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "egressConfig")] + public object EgressConfig {get; private set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertState.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertState.cs index 065b05124df2..11a8df6eca52 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertState.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertState.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models /// /// Defines values for AlertState. /// + + public static class AlertState { public const string New = "New"; public const string Acknowledged = "Acknowledged"; public const string Closed = "Closed"; } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsMetaData.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsMetaData.cs index bf2f9335450a..90c4777dd3e3 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsMetaData.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsMetaData.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,9 +23,13 @@ public AlertsMetaData() /// /// Initializes a new instance of the AlertsMetaData class. /// + + /// alert meta data property bag + /// public AlertsMetaData(AlertsMetaDataProperties properties = default(AlertsMetaDataProperties)) + { - Properties = properties; + this.Properties = properties; CustomInit(); } @@ -40,10 +38,11 @@ public AlertsMetaData() /// partial void CustomInit(); + /// + /// Gets or sets alert meta data property bag /// - [JsonProperty(PropertyName = "properties")] - public AlertsMetaDataProperties Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public AlertsMetaDataProperties Properties {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsMetaDataProperties.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsMetaDataProperties.cs index 18cf9c088257..5e6ad63243f6 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsMetaDataProperties.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsMetaDataProperties.cs @@ -1,22 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// /// alert meta data property bag /// - [Newtonsoft.Json.JsonObject("alertsMetaDataProperties")] + [Newtonsoft.Json.JsonObject("AlertsMetaDataProperties")] public partial class AlertsMetaDataProperties { /// @@ -34,4 +28,4 @@ public AlertsMetaDataProperties() partial void CustomInit(); } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSortByFields.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSortByFields.cs index 7105f5be3ac7..54ef15a67f5b 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSortByFields.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSortByFields.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models /// /// Defines values for AlertsSortByFields. /// + + public static class AlertsSortByFields { public const string Name = "name"; @@ -27,4 +24,4 @@ public static class AlertsSortByFields public const string StartDateTime = "startDateTime"; public const string LastModifiedDateTime = "lastModifiedDateTime"; } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSummary.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSummary.cs index f9d685035599..3d02768701a4 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSummary.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSummary.cs @@ -1,20 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Summary of alerts based on the input filters and 'groupby' parameters. + /// Summary of alerts based on the input filters and 'groupby' parameters. /// public partial class AlertsSummary : Resource { @@ -29,13 +23,23 @@ public AlertsSummary() /// /// Initializes a new instance of the AlertsSummary class. /// - /// Azure resource Id - /// Azure resource type - /// Azure resource name + + /// Azure resource Id + /// + + /// Azure resource type + /// + + /// Azure resource name + /// + + /// Group the result set. + /// public AlertsSummary(string id = default(string), string type = default(string), string name = default(string), AlertsSummaryGroup properties = default(AlertsSummaryGroup)) - : base(id, type, name) + + : base(id, type, name) { - Properties = properties; + this.Properties = properties; CustomInit(); } @@ -44,10 +48,11 @@ public AlertsSummary() /// partial void CustomInit(); + /// + /// Gets or sets group the result set. /// - [JsonProperty(PropertyName = "properties")] - public AlertsSummaryGroup Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public AlertsSummaryGroup Properties {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSummaryGroup.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSummaryGroup.cs index eadbf7420ae0..0bf5c505e009 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSummaryGroup.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSummaryGroup.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,17 +23,25 @@ public AlertsSummaryGroup() /// /// Initializes a new instance of the AlertsSummaryGroup class. /// - /// Total count of the result set. - /// Total count of the smart - /// groups. - /// Name of the field aggregated - /// List of the items - public AlertsSummaryGroup(long? total = default(long?), long? smartGroupsCount = default(long?), string groupedby = default(string), IList values = default(IList)) + + /// Total count of the result set. + /// + + /// Total count of the smart groups. + /// + + /// Name of the field aggregated + /// + + /// List of the items + /// + public AlertsSummaryGroup(long? total = default(long?), long? smartGroupsCount = default(long?), string groupedby = default(string), System.Collections.Generic.IList values = default(System.Collections.Generic.IList)) + { - Total = total; - SmartGroupsCount = smartGroupsCount; - Groupedby = groupedby; - Values = values; + this.Total = total; + this.SmartGroupsCount = smartGroupsCount; + this.Groupedby = groupedby; + this.Values = values; CustomInit(); } @@ -50,29 +50,29 @@ public AlertsSummaryGroup() /// partial void CustomInit(); + /// /// Gets or sets total count of the result set. /// - [JsonProperty(PropertyName = "total")] - public long? Total { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "total")] + public long? Total {get; set; } /// /// Gets or sets total count of the smart groups. /// - [JsonProperty(PropertyName = "smartGroupsCount")] - public long? SmartGroupsCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "smartGroupsCount")] + public long? SmartGroupsCount {get; set; } /// /// Gets or sets name of the field aggregated /// - [JsonProperty(PropertyName = "groupedby")] - public string Groupedby { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "groupedby")] + public string Groupedby {get; set; } /// /// Gets or sets list of the items /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "values")] + public System.Collections.Generic.IList Values {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSummaryGroupByFields.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSummaryGroupByFields.cs index 27804ee3ba65..21fe230266f0 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSummaryGroupByFields.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSummaryGroupByFields.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models /// /// Defines values for AlertsSummaryGroupByFields. /// + + public static class AlertsSummaryGroupByFields { public const string Severity = "severity"; @@ -23,4 +20,4 @@ public static class AlertsSummaryGroupByFields public const string SignalType = "signalType"; public const string AlertRule = "alertRule"; } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSummaryGroupItem.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSummaryGroupItem.cs index 2268acfa0eca..6803edf6a05e 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSummaryGroupItem.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/AlertsSummaryGroupItem.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,16 +23,25 @@ public AlertsSummaryGroupItem() /// /// Initializes a new instance of the AlertsSummaryGroupItem class. /// - /// Value of the aggregated field - /// Count of the aggregated field - /// Name of the field aggregated - /// List of the items - public AlertsSummaryGroupItem(string name = default(string), long? count = default(long?), string groupedby = default(string), IList values = default(IList)) + + /// Value of the aggregated field + /// + + /// Count of the aggregated field + /// + + /// Name of the field aggregated + /// + + /// List of the items + /// + public AlertsSummaryGroupItem(string name = default(string), long? count = default(long?), string groupedby = default(string), System.Collections.Generic.IList values = default(System.Collections.Generic.IList)) + { - Name = name; - Count = count; - Groupedby = groupedby; - Values = values; + this.Name = name; + this.Count = count; + this.Groupedby = groupedby; + this.Values = values; CustomInit(); } @@ -49,29 +50,29 @@ public AlertsSummaryGroupItem() /// partial void CustomInit(); + /// /// Gets or sets value of the aggregated field /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets count of the aggregated field /// - [JsonProperty(PropertyName = "count")] - public long? Count { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "count")] + public long? Count {get; set; } /// /// Gets or sets name of the field aggregated /// - [JsonProperty(PropertyName = "groupedby")] - public string Groupedby { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "groupedby")] + public string Groupedby {get; set; } /// /// Gets or sets list of the items /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "values")] + public System.Collections.Generic.IList Values {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Comments.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Comments.cs index 03adbc76b5c9..497f38b2f00b 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Comments.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Comments.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,9 +23,13 @@ public Comments() /// /// Initializes a new instance of the Comments class. /// + + /// + /// public Comments(string commentsProperty = default(string)) + { - CommentsProperty = commentsProperty; + this.CommentsProperty = commentsProperty; CustomInit(); } @@ -40,10 +38,11 @@ public Comments() /// partial void CustomInit(); + /// + /// Gets or sets /// - [JsonProperty(PropertyName = "comments")] - public string CommentsProperty { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "comments")] + public string CommentsProperty {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Condition.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Condition.cs index 69f3dc22fc10..7a8f43ef33da 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Condition.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Condition.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,21 +23,25 @@ public Condition() /// /// Initializes a new instance of the Condition class. /// - /// Field for a given condition. Possible values - /// include: 'Severity', 'MonitorService', 'MonitorCondition', + + /// Field for a given condition. + /// Possible values include: 'Severity', 'MonitorService', 'MonitorCondition', /// 'SignalType', 'TargetResourceType', 'TargetResource', - /// 'TargetResourceGroup', 'AlertRuleId', 'AlertRuleName', - /// 'Description', 'AlertContext' + /// 'TargetResourceGroup', 'AlertRuleId', 'AlertRuleName', 'Description', + /// 'AlertContext' + /// Operator for a given condition. /// Possible values include: 'Equals', 'NotEquals', 'Contains', /// 'DoesNotContain' - /// List of values to match for a given - /// condition. - public Condition(string field = default(string), string operatorProperty = default(string), IList values = default(IList)) + + /// List of values to match for a given condition. + /// + public Condition(string field = default(string), string operatorProperty = default(string), System.Collections.Generic.IList values = default(System.Collections.Generic.IList)) + { - Field = field; - OperatorProperty = operatorProperty; - Values = values; + this.Field = field; + this.OperatorProperty = operatorProperty; + this.Values = values; CustomInit(); } @@ -54,27 +50,23 @@ public Condition() /// partial void CustomInit(); + /// - /// Gets or sets field for a given condition. Possible values include: - /// 'Severity', 'MonitorService', 'MonitorCondition', 'SignalType', - /// 'TargetResourceType', 'TargetResource', 'TargetResourceGroup', - /// 'AlertRuleId', 'AlertRuleName', 'Description', 'AlertContext' + /// Gets or sets field for a given condition. Possible values include: 'Severity', 'MonitorService', 'MonitorCondition', 'SignalType', 'TargetResourceType', 'TargetResource', 'TargetResourceGroup', 'AlertRuleId', 'AlertRuleName', 'Description', 'AlertContext' /// - [JsonProperty(PropertyName = "field")] - public string Field { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "field")] + public string Field {get; set; } /// - /// Gets or sets operator for a given condition. Possible values - /// include: 'Equals', 'NotEquals', 'Contains', 'DoesNotContain' + /// Gets or sets operator for a given condition. Possible values include: 'Equals', 'NotEquals', 'Contains', 'DoesNotContain' /// - [JsonProperty(PropertyName = "operator")] - public string OperatorProperty { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "operator")] + public string OperatorProperty {get; set; } /// /// Gets or sets list of values to match for a given condition. /// - [JsonProperty(PropertyName = "values")] - public IList Values { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "values")] + public System.Collections.Generic.IList Values {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/CreatedByType.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/CreatedByType.cs index 141356b0d1c9..bdc9db959413 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/CreatedByType.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/CreatedByType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models /// /// Defines values for CreatedByType. /// + + public static class CreatedByType { public const string User = "User"; @@ -21,4 +18,4 @@ public static class CreatedByType public const string ManagedIdentity = "ManagedIdentity"; public const string Key = "Key"; } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/DailyRecurrence.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/DailyRecurrence.cs index 47898942f72d..08639f672abc 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/DailyRecurrence.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/DailyRecurrence.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -30,10 +24,15 @@ public DailyRecurrence() /// /// Initializes a new instance of the DailyRecurrence class. /// - /// Start time for recurrence. - /// End time for recurrence. + + /// Start time for recurrence. + /// + + /// End time for recurrence. + /// public DailyRecurrence(string startTime = default(string), string endTime = default(string)) - : base(startTime, endTime) + + : base(startTime, endTime) { CustomInit(); } @@ -44,4 +43,4 @@ public DailyRecurrence() partial void CustomInit(); } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/DaysOfWeek.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/DaysOfWeek.cs index d2fd2f43bdd8..5ce175636b35 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/DaysOfWeek.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/DaysOfWeek.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models /// /// Defines values for DaysOfWeek. /// + + public static class DaysOfWeek { public const string Sunday = "Sunday"; @@ -24,4 +21,4 @@ public static class DaysOfWeek public const string Friday = "Friday"; public const string Saturday = "Saturday"; } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponse.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponse.cs index 2e760f9af4b2..e499d3e334ee 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponse.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponse.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,9 +23,13 @@ public ErrorResponse() /// /// Initializes a new instance of the ErrorResponse class. /// + + /// Details of error response. + /// public ErrorResponse(ErrorResponseBody error = default(ErrorResponseBody)) + { - Error = error; + this.Error = error; CustomInit(); } @@ -40,10 +38,11 @@ public ErrorResponse() /// partial void CustomInit(); + /// + /// Gets or sets details of error response. /// - [JsonProperty(PropertyName = "error")] - public ErrorResponseBody Error { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorResponseBody Error {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseAutoGenerated.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseAutoGenerated.cs new file mode 100644 index 000000000000..f5fc6613e369 --- /dev/null +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseAutoGenerated.cs @@ -0,0 +1,48 @@ +// 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.AlertsManagement.Models +{ + using System.Linq; + + /// + /// An error response from the service. + /// + public partial class ErrorResponseAutoGenerated + { + /// + /// Initializes a new instance of the ErrorResponseAutoGenerated class. + /// + public ErrorResponseAutoGenerated() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponseAutoGenerated class. + /// + + /// Details of error response. + /// + public ErrorResponseAutoGenerated(ErrorResponseBodyAutoGenerated error = default(ErrorResponseBodyAutoGenerated)) + + { + this.Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets details of error response. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorResponseBodyAutoGenerated Error {get; set; } + } +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseAutoGenerated2.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseAutoGenerated2.cs new file mode 100644 index 000000000000..151ca3dc7aa3 --- /dev/null +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseAutoGenerated2.cs @@ -0,0 +1,48 @@ +// 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.AlertsManagement.Models +{ + using System.Linq; + + /// + /// An error response from the service. + /// + public partial class ErrorResponseAutoGenerated2 + { + /// + /// Initializes a new instance of the ErrorResponseAutoGenerated2 class. + /// + public ErrorResponseAutoGenerated2() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponseAutoGenerated2 class. + /// + + /// Details of error response. + /// + public ErrorResponseAutoGenerated2(ErrorResponseBodyAutoGenerated2 error = default(ErrorResponseBodyAutoGenerated2)) + + { + this.Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets details of error response. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorResponseBodyAutoGenerated2 Error {get; set; } + } +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseAutoGenerated2Exception.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseAutoGenerated2Exception.cs new file mode 100644 index 000000000000..8292b18743ce --- /dev/null +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseAutoGenerated2Exception.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.AlertsManagement.Models +{ + + /// + /// Exception thrown for an invalid response with ErrorResponseAutoGenerated2 information. + /// + public partial class ErrorResponseAutoGenerated2Exception : Microsoft.Rest.RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponseAutoGenerated2 Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseAutoGenerated2Exception class. + /// + public ErrorResponseAutoGenerated2Exception() + { + } + + /// + /// Initializes a new instance of the ErrorResponseAutoGenerated2 class. + /// + /// The exception message. + public ErrorResponseAutoGenerated2Exception(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseAutoGenerated2 class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseAutoGenerated2Exception(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseAutoGeneratedException.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseAutoGeneratedException.cs new file mode 100644 index 000000000000..81be0b12d2a6 --- /dev/null +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseAutoGeneratedException.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.AlertsManagement.Models +{ + + /// + /// Exception thrown for an invalid response with ErrorResponseAutoGenerated information. + /// + public partial class ErrorResponseAutoGeneratedException : Microsoft.Rest.RestException + { + /// + /// Gets information about the associated HTTP request. + /// + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } + + /// + /// Gets information about the associated HTTP response. + /// + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } + + /// + /// Gets or sets the body object. + /// + public ErrorResponseAutoGenerated Body { get; set; } + + /// + /// Initializes a new instance of the ErrorResponseAutoGeneratedException class. + /// + public ErrorResponseAutoGeneratedException() + { + } + + /// + /// Initializes a new instance of the ErrorResponseAutoGenerated class. + /// + /// The exception message. + public ErrorResponseAutoGeneratedException(string message) + : this(message, null) + { + } + + /// + /// Initializes a new instance of the ErrorResponseAutoGenerated class. + /// + /// The exception message. + /// Inner exception. + public ErrorResponseAutoGeneratedException(string message, System.Exception innerException) + : base(message, innerException) + { + } + } +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseBody.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseBody.cs index e5de2be966c2..80cb29c75477 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseBody.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseBody.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -31,20 +23,25 @@ public ErrorResponseBody() /// /// Initializes a new instance of the ErrorResponseBody class. /// - /// Error code, intended to be consumed - /// programmatically. - /// Description of the error, intended for - /// display in user interface. - /// Target of the particular error, for example - /// name of the property. - /// A list of additional details about the - /// error. - public ErrorResponseBody(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList)) + + /// Error code, intended to be consumed programmatically. + /// + + /// Description of the error, intended for display in user interface. + /// + + /// Target of the particular error, for example name of the property. + /// + + /// A list of additional details about the error. + /// + public ErrorResponseBody(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList)) + { - Code = code; - Message = message; - Target = target; - Details = details; + this.Code = code; + this.Message = message; + this.Target = target; + this.Details = details; CustomInit(); } @@ -53,31 +50,31 @@ public ErrorResponseBody() /// partial void CustomInit(); + /// /// Gets or sets error code, intended to be consumed programmatically. /// - [JsonProperty(PropertyName = "code")] - public string Code { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } /// /// Gets or sets description of the error, intended for display in user /// interface. /// - [JsonProperty(PropertyName = "message")] - public string Message { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } /// - /// Gets or sets target of the particular error, for example name of - /// the property. + /// Gets or sets target of the particular error, for example name of the + /// property. /// - [JsonProperty(PropertyName = "target")] - public string Target { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; set; } /// /// Gets or sets a list of additional details about the error. /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseBodyAutoGenerated.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseBodyAutoGenerated.cs new file mode 100644 index 000000000000..eb9d524f3a4f --- /dev/null +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseBodyAutoGenerated.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.AlertsManagement.Models +{ + using System.Linq; + + /// + /// Details of error response. + /// + public partial class ErrorResponseBodyAutoGenerated + { + /// + /// Initializes a new instance of the ErrorResponseBodyAutoGenerated class. + /// + public ErrorResponseBodyAutoGenerated() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponseBodyAutoGenerated class. + /// + + /// Error code, intended to be consumed programmatically. + /// + + /// Description of the error, intended for display in user interface. + /// + + /// Target of the particular error, for example name of the property. + /// + + /// A list of additional details about the error. + /// + public ErrorResponseBodyAutoGenerated(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList)) + + { + this.Code = code; + this.Message = message; + this.Target = target; + this.Details = details; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets error code, intended to be consumed programmatically. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } + + /// + /// Gets or sets description of the error, intended for display in user + /// interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } + + /// + /// Gets or sets target of the particular error, for example name of the + /// property. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; set; } + + /// + /// Gets or sets a list of additional details about the error. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details {get; set; } + } +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseBodyAutoGenerated2.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseBodyAutoGenerated2.cs new file mode 100644 index 000000000000..be0ae06452b9 --- /dev/null +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseBodyAutoGenerated2.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.AlertsManagement.Models +{ + using System.Linq; + + /// + /// Details of error response. + /// + public partial class ErrorResponseBodyAutoGenerated2 + { + /// + /// Initializes a new instance of the ErrorResponseBodyAutoGenerated2 class. + /// + public ErrorResponseBodyAutoGenerated2() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorResponseBodyAutoGenerated2 class. + /// + + /// Error code, intended to be consumed programmatically. + /// + + /// Description of the error, intended for display in user interface. + /// + + /// Target of the particular error, for example name of the property. + /// + + /// A list of additional details about the error. + /// + public ErrorResponseBodyAutoGenerated2(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList)) + + { + this.Code = code; + this.Message = message; + this.Target = target; + this.Details = details; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets error code, intended to be consumed programmatically. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; set; } + + /// + /// Gets or sets description of the error, intended for display in user + /// interface. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; set; } + + /// + /// Gets or sets target of the particular error, for example name of the + /// property. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; set; } + + /// + /// Gets or sets a list of additional details about the error. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details {get; set; } + } +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseException.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseException.cs index 7e5cdcef3698..37047a03925b 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseException.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ErrorResponseException.cs @@ -1,32 +1,25 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Microsoft.Rest; /// - /// Exception thrown for an invalid response with ErrorResponse - /// information. + /// Exception thrown for an invalid response with ErrorResponse information. /// - public partial class ErrorResponseException : RestException + public partial class ErrorResponseException : Microsoft.Rest.RestException { /// /// Gets information about the associated HTTP request. /// - public HttpRequestMessageWrapper Request { get; set; } + public Microsoft.Rest.HttpRequestMessageWrapper Request { get; set; } /// /// Gets information about the associated HTTP response. /// - public HttpResponseMessageWrapper Response { get; set; } + public Microsoft.Rest.HttpResponseMessageWrapper Response { get; set; } /// /// Gets or sets the body object. @@ -41,7 +34,7 @@ public ErrorResponseException() } /// - /// Initializes a new instance of the ErrorResponseException class. + /// Initializes a new instance of the ErrorResponse class. /// /// The exception message. public ErrorResponseException(string message) @@ -50,7 +43,7 @@ public ErrorResponseException(string message) } /// - /// Initializes a new instance of the ErrorResponseException class. + /// Initializes a new instance of the ErrorResponse class. /// /// The exception message. /// Inner exception. @@ -59,4 +52,4 @@ public ErrorResponseException(string message, System.Exception innerException) { } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Essentials.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Essentials.cs index 082ac48d89f7..2b5f8dd8f4d6 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Essentials.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Essentials.cs @@ -1,21 +1,14 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// - /// This object contains consistent fields across different monitor - /// services. + /// This object contains consistent fields across different monitor services. /// public partial class Essentials { @@ -30,75 +23,98 @@ public Essentials() /// /// Initializes a new instance of the Essentials class. /// - /// Severity of alert Sev0 being highest and - /// Sev4 being lowest. Possible values include: 'Sev0', 'Sev1', 'Sev2', - /// 'Sev3', 'Sev4' - /// The type of signal the alert is based on, - /// which could be metrics, logs or activity logs. Possible values - /// include: 'Metric', 'Log', 'Unknown' - /// Alert object state, which can be modified - /// by the user. Possible values include: 'New', 'Acknowledged', - /// 'Closed' - /// Condition of the rule at the monitor - /// service. It represents whether the underlying conditions have - /// crossed the defined alert rule thresholds. Possible values include: - /// 'Fired', 'Resolved' - /// Target ARM resource, on which alert - /// got created. - /// Name of the target ARM resource - /// name, on which alert got created. - /// Resource group of target ARM - /// resource, on which alert got created. - /// Resource type of target ARM - /// resource, on which alert got created. - /// Monitor service on which the - /// rule(monitor) is set. Possible values include: 'Application - /// Insights', 'ActivityLog Administrative', 'ActivityLog Security', - /// 'ActivityLog Recommendation', 'ActivityLog Policy', 'ActivityLog - /// Autoscale', 'Log Analytics', 'Nagios', 'Platform', 'SCOM', - /// 'ServiceHealth', 'SmartDetector', 'VM Insights', 'Zabbix' - /// Rule(monitor) which fired alert instance. - /// Depending on the monitor service, this would be ARM id or name of - /// the rule. - /// Unique Id created by monitor service - /// for each alert instance. This could be used to track the issue at - /// the monitor service, in case of Nagios, Zabbix, SCOM etc. - /// Unique Id of the smart group - /// Verbose reason describing the - /// reason why this alert instance is added to a smart group - /// Creation time(ISO-8601 format) of alert - /// instance. - /// Last modification time(ISO-8601 - /// format) of alert instance. - /// Resolved - /// time(ISO-8601 format) of alert instance. This will be updated when - /// monitor service resolves the alert instance because the rule - /// condition is no longer met. - /// User who last modified the - /// alert, in case of monitor service updates user would be 'system', - /// otherwise name of the user. - /// Alert description. + + /// Severity of alert Sev0 being highest and Sev4 being lowest. + /// Possible values include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' + + /// The type of signal the alert is based on, which could be metrics, logs or + /// activity logs. + /// Possible values include: 'Metric', 'Log', 'Unknown' + + /// Alert object state, which can be modified by the user. + /// Possible values include: 'New', 'Acknowledged', 'Closed' + + /// Condition of the rule at the monitor service. It represents whether the + /// underlying conditions have crossed the defined alert rule thresholds. + /// Possible values include: 'Fired', 'Resolved' + + /// Target ARM resource, on which alert got created. + /// + + /// Name of the target ARM resource name, on which alert got created. + /// + + /// Resource group of target ARM resource, on which alert got created. + /// + + /// Resource type of target ARM resource, on which alert got created. + /// + + /// Monitor service on which the rule(monitor) is set. + /// Possible values include: 'Application Insights', 'ActivityLog + /// Administrative', 'ActivityLog Security', 'ActivityLog Recommendation', + /// 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log Analytics', 'Nagios', + /// 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', 'VM Insights', + /// 'Zabbix' + + /// Rule(monitor) which fired alert instance. Depending on the monitor service, + /// this would be ARM id or name of the rule. + /// + + /// Unique Id created by monitor service for each alert instance. This could be + /// used to track the issue at the monitor service, in case of Nagios, Zabbix, + /// SCOM etc. + /// + + /// Unique Id of the smart group + /// + + /// Verbose reason describing the reason why this alert instance is added to a + /// smart group + /// + + /// Creation time(ISO-8601 format) of alert instance. + /// + + /// Last modification time(ISO-8601 format) of alert instance. + /// + + /// Resolved time(ISO-8601 format) of alert instance. This will be updated when + /// monitor service resolves the alert instance because the rule condition is + /// no longer met. + /// + + /// User who last modified the alert, in case of monitor service updates user + /// would be 'system', otherwise name of the user. + /// + + /// Action status + /// + + /// Alert description. + /// public Essentials(string severity = default(string), string signalType = default(string), string alertState = default(string), string monitorCondition = default(string), string targetResource = default(string), string targetResourceName = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string alertRule = default(string), string sourceCreatedId = default(string), string smartGroupId = default(string), string smartGroupingReason = default(string), System.DateTime? startDateTime = default(System.DateTime?), System.DateTime? lastModifiedDateTime = default(System.DateTime?), System.DateTime? monitorConditionResolvedDateTime = default(System.DateTime?), string lastModifiedUserName = default(string), ActionStatus actionStatus = default(ActionStatus), string description = default(string)) + { - Severity = severity; - SignalType = signalType; - AlertState = alertState; - MonitorCondition = monitorCondition; - TargetResource = targetResource; - TargetResourceName = targetResourceName; - TargetResourceGroup = targetResourceGroup; - TargetResourceType = targetResourceType; - MonitorService = monitorService; - AlertRule = alertRule; - SourceCreatedId = sourceCreatedId; - SmartGroupId = smartGroupId; - SmartGroupingReason = smartGroupingReason; - StartDateTime = startDateTime; - LastModifiedDateTime = lastModifiedDateTime; - MonitorConditionResolvedDateTime = monitorConditionResolvedDateTime; - LastModifiedUserName = lastModifiedUserName; - ActionStatus = actionStatus; - Description = description; + this.Severity = severity; + this.SignalType = signalType; + this.AlertState = alertState; + this.MonitorCondition = monitorCondition; + this.TargetResource = targetResource; + this.TargetResourceName = targetResourceName; + this.TargetResourceGroup = targetResourceGroup; + this.TargetResourceType = targetResourceType; + this.MonitorService = monitorService; + this.AlertRule = alertRule; + this.SourceCreatedId = sourceCreatedId; + this.SmartGroupId = smartGroupId; + this.SmartGroupingReason = smartGroupingReason; + this.StartDateTime = startDateTime; + this.LastModifiedDateTime = lastModifiedDateTime; + this.MonitorConditionResolvedDateTime = monitorConditionResolvedDateTime; + this.LastModifiedUserName = lastModifiedUserName; + this.ActionStatus = actionStatus; + this.Description = description; CustomInit(); } @@ -107,139 +123,131 @@ public Essentials() /// partial void CustomInit(); + /// - /// Gets severity of alert Sev0 being highest and Sev4 being lowest. - /// Possible values include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' + /// Gets severity of alert Sev0 being highest and Sev4 being lowest. Possible values include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' /// - [JsonProperty(PropertyName = "severity")] - public string Severity { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "severity")] + public string Severity {get; private set; } /// - /// Gets the type of signal the alert is based on, which could be - /// metrics, logs or activity logs. Possible values include: 'Metric', - /// 'Log', 'Unknown' + /// Gets the type of signal the alert is based on, which could be metrics, logs + /// or activity logs. Possible values include: 'Metric', 'Log', 'Unknown' /// - [JsonProperty(PropertyName = "signalType")] - public string SignalType { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "signalType")] + public string SignalType {get; private set; } /// - /// Gets alert object state, which can be modified by the user. - /// Possible values include: 'New', 'Acknowledged', 'Closed' + /// Gets alert object state, which can be modified by the user. Possible values include: 'New', 'Acknowledged', 'Closed' /// - [JsonProperty(PropertyName = "alertState")] - public string AlertState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "alertState")] + public string AlertState {get; private set; } /// - /// Gets condition of the rule at the monitor service. It represents - /// whether the underlying conditions have crossed the defined alert - /// rule thresholds. Possible values include: 'Fired', 'Resolved' + /// Gets condition of the rule at the monitor service. It represents whether + /// the underlying conditions have crossed the defined alert rule thresholds. Possible values include: 'Fired', 'Resolved' /// - [JsonProperty(PropertyName = "monitorCondition")] - public string MonitorCondition { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "monitorCondition")] + public string MonitorCondition {get; private set; } /// /// Gets or sets target ARM resource, on which alert got created. /// - [JsonProperty(PropertyName = "targetResource")] - public string TargetResource { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResource")] + public string TargetResource {get; set; } /// - /// Gets or sets name of the target ARM resource name, on which alert - /// got created. + /// Gets or sets name of the target ARM resource name, on which alert got + /// created. /// - [JsonProperty(PropertyName = "targetResourceName")] - public string TargetResourceName { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceName")] + public string TargetResourceName {get; set; } /// - /// Gets or sets resource group of target ARM resource, on which alert - /// got created. + /// Gets or sets resource group of target ARM resource, on which alert got + /// created. /// - [JsonProperty(PropertyName = "targetResourceGroup")] - public string TargetResourceGroup { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceGroup")] + public string TargetResourceGroup {get; set; } /// - /// Gets or sets resource type of target ARM resource, on which alert - /// got created. + /// Gets or sets resource type of target ARM resource, on which alert got + /// created. /// - [JsonProperty(PropertyName = "targetResourceType")] - public string TargetResourceType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceType")] + public string TargetResourceType {get; set; } /// - /// Gets monitor service on which the rule(monitor) is set. Possible - /// values include: 'Application Insights', 'ActivityLog - /// Administrative', 'ActivityLog Security', 'ActivityLog - /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', - /// 'Log Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', - /// 'SmartDetector', 'VM Insights', 'Zabbix' + /// Gets monitor service on which the rule(monitor) is set. Possible values include: 'Application Insights', 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', 'VM Insights', 'Zabbix' /// - [JsonProperty(PropertyName = "monitorService")] - public string MonitorService { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "monitorService")] + public string MonitorService {get; private set; } /// - /// Gets rule(monitor) which fired alert instance. Depending on the - /// monitor service, this would be ARM id or name of the rule. + /// Gets rule(monitor) which fired alert instance. Depending on the monitor + /// service, this would be ARM id or name of the rule. /// - [JsonProperty(PropertyName = "alertRule")] - public string AlertRule { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "alertRule")] + public string AlertRule {get; private set; } /// - /// Gets unique Id created by monitor service for each alert instance. - /// This could be used to track the issue at the monitor service, in - /// case of Nagios, Zabbix, SCOM etc. + /// Gets unique Id created by monitor service for each alert instance. This + /// could be used to track the issue at the monitor service, in case of Nagios, + /// Zabbix, SCOM etc. /// - [JsonProperty(PropertyName = "sourceCreatedId")] - public string SourceCreatedId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceCreatedId")] + public string SourceCreatedId {get; private set; } /// /// Gets unique Id of the smart group /// - [JsonProperty(PropertyName = "smartGroupId")] - public string SmartGroupId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "smartGroupId")] + public string SmartGroupId {get; private set; } /// - /// Gets verbose reason describing the reason why this alert instance - /// is added to a smart group + /// Gets verbose reason describing the reason why this alert instance is added + /// to a smart group /// - [JsonProperty(PropertyName = "smartGroupingReason")] - public string SmartGroupingReason { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "smartGroupingReason")] + public string SmartGroupingReason {get; private set; } /// /// Gets creation time(ISO-8601 format) of alert instance. /// - [JsonProperty(PropertyName = "startDateTime")] - public System.DateTime? StartDateTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startDateTime")] + public System.DateTime? StartDateTime {get; private set; } /// /// Gets last modification time(ISO-8601 format) of alert instance. /// - [JsonProperty(PropertyName = "lastModifiedDateTime")] - public System.DateTime? LastModifiedDateTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedDateTime")] + public System.DateTime? LastModifiedDateTime {get; private set; } /// - /// Gets resolved time(ISO-8601 format) of alert instance. This will be - /// updated when monitor service resolves the alert instance because - /// the rule condition is no longer met. + /// Gets resolved time(ISO-8601 format) of alert instance. This will be updated + /// when monitor service resolves the alert instance because the rule condition + /// is no longer met. /// - [JsonProperty(PropertyName = "monitorConditionResolvedDateTime")] - public System.DateTime? MonitorConditionResolvedDateTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "monitorConditionResolvedDateTime")] + public System.DateTime? MonitorConditionResolvedDateTime {get; private set; } /// - /// Gets user who last modified the alert, in case of monitor service - /// updates user would be 'system', otherwise name of the user. + /// Gets user who last modified the alert, in case of monitor service updates + /// user would be 'system', otherwise name of the user. /// - [JsonProperty(PropertyName = "lastModifiedUserName")] - public string LastModifiedUserName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedUserName")] + public string LastModifiedUserName {get; private set; } /// + /// Gets or sets action status /// - [JsonProperty(PropertyName = "actionStatus")] - public ActionStatus ActionStatus { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "actionStatus")] + public ActionStatus ActionStatus {get; set; } /// /// Gets or sets alert description. /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Field.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Field.cs index f566f25f64b4..107e78debe8a 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Field.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Field.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models /// /// Defines values for Field. /// + + public static class Field { public const string Severity = "Severity"; @@ -28,4 +25,4 @@ public static class Field public const string Description = "Description"; public const string AlertContext = "AlertContext"; } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Identifier.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Identifier.cs new file mode 100644 index 000000000000..08aab9361d5c --- /dev/null +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Identifier.cs @@ -0,0 +1,18 @@ +// 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.AlertsManagement.Models +{ + + /// + /// Defines values for Identifier. + /// + + + public static class Identifier + { + public const string MonitorServiceList = "MonitorServiceList"; + } +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ManagedResource.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ManagedResource.cs index b5a39fd4af9d..824a644da351 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ManagedResource.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/ManagedResource.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,16 +23,27 @@ public ManagedResource() /// /// Initializes a new instance of the ManagedResource class. /// - /// Resource location - /// Azure resource Id - /// Azure resource type - /// Azure resource name - /// Resource tags - public ManagedResource(string location, string id = default(string), string type = default(string), string name = default(string), IDictionary tags = default(IDictionary)) - : base(id, type, name) + + /// Azure resource Id + /// + + /// Azure resource type + /// + + /// Azure resource name + /// + + /// Resource location + /// + + /// Resource tags + /// + public ManagedResource(string location, string id = default(string), string type = default(string), string name = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + + : base(id, type, name) { - Location = location; - Tags = tags; + this.Location = location; + this.Tags = tags; CustomInit(); } @@ -50,30 +52,32 @@ public ManagedResource() /// partial void CustomInit(); + /// /// Gets or sets resource location /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } /// /// Gets or sets resource tags /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Location == null) + if (this.Location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); } + + } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MetadataIdentifier.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MetadataIdentifier.cs new file mode 100644 index 000000000000..587bccd671ba --- /dev/null +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MetadataIdentifier.cs @@ -0,0 +1,18 @@ +// 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.AlertsManagement.Models +{ + + /// + /// Defines values for MetadataIdentifier. + /// + + + public static class MetadataIdentifier + { + public const string MonitorServiceList = "MonitorServiceList"; + } +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonitorCondition.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonitorCondition.cs index d5594b622a48..bb6012199273 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonitorCondition.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonitorCondition.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models /// /// Defines values for MonitorCondition. /// + + public static class MonitorCondition { public const string Fired = "Fired"; public const string Resolved = "Resolved"; } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonitorService.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonitorService.cs index e4ce3a2187c4..1b4c3ee23af1 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonitorService.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonitorService.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models /// /// Defines values for MonitorService. /// + + public static class MonitorService { public const string ApplicationInsights = "Application Insights"; @@ -25,10 +22,10 @@ public static class MonitorService public const string LogAnalytics = "Log Analytics"; public const string Nagios = "Nagios"; public const string Platform = "Platform"; - public const string SCOM = "SCOM"; + public const string Scom = "SCOM"; public const string ServiceHealth = "ServiceHealth"; public const string SmartDetector = "SmartDetector"; public const string VMInsights = "VM Insights"; public const string Zabbix = "Zabbix"; } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonitorServiceDetails.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonitorServiceDetails.cs index 3197effd1f1a..2349f6f44c07 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonitorServiceDetails.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonitorServiceDetails.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,12 +23,17 @@ public MonitorServiceDetails() /// /// Initializes a new instance of the MonitorServiceDetails class. /// - /// Monitor service name - /// Monitor service display name + + /// Monitor service name + /// + + /// Monitor service display name + /// public MonitorServiceDetails(string name = default(string), string displayName = default(string)) + { - Name = name; - DisplayName = displayName; + this.Name = name; + this.DisplayName = displayName; CustomInit(); } @@ -43,17 +42,17 @@ public MonitorServiceDetails() /// partial void CustomInit(); + /// /// Gets or sets monitor service name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets monitor service display name /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + public string DisplayName {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonitorServiceList.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonitorServiceList.cs index c2e785c5bc72..ce7c476f1079 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonitorServiceList.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonitorServiceList.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -36,10 +27,13 @@ public MonitorServiceList() /// /// Initializes a new instance of the MonitorServiceList class. /// - /// Array of operations - public MonitorServiceList(IList data) + + /// Array of operations + /// + public MonitorServiceList(System.Collections.Generic.IList data) + { - Data = data; + this.Data = data; CustomInit(); } @@ -48,24 +42,25 @@ public MonitorServiceList(IList data) /// partial void CustomInit(); + /// /// Gets or sets array of operations /// - [JsonProperty(PropertyName = "data")] - public IList Data { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "data")] + public System.Collections.Generic.IList Data {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (Data == null) + if (this.Data == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Data"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Data"); } + } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonthlyRecurrence.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonthlyRecurrence.cs index b6451a5eafa4..5e66fff00f65 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonthlyRecurrence.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/MonthlyRecurrence.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -33,14 +24,20 @@ public MonthlyRecurrence() /// /// Initializes a new instance of the MonthlyRecurrence class. /// - /// Specifies the values for monthly - /// recurrence pattern. - /// Start time for recurrence. - /// End time for recurrence. - public MonthlyRecurrence(IList daysOfMonth, string startTime = default(string), string endTime = default(string)) - : base(startTime, endTime) + + /// Start time for recurrence. + /// + + /// End time for recurrence. + /// + + /// Specifies the values for monthly recurrence pattern. + /// + public MonthlyRecurrence(System.Collections.Generic.IList daysOfMonth, string startTime = default(string), string endTime = default(string)) + + : base(startTime, endTime) { - DaysOfMonth = daysOfMonth; + this.DaysOfMonth = daysOfMonth; CustomInit(); } @@ -49,24 +46,25 @@ public MonthlyRecurrence() /// partial void CustomInit(); + /// /// Gets or sets specifies the values for monthly recurrence pattern. /// - [JsonProperty(PropertyName = "daysOfMonth")] - public IList DaysOfMonth { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "daysOfMonth")] + public System.Collections.Generic.IList DaysOfMonth {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (DaysOfMonth == null) + if (this.DaysOfMonth == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "DaysOfMonth"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DaysOfMonth"); } + } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Operation.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Operation.cs index f68692b2ecd8..97a9a46319eb 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Operation.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Operation.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,14 +23,21 @@ public Operation() /// /// Initializes a new instance of the Operation class. /// - /// Name of the operation - /// Properties of the operation - /// Origin of the operation + + /// Name of the operation + /// + + /// Properties of the operation + /// + + /// Origin of the operation + /// public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay), string origin = default(string)) + { - Name = name; - Display = display; - Origin = origin; + this.Name = name; + this.Display = display; + this.Origin = origin; CustomInit(); } @@ -45,23 +46,23 @@ public Operation() /// partial void CustomInit(); + /// /// Gets or sets name of the operation /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets properties of the operation /// - [JsonProperty(PropertyName = "display")] - public OperationDisplay Display { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "display")] + public OperationDisplay Display {get; set; } /// /// Gets or sets origin of the operation /// - [JsonProperty(PropertyName = "origin")] - public string Origin { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "origin")] + public string Origin {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/OperationDisplay.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/OperationDisplay.cs index 7c8fbd4b425f..3fc896bfbd90 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/OperationDisplay.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/OperationDisplay.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,16 +23,25 @@ public OperationDisplay() /// /// Initializes a new instance of the OperationDisplay class. /// - /// Provider name - /// Resource name - /// Operation name - /// Description of the operation + + /// Provider name + /// + + /// Resource name + /// + + /// Operation name + /// + + /// Description of the operation + /// public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + { - Provider = provider; - Resource = resource; - Operation = operation; - Description = description; + this.Provider = provider; + this.Resource = resource; + this.Operation = operation; + this.Description = description; CustomInit(); } @@ -47,29 +50,29 @@ public OperationDisplay() /// partial void CustomInit(); + /// /// Gets or sets provider name /// - [JsonProperty(PropertyName = "provider")] - public string Provider { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "provider")] + public string Provider {get; set; } /// /// Gets or sets resource name /// - [JsonProperty(PropertyName = "resource")] - public string Resource { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "resource")] + public string Resource {get; set; } /// /// Gets or sets operation name /// - [JsonProperty(PropertyName = "operation")] - public string Operation { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "operation")] + public string Operation {get; set; } /// /// Gets or sets description of the operation /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/OperatorModel.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Operator.cs similarity index 75% rename from src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/OperatorModel.cs rename to src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Operator.cs index f9756ee9f4ad..3554097c75b2 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/OperatorModel.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Operator.cs @@ -1,24 +1,21 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { /// - /// Defines values for OperatorModel. + /// Defines values for Operator. /// - public static class OperatorModel + + + public static class Operator { public const string Equals = "Equals"; public const string NotEquals = "NotEquals"; public const string Contains = "Contains"; public const string DoesNotContain = "DoesNotContain"; } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Page.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Page.cs index 5ede221ade4a..10468ac2ca34 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Page.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Page.cs @@ -1,53 +1,43 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [JsonObject] - public class Page : IPage + [Newtonsoft.Json.JsonObject] + public class Page : Microsoft.Rest.Azure.IPage { - /// - /// Gets the link to the next page. - /// - [JsonProperty("nextLink")] - public string NextPageLink { get; private set; } - - [JsonProperty("value")] - private IList Items{ get; set; } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() - { - return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } + /// + /// Gets the link to the next page. + /// + [Newtonsoft.Json.JsonProperty("nextLink")] + public System.String NextPageLink { get; private set; } + + [Newtonsoft.Json.JsonProperty("value")] + private System.Collections.Generic.IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public System.Collections.Generic.IEnumerator GetEnumerator() + { + return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/PatchObject.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/PatchObject.cs index 49ed4f6441c9..9cb22009ee2c 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/PatchObject.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/PatchObject.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Data contract for patch. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class PatchObject { /// @@ -34,13 +24,17 @@ public PatchObject() /// /// Initializes a new instance of the PatchObject class. /// - /// Indicates if the given alert processing rule - /// is enabled or disabled. - /// Tags to be updated. - public PatchObject(bool? enabled = default(bool?), IDictionary tags = default(IDictionary)) + + /// Tags to be updated. + /// + + /// Indicates if the given alert processing rule is enabled or disabled. + /// + public PatchObject(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), bool? enabled = default(bool?)) + { - Enabled = enabled; - Tags = tags; + this.Tags = tags; + this.Enabled = enabled; CustomInit(); } @@ -49,18 +43,18 @@ public PatchObject() /// partial void CustomInit(); - /// - /// Gets or sets indicates if the given alert processing rule is - /// enabled or disabled. - /// - [JsonProperty(PropertyName = "properties.enabled")] - public bool? Enabled { get; set; } /// /// Gets or sets tags to be updated. /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + /// + /// Gets or sets indicates if the given alert processing rule is enabled or + /// disabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.enabled")] + public bool? Enabled {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/PatchProperties.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/PatchProperties.cs new file mode 100644 index 000000000000..818f6280de62 --- /dev/null +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/PatchProperties.cs @@ -0,0 +1,49 @@ +// 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.AlertsManagement.Models +{ + using System.Linq; + + /// + /// Alert processing rule properties supported by patch. + /// + public partial class PatchProperties + { + /// + /// Initializes a new instance of the PatchProperties class. + /// + public PatchProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PatchProperties class. + /// + + /// Indicates if the given alert processing rule is enabled or disabled. + /// + public PatchProperties(bool? enabled = default(bool?)) + + { + this.Enabled = enabled; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets indicates if the given alert processing rule is enabled or + /// disabled. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "enabled")] + public bool? Enabled {get; set; } + } +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Recurrence.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Recurrence.cs index 7c0cdf037c84..af28a768dfbe 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Recurrence.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Recurrence.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -30,12 +24,17 @@ public Recurrence() /// /// Initializes a new instance of the Recurrence class. /// - /// Start time for recurrence. - /// End time for recurrence. + + /// Start time for recurrence. + /// + + /// End time for recurrence. + /// public Recurrence(string startTime = default(string), string endTime = default(string)) + { - StartTime = startTime; - EndTime = endTime; + this.StartTime = startTime; + this.EndTime = endTime; CustomInit(); } @@ -44,17 +43,17 @@ public Recurrence() /// partial void CustomInit(); + /// /// Gets or sets start time for recurrence. /// - [JsonProperty(PropertyName = "startTime")] - public string StartTime { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "startTime")] + public string StartTime {get; set; } /// /// Gets or sets end time for recurrence. /// - [JsonProperty(PropertyName = "endTime")] - public string EndTime { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "endTime")] + public string EndTime {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/RecurrenceType.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/RecurrenceType.cs new file mode 100644 index 000000000000..b151c08a253f --- /dev/null +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/RecurrenceType.cs @@ -0,0 +1,20 @@ +// 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.AlertsManagement.Models +{ + + /// + /// Defines values for RecurrenceType. + /// + + + public static class RecurrenceType + { + public const string Daily = "Daily"; + public const string Weekly = "Weekly"; + public const string Monthly = "Monthly"; + } +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/RemoveAllActionGroups.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/RemoveAllActionGroups.cs index 4e15a00e62ff..143e71e7861c 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/RemoveAllActionGroups.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/RemoveAllActionGroups.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -34,4 +28,4 @@ public RemoveAllActionGroups() partial void CustomInit(); } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Resource.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Resource.cs index 7e3303b65fc0..11596cf7bacf 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Resource.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Resource.cs @@ -1,24 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Newtonsoft.Json; using System.Linq; /// /// An azure resource object /// - public partial class Resource : IResource + public partial class Resource : Microsoft.Rest.Azure.IResource { /// /// Initializes a new instance of the Resource class. @@ -31,14 +23,21 @@ public Resource() /// /// Initializes a new instance of the Resource class. /// - /// Azure resource Id - /// Azure resource type - /// Azure resource name + + /// Azure resource Id + /// + + /// Azure resource type + /// + + /// Azure resource name + /// public Resource(string id = default(string), string type = default(string), string name = default(string)) + { - Id = id; - Type = type; - Name = name; + this.Id = id; + this.Type = type; + this.Name = name; CustomInit(); } @@ -47,23 +46,23 @@ public Resource() /// partial void CustomInit(); + /// /// Gets azure resource Id /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + public string Id {get; private set; } /// /// Gets azure resource type /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + public string Type {get; private set; } /// /// Gets azure resource name /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Schedule.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Schedule.cs index 0e08da86fd93..f187264022d4 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Schedule.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Schedule.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,18 +23,27 @@ public Schedule() /// /// Initializes a new instance of the Schedule class. /// - /// Scheduling effective from time. - /// Date-Time in ISO-8601 format without timezone suffix. - /// Scheduling effective until time. - /// Date-Time in ISO-8601 format without timezone suffix. - /// Scheduling time zone. - /// List of recurrences. - public Schedule(string effectiveFrom = default(string), string effectiveUntil = default(string), string timeZone = default(string), IList recurrences = default(IList)) + + /// Scheduling effective from time. Date-Time in ISO-8601 format without + /// timezone suffix. + /// + + /// Scheduling effective until time. Date-Time in ISO-8601 format without + /// timezone suffix. + /// + + /// Scheduling time zone. + /// + + /// List of recurrences. + /// + public Schedule(string effectiveFrom = default(string), string effectiveUntil = default(string), string timeZone = default(string), System.Collections.Generic.IList recurrences = default(System.Collections.Generic.IList)) + { - EffectiveFrom = effectiveFrom; - EffectiveUntil = effectiveUntil; - TimeZone = timeZone; - Recurrences = recurrences; + this.EffectiveFrom = effectiveFrom; + this.EffectiveUntil = effectiveUntil; + this.TimeZone = timeZone; + this.Recurrences = recurrences; CustomInit(); } @@ -52,54 +52,56 @@ public Schedule() /// partial void CustomInit(); + /// - /// Gets or sets scheduling effective from time. Date-Time in ISO-8601 - /// format without timezone suffix. + /// Gets or sets scheduling effective from time. Date-Time in ISO-8601 format + /// without timezone suffix. /// - [JsonProperty(PropertyName = "effectiveFrom")] - public string EffectiveFrom { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "effectiveFrom")] + public string EffectiveFrom {get; set; } /// - /// Gets or sets scheduling effective until time. Date-Time in ISO-8601 - /// format without timezone suffix. + /// Gets or sets scheduling effective until time. Date-Time in ISO-8601 format + /// without timezone suffix. /// - [JsonProperty(PropertyName = "effectiveUntil")] - public string EffectiveUntil { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "effectiveUntil")] + public string EffectiveUntil {get; set; } /// /// Gets or sets scheduling time zone. /// - [JsonProperty(PropertyName = "timeZone")] - public string TimeZone { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "timeZone")] + public string TimeZone {get; set; } /// /// Gets or sets list of recurrences. /// - [JsonProperty(PropertyName = "recurrences")] - public IList Recurrences { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "recurrences")] + public System.Collections.Generic.IList Recurrences {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (EffectiveFrom != null) + if (this.EffectiveFrom != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(EffectiveFrom, "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.EffectiveFrom, "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$")) { - throw new ValidationException(ValidationRules.Pattern, "EffectiveFrom", "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "EffectiveFrom", "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$"); } } - if (EffectiveUntil != null) + if (this.EffectiveUntil != null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(EffectiveUntil, "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$")) + if (!System.Text.RegularExpressions.Regex.IsMatch(this.EffectiveUntil, "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$")) { - throw new ValidationException(ValidationRules.Pattern, "EffectiveUntil", "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "EffectiveUntil", "^(?:(\\d{4}-\\d{2}-\\d{2})T(\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?))$"); } } + + } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Severity.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Severity.cs index ac24737d432b..e0293d7dc0dd 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Severity.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/Severity.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models /// /// Defines values for Severity. /// + + public static class Severity { public const string Sev0 = "Sev0"; @@ -22,4 +19,4 @@ public static class Severity public const string Sev3 = "Sev3"; public const string Sev4 = "Sev4"; } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SignalType.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SignalType.cs index e66f65c7841f..8344fa7f0220 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SignalType.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SignalType.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models /// /// Defines values for SignalType. /// + + public static class SignalType { public const string Metric = "Metric"; public const string Log = "Log"; public const string Unknown = "Unknown"; } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroup.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroup.cs index 94c270ac3fc7..6e3eb97ee232 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroup.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroup.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// /// Set of related alerts grouped together smartly by AMS. /// - [Rest.Serialization.JsonTransformation] + [Microsoft.Rest.Serialization.JsonTransformation] public partial class SmartGroup : Resource { /// @@ -34,57 +24,77 @@ public SmartGroup() /// /// Initializes a new instance of the SmartGroup class. /// - /// Azure resource Id - /// Azure resource type - /// Azure resource name - /// Total number of alerts in smart - /// group - /// Smart group state. Possible values - /// include: 'New', 'Acknowledged', 'Closed' - /// Severity of smart group is the highest(Sev0 - /// >... > Sev4) severity of all the alerts in the group. - /// Possible values include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', - /// 'Sev4' - /// Creation time of smart group. Date-Time - /// in ISO-8601 format. - /// Last updated time of smart - /// group. Date-Time in ISO-8601 format. - /// Last modified by user - /// name. - /// Summary of target resources in the smart - /// group - /// Summary of target resource types in the - /// smart group - /// Summary of target resource groups in - /// the smart group - /// Summary of monitorServices in the - /// smart group - /// Summary of monitorConditions in the - /// smart group - /// Summary of alertStates in the smart - /// group - /// Summary of alertSeverities in the - /// smart group - /// The URI to fetch the next page of alerts. - /// Call ListNext() with this URI to fetch the next page - /// alerts. - public SmartGroup(string id = default(string), string type = default(string), string name = default(string), long? alertsCount = default(long?), string smartGroupState = default(string), string severity = default(string), System.DateTime? startDateTime = default(System.DateTime?), System.DateTime? lastModifiedDateTime = default(System.DateTime?), string lastModifiedUserName = default(string), IList resources = default(IList), IList resourceTypes = default(IList), IList resourceGroups = default(IList), IList monitorServices = default(IList), IList monitorConditions = default(IList), IList alertStates = default(IList), IList alertSeverities = default(IList), string nextLink = default(string)) - : base(id, type, name) + + /// Azure resource Id + /// + + /// Azure resource type + /// + + /// Azure resource name + /// + + /// Severity of smart group is the highest(Sev0 >... > Sev4) severity of all + /// the alerts in the group. + /// Possible values include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' + + /// Total number of alerts in smart group + /// + + /// Smart group state + /// Possible values include: 'New', 'Acknowledged', 'Closed' + + /// Creation time of smart group. Date-Time in ISO-8601 format. + /// + + /// Last updated time of smart group. Date-Time in ISO-8601 format. + /// + + /// Last modified by user name. + /// + + /// Summary of target resources in the smart group + /// + + /// Summary of target resource types in the smart group + /// + + /// Summary of target resource groups in the smart group + /// + + /// Summary of monitorServices in the smart group + /// + + /// Summary of monitorConditions in the smart group + /// + + /// Summary of alertStates in the smart group + /// + + /// Summary of alertSeverities in the smart group + /// + + /// The URI to fetch the next page of alerts. Call ListNext() with this URI to + /// fetch the next page alerts. + /// + public SmartGroup(string id = default(string), string type = default(string), string name = default(string), string severity = default(string), long? alertsCount = default(long?), string smartGroupState = default(string), System.DateTime? startDateTime = default(System.DateTime?), System.DateTime? lastModifiedDateTime = default(System.DateTime?), string lastModifiedUserName = default(string), System.Collections.Generic.IList resources = default(System.Collections.Generic.IList), System.Collections.Generic.IList resourceTypes = default(System.Collections.Generic.IList), System.Collections.Generic.IList resourceGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList monitorServices = default(System.Collections.Generic.IList), System.Collections.Generic.IList monitorConditions = default(System.Collections.Generic.IList), System.Collections.Generic.IList alertStates = default(System.Collections.Generic.IList), System.Collections.Generic.IList alertSeverities = default(System.Collections.Generic.IList), string nextLink = default(string)) + + : base(id, type, name) { - AlertsCount = alertsCount; - SmartGroupState = smartGroupState; - Severity = severity; - StartDateTime = startDateTime; - LastModifiedDateTime = lastModifiedDateTime; - LastModifiedUserName = lastModifiedUserName; - Resources = resources; - ResourceTypes = resourceTypes; - ResourceGroups = resourceGroups; - MonitorServices = monitorServices; - MonitorConditions = monitorConditions; - AlertStates = alertStates; - AlertSeverities = alertSeverities; - NextLink = nextLink; + this.Severity = severity; + this.AlertsCount = alertsCount; + this.SmartGroupState = smartGroupState; + this.StartDateTime = startDateTime; + this.LastModifiedDateTime = lastModifiedDateTime; + this.LastModifiedUserName = lastModifiedUserName; + this.Resources = resources; + this.ResourceTypes = resourceTypes; + this.ResourceGroups = resourceGroups; + this.MonitorServices = monitorServices; + this.MonitorConditions = monitorConditions; + this.AlertStates = alertStates; + this.AlertSeverities = alertSeverities; + this.NextLink = nextLink; CustomInit(); } @@ -93,94 +103,91 @@ public SmartGroup() /// partial void CustomInit(); + /// - /// Gets or sets total number of alerts in smart group + /// Gets severity of smart group is the highest(Sev0 >... > Sev4) severity of + /// all the alerts in the group. Possible values include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' /// - [JsonProperty(PropertyName = "properties.alertsCount")] - public long? AlertsCount { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.severity")] + public string Severity {get; private set; } /// - /// Gets smart group state. Possible values include: 'New', - /// 'Acknowledged', 'Closed' + /// Gets or sets total number of alerts in smart group /// - [JsonProperty(PropertyName = "properties.smartGroupState")] - public string SmartGroupState { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.alertsCount")] + public long? AlertsCount {get; set; } /// - /// Gets severity of smart group is the highest(Sev0 &gt;... - /// &gt; Sev4) severity of all the alerts in the group. Possible - /// values include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' + /// Gets smart group state Possible values include: 'New', 'Acknowledged', 'Closed' /// - [JsonProperty(PropertyName = "properties.severity")] - public string Severity { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.smartGroupState")] + public string SmartGroupState {get; private set; } /// /// Gets creation time of smart group. Date-Time in ISO-8601 format. /// - [JsonProperty(PropertyName = "properties.startDateTime")] - public System.DateTime? StartDateTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.startDateTime")] + public System.DateTime? StartDateTime {get; private set; } /// - /// Gets last updated time of smart group. Date-Time in ISO-8601 - /// format. + /// Gets last updated time of smart group. Date-Time in ISO-8601 format. /// - [JsonProperty(PropertyName = "properties.lastModifiedDateTime")] - public System.DateTime? LastModifiedDateTime { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.lastModifiedDateTime")] + public System.DateTime? LastModifiedDateTime {get; private set; } /// /// Gets last modified by user name. /// - [JsonProperty(PropertyName = "properties.lastModifiedUserName")] - public string LastModifiedUserName { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.lastModifiedUserName")] + public string LastModifiedUserName {get; private set; } /// /// Gets or sets summary of target resources in the smart group /// - [JsonProperty(PropertyName = "properties.resources")] - public IList Resources { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resources")] + public System.Collections.Generic.IList Resources {get; set; } /// /// Gets or sets summary of target resource types in the smart group /// - [JsonProperty(PropertyName = "properties.resourceTypes")] - public IList ResourceTypes { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceTypes")] + public System.Collections.Generic.IList ResourceTypes {get; set; } /// /// Gets or sets summary of target resource groups in the smart group /// - [JsonProperty(PropertyName = "properties.resourceGroups")] - public IList ResourceGroups { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.resourceGroups")] + public System.Collections.Generic.IList ResourceGroups {get; set; } /// /// Gets or sets summary of monitorServices in the smart group /// - [JsonProperty(PropertyName = "properties.monitorServices")] - public IList MonitorServices { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.monitorServices")] + public System.Collections.Generic.IList MonitorServices {get; set; } /// /// Gets or sets summary of monitorConditions in the smart group /// - [JsonProperty(PropertyName = "properties.monitorConditions")] - public IList MonitorConditions { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.monitorConditions")] + public System.Collections.Generic.IList MonitorConditions {get; set; } /// /// Gets or sets summary of alertStates in the smart group /// - [JsonProperty(PropertyName = "properties.alertStates")] - public IList AlertStates { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.alertStates")] + public System.Collections.Generic.IList AlertStates {get; set; } /// /// Gets or sets summary of alertSeverities in the smart group /// - [JsonProperty(PropertyName = "properties.alertSeverities")] - public IList AlertSeverities { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.alertSeverities")] + public System.Collections.Generic.IList AlertSeverities {get; set; } /// - /// Gets or sets the URI to fetch the next page of alerts. Call - /// ListNext() with this URI to fetch the next page alerts. + /// Gets or sets the URI to fetch the next page of alerts. Call ListNext() with + /// this URI to fetch the next page alerts. /// - [JsonProperty(PropertyName = "properties.nextLink")] - public string NextLink { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties.nextLink")] + public string NextLink {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupAggregatedProperty.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupAggregatedProperty.cs index ba75c078ce70..dd4ac631b498 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupAggregatedProperty.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupAggregatedProperty.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,8 +13,7 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models public partial class SmartGroupAggregatedProperty { /// - /// Initializes a new instance of the SmartGroupAggregatedProperty - /// class. + /// Initializes a new instance of the SmartGroupAggregatedProperty class. /// public SmartGroupAggregatedProperty() { @@ -28,15 +21,19 @@ public SmartGroupAggregatedProperty() } /// - /// Initializes a new instance of the SmartGroupAggregatedProperty - /// class. + /// Initializes a new instance of the SmartGroupAggregatedProperty class. /// - /// Name of the type. - /// Total number of items of type. + + /// Name of the type. + /// + + /// Total number of items of type. + /// public SmartGroupAggregatedProperty(string name = default(string), long? count = default(long?)) + { - Name = name; - Count = count; + this.Name = name; + this.Count = count; CustomInit(); } @@ -45,17 +42,17 @@ public SmartGroupAggregatedProperty() /// partial void CustomInit(); + /// /// Gets or sets name of the type. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; set; } /// /// Gets or sets total number of items of type. /// - [JsonProperty(PropertyName = "count")] - public long? Count { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "count")] + public long? Count {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupModification.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupModification.cs index 414e11b3de0a..c021c670ee00 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupModification.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupModification.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,13 +23,23 @@ public SmartGroupModification() /// /// Initializes a new instance of the SmartGroupModification class. /// - /// Azure resource Id - /// Azure resource type - /// Azure resource name + + /// Azure resource Id + /// + + /// Azure resource type + /// + + /// Azure resource name + /// + + /// Properties of the smartGroup modification item. + /// public SmartGroupModification(string id = default(string), string type = default(string), string name = default(string), SmartGroupModificationProperties properties = default(SmartGroupModificationProperties)) - : base(id, type, name) + + : base(id, type, name) { - Properties = properties; + this.Properties = properties; CustomInit(); } @@ -44,10 +48,11 @@ public SmartGroupModification() /// partial void CustomInit(); + /// + /// Gets or sets properties of the smartGroup modification item. /// - [JsonProperty(PropertyName = "properties")] - public SmartGroupModificationProperties Properties { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] + public SmartGroupModificationProperties Properties {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupModificationEvent.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupModificationEvent.cs index 21bdcbbaada4..f68c5aaaab3a 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupModificationEvent.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupModificationEvent.cs @@ -1,33 +1,26 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; - using Newtonsoft.Json.Converters; - using System.Runtime; - using System.Runtime.Serialization; /// /// Defines values for SmartGroupModificationEvent. /// - [JsonConverter(typeof(StringEnumConverter))] + + + [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum SmartGroupModificationEvent { - [EnumMember(Value = "SmartGroupCreated")] + [System.Runtime.Serialization.EnumMember(Value = "SmartGroupCreated")] SmartGroupCreated, - [EnumMember(Value = "StateChange")] + [System.Runtime.Serialization.EnumMember(Value = "StateChange")] StateChange, - [EnumMember(Value = "AlertAdded")] + [System.Runtime.Serialization.EnumMember(Value = "AlertAdded")] AlertAdded, - [EnumMember(Value = "AlertRemoved")] + [System.Runtime.Serialization.EnumMember(Value = "AlertRemoved")] AlertRemoved } internal static class SmartGroupModificationEventEnumExtension @@ -36,7 +29,6 @@ internal static string ToSerializedValue(this SmartGroupModificationEvent? value { return value == null ? null : ((SmartGroupModificationEvent)value).ToSerializedValue(); } - internal static string ToSerializedValue(this SmartGroupModificationEvent value) { switch( value ) @@ -52,7 +44,6 @@ internal static string ToSerializedValue(this SmartGroupModificationEvent value) } return null; } - internal static SmartGroupModificationEvent? ParseSmartGroupModificationEvent(this string value) { switch( value ) @@ -69,4 +60,4 @@ internal static string ToSerializedValue(this SmartGroupModificationEvent value) return null; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupModificationItem.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupModificationItem.cs index 6f438742f3ea..74303c6116ea 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupModificationItem.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupModificationItem.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,25 +23,38 @@ public SmartGroupModificationItem() /// /// Initializes a new instance of the SmartGroupModificationItem class. /// - /// Reason for the modification. - /// Possible values include: 'SmartGroupCreated', 'StateChange', - /// 'AlertAdded', 'AlertRemoved' - /// Old value - /// New value - /// Modified date and time - /// Modified user details (Principal client - /// name) - /// Modification comments - /// Description of the modification + + /// Reason for the modification + /// Possible values include: 'SmartGroupCreated', 'StateChange', 'AlertAdded', + /// 'AlertRemoved' + + /// Old value + /// + + /// New value + /// + + /// Modified date and time + /// + + /// Modified user details (Principal client name) + /// + + /// Modification comments + /// + + /// Description of the modification + /// public SmartGroupModificationItem(SmartGroupModificationEvent? modificationEvent = default(SmartGroupModificationEvent?), string oldValue = default(string), string newValue = default(string), string modifiedAt = default(string), string modifiedBy = default(string), string comments = default(string), string description = default(string)) + { - ModificationEvent = modificationEvent; - OldValue = oldValue; - NewValue = newValue; - ModifiedAt = modifiedAt; - ModifiedBy = modifiedBy; - Comments = comments; - Description = description; + this.ModificationEvent = modificationEvent; + this.OldValue = oldValue; + this.NewValue = newValue; + this.ModifiedAt = modifiedAt; + this.ModifiedBy = modifiedBy; + this.Comments = comments; + this.Description = description; CustomInit(); } @@ -56,48 +63,47 @@ public SmartGroupModificationItem() /// partial void CustomInit(); + /// - /// Gets or sets reason for the modification. Possible values include: - /// 'SmartGroupCreated', 'StateChange', 'AlertAdded', 'AlertRemoved' + /// Gets or sets reason for the modification Possible values include: 'SmartGroupCreated', 'StateChange', 'AlertAdded', 'AlertRemoved' /// - [JsonProperty(PropertyName = "modificationEvent")] - public SmartGroupModificationEvent? ModificationEvent { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "modificationEvent")] + public SmartGroupModificationEvent? ModificationEvent {get; set; } /// /// Gets or sets old value /// - [JsonProperty(PropertyName = "oldValue")] - public string OldValue { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "oldValue")] + public string OldValue {get; set; } /// /// Gets or sets new value /// - [JsonProperty(PropertyName = "newValue")] - public string NewValue { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "newValue")] + public string NewValue {get; set; } /// /// Gets or sets modified date and time /// - [JsonProperty(PropertyName = "modifiedAt")] - public string ModifiedAt { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "modifiedAt")] + public string ModifiedAt {get; set; } /// /// Gets or sets modified user details (Principal client name) /// - [JsonProperty(PropertyName = "modifiedBy")] - public string ModifiedBy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "modifiedBy")] + public string ModifiedBy {get; set; } /// /// Gets or sets modification comments /// - [JsonProperty(PropertyName = "comments")] - public string Comments { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "comments")] + public string Comments {get; set; } /// /// Gets or sets description of the modification /// - [JsonProperty(PropertyName = "description")] - public string Description { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "description")] + public string Description {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupModificationProperties.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupModificationProperties.cs index 55980d35c0f2..39650fd8791d 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupModificationProperties.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupModificationProperties.cs @@ -1,18 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -21,8 +13,7 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models public partial class SmartGroupModificationProperties { /// - /// Initializes a new instance of the SmartGroupModificationProperties - /// class. + /// Initializes a new instance of the SmartGroupModificationProperties class. /// public SmartGroupModificationProperties() { @@ -30,19 +21,23 @@ public SmartGroupModificationProperties() } /// - /// Initializes a new instance of the SmartGroupModificationProperties - /// class. + /// Initializes a new instance of the SmartGroupModificationProperties class. /// - /// Unique Id of the smartGroup for which - /// the history is being retrieved - /// Modification details - /// URL to fetch the next set of - /// results. - public SmartGroupModificationProperties(string smartGroupId = default(string), IList modifications = default(IList), string nextLink = default(string)) + + /// Unique Id of the smartGroup for which the history is being retrieved + /// + + /// Modification details + /// + + /// URL to fetch the next set of results. + /// + public SmartGroupModificationProperties(string smartGroupId = default(string), System.Collections.Generic.IList modifications = default(System.Collections.Generic.IList), string nextLink = default(string)) + { - SmartGroupId = smartGroupId; - Modifications = modifications; - NextLink = nextLink; + this.SmartGroupId = smartGroupId; + this.Modifications = modifications; + this.NextLink = nextLink; CustomInit(); } @@ -51,24 +46,23 @@ public SmartGroupModificationProperties() /// partial void CustomInit(); + /// - /// Gets unique Id of the smartGroup for which the history is being - /// retrieved + /// Gets unique Id of the smartGroup for which the history is being retrieved /// - [JsonProperty(PropertyName = "smartGroupId")] - public string SmartGroupId { get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "smartGroupId")] + public string SmartGroupId {get; private set; } /// /// Gets or sets modification details /// - [JsonProperty(PropertyName = "modifications")] - public IList Modifications { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "modifications")] + public System.Collections.Generic.IList Modifications {get; set; } /// - /// Gets or sets URL to fetch the next set of results. + /// Gets or sets uRL to fetch the next set of results. /// - [JsonProperty(PropertyName = "nextLink")] - public string NextLink { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + public string NextLink {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupProperties.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupProperties.cs new file mode 100644 index 000000000000..57c3eb8f3736 --- /dev/null +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupProperties.cs @@ -0,0 +1,182 @@ +// 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.AlertsManagement.Models +{ + using System.Linq; + + /// + /// Properties of smart group. + /// + public partial class SmartGroupProperties + { + /// + /// Initializes a new instance of the SmartGroupProperties class. + /// + public SmartGroupProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SmartGroupProperties class. + /// + + /// Total number of alerts in smart group + /// + + /// Smart group state + /// Possible values include: 'New', 'Acknowledged', 'Closed' + + /// Severity of smart group is the highest(Sev0 >... > Sev4) severity of all + /// the alerts in the group. + /// Possible values include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' + + /// Creation time of smart group. Date-Time in ISO-8601 format. + /// + + /// Last updated time of smart group. Date-Time in ISO-8601 format. + /// + + /// Last modified by user name. + /// + + /// Summary of target resources in the smart group + /// + + /// Summary of target resource types in the smart group + /// + + /// Summary of target resource groups in the smart group + /// + + /// Summary of monitorServices in the smart group + /// + + /// Summary of monitorConditions in the smart group + /// + + /// Summary of alertStates in the smart group + /// + + /// Summary of alertSeverities in the smart group + /// + + /// The URI to fetch the next page of alerts. Call ListNext() with this URI to + /// fetch the next page alerts. + /// + public SmartGroupProperties(long? alertsCount = default(long?), string smartGroupState = default(string), string severity = default(string), System.DateTime? startDateTime = default(System.DateTime?), System.DateTime? lastModifiedDateTime = default(System.DateTime?), string lastModifiedUserName = default(string), System.Collections.Generic.IList resources = default(System.Collections.Generic.IList), System.Collections.Generic.IList resourceTypes = default(System.Collections.Generic.IList), System.Collections.Generic.IList resourceGroups = default(System.Collections.Generic.IList), System.Collections.Generic.IList monitorServices = default(System.Collections.Generic.IList), System.Collections.Generic.IList monitorConditions = default(System.Collections.Generic.IList), System.Collections.Generic.IList alertStates = default(System.Collections.Generic.IList), System.Collections.Generic.IList alertSeverities = default(System.Collections.Generic.IList), string nextLink = default(string)) + + { + this.AlertsCount = alertsCount; + this.SmartGroupState = smartGroupState; + this.Severity = severity; + this.StartDateTime = startDateTime; + this.LastModifiedDateTime = lastModifiedDateTime; + this.LastModifiedUserName = lastModifiedUserName; + this.Resources = resources; + this.ResourceTypes = resourceTypes; + this.ResourceGroups = resourceGroups; + this.MonitorServices = monitorServices; + this.MonitorConditions = monitorConditions; + this.AlertStates = alertStates; + this.AlertSeverities = alertSeverities; + this.NextLink = nextLink; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets total number of alerts in smart group + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "alertsCount")] + public long? AlertsCount {get; set; } + + /// + /// Gets smart group state Possible values include: 'New', 'Acknowledged', 'Closed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "smartGroupState")] + public string SmartGroupState {get; private set; } + + /// + /// Gets severity of smart group is the highest(Sev0 >... > Sev4) severity of + /// all the alerts in the group. Possible values include: 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "severity")] + public string Severity {get; private set; } + + /// + /// Gets creation time of smart group. Date-Time in ISO-8601 format. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "startDateTime")] + public System.DateTime? StartDateTime {get; private set; } + + /// + /// Gets last updated time of smart group. Date-Time in ISO-8601 format. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedDateTime")] + public System.DateTime? LastModifiedDateTime {get; private set; } + + /// + /// Gets last modified by user name. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedUserName")] + public string LastModifiedUserName {get; private set; } + + /// + /// Gets or sets summary of target resources in the smart group + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resources")] + public System.Collections.Generic.IList Resources {get; set; } + + /// + /// Gets or sets summary of target resource types in the smart group + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceTypes")] + public System.Collections.Generic.IList ResourceTypes {get; set; } + + /// + /// Gets or sets summary of target resource groups in the smart group + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "resourceGroups")] + public System.Collections.Generic.IList ResourceGroups {get; set; } + + /// + /// Gets or sets summary of monitorServices in the smart group + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "monitorServices")] + public System.Collections.Generic.IList MonitorServices {get; set; } + + /// + /// Gets or sets summary of monitorConditions in the smart group + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "monitorConditions")] + public System.Collections.Generic.IList MonitorConditions {get; set; } + + /// + /// Gets or sets summary of alertStates in the smart group + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "alertStates")] + public System.Collections.Generic.IList AlertStates {get; set; } + + /// + /// Gets or sets summary of alertSeverities in the smart group + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "alertSeverities")] + public System.Collections.Generic.IList AlertSeverities {get; set; } + + /// + /// Gets or sets the URI to fetch the next page of alerts. Call ListNext() with + /// this URI to fetch the next page alerts. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "nextLink")] + public string NextLink {get; set; } + } +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupsChangeStateHeaders.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupsChangeStateHeaders.cs index 9079a2b481dc..d9d8d8f32153 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupsChangeStateHeaders.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupsChangeStateHeaders.cs @@ -1,26 +1,16 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for ChangeState operation. - /// public partial class SmartGroupsChangeStateHeaders { /// - /// Initializes a new instance of the SmartGroupsChangeStateHeaders - /// class. + /// Initializes a new instance of the SmartGroupsChangeStateHeaders class. /// public SmartGroupsChangeStateHeaders() { @@ -28,13 +18,15 @@ public SmartGroupsChangeStateHeaders() } /// - /// Initializes a new instance of the SmartGroupsChangeStateHeaders - /// class. + /// Initializes a new instance of the SmartGroupsChangeStateHeaders class. /// - /// Service generated Request ID. - public SmartGroupsChangeStateHeaders(string xMsRequestId = default(string)) + + /// + /// + public SmartGroupsChangeStateHeaders(string xmsRequestId = default(string)) + { - XMsRequestId = xMsRequestId; + this.XMSRequestId = xmsRequestId; CustomInit(); } @@ -43,11 +35,11 @@ public SmartGroupsChangeStateHeaders() /// partial void CustomInit(); + /// - /// Gets or sets service generated Request ID. + /// Gets or sets /// - [JsonProperty(PropertyName = "x-ms-request-id")] - public string XMsRequestId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "x-ms-request-id")] + public string XMSRequestId {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupsGetByIdHeaders.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupsGetByIdHeaders.cs index f4b265fd8f51..1d945099829d 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupsGetByIdHeaders.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupsGetByIdHeaders.cs @@ -1,21 +1,12 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; - /// - /// Defines headers for GetById operation. - /// public partial class SmartGroupsGetByIdHeaders { /// @@ -29,10 +20,13 @@ public SmartGroupsGetByIdHeaders() /// /// Initializes a new instance of the SmartGroupsGetByIdHeaders class. /// - /// Service generated Request ID. - public SmartGroupsGetByIdHeaders(string xMsRequestId = default(string)) + + /// + /// + public SmartGroupsGetByIdHeaders(string xmsRequestId = default(string)) + { - XMsRequestId = xMsRequestId; + this.XMSRequestId = xmsRequestId; CustomInit(); } @@ -41,11 +35,11 @@ public SmartGroupsGetByIdHeaders() /// partial void CustomInit(); + /// - /// Gets or sets service generated Request ID. + /// Gets or sets /// - [JsonProperty(PropertyName = "x-ms-request-id")] - public string XMsRequestId { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "x-ms-request-id")] + public string XMSRequestId {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupsSortByFields.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupsSortByFields.cs index 651c7023266b..8d4155ad5e7b 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupsSortByFields.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SmartGroupsSortByFields.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { @@ -14,6 +9,8 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models /// /// Defines values for SmartGroupsSortByFields. /// + + public static class SmartGroupsSortByFields { public const string AlertsCount = "alertsCount"; @@ -22,4 +19,4 @@ public static class SmartGroupsSortByFields public const string StartDateTime = "startDateTime"; public const string LastModifiedDateTime = "lastModifiedDateTime"; } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SortOrder.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SortOrder.cs index 24bbdd717183..bc034b7f6d4d 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SortOrder.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SortOrder.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { @@ -14,9 +9,11 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models /// /// Defines values for SortOrder. /// + + public static class SortOrder { public const string Asc = "asc"; public const string Desc = "desc"; } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/State.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/State.cs index 38af248457a5..ff5453ec8ff4 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/State.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/State.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { @@ -14,10 +9,12 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models /// /// Defines values for State. /// + + public static class State { public const string New = "New"; public const string Acknowledged = "Acknowledged"; public const string Closed = "Closed"; } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SystemData.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SystemData.cs index 5b2236343f8f..11eebbe0dff3 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SystemData.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/SystemData.cs @@ -1,16 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -29,28 +23,33 @@ public SystemData() /// /// Initializes a new instance of the SystemData class. /// - /// The identity that created the - /// resource. - /// The type of identity that created the - /// resource. Possible values include: 'User', 'Application', - /// 'ManagedIdentity', 'Key' - /// The timestamp of resource creation - /// (UTC). - /// The identity that last modified the - /// resource. - /// The type of identity that last - /// modified the resource. Possible values include: 'User', - /// 'Application', 'ManagedIdentity', 'Key' - /// The timestamp of resource last - /// modification (UTC) + + /// The identity that created the resource. + /// + + /// The type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + + /// The timestamp of resource creation (UTC). + /// + + /// The identity that last modified the resource. + /// + + /// The type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + + /// The timestamp of resource last modification (UTC) + /// public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { - CreatedBy = createdBy; - CreatedByType = createdByType; - CreatedAt = createdAt; - LastModifiedBy = lastModifiedBy; - LastModifiedByType = lastModifiedByType; - LastModifiedAt = lastModifiedAt; + this.CreatedBy = createdBy; + this.CreatedByType = createdByType; + this.CreatedAt = createdAt; + this.LastModifiedBy = lastModifiedBy; + this.LastModifiedByType = lastModifiedByType; + this.LastModifiedAt = lastModifiedAt; CustomInit(); } @@ -59,45 +58,41 @@ public SystemData() /// partial void CustomInit(); + /// /// Gets or sets the identity that created the resource. /// - [JsonProperty(PropertyName = "createdBy")] - public string CreatedBy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createdBy")] + public string CreatedBy {get; set; } /// - /// Gets or sets the type of identity that created the resource. - /// Possible values include: 'User', 'Application', 'ManagedIdentity', - /// 'Key' + /// Gets or sets the type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' /// - [JsonProperty(PropertyName = "createdByType")] - public string CreatedByType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createdByType")] + public string CreatedByType {get; set; } /// /// Gets or sets the timestamp of resource creation (UTC). /// - [JsonProperty(PropertyName = "createdAt")] - public System.DateTime? CreatedAt { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt {get; set; } /// /// Gets or sets the identity that last modified the resource. /// - [JsonProperty(PropertyName = "lastModifiedBy")] - public string LastModifiedBy { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy {get; set; } /// - /// Gets or sets the type of identity that last modified the resource. - /// Possible values include: 'User', 'Application', 'ManagedIdentity', - /// 'Key' + /// Gets or sets the type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' /// - [JsonProperty(PropertyName = "lastModifiedByType")] - public string LastModifiedByType { get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType {get; set; } /// /// Gets or sets the timestamp of resource last modification (UTC) /// - [JsonProperty(PropertyName = "lastModifiedAt")] - public System.DateTime? LastModifiedAt { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt {get; set; } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/TimeRange.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/TimeRange.cs index ce81c3a80711..7d43b82d23ea 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/TimeRange.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/TimeRange.cs @@ -1,12 +1,7 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { @@ -14,11 +9,13 @@ namespace Microsoft.Azure.Management.AlertsManagement.Models /// /// Defines values for TimeRange. /// + + public static class TimeRange { - public const string Oneh = "1h"; - public const string Oned = "1d"; - public const string Sevend = "7d"; - public const string ThreeZerod = "30d"; + public const string OneH = "1h"; + public const string OneD = "1d"; + public const string SevenD = "7d"; + public const string ThirtyD = "30d"; } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/WeeklyRecurrence.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/WeeklyRecurrence.cs index ce8d2ee311ee..5ee53bb9bbcb 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/WeeklyRecurrence.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Models/WeeklyRecurrence.cs @@ -1,19 +1,10 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement.Models { - using Microsoft.Rest; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -33,14 +24,20 @@ public WeeklyRecurrence() /// /// Initializes a new instance of the WeeklyRecurrence class. /// - /// Specifies the values for weekly recurrence - /// pattern. - /// Start time for recurrence. - /// End time for recurrence. - public WeeklyRecurrence(IList daysOfWeek, string startTime = default(string), string endTime = default(string)) - : base(startTime, endTime) + + /// Start time for recurrence. + /// + + /// End time for recurrence. + /// + + /// Specifies the values for weekly recurrence pattern. + /// + public WeeklyRecurrence(System.Collections.Generic.IList daysOfWeek, string startTime = default(string), string endTime = default(string)) + + : base(startTime, endTime) { - DaysOfWeek = daysOfWeek; + this.DaysOfWeek = daysOfWeek; CustomInit(); } @@ -49,24 +46,25 @@ public WeeklyRecurrence() /// partial void CustomInit(); + /// /// Gets or sets specifies the values for weekly recurrence pattern. /// - [JsonProperty(PropertyName = "daysOfWeek")] - public IList DaysOfWeek { get; set; } - + [Newtonsoft.Json.JsonProperty(PropertyName = "daysOfWeek")] + public System.Collections.Generic.IList DaysOfWeek {get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (DaysOfWeek == null) + if (this.DaysOfWeek == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "DaysOfWeek"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "DaysOfWeek"); } + } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Operations.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Operations.cs index 079216703675..8c3841604ace 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/Operations.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/Operations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// Operations operations. /// - internal partial class Operations : IServiceOperations, IOperations + internal partial class Operations : Microsoft.Rest.IServiceOperations, IOperations { /// /// Initializes a new instance of the Operations class. @@ -36,13 +24,13 @@ internal partial class Operations : IServiceOperations, /// /// Thrown when a required parameter is null /// - internal Operations(AlertsManagementClient client) + internal Operations (AlertsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,8 +39,7 @@ internal Operations(AlertsManagementClient client) public AlertsManagementClient Client { get; private set; } /// - /// List all operations available through Azure Alerts Management Resource - /// Provider. + /// List all operations available through Azure Alerts Management Resource Provider. /// /// /// Headers that will be added to request. @@ -60,33 +47,47 @@ internal Operations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + + + + string apiVersion = "2019-05-05-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.AlertsManagement/operations").ToString(); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -96,25 +97,24 @@ internal Operations(AlertsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -126,50 +126,51 @@ internal Operations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -179,9 +180,10 @@ internal Operations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -192,28 +194,31 @@ internal Operations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// List all operations available through Azure Alerts Management Resource - /// Provider. + /// List all operations available through Azure Alerts Management Resource Provider. /// /// /// The NextLink from the previous successful call to List operation. @@ -224,13 +229,13 @@ internal Operations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -239,51 +244,53 @@ internal Operations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -295,50 +302,51 @@ internal Operations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGenerated2Exception(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseAutoGenerated2 _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -348,9 +356,10 @@ internal Operations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -361,24 +370,28 @@ internal Operations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/OperationsExtensions.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/OperationsExtensions.cs index 30f85828f349..7ae5fe1ff449 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/OperationsExtensions.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/OperationsExtensions.cs @@ -1,91 +1,76 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for Operations. + /// Extension methods for Operations /// public static partial class OperationsExtensions { - /// - /// List all operations available through Azure Alerts Management Resource - /// Provider. - /// - /// - /// The operations group for this extension method. - /// - public static IPage List(this IOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } + /// + /// List all operations available through Azure Alerts Management Resource Provider. + /// + /// + /// The operations group for this extension method. + /// + public static Microsoft.Rest.Azure.IPage List(this IOperations operations) + { + return ((IOperations)operations).ListAsync().GetAwaiter().GetResult(); + } - /// - /// List all operations available through Azure Alerts Management Resource - /// Provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// List all operations available through Azure Alerts Management Resource Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListAsync(this IOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List all operations available through Azure Alerts Management Resource Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IOperations operations, string nextPageLink) + { + return ((IOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// List all operations available through Azure Alerts Management Resource - /// Provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IOperations operations, string nextPageLink) + /// + /// List all operations available through Azure Alerts Management Resource Provider. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// List all operations available through Azure Alerts Management Resource - /// Provider. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/SdkInfo_AlertsManagementClient.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/SdkInfo_AlertsManagementClient.cs deleted file mode 100644 index 4ab23101e302..000000000000 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/SdkInfo_AlertsManagementClient.cs +++ /dev/null @@ -1,30 +0,0 @@ - -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.AlertsManagement -{ - using System; - using System.Collections.Generic; - using System.Linq; - - internal static partial class SdkInfo - { - public static IEnumerable> ApiInfo_AlertsManagementClient - { - get - { - return new Tuple[] - { - new Tuple("AlertsManagement", "AlertProcessingRules", "2021-08-08"), - new Tuple("AlertsManagement", "Alerts", "2019-05-05-preview"), - new Tuple("AlertsManagement", "Operations", "2019-05-05-preview"), - new Tuple("AlertsManagement", "SmartGroups", "2019-05-05-preview"), - }.AsEnumerable(); - } - } - } -} diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/SmartGroupsOperations.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/SmartGroupsOperations.cs index 4ea12658fddf..e0471528f4b6 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/SmartGroupsOperations.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/SmartGroupsOperations.cs @@ -1,31 +1,19 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement { + using System.Linq; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// SmartGroupsOperations operations. /// - internal partial class SmartGroupsOperations : IServiceOperations, ISmartGroupsOperations + internal partial class SmartGroupsOperations : Microsoft.Rest.IServiceOperations, ISmartGroupsOperations { /// /// Initializes a new instance of the SmartGroupsOperations class. @@ -36,13 +24,13 @@ internal partial class SmartGroupsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal SmartGroupsOperations(AlertsManagementClient client) + internal SmartGroupsOperations (AlertsManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - Client = client; + this.Client = client; } /// @@ -51,14 +39,10 @@ internal SmartGroupsOperations(AlertsManagementClient client) public AlertsManagementClient Client { get; private set; } /// - /// Get all Smart Groups within a specified subscription + /// List all the Smart Groups within a specified subscription. /// - /// - /// List all the Smart Groups within a specified subscription. - /// /// - /// Filter by target resource( which is full ARM ID) Default value is select - /// all. + /// Filter by target resource( which is full ARM ID) Default value is select all. /// /// /// Filter by target resource group name. Default value is select all. @@ -67,43 +51,28 @@ internal SmartGroupsOperations(AlertsManagementClient client) /// Filter by target resource type. Default value is select all. /// /// - /// Filter by monitor service which generates the alert instance. Default value - /// is select all. Possible values include: 'Application Insights', - /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog - /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log - /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', - /// 'VM Insights', 'Zabbix' + /// Filter by monitor service which generates the alert instance. Default value is select all. /// /// - /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default - /// value is to select all. Possible values include: 'Fired', 'Resolved' + /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all. /// /// - /// Filter by severity. Default value is select all. Possible values include: - /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' + /// Filter by severity. Default value is select all. /// /// /// Filter by state of the smart group. Default value is to select all. - /// Possible values include: 'New', 'Acknowledged', 'Closed' /// /// /// Filter by time range by below listed values. Default value is 1 day. - /// Possible values include: '1h', '1d', '7d', '30d' /// /// - /// Determines number of alerts returned per page in response. Permissible - /// value is between 1 to 250. When the "includeContent" filter is selected, - /// maximum value allowed is 25. Default value is 25. + /// Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the "includeContent" filter is selected, maximum value allowed is 25. Default value is 25. /// /// - /// Sort the query results by input field. Default value is sort by - /// 'lastModifiedDateTime'. Possible values include: 'alertsCount', 'state', - /// 'severity', 'startDateTime', 'lastModifiedDateTime' + /// Sort the query results by input field. Default value is sort by 'lastModifiedDateTime'. /// /// - /// Sort the query results order in either ascending or descending. Default - /// value is 'desc' for time fields and 'asc' for others. Possible values - /// include: 'asc', 'desc' + /// Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others. /// /// /// Headers that will be added to request. @@ -111,13 +80,13 @@ internal SmartGroupsOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -126,27 +95,42 @@ internal SmartGroupsOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetAllWithHttpMessagesAsync(string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> GetAllWithHttpMessagesAsync(string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } + + + + + + + + + + + string apiVersion = "2019-05-05-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("targetResource", targetResource); tracingParameters.Add("targetResourceGroup", targetResourceGroup); tracingParameters.Add("targetResourceType", targetResourceType); @@ -159,14 +143,18 @@ internal SmartGroupsOperations(AlertsManagementClient client) tracingParameters.Add("sortBy", sortBy); tracingParameters.Add("sortOrder", sortOrder); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAll", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetAll", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (targetResource != null) { _queryParameters.Add(string.Format("targetResource={0}", System.Uri.EscapeDataString(targetResource))); @@ -201,7 +189,7 @@ internal SmartGroupsOperations(AlertsManagementClient client) } if (pageCount != null) { - _queryParameters.Add(string.Format("pageCount={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(pageCount, Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("pageCount={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(pageCount, this.Client.SerializationSettings).Trim('"')))); } if (sortBy != null) { @@ -220,25 +208,24 @@ internal SmartGroupsOperations(AlertsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -250,50 +237,51 @@ internal SmartGroupsOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -303,9 +291,10 @@ internal SmartGroupsOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -316,33 +305,34 @@ internal SmartGroupsOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Get information related to a specific Smart Group. /// - /// - /// Get information related to a specific Smart Group. - /// /// - /// Smart group unique id. + /// Smart group unique id. /// /// /// Headers that will be added to request. @@ -350,13 +340,13 @@ internal SmartGroupsOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -365,42 +355,51 @@ internal SmartGroupsOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetByIdWithHttpMessagesAsync(string smartGroupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetByIdWithHttpMessagesAsync(string smartGroupId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (smartGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "smartGroupId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "smartGroupId"); } + string apiVersion = "2019-05-05-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("smartGroupId", smartGroupId); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetById", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetById", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups/{smartGroupId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{smartGroupId}", System.Uri.EscapeDataString(smartGroupId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -410,25 +409,24 @@ internal SmartGroupsOperations(AlertsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -440,50 +438,51 @@ internal SmartGroupsOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -493,9 +492,10 @@ internal SmartGroupsOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -506,47 +506,50 @@ internal SmartGroupsOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// /// Change the state of a Smart Group. /// /// - /// Smart group unique id. + /// Smart group unique id. /// /// - /// New state of the alert. Possible values include: 'New', 'Acknowledged', - /// 'Closed' + /// New state of the alert. /// /// /// Headers that will be added to request. @@ -554,13 +557,13 @@ internal SmartGroupsOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -569,47 +572,57 @@ internal SmartGroupsOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ChangeStateWithHttpMessagesAsync(string smartGroupId, string newState, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> ChangeStateWithHttpMessagesAsync(string smartGroupId, string newState, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (smartGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "smartGroupId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "smartGroupId"); } + if (newState == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "newState"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "newState"); } + string apiVersion = "2019-05-05-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("smartGroupId", smartGroupId); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("newState", newState); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ChangeState", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ChangeState", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups/{smartGroupId}/changeState").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{smartGroupId}", System.Uri.EscapeDataString(smartGroupId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -623,25 +636,24 @@ internal SmartGroupsOperations(AlertsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -653,50 +665,51 @@ internal SmartGroupsOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -706,9 +719,10 @@ internal SmartGroupsOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -719,44 +733,47 @@ internal SmartGroupsOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Get the history a smart group, which captures any Smart Group state changes - /// (New/Acknowledged/Closed) . + /// Get the history a smart group, which captures any Smart Group state changes (New/Acknowledged/Closed) . /// /// - /// Smart group unique id. + /// Smart group unique id. /// /// /// Headers that will be added to request. @@ -764,13 +781,13 @@ internal SmartGroupsOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -779,42 +796,51 @@ internal SmartGroupsOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetHistoryWithHttpMessagesAsync(string smartGroupId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task> GetHistoryWithHttpMessagesAsync(string smartGroupId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (Client.SubscriptionId == null) + + + + + if (this.Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (Client.SubscriptionId != null) + if (this.Client.SubscriptionId != null) { - if (Client.SubscriptionId.Length < 1) + if (this.Client.SubscriptionId.Length < 1) { - throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); } } if (smartGroupId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "smartGroupId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "smartGroupId"); } + string apiVersion = "2019-05-05-preview"; // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("smartGroupId", smartGroupId); tracingParameters.Add("apiVersion", apiVersion); + + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetHistory", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetHistory", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; + + var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups/{smartGroupId}/history").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); _url = _url.Replace("{smartGroupId}", System.Uri.EscapeDataString(smartGroupId)); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); @@ -824,25 +850,24 @@ internal SmartGroupsOperations(AlertsManagementClient client) _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -854,50 +879,51 @@ internal SmartGroupsOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -907,9 +933,10 @@ internal SmartGroupsOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.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(); @@ -920,31 +947,32 @@ internal SmartGroupsOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } /// - /// Get all Smart Groups within a specified subscription + /// List all the Smart Groups within a specified subscription. /// - /// - /// List all the Smart Groups within a specified subscription. - /// /// /// The NextLink from the previous successful call to List operation. /// @@ -954,13 +982,13 @@ internal SmartGroupsOperations(AlertsManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// /// Thrown when a required parameter is null /// /// @@ -969,51 +997,53 @@ internal SmartGroupsOperations(AlertsManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetAllNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async System.Threading.Tasks.Task>> GetAllNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAllNext", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetAllNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (Client.AcceptLanguage != null) + if (this.Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (customHeaders != null) { foreach(var _header in customHeaders) @@ -1025,50 +1055,51 @@ internal SmartGroupsOperations(AlertsManagementClient client) _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); } } - // Serialize Request string _requestContent = null; // Set Credentials - if (Client.Credentials != null) + if (this.Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - HttpStatusCode _statusCode = _httpResponse.StatusCode; + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; + if ((int)_statusCode != 200) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseAutoGeneratedException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorResponseAutoGenerated _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; } } - catch (JsonException) + catch (Newtonsoft.Json.JsonException) { // Ignore the exception } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { - ServiceClientTracing.Error(_invocationId, ex); + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1078,9 +1109,10 @@ internal SmartGroupsOperations(AlertsManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.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(); @@ -1091,24 +1123,28 @@ internal SmartGroupsOperations(AlertsManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } - catch (JsonException ex) + catch (Newtonsoft.Json.JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - ServiceClientTracing.Exit(_invocationId, _result); + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); } return _result; - } + + + + + } } -} +} \ No newline at end of file diff --git a/src/AlertsManagement/AlertsManagement.Sdk/Generated/SmartGroupsOperationsExtensions.cs b/src/AlertsManagement/AlertsManagement.Sdk/Generated/SmartGroupsOperationsExtensions.cs index a14927b11e3c..60cfff694625 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/Generated/SmartGroupsOperationsExtensions.cs +++ b/src/AlertsManagement/AlertsManagement.Sdk/Generated/SmartGroupsOperationsExtensions.cs @@ -1,315 +1,247 @@ -// // Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// +// 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. -// - +// Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Microsoft.Azure.Management.AlertsManagement { - using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Threading; - using System.Threading.Tasks; /// - /// Extension methods for SmartGroupsOperations. + /// Extension methods for SmartGroupsOperations /// public static partial class SmartGroupsOperationsExtensions { - /// - /// Get all Smart Groups within a specified subscription - /// - /// - /// List all the Smart Groups within a specified subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Filter by target resource( which is full ARM ID) Default value is select - /// all. - /// - /// - /// Filter by target resource group name. Default value is select all. - /// - /// - /// Filter by target resource type. Default value is select all. - /// - /// - /// Filter by monitor service which generates the alert instance. Default value - /// is select all. Possible values include: 'Application Insights', - /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog - /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log - /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', - /// 'VM Insights', 'Zabbix' - /// - /// - /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default - /// value is to select all. Possible values include: 'Fired', 'Resolved' - /// - /// - /// Filter by severity. Default value is select all. Possible values include: - /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' - /// - /// - /// Filter by state of the smart group. Default value is to select all. - /// Possible values include: 'New', 'Acknowledged', 'Closed' - /// - /// - /// Filter by time range by below listed values. Default value is 1 day. - /// Possible values include: '1h', '1d', '7d', '30d' - /// - /// - /// Determines number of alerts returned per page in response. Permissible - /// value is between 1 to 250. When the "includeContent" filter is selected, - /// maximum value allowed is 25. Default value is 25. - /// - /// - /// Sort the query results by input field. Default value is sort by - /// 'lastModifiedDateTime'. Possible values include: 'alertsCount', 'state', - /// 'severity', 'startDateTime', 'lastModifiedDateTime' - /// - /// - /// Sort the query results order in either ascending or descending. Default - /// value is 'desc' for time fields and 'asc' for others. Possible values - /// include: 'asc', 'desc' - /// - public static IPage GetAll(this ISmartGroupsOperations operations, string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string)) - { - return operations.GetAllAsync(targetResource, targetResourceGroup, targetResourceType, monitorService, monitorCondition, severity, smartGroupState, timeRange, pageCount, sortBy, sortOrder).GetAwaiter().GetResult(); - } - - /// - /// Get all Smart Groups within a specified subscription - /// - /// - /// List all the Smart Groups within a specified subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Filter by target resource( which is full ARM ID) Default value is select - /// all. - /// - /// - /// Filter by target resource group name. Default value is select all. - /// - /// - /// Filter by target resource type. Default value is select all. - /// - /// - /// Filter by monitor service which generates the alert instance. Default value - /// is select all. Possible values include: 'Application Insights', - /// 'ActivityLog Administrative', 'ActivityLog Security', 'ActivityLog - /// Recommendation', 'ActivityLog Policy', 'ActivityLog Autoscale', 'Log - /// Analytics', 'Nagios', 'Platform', 'SCOM', 'ServiceHealth', 'SmartDetector', - /// 'VM Insights', 'Zabbix' - /// - /// - /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default - /// value is to select all. Possible values include: 'Fired', 'Resolved' - /// - /// - /// Filter by severity. Default value is select all. Possible values include: - /// 'Sev0', 'Sev1', 'Sev2', 'Sev3', 'Sev4' - /// - /// - /// Filter by state of the smart group. Default value is to select all. - /// Possible values include: 'New', 'Acknowledged', 'Closed' - /// - /// - /// Filter by time range by below listed values. Default value is 1 day. - /// Possible values include: '1h', '1d', '7d', '30d' - /// - /// - /// Determines number of alerts returned per page in response. Permissible - /// value is between 1 to 250. When the "includeContent" filter is selected, - /// maximum value allowed is 25. Default value is 25. - /// - /// - /// Sort the query results by input field. Default value is sort by - /// 'lastModifiedDateTime'. Possible values include: 'alertsCount', 'state', - /// 'severity', 'startDateTime', 'lastModifiedDateTime' - /// - /// - /// Sort the query results order in either ascending or descending. Default - /// value is 'desc' for time fields and 'asc' for others. Possible values - /// include: 'asc', 'desc' - /// - /// - /// The cancellation token. - /// - public static async Task> GetAllAsync(this ISmartGroupsOperations operations, string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAllWithHttpMessagesAsync(targetResource, targetResourceGroup, targetResourceType, monitorService, monitorCondition, severity, smartGroupState, timeRange, pageCount, sortBy, sortOrder, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get information related to a specific Smart Group. - /// - /// - /// Get information related to a specific Smart Group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Smart group unique id. - /// - public static SmartGroup GetById(this ISmartGroupsOperations operations, string smartGroupId) - { - return operations.GetByIdAsync(smartGroupId).GetAwaiter().GetResult(); - } - - /// - /// Get information related to a specific Smart Group. - /// - /// - /// Get information related to a specific Smart Group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Smart group unique id. - /// - /// - /// The cancellation token. - /// - public static async Task GetByIdAsync(this ISmartGroupsOperations operations, string smartGroupId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetByIdWithHttpMessagesAsync(smartGroupId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } + /// + /// List all the Smart Groups within a specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Filter by target resource( which is full ARM ID) Default value is select all. + /// + /// + /// Filter by target resource group name. Default value is select all. + /// + /// + /// Filter by target resource type. Default value is select all. + /// + /// + /// Filter by monitor service which generates the alert instance. Default value is select all. + /// + /// + /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all. + /// + /// + /// Filter by severity. Default value is select all. + /// + /// + /// Filter by state of the smart group. Default value is to select all. + /// + /// + /// Filter by time range by below listed values. Default value is 1 day. + /// + /// + /// Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the "includeContent" filter is selected, maximum value allowed is 25. Default value is 25. + /// + /// + /// Sort the query results by input field. Default value is sort by 'lastModifiedDateTime'. + /// + /// + /// Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others. + /// + public static Microsoft.Rest.Azure.IPage GetAll(this ISmartGroupsOperations operations, string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string)) + { + return ((ISmartGroupsOperations)operations).GetAllAsync(targetResource, targetResourceGroup, targetResourceType, monitorService, monitorCondition, severity, smartGroupState, timeRange, pageCount, sortBy, sortOrder).GetAwaiter().GetResult(); + } - /// - /// Change the state of a Smart Group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Smart group unique id. - /// - /// - /// New state of the alert. Possible values include: 'New', 'Acknowledged', - /// 'Closed' - /// - public static SmartGroup ChangeState(this ISmartGroupsOperations operations, string smartGroupId, string newState) + /// + /// List all the Smart Groups within a specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Filter by target resource( which is full ARM ID) Default value is select all. + /// + /// + /// Filter by target resource group name. Default value is select all. + /// + /// + /// Filter by target resource type. Default value is select all. + /// + /// + /// Filter by monitor service which generates the alert instance. Default value is select all. + /// + /// + /// Filter by monitor condition which is either 'Fired' or 'Resolved'. Default value is to select all. + /// + /// + /// Filter by severity. Default value is select all. + /// + /// + /// Filter by state of the smart group. Default value is to select all. + /// + /// + /// Filter by time range by below listed values. Default value is 1 day. + /// + /// + /// Determines number of alerts returned per page in response. Permissible value is between 1 to 250. When the "includeContent" filter is selected, maximum value allowed is 25. Default value is 25. + /// + /// + /// Sort the query results by input field. Default value is sort by 'lastModifiedDateTime'. + /// + /// + /// Sort the query results order in either ascending or descending. Default value is 'desc' for time fields and 'asc' for others. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> GetAllAsync(this ISmartGroupsOperations operations, string targetResource = default(string), string targetResourceGroup = default(string), string targetResourceType = default(string), string monitorService = default(string), string monitorCondition = default(string), string severity = default(string), string smartGroupState = default(string), string timeRange = default(string), long? pageCount = default(long?), string sortBy = default(string), string sortOrder = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAllWithHttpMessagesAsync(targetResource, targetResourceGroup, targetResourceType, monitorService, monitorCondition, severity, smartGroupState, timeRange, pageCount, sortBy, sortOrder, null, cancellationToken).ConfigureAwait(false)) { - return operations.ChangeStateAsync(smartGroupId, newState).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get information related to a specific Smart Group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Smart group unique id. + /// + public static SmartGroup GetById(this ISmartGroupsOperations operations, string smartGroupId) + { + return ((ISmartGroupsOperations)operations).GetByIdAsync(smartGroupId).GetAwaiter().GetResult(); + } - /// - /// Change the state of a Smart Group. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Smart group unique id. - /// - /// - /// New state of the alert. Possible values include: 'New', 'Acknowledged', - /// 'Closed' - /// - /// - /// The cancellation token. - /// - public static async Task ChangeStateAsync(this ISmartGroupsOperations operations, string smartGroupId, string newState, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get information related to a specific Smart Group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Smart group unique id. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetByIdAsync(this ISmartGroupsOperations operations, string smartGroupId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetByIdWithHttpMessagesAsync(smartGroupId, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.ChangeStateWithHttpMessagesAsync(smartGroupId, newState, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// Change the state of a Smart Group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Smart group unique id. + /// + /// + /// New state of the alert. + /// + public static SmartGroup ChangeState(this ISmartGroupsOperations operations, string smartGroupId, string newState) + { + return ((ISmartGroupsOperations)operations).ChangeStateAsync(smartGroupId, newState).GetAwaiter().GetResult(); + } - /// - /// Get the history a smart group, which captures any Smart Group state changes - /// (New/Acknowledged/Closed) . - /// - /// - /// The operations group for this extension method. - /// - /// - /// Smart group unique id. - /// - public static SmartGroupModification GetHistory(this ISmartGroupsOperations operations, string smartGroupId) + /// + /// Change the state of a Smart Group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Smart group unique id. + /// + /// + /// New state of the alert. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ChangeStateAsync(this ISmartGroupsOperations operations, string smartGroupId, string newState, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ChangeStateWithHttpMessagesAsync(smartGroupId, newState, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetHistoryAsync(smartGroupId).GetAwaiter().GetResult(); + return _result.Body; } + } + /// + /// Get the history a smart group, which captures any Smart Group state changes (New/Acknowledged/Closed) . + /// + /// + /// The operations group for this extension method. + /// + /// + /// Smart group unique id. + /// + public static SmartGroupModification GetHistory(this ISmartGroupsOperations operations, string smartGroupId) + { + return ((ISmartGroupsOperations)operations).GetHistoryAsync(smartGroupId).GetAwaiter().GetResult(); + } - /// - /// Get the history a smart group, which captures any Smart Group state changes - /// (New/Acknowledged/Closed) . - /// - /// - /// The operations group for this extension method. - /// - /// - /// Smart group unique id. - /// - /// - /// The cancellation token. - /// - public static async Task GetHistoryAsync(this ISmartGroupsOperations operations, string smartGroupId, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// Get the history a smart group, which captures any Smart Group state changes (New/Acknowledged/Closed) . + /// + /// + /// The operations group for this extension method. + /// + /// + /// Smart group unique id. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task GetHistoryAsync(this ISmartGroupsOperations operations, string smartGroupId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetHistoryWithHttpMessagesAsync(smartGroupId, null, cancellationToken).ConfigureAwait(false)) { - using (var _result = await operations.GetHistoryWithHttpMessagesAsync(smartGroupId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } + return _result.Body; } + } + /// + /// List all the Smart Groups within a specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage GetAllNext(this ISmartGroupsOperations operations, string nextPageLink) + { + return ((ISmartGroupsOperations)operations).GetAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + } - /// - /// Get all Smart Groups within a specified subscription - /// - /// - /// List all the Smart Groups within a specified subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage GetAllNext(this ISmartGroupsOperations operations, string nextPageLink) + /// + /// List all the Smart Groups within a specified subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> GetAllNextAsync(this ISmartGroupsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.GetAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { - return operations.GetAllNextAsync(nextPageLink).GetAwaiter().GetResult(); + return _result.Body; } - - /// - /// Get all Smart Groups within a specified subscription - /// - /// - /// List all the Smart Groups within a specified subscription. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> GetAllNextAsync(this ISmartGroupsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAllNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - + } } } diff --git a/src/AlertsManagement/AlertsManagement.Sdk/README.md b/src/AlertsManagement/AlertsManagement.Sdk/README.md index 33f9d168517e..2aca53efea58 100644 --- a/src/AlertsManagement/AlertsManagement.Sdk/README.md +++ b/src/AlertsManagement/AlertsManagement.Sdk/README.md @@ -5,14 +5,14 @@ This directory contains management plane service clients of Az.AlertsManagement In this directory, run AutoRest: ``` autorest --reset -autorest --use:@microsoft.azure/autorest.csharp@2.3.90 -autorest.cmd README.md --version=v2 +autorest --use:@autorest/powershell@4.x ``` ### AutoRest Configuration > see https://aka.ms/autorest ``` yaml -csharp: true +isSdkGenerator: true +powershell: true clear-output-folder: true reflect-api-versions: true azure-arm: true diff --git a/tools/StaticAnalysis/GeneratedSdkAnalyzer/SDKGeneratedCodeVerify.ps1 b/tools/StaticAnalysis/GeneratedSdkAnalyzer/SDKGeneratedCodeVerify.ps1 index bb48dcd1278b..62ac07303066 100644 --- a/tools/StaticAnalysis/GeneratedSdkAnalyzer/SDKGeneratedCodeVerify.ps1 +++ b/tools/StaticAnalysis/GeneratedSdkAnalyzer/SDKGeneratedCodeVerify.ps1 @@ -29,7 +29,7 @@ Class GeneratedSdkIssue { $ExceptionList = @() $SavePath = $PWD -$skipModules = @('Az.KeyVault', 'Az.CosmosDB') +$skipModules = @('Az.KeyVault', 'Az.CosmosDB', 'Az.AlertsManagement') $MissReadMe = 9000 $GenSdkChanged = 9090