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