diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ActionGroupsOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ActionGroupsOperations.cs
new file mode 100644
index 000000000000..dbbf72da5321
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ActionGroupsOperations.cs
@@ -0,0 +1,1206 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ 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;
+
+ ///
+ /// ActionGroupsOperations operations.
+ ///
+ internal partial class ActionGroupsOperations : IServiceOperations, IActionGroupsOperations
+ {
+ ///
+ /// Initializes a new instance of the ActionGroupsOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal ActionGroupsOperations(MonitorManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the MonitorManagementClient
+ ///
+ public MonitorManagementClient Client { get; private set; }
+
+ ///
+ /// Create a new action group or update an existing one.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the action group.
+ ///
+ ///
+ /// The action group to create or use for the update.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string actionGroupName, ActionGroupResource actionGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (actionGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "actionGroupName");
+ }
+ if (actionGroup == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "actionGroup");
+ }
+ if (actionGroup != null)
+ {
+ actionGroup.Validate();
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string apiVersion = "2017-04-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("actionGroupName", actionGroupName);
+ tracingParameters.Add("actionGroup", actionGroup);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{actionGroupName}", System.Uri.EscapeDataString(actionGroupName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(actionGroup != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(actionGroup, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Get an action group.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the action group.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string actionGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (actionGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "actionGroupName");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string apiVersion = "2017-04-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("actionGroupName", actionGroupName);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{actionGroupName}", System.Uri.EscapeDataString(actionGroupName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 404)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Delete an action group.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the action group.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string actionGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (actionGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "actionGroupName");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string apiVersion = "2017-04-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("actionGroupName", actionGroupName);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{actionGroupName}", System.Uri.EscapeDataString(actionGroupName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 204)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Get a list of all action groups in a subscription.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListBySubscriptionIdWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string apiVersion = "2017-04-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionId", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/actionGroups").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Get a list of all action groups in a resource group.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string apiVersion = "2017-04-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Enable a receiver in an action group. This changes the receiver's status
+ /// from Disabled to Enabled.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the action group.
+ ///
+ ///
+ /// The name of the receiver to resubscribe.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task EnableReceiverWithHttpMessagesAsync(string resourceGroupName, string actionGroupName, string receiverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (actionGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "actionGroupName");
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (receiverName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "receiverName");
+ }
+ string apiVersion = "2017-04-01";
+ EnableRequest enableRequest = new EnableRequest();
+ if (receiverName != null)
+ {
+ enableRequest.ReceiverName = receiverName;
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("actionGroupName", actionGroupName);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("enableRequest", enableRequest);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "EnableReceiver", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}/subscribe").ToString();
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{actionGroupName}", System.Uri.EscapeDataString(actionGroupName));
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("POST");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(enableRequest != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(enableRequest, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 409 && (int)_statusCode != 404)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ActionGroupsOperationsExtensions.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ActionGroupsOperationsExtensions.cs
new file mode 100644
index 000000000000..c5256dee0a1c
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ActionGroupsOperationsExtensions.cs
@@ -0,0 +1,258 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for ActionGroupsOperations.
+ ///
+ public static partial class ActionGroupsOperationsExtensions
+ {
+ ///
+ /// Create a new action group or update an existing one.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the action group.
+ ///
+ ///
+ /// The action group to create or use for the update.
+ ///
+ public static ActionGroupResource CreateOrUpdate(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName, ActionGroupResource actionGroup)
+ {
+ return operations.CreateOrUpdateAsync(resourceGroupName, actionGroupName, actionGroup).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Create a new action group or update an existing one.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the action group.
+ ///
+ ///
+ /// The action group to create or use for the update.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CreateOrUpdateAsync(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName, ActionGroupResource actionGroup, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, actionGroupName, actionGroup, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get an action group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the action group.
+ ///
+ public static ActionGroupResource Get(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName)
+ {
+ return operations.GetAsync(resourceGroupName, actionGroupName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get an action group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the action group.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, actionGroupName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Delete an action group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the action group.
+ ///
+ public static void Delete(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName)
+ {
+ operations.DeleteAsync(resourceGroupName, actionGroupName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Delete an action group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the action group.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeleteAsync(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, actionGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// Get a list of all action groups in a subscription.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ public static IEnumerable ListBySubscriptionId(this IActionGroupsOperations operations)
+ {
+ return operations.ListBySubscriptionIdAsync().GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get a list of all action groups in a subscription.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListBySubscriptionIdAsync(this IActionGroupsOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListBySubscriptionIdWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get a list of all action groups in a resource group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ public static IEnumerable ListByResourceGroup(this IActionGroupsOperations operations, string resourceGroupName)
+ {
+ return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get a list of all action groups in a resource group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByResourceGroupAsync(this IActionGroupsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Enable a receiver in an action group. This changes the receiver's status
+ /// from Disabled to Enabled.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the action group.
+ ///
+ ///
+ /// The name of the receiver to resubscribe.
+ ///
+ public static void EnableReceiver(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName, string receiverName)
+ {
+ operations.EnableReceiverAsync(resourceGroupName, actionGroupName, receiverName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Enable a receiver in an action group. This changes the receiver's status
+ /// from Disabled to Enabled.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the action group.
+ ///
+ ///
+ /// The name of the receiver to resubscribe.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task EnableReceiverAsync(this IActionGroupsOperations operations, string resourceGroupName, string actionGroupName, string receiverName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.EnableReceiverWithHttpMessagesAsync(resourceGroupName, actionGroupName, receiverName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ActivityLogAlertsOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ActivityLogAlertsOperations.cs
new file mode 100644
index 000000000000..a7eb0aa3dbbf
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ActivityLogAlertsOperations.cs
@@ -0,0 +1,1192 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ 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;
+
+ ///
+ /// ActivityLogAlertsOperations operations.
+ ///
+ internal partial class ActivityLogAlertsOperations : IServiceOperations, IActivityLogAlertsOperations
+ {
+ ///
+ /// Initializes a new instance of the ActivityLogAlertsOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal ActivityLogAlertsOperations(MonitorManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the MonitorManagementClient
+ ///
+ public MonitorManagementClient Client { get; private set; }
+
+ ///
+ /// Create a new activity log alert or update an existing one.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the activity log alert.
+ ///
+ ///
+ /// The activity log alert to create or use for the update.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string activityLogAlertName, ActivityLogAlertResource activityLogAlert, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (activityLogAlertName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "activityLogAlertName");
+ }
+ if (activityLogAlert == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "activityLogAlert");
+ }
+ if (activityLogAlert != null)
+ {
+ activityLogAlert.Validate();
+ }
+ string apiVersion = "2017-04-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("activityLogAlertName", activityLogAlertName);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("activityLogAlert", activityLogAlert);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{activityLogAlertName}", System.Uri.EscapeDataString(activityLogAlertName));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(activityLogAlert != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(activityLogAlert, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ {
+ var ex = new 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);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Get an activity log alert.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the activity log alert.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string activityLogAlertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (activityLogAlertName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "activityLogAlertName");
+ }
+ string apiVersion = "2017-04-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("activityLogAlertName", activityLogAlertName);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{activityLogAlertName}", System.Uri.EscapeDataString(activityLogAlertName));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new 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);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Delete an activity log alert.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the activity log alert.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string activityLogAlertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (activityLogAlertName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "activityLogAlertName");
+ }
+ string apiVersion = "2017-04-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("activityLogAlertName", activityLogAlertName);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{activityLogAlertName}", System.Uri.EscapeDataString(activityLogAlertName));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 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);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Updates an existing ActivityLogAlertResource's tags. To update other fields
+ /// use the CreateOrUpdate method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the activity log alert.
+ ///
+ ///
+ /// Parameters supplied to the operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string activityLogAlertName, ActivityLogAlertPatchBody activityLogAlertPatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (activityLogAlertName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "activityLogAlertName");
+ }
+ if (activityLogAlertPatch == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "activityLogAlertPatch");
+ }
+ string apiVersion = "2017-04-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("activityLogAlertName", activityLogAlertName);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("activityLogAlertPatch", activityLogAlertPatch);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{activityLogAlertName}", System.Uri.EscapeDataString(activityLogAlertName));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PATCH");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(activityLogAlertPatch != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(activityLogAlertPatch, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new 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);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Get a list of all activity log alerts in a subscription.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListBySubscriptionIdWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ string apiVersion = "2017-04-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionId", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/activityLogAlerts").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new 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);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Get a list of all activity log alerts in a resource group.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ string apiVersion = "2017-04-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new 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);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ActivityLogAlertsOperationsExtensions.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ActivityLogAlertsOperationsExtensions.cs
new file mode 100644
index 000000000000..9e5f00a1cbea
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ActivityLogAlertsOperationsExtensions.cs
@@ -0,0 +1,261 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for ActivityLogAlertsOperations.
+ ///
+ public static partial class ActivityLogAlertsOperationsExtensions
+ {
+ ///
+ /// Create a new activity log alert or update an existing one.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the activity log alert.
+ ///
+ ///
+ /// The activity log alert to create or use for the update.
+ ///
+ public static ActivityLogAlertResource CreateOrUpdate(this IActivityLogAlertsOperations operations, string resourceGroupName, string activityLogAlertName, ActivityLogAlertResource activityLogAlert)
+ {
+ return operations.CreateOrUpdateAsync(resourceGroupName, activityLogAlertName, activityLogAlert).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Create a new activity log alert or update an existing one.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the activity log alert.
+ ///
+ ///
+ /// The activity log alert to create or use for the update.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CreateOrUpdateAsync(this IActivityLogAlertsOperations operations, string resourceGroupName, string activityLogAlertName, ActivityLogAlertResource activityLogAlert, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, activityLogAlertName, activityLogAlert, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get an activity log alert.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the activity log alert.
+ ///
+ public static ActivityLogAlertResource Get(this IActivityLogAlertsOperations operations, string resourceGroupName, string activityLogAlertName)
+ {
+ return operations.GetAsync(resourceGroupName, activityLogAlertName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get an activity log alert.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the activity log alert.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this IActivityLogAlertsOperations operations, string resourceGroupName, string activityLogAlertName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, activityLogAlertName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Delete an activity log alert.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the activity log alert.
+ ///
+ public static void Delete(this IActivityLogAlertsOperations operations, string resourceGroupName, string activityLogAlertName)
+ {
+ operations.DeleteAsync(resourceGroupName, activityLogAlertName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Delete an activity log alert.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the activity log alert.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeleteAsync(this IActivityLogAlertsOperations operations, string resourceGroupName, string activityLogAlertName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, activityLogAlertName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// Updates an existing ActivityLogAlertResource's tags. To update other fields
+ /// use the CreateOrUpdate method.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the activity log alert.
+ ///
+ ///
+ /// Parameters supplied to the operation.
+ ///
+ public static ActivityLogAlertResource Update(this IActivityLogAlertsOperations operations, string resourceGroupName, string activityLogAlertName, ActivityLogAlertPatchBody activityLogAlertPatch)
+ {
+ return operations.UpdateAsync(resourceGroupName, activityLogAlertName, activityLogAlertPatch).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Updates an existing ActivityLogAlertResource's tags. To update other fields
+ /// use the CreateOrUpdate method.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the activity log alert.
+ ///
+ ///
+ /// Parameters supplied to the operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task UpdateAsync(this IActivityLogAlertsOperations operations, string resourceGroupName, string activityLogAlertName, ActivityLogAlertPatchBody activityLogAlertPatch, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, activityLogAlertName, activityLogAlertPatch, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get a list of all activity log alerts in a subscription.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ public static IEnumerable ListBySubscriptionId(this IActivityLogAlertsOperations operations)
+ {
+ return operations.ListBySubscriptionIdAsync().GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get a list of all activity log alerts in a subscription.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListBySubscriptionIdAsync(this IActivityLogAlertsOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListBySubscriptionIdWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get a list of all activity log alerts in a resource group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ public static IEnumerable ListByResourceGroup(this IActivityLogAlertsOperations operations, string resourceGroupName)
+ {
+ return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get a list of all activity log alerts in a resource group.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByResourceGroupAsync(this IActivityLogAlertsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/AlertRulesOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/AlertRulesOperations.cs
index 31f59eb4b894..9a7e0e519c33 100644
--- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/AlertRulesOperations.cs
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/AlertRulesOperations.cs
@@ -643,6 +643,228 @@ internal AlertRulesOperations(MonitorManagementClient client)
return _result;
}
+ ///
+ /// Updates an existing AlertRuleResource. To update other fields use the
+ /// CreateOrUpdate method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the rule.
+ ///
+ ///
+ /// Parameters supplied to the operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string ruleName, AlertRuleResourcePatch alertRulesResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (ruleName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "ruleName");
+ }
+ if (alertRulesResource == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "alertRulesResource");
+ }
+ string apiVersion = "2016-03-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("ruleName", ruleName);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("alertRulesResource", alertRulesResource);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{ruleName}", System.Uri.EscapeDataString(ruleName));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PATCH");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(alertRulesResource != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(alertRulesResource, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ {
+ var ex = new 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);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
///
/// List the alert rules within a resource group.
///
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/AlertRulesOperationsExtensions.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/AlertRulesOperationsExtensions.cs
index 7b525f3239e7..5c6982b36d5f 100644
--- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/AlertRulesOperationsExtensions.cs
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/AlertRulesOperationsExtensions.cs
@@ -147,6 +147,54 @@ public static AlertRuleResource Get(this IAlertRulesOperations operations, strin
}
}
+ ///
+ /// Updates an existing AlertRuleResource. To update other fields use the
+ /// CreateOrUpdate method.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the rule.
+ ///
+ ///
+ /// Parameters supplied to the operation.
+ ///
+ public static AlertRuleResource Update(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, AlertRuleResourcePatch alertRulesResource)
+ {
+ return operations.UpdateAsync(resourceGroupName, ruleName, alertRulesResource).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Updates an existing AlertRuleResource. To update other fields use the
+ /// CreateOrUpdate method.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the rule.
+ ///
+ ///
+ /// Parameters supplied to the operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task UpdateAsync(this IAlertRulesOperations operations, string resourceGroupName, string ruleName, AlertRuleResourcePatch alertRulesResource, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, ruleName, alertRulesResource, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
///
/// List the alert rules within a resource group.
///
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperations.cs
index 45b50e6f4b42..39d5c04081bb 100644
--- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperations.cs
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperations.cs
@@ -813,6 +813,210 @@ internal AutoscaleSettingsOperations(MonitorManagementClient client)
return _result;
}
+ ///
+ /// Updates an existing AutoscaleSettingsResource. To update other fields use
+ /// the CreateOrUpdate method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The autoscale setting name.
+ ///
+ ///
+ /// Parameters supplied to the operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, AutoscaleSettingResourcePatch autoscaleSettingResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (autoscaleSettingName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "autoscaleSettingName");
+ }
+ if (autoscaleSettingResource == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "autoscaleSettingResource");
+ }
+ string apiVersion = "2015-04-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("autoscaleSettingName", autoscaleSettingName);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("autoscaleSettingResource", autoscaleSettingResource);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{autoscaleSettingName}", System.Uri.EscapeDataString(autoscaleSettingName));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PATCH");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(autoscaleSettingResource != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(autoscaleSettingResource, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new 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);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
///
/// Lists the autoscale settings for a resource group
///
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperationsExtensions.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperationsExtensions.cs
index cc9b8385113e..303ae70b4799 100644
--- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperationsExtensions.cs
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/AutoscaleSettingsOperationsExtensions.cs
@@ -179,6 +179,54 @@ public static AutoscaleSettingResource Get(this IAutoscaleSettingsOperations ope
}
}
+ ///
+ /// Updates an existing AutoscaleSettingsResource. To update other fields use
+ /// the CreateOrUpdate method.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The autoscale setting name.
+ ///
+ ///
+ /// Parameters supplied to the operation.
+ ///
+ public static AutoscaleSettingResource Update(this IAutoscaleSettingsOperations operations, string resourceGroupName, string autoscaleSettingName, AutoscaleSettingResourcePatch autoscaleSettingResource)
+ {
+ return operations.UpdateAsync(resourceGroupName, autoscaleSettingName, autoscaleSettingResource).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Updates an existing AutoscaleSettingsResource. To update other fields use
+ /// the CreateOrUpdate method.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The autoscale setting name.
+ ///
+ ///
+ /// Parameters supplied to the operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task UpdateAsync(this IAutoscaleSettingsOperations operations, string resourceGroupName, string autoscaleSettingName, AutoscaleSettingResourcePatch autoscaleSettingResource, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, autoscaleSettingName, autoscaleSettingResource, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
///
/// Lists the autoscale settings for a resource group
///
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IActionGroupsOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IActionGroupsOperations.cs
new file mode 100644
index 000000000000..14f98b1532f5
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IActionGroupsOperations.cs
@@ -0,0 +1,170 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// ActionGroupsOperations operations.
+ ///
+ public partial interface IActionGroupsOperations
+ {
+ ///
+ /// Create a new action group or update an existing one.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the action group.
+ ///
+ ///
+ /// The action group to create or use for the update.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string actionGroupName, ActionGroupResource actionGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Get an action group.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the action group.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string actionGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Delete an action group.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the action group.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task DeleteWithHttpMessagesAsync(string resourceGroupName, string actionGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Get a list of all action groups in a subscription.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListBySubscriptionIdWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Get a list of all action groups in a resource group.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Enable a receiver in an action group. This changes the receiver's
+ /// status from Disabled to Enabled.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the action group.
+ ///
+ ///
+ /// The name of the receiver to resubscribe.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task EnableReceiverWithHttpMessagesAsync(string resourceGroupName, string actionGroupName, string receiverName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IActivityLogAlertsOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IActivityLogAlertsOperations.cs
new file mode 100644
index 000000000000..cf04d793be04
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IActivityLogAlertsOperations.cs
@@ -0,0 +1,173 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// ActivityLogAlertsOperations operations.
+ ///
+ public partial interface IActivityLogAlertsOperations
+ {
+ ///
+ /// Create a new activity log alert or update an existing one.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the activity log alert.
+ ///
+ ///
+ /// The activity log alert to create or use for the update.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string activityLogAlertName, ActivityLogAlertResource activityLogAlert, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Get an activity log alert.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the activity log alert.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetWithHttpMessagesAsync(string resourceGroupName, string activityLogAlertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Delete an activity log alert.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the activity log alert.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task DeleteWithHttpMessagesAsync(string resourceGroupName, string activityLogAlertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Updates an existing ActivityLogAlertResource's tags. To update
+ /// other fields use the CreateOrUpdate method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the activity log alert.
+ ///
+ ///
+ /// Parameters supplied to the operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string activityLogAlertName, ActivityLogAlertPatchBody activityLogAlertPatch, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Get a list of all activity log alerts in a subscription.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListBySubscriptionIdWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Get a list of all activity log alerts in a resource group.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IAlertRulesOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IAlertRulesOperations.cs
index 865e9941a078..c94c0dbbcdff 100644
--- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IAlertRulesOperations.cs
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IAlertRulesOperations.cs
@@ -100,6 +100,35 @@ public partial interface IAlertRulesOperations
///
Task> GetWithHttpMessagesAsync(string resourceGroupName, string ruleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
+ /// Updates an existing AlertRuleResource. To update other fields use
+ /// the CreateOrUpdate method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The name of the rule.
+ ///
+ ///
+ /// Parameters supplied to the operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string ruleName, AlertRuleResourcePatch alertRulesResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
/// List the alert rules within a resource group.
///
///
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IAutoscaleSettingsOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IAutoscaleSettingsOperations.cs
index 4ae998016a58..80a890d63c60 100644
--- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IAutoscaleSettingsOperations.cs
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IAutoscaleSettingsOperations.cs
@@ -122,6 +122,35 @@ public partial interface IAutoscaleSettingsOperations
///
Task> GetWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
+ /// Updates an existing AutoscaleSettingsResource. To update other
+ /// fields use the CreateOrUpdate method.
+ ///
+ ///
+ /// The name of the resource group.
+ ///
+ ///
+ /// The autoscale setting name.
+ ///
+ ///
+ /// Parameters supplied to the operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string autoscaleSettingName, AutoscaleSettingResourcePatch autoscaleSettingResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
/// Lists the autoscale settings for a resource group
///
///
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ILogProfilesOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ILogProfilesOperations.cs
index cc7def846eae..8c54d6566789 100644
--- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ILogProfilesOperations.cs
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ILogProfilesOperations.cs
@@ -91,6 +91,32 @@ public partial interface ILogProfilesOperations
///
Task> CreateOrUpdateWithHttpMessagesAsync(string logProfileName, LogProfileResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
+ /// Updates an existing LogProfilesResource. To update other fields use
+ /// the CreateOrUpdate method.
+ ///
+ ///
+ /// The name of the log profile.
+ ///
+ ///
+ /// Parameters supplied to the operation.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> UpdateWithHttpMessagesAsync(string logProfileName, LogProfileResourcePatch logProfilesResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
/// List the log profiles.
///
///
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs
index 0f8555364170..d53cc3a79f28 100644
--- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IMonitorManagementClient.cs
@@ -79,6 +79,11 @@ public partial interface IMonitorManagementClient : System.IDisposable
///
IAlertRuleIncidentsOperations AlertRuleIncidents { get; }
+ ///
+ /// Gets the IActivityLogAlertsOperations.
+ ///
+ IActivityLogAlertsOperations ActivityLogAlerts { get; }
+
///
/// Gets the ILogProfilesOperations.
///
@@ -89,5 +94,10 @@ public partial interface IMonitorManagementClient : System.IDisposable
///
IServiceDiagnosticSettingsOperations ServiceDiagnosticSettings { get; }
+ ///
+ /// Gets the IActionGroupsOperations.
+ ///
+ IActionGroupsOperations ActionGroups { get; }
+
}
}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IServiceDiagnosticSettingsOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IServiceDiagnosticSettingsOperations.cs
index 448d06067ff1..ca638736f7d6 100644
--- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IServiceDiagnosticSettingsOperations.cs
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/IServiceDiagnosticSettingsOperations.cs
@@ -100,6 +100,6 @@ public partial interface IServiceDiagnosticSettingsOperations
///
/// Thrown when a required parameter is null
///
- Task> UpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettingsResource serviceDiagnosticSettingsResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> UpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettingsResourcePatch serviceDiagnosticSettingsResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/LogProfilesOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/LogProfilesOperations.cs
index 07af14beefdd..e6983b7d69b3 100644
--- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/LogProfilesOperations.cs
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/LogProfilesOperations.cs
@@ -598,6 +598,201 @@ internal LogProfilesOperations(MonitorManagementClient client)
return _result;
}
+ ///
+ /// Updates an existing LogProfilesResource. To update other fields use the
+ /// CreateOrUpdate method.
+ ///
+ ///
+ /// The name of the log profile.
+ ///
+ ///
+ /// Parameters supplied to the operation.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> UpdateWithHttpMessagesAsync(string logProfileName, LogProfileResourcePatch logProfilesResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (logProfileName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "logProfileName");
+ }
+ if (logProfilesResource == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "logProfilesResource");
+ }
+ string apiVersion = "2016-03-01";
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("logProfileName", logProfileName);
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("logProfilesResource", logProfilesResource);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{logProfileName}", System.Uri.EscapeDataString(logProfileName));
+ List _queryParameters = new List();
+ if (apiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PATCH");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(logProfilesResource != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(logProfilesResource, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new 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);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
///
/// List the log profiles.
///
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/LogProfilesOperationsExtensions.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/LogProfilesOperationsExtensions.cs
index 6801faa0a15f..91d6d4cf3f51 100644
--- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/LogProfilesOperationsExtensions.cs
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/LogProfilesOperationsExtensions.cs
@@ -129,6 +129,48 @@ public static LogProfileResource CreateOrUpdate(this ILogProfilesOperations oper
}
}
+ ///
+ /// Updates an existing LogProfilesResource. To update other fields use the
+ /// CreateOrUpdate method.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the log profile.
+ ///
+ ///
+ /// Parameters supplied to the operation.
+ ///
+ public static LogProfileResource Update(this ILogProfilesOperations operations, string logProfileName, LogProfileResourcePatch logProfilesResource)
+ {
+ return operations.UpdateAsync(logProfileName, logProfilesResource).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Updates an existing LogProfilesResource. To update other fields use the
+ /// CreateOrUpdate method.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the log profile.
+ ///
+ ///
+ /// Parameters supplied to the operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task UpdateAsync(this ILogProfilesOperations operations, string logProfileName, LogProfileResourcePatch logProfilesResource, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(logProfileName, logProfilesResource, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
///
/// List the log profiles.
///
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActionGroupResource.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActionGroupResource.cs
new file mode 100644
index 000000000000..5a7a1825006c
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActionGroupResource.cs
@@ -0,0 +1,150 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Azure.Management.Monitor.Management;
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// An action group resource.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class ActionGroupResource : Resource
+ {
+ ///
+ /// Initializes a new instance of the ActionGroupResource class.
+ ///
+ public ActionGroupResource() { }
+
+ ///
+ /// Initializes a new instance of the ActionGroupResource class.
+ ///
+ /// Resource location
+ /// The short name of the action group.
+ /// This will be used in SMS messages.
+ /// Indicates whether this action group is
+ /// enabled. If an action group is not enabled, then none of its
+ /// receviers will receive communications.
+ /// Azure resource Id
+ /// Azure resource name
+ /// Azure resource type
+ /// Resource tags
+ /// The list of email receivers that are
+ /// part of this action group.
+ /// The list of SMS receivers that are part
+ /// of this action group.
+ /// The list of webhook receivers that
+ /// are part of this action group.
+ public ActionGroupResource(string location, string groupShortName, bool enabled, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), IList emailReceivers = default(IList), IList smsReceivers = default(IList), IList webhookReceivers = default(IList))
+ : base(location, id, name, type, tags)
+ {
+ GroupShortName = groupShortName;
+ Enabled = enabled;
+ EmailReceivers = emailReceivers;
+ SmsReceivers = smsReceivers;
+ WebhookReceivers = webhookReceivers;
+ }
+
+ ///
+ /// Gets or sets the short name of the action group. This will be used
+ /// in SMS messages.
+ ///
+ [JsonProperty(PropertyName = "properties.groupShortName")]
+ public string GroupShortName { get; set; }
+
+ ///
+ /// Gets or sets indicates whether this action group is enabled. If an
+ /// action group is not enabled, then none of its receviers will
+ /// receive communications.
+ ///
+ [JsonProperty(PropertyName = "properties.enabled")]
+ public bool Enabled { get; set; }
+
+ ///
+ /// Gets or sets the list of email receivers that are part of this
+ /// action group.
+ ///
+ [JsonProperty(PropertyName = "properties.emailReceivers")]
+ public IList EmailReceivers { get; set; }
+
+ ///
+ /// Gets or sets the list of SMS receivers that are part of this action
+ /// group.
+ ///
+ [JsonProperty(PropertyName = "properties.smsReceivers")]
+ public IList SmsReceivers { get; set; }
+
+ ///
+ /// Gets or sets the list of webhook receivers that are part of this
+ /// action group.
+ ///
+ [JsonProperty(PropertyName = "properties.webhookReceivers")]
+ public IList WebhookReceivers { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public override void Validate()
+ {
+ base.Validate();
+ if (GroupShortName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "GroupShortName");
+ }
+ if (GroupShortName != null)
+ {
+ if (GroupShortName.Length > 15)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "GroupShortName", 15);
+ }
+ }
+ if (EmailReceivers != null)
+ {
+ foreach (var element in EmailReceivers)
+ {
+ if (element != null)
+ {
+ element.Validate();
+ }
+ }
+ }
+ if (SmsReceivers != null)
+ {
+ foreach (var element1 in SmsReceivers)
+ {
+ if (element1 != null)
+ {
+ element1.Validate();
+ }
+ }
+ }
+ if (WebhookReceivers != null)
+ {
+ foreach (var element2 in WebhookReceivers)
+ {
+ if (element2 != null)
+ {
+ element2.Validate();
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertActionGroup.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertActionGroup.cs
new file mode 100644
index 000000000000..fba22c0d98b0
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertActionGroup.cs
@@ -0,0 +1,75 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Azure.Management.Monitor.Management;
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// A pointer to an Azure Action Group.
+ ///
+ public partial class ActivityLogAlertActionGroup
+ {
+ ///
+ /// Initializes a new instance of the ActivityLogAlertActionGroup
+ /// class.
+ ///
+ public ActivityLogAlertActionGroup() { }
+
+ ///
+ /// Initializes a new instance of the ActivityLogAlertActionGroup
+ /// class.
+ ///
+ /// The resourceId of the action group.
+ /// This cannot be null or empty.
+ /// the dictionary of custom properties
+ /// to include with the post operation. These data are appended to the
+ /// webhook payload.
+ public ActivityLogAlertActionGroup(string actionGroupId, IDictionary webhookProperties = default(IDictionary))
+ {
+ ActionGroupId = actionGroupId;
+ WebhookProperties = webhookProperties;
+ }
+
+ ///
+ /// Gets or sets the resourceId of the action group. This cannot be
+ /// null or empty.
+ ///
+ [JsonProperty(PropertyName = "actionGroupId")]
+ public string ActionGroupId { get; set; }
+
+ ///
+ /// Gets or sets the dictionary of custom properties to include with
+ /// the post operation. These data are appended to the webhook payload.
+ ///
+ [JsonProperty(PropertyName = "webhookProperties")]
+ public IDictionary WebhookProperties { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (ActionGroupId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "ActionGroupId");
+ }
+ }
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertActionList.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertActionList.cs
new file mode 100644
index 000000000000..ba74f11e3683
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertActionList.cs
@@ -0,0 +1,46 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Azure.Management.Monitor.Management;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// A list of activity log alert actions.
+ ///
+ public partial class ActivityLogAlertActionList
+ {
+ ///
+ /// Initializes a new instance of the ActivityLogAlertActionList class.
+ ///
+ public ActivityLogAlertActionList() { }
+
+ ///
+ /// Initializes a new instance of the ActivityLogAlertActionList class.
+ ///
+ /// The list of activity log alerts.
+ public ActivityLogAlertActionList(IList actionGroups = default(IList))
+ {
+ ActionGroups = actionGroups;
+ }
+
+ ///
+ /// Gets or sets the list of activity log alerts.
+ ///
+ [JsonProperty(PropertyName = "actionGroups")]
+ public IList ActionGroups { get; set; }
+
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertAllOfCondition.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertAllOfCondition.cs
new file mode 100644
index 000000000000..3519e9decedc
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertAllOfCondition.cs
@@ -0,0 +1,74 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Azure.Management.Monitor.Management;
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// An Activity Log alert condition that is met when all its member
+ /// conditions are met.
+ ///
+ public partial class ActivityLogAlertAllOfCondition
+ {
+ ///
+ /// Initializes a new instance of the ActivityLogAlertAllOfCondition
+ /// class.
+ ///
+ public ActivityLogAlertAllOfCondition() { }
+
+ ///
+ /// Initializes a new instance of the ActivityLogAlertAllOfCondition
+ /// class.
+ ///
+ /// The list of activity log alert
+ /// conditions.
+ public ActivityLogAlertAllOfCondition(IList allOf)
+ {
+ AllOf = allOf;
+ }
+
+ ///
+ /// Gets or sets the list of activity log alert conditions.
+ ///
+ [JsonProperty(PropertyName = "allOf")]
+ public IList AllOf { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (AllOf == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "AllOf");
+ }
+ if (AllOf != null)
+ {
+ foreach (var element in AllOf)
+ {
+ if (element != null)
+ {
+ element.Validate();
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertLeafCondition.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertLeafCondition.cs
new file mode 100644
index 000000000000..28eef667b4f9
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertLeafCondition.cs
@@ -0,0 +1,83 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Azure.Management.Monitor.Management;
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// An Activity Log alert condition that is met by comparing an activity
+ /// log field and value.
+ ///
+ public partial class ActivityLogAlertLeafCondition
+ {
+ ///
+ /// Initializes a new instance of the ActivityLogAlertLeafCondition
+ /// class.
+ ///
+ public ActivityLogAlertLeafCondition() { }
+
+ ///
+ /// Initializes a new instance of the ActivityLogAlertLeafCondition
+ /// class.
+ ///
+ /// The name of the field that this condition will
+ /// examine. The possible values for this field are (case-insensitive):
+ /// 'resourceId', 'category', 'caller', 'level', 'operationName',
+ /// 'resourceGroup', 'resourceProvider', 'status', 'subStatus',
+ /// 'resourceType', or anything beginning with 'properties.'.
+ /// The field value will be compared to this value
+ /// (case-insensitive) to determine if the condition is met.
+ public ActivityLogAlertLeafCondition(string field, string equals)
+ {
+ Field = field;
+ Equals = equals;
+ }
+
+ ///
+ /// Gets or sets the name of the field that this condition will
+ /// examine. The possible values for this field are (case-insensitive):
+ /// 'resourceId', 'category', 'caller', 'level', 'operationName',
+ /// 'resourceGroup', 'resourceProvider', 'status', 'subStatus',
+ /// 'resourceType', or anything beginning with 'properties.'.
+ ///
+ [JsonProperty(PropertyName = "field")]
+ public string Field { get; set; }
+
+ ///
+ /// Gets or sets the field value will be compared to this value
+ /// (case-insensitive) to determine if the condition is met.
+ ///
+ [JsonProperty(PropertyName = "equals")]
+ public string Equals { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Field == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Field");
+ }
+ if (Equals == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Equals");
+ }
+ }
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertPatchBody.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertPatchBody.cs
new file mode 100644
index 000000000000..d196db72c807
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertPatchBody.cs
@@ -0,0 +1,61 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Azure.Management.Monitor.Management;
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// An activity log alert object for the body of patch operations.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class ActivityLogAlertPatchBody
+ {
+ ///
+ /// Initializes a new instance of the ActivityLogAlertPatchBody class.
+ ///
+ public ActivityLogAlertPatchBody() { }
+
+ ///
+ /// Initializes a new instance of the ActivityLogAlertPatchBody class.
+ ///
+ /// Resource tags
+ /// Indicates whether this activity log alert is
+ /// enabled. If an activity log alert is not enabled, then none of its
+ /// actions will be activated.
+ public ActivityLogAlertPatchBody(IDictionary tags = default(IDictionary), bool? enabled = default(bool?))
+ {
+ Tags = tags;
+ Enabled = enabled;
+ }
+
+ ///
+ /// Gets or sets resource tags
+ ///
+ [JsonProperty(PropertyName = "tags")]
+ public IDictionary Tags { get; set; }
+
+ ///
+ /// Gets or sets indicates whether this activity log alert is enabled.
+ /// If an activity log alert is not enabled, then none of its actions
+ /// will be activated.
+ ///
+ [JsonProperty(PropertyName = "properties.enabled")]
+ public bool? Enabled { get; set; }
+
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertResource.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertResource.cs
new file mode 100644
index 000000000000..acd7a09f6cb9
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ActivityLogAlertResource.cs
@@ -0,0 +1,127 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Azure.Management.Monitor.Management;
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// An activity log alert resource.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class ActivityLogAlertResource : Resource
+ {
+ ///
+ /// Initializes a new instance of the ActivityLogAlertResource class.
+ ///
+ public ActivityLogAlertResource() { }
+
+ ///
+ /// Initializes a new instance of the ActivityLogAlertResource class.
+ ///
+ /// Resource location
+ /// A list of resourceIds that will be used as
+ /// prefixes. The alert will only apply to activityLogs with
+ /// resourceIds that fall under one of these prefixes. This list must
+ /// include at least one item.
+ /// The conditon that will cause this alert to
+ /// activate.
+ /// The actions that will activate when the
+ /// condition is met.
+ /// Azure resource Id
+ /// Azure resource name
+ /// Azure resource type
+ /// Resource tags
+ /// Indicates whether this activity log alert is
+ /// enabled. If an activity log alert is not enabled, then none of its
+ /// actions will be activated.
+ /// A description of this activity log
+ /// alert.
+ public ActivityLogAlertResource(string location, IList scopes, ActivityLogAlertAllOfCondition condition, ActivityLogAlertActionList actions, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), bool? enabled = default(bool?), string description = default(string))
+ : base(location, id, name, type, tags)
+ {
+ Scopes = scopes;
+ Enabled = enabled;
+ Condition = condition;
+ Actions = actions;
+ Description = description;
+ }
+
+ ///
+ /// Gets or sets a list of resourceIds that will be used as prefixes.
+ /// The alert will only apply to activityLogs with resourceIds that
+ /// fall under one of these prefixes. This list must include at least
+ /// one item.
+ ///
+ [JsonProperty(PropertyName = "properties.scopes")]
+ public IList Scopes { get; set; }
+
+ ///
+ /// Gets or sets indicates whether this activity log alert is enabled.
+ /// If an activity log alert is not enabled, then none of its actions
+ /// will be activated.
+ ///
+ [JsonProperty(PropertyName = "properties.enabled")]
+ public bool? Enabled { get; set; }
+
+ ///
+ /// Gets or sets the conditon that will cause this alert to activate.
+ ///
+ [JsonProperty(PropertyName = "properties.condition")]
+ public ActivityLogAlertAllOfCondition Condition { get; set; }
+
+ ///
+ /// Gets or sets the actions that will activate when the condition is
+ /// met.
+ ///
+ [JsonProperty(PropertyName = "properties.actions")]
+ public ActivityLogAlertActionList Actions { get; set; }
+
+ ///
+ /// Gets or sets a description of this activity log alert.
+ ///
+ [JsonProperty(PropertyName = "properties.description")]
+ public string Description { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public override void Validate()
+ {
+ base.Validate();
+ if (Scopes == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Scopes");
+ }
+ if (Condition == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Condition");
+ }
+ if (Actions == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Actions");
+ }
+ if (Condition != null)
+ {
+ Condition.Validate();
+ }
+ }
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/AlertRuleResourcePatch.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/AlertRuleResourcePatch.cs
new file mode 100644
index 000000000000..4778d4e7bf4c
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/AlertRuleResourcePatch.cs
@@ -0,0 +1,124 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Azure.Management.Monitor.Management;
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The alert rule object for patch operations.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class AlertRuleResourcePatch
+ {
+ ///
+ /// Initializes a new instance of the AlertRuleResourcePatch class.
+ ///
+ public AlertRuleResourcePatch() { }
+
+ ///
+ /// Initializes a new instance of the AlertRuleResourcePatch class.
+ ///
+ /// the name of the alert rule.
+ /// the flag that indicates whether the alert
+ /// rule is enabled.
+ /// the condition that results in the alert
+ /// rule being activated.
+ /// Resource tags
+ /// the description of the alert rule that
+ /// will be included in the alert email.
+ /// the array of actions that are performed when
+ /// the alert rule becomes active, and when an alert condition is
+ /// resolved.
+ /// Last time the rule was updated in
+ /// ISO8601 format.
+ public AlertRuleResourcePatch(string name, bool isEnabled, RuleCondition condition, IDictionary tags = default(IDictionary), string description = default(string), IList actions = default(IList), System.DateTime? lastUpdatedTime = default(System.DateTime?))
+ {
+ Tags = tags;
+ Name = name;
+ Description = description;
+ IsEnabled = isEnabled;
+ Condition = condition;
+ Actions = actions;
+ LastUpdatedTime = lastUpdatedTime;
+ }
+
+ ///
+ /// Gets or sets resource tags
+ ///
+ [JsonProperty(PropertyName = "tags")]
+ public IDictionary Tags { get; set; }
+
+ ///
+ /// Gets or sets the name of the alert rule.
+ ///
+ [JsonProperty(PropertyName = "properties.name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets the description of the alert rule that will be
+ /// included in the alert email.
+ ///
+ [JsonProperty(PropertyName = "properties.description")]
+ public string Description { get; set; }
+
+ ///
+ /// Gets or sets the flag that indicates whether the alert rule is
+ /// enabled.
+ ///
+ [JsonProperty(PropertyName = "properties.isEnabled")]
+ public bool IsEnabled { get; set; }
+
+ ///
+ /// Gets or sets the condition that results in the alert rule being
+ /// activated.
+ ///
+ [JsonProperty(PropertyName = "properties.condition")]
+ public RuleCondition Condition { get; set; }
+
+ ///
+ /// Gets or sets the array of actions that are performed when the alert
+ /// rule becomes active, and when an alert condition is resolved.
+ ///
+ [JsonProperty(PropertyName = "properties.actions")]
+ public IList Actions { get; set; }
+
+ ///
+ /// Gets last time the rule was updated in ISO8601 format.
+ ///
+ [JsonProperty(PropertyName = "properties.lastUpdatedTime")]
+ public System.DateTime? LastUpdatedTime { get; private set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Name");
+ }
+ if (Condition == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Condition");
+ }
+ }
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/AutoscaleSettingResourcePatch.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/AutoscaleSettingResourcePatch.cs
new file mode 100644
index 000000000000..0a5b62cfb94f
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/AutoscaleSettingResourcePatch.cs
@@ -0,0 +1,128 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Azure.Management.Monitor.Management;
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The autoscale setting object for patch operations.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class AutoscaleSettingResourcePatch
+ {
+ ///
+ /// Initializes a new instance of the AutoscaleSettingResourcePatch
+ /// class.
+ ///
+ public AutoscaleSettingResourcePatch() { }
+
+ ///
+ /// Initializes a new instance of the AutoscaleSettingResourcePatch
+ /// class.
+ ///
+ /// the collection of automatic scaling profiles
+ /// that specify different scaling parameters for different time
+ /// periods. A maximum of 20 profiles can be specified.
+ /// Resource tags
+ /// the collection of
+ /// notifications.
+ /// the enabled flag. Specifies whether automatic
+ /// scaling is enabled for the resource. The default value is
+ /// 'true'.
+ /// the name of the autoscale setting.
+ /// the resource identifier of the
+ /// resource that the autoscale setting should be added to.
+ public AutoscaleSettingResourcePatch(IList profiles, IDictionary tags = default(IDictionary), IList notifications = default(IList), bool? enabled = default(bool?), string name = default(string), string targetResourceUri = default(string))
+ {
+ Tags = tags;
+ Profiles = profiles;
+ Notifications = notifications;
+ Enabled = enabled;
+ Name = name;
+ TargetResourceUri = targetResourceUri;
+ }
+
+ ///
+ /// Gets or sets resource tags
+ ///
+ [JsonProperty(PropertyName = "tags")]
+ public IDictionary Tags { get; set; }
+
+ ///
+ /// Gets or sets the collection of automatic scaling profiles that
+ /// specify different scaling parameters for different time periods. A
+ /// maximum of 20 profiles can be specified.
+ ///
+ [JsonProperty(PropertyName = "properties.profiles")]
+ public IList Profiles { get; set; }
+
+ ///
+ /// Gets or sets the collection of notifications.
+ ///
+ [JsonProperty(PropertyName = "properties.notifications")]
+ public IList Notifications { get; set; }
+
+ ///
+ /// Gets or sets the enabled flag. Specifies whether automatic scaling
+ /// is enabled for the resource. The default value is 'true'.
+ ///
+ [JsonProperty(PropertyName = "properties.enabled")]
+ public bool? Enabled { get; set; }
+
+ ///
+ /// Gets or sets the name of the autoscale setting.
+ ///
+ [JsonProperty(PropertyName = "properties.name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets the resource identifier of the resource that the
+ /// autoscale setting should be added to.
+ ///
+ [JsonProperty(PropertyName = "properties.targetResourceUri")]
+ public string TargetResourceUri { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Profiles == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Profiles");
+ }
+ if (Profiles != null)
+ {
+ if (Profiles.Count > 20)
+ {
+ throw new ValidationException(ValidationRules.MaxItems, "Profiles", 20);
+ }
+ foreach (var element in Profiles)
+ {
+ if (element != null)
+ {
+ element.Validate();
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/EmailReceiver.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/EmailReceiver.cs
new file mode 100644
index 000000000000..7ec40c4f0b95
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/EmailReceiver.cs
@@ -0,0 +1,82 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Azure.Management.Monitor.Management;
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// An email receiver.
+ ///
+ public partial class EmailReceiver
+ {
+ ///
+ /// Initializes a new instance of the EmailReceiver class.
+ ///
+ public EmailReceiver() { }
+
+ ///
+ /// Initializes a new instance of the EmailReceiver class.
+ ///
+ /// The name of the email receiver. Names must be
+ /// unique across all receivers within an action group.
+ /// The email address of this
+ /// receiver.
+ /// Possible values include: 'NotSpecified',
+ /// 'Enabled', 'Disabled'
+ public EmailReceiver(string name, string emailAddress, ReceiverStatus? status = default(ReceiverStatus?))
+ {
+ Name = name;
+ EmailAddress = emailAddress;
+ Status = status;
+ }
+
+ ///
+ /// Gets or sets the name of the email receiver. Names must be unique
+ /// across all receivers within an action group.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets the email address of this receiver.
+ ///
+ [JsonProperty(PropertyName = "emailAddress")]
+ public string EmailAddress { get; set; }
+
+ ///
+ /// Gets possible values include: 'NotSpecified', 'Enabled', 'Disabled'
+ ///
+ [JsonProperty(PropertyName = "status")]
+ public ReceiverStatus? Status { get; private set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Name");
+ }
+ if (EmailAddress == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "EmailAddress");
+ }
+ }
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/EnableRequest.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/EnableRequest.cs
new file mode 100644
index 000000000000..e58674cdd6d9
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/EnableRequest.cs
@@ -0,0 +1,59 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Azure.Management.Monitor.Management;
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Describes a receiver that should be resubscribed.
+ ///
+ public partial class EnableRequest
+ {
+ ///
+ /// Initializes a new instance of the EnableRequest class.
+ ///
+ public EnableRequest() { }
+
+ ///
+ /// Initializes a new instance of the EnableRequest class.
+ ///
+ /// The name of the receiver to
+ /// resubscribe.
+ public EnableRequest(string receiverName)
+ {
+ ReceiverName = receiverName;
+ }
+
+ ///
+ /// Gets or sets the name of the receiver to resubscribe.
+ ///
+ [JsonProperty(PropertyName = "receiverName")]
+ public string ReceiverName { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (ReceiverName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "ReceiverName");
+ }
+ }
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/LocationThresholdRuleCondition.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/LocationThresholdRuleCondition.cs
index f215e8d9bf99..e969af310b32 100644
--- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/LocationThresholdRuleCondition.cs
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/LocationThresholdRuleCondition.cs
@@ -12,6 +12,7 @@ namespace Microsoft.Azure.Management.Monitor.Management.Models
using Microsoft.Azure.Management;
using Microsoft.Azure.Management.Monitor;
using Microsoft.Azure.Management.Monitor.Management;
+ using Microsoft.Rest;
using Newtonsoft.Json;
using System.Linq;
@@ -65,12 +66,15 @@ public LocationThresholdRuleCondition() { }
///
/// Validate the object.
///
- ///
+ ///
/// Thrown if validation fails
///
public virtual void Validate()
{
- //Nothing to validate
+ if (FailedLocationCount < 0)
+ {
+ throw new ValidationException(ValidationRules.InclusiveMinimum, "FailedLocationCount", 0);
+ }
}
}
}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/LogProfileResourcePatch.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/LogProfileResourcePatch.cs
new file mode 100644
index 000000000000..0db66d3c5679
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/LogProfileResourcePatch.cs
@@ -0,0 +1,132 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Azure.Management.Monitor.Management;
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// The log profile resource for patch operations.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class LogProfileResourcePatch
+ {
+ ///
+ /// Initializes a new instance of the LogProfileResourcePatch class.
+ ///
+ public LogProfileResourcePatch() { }
+
+ ///
+ /// Initializes a new instance of the LogProfileResourcePatch class.
+ ///
+ /// List of regions for which Activity Log
+ /// events should be stored or streamed. It is a comma separated list
+ /// of valid ARM locations including the 'global' location.
+ /// the categories of the logs. These
+ /// categories are created as is convenient to the user. Some values
+ /// are: 'Write', 'Delete', and/or 'Action.'
+ /// the retention policy for the events
+ /// in the log.
+ /// Resource tags
+ /// the resource id of the storage
+ /// account to which you would like to send the Activity Log.
+ /// The service bus rule ID of the
+ /// service bus namespace in which you would like to have Event Hubs
+ /// created for streaming the Activity Log. The rule ID is of the
+ /// format: '{service bus resource ID}/authorizationrules/{key
+ /// name}'.
+ public LogProfileResourcePatch(IList locations, IList categories, RetentionPolicy retentionPolicy, IDictionary tags = default(IDictionary), string storageAccountId = default(string), string serviceBusRuleId = default(string))
+ {
+ Tags = tags;
+ StorageAccountId = storageAccountId;
+ ServiceBusRuleId = serviceBusRuleId;
+ Locations = locations;
+ Categories = categories;
+ RetentionPolicy = retentionPolicy;
+ }
+
+ ///
+ /// Gets or sets resource tags
+ ///
+ [JsonProperty(PropertyName = "tags")]
+ public IDictionary Tags { get; set; }
+
+ ///
+ /// Gets or sets the resource id of the storage account to which you
+ /// would like to send the Activity Log.
+ ///
+ [JsonProperty(PropertyName = "properties.storageAccountId")]
+ public string StorageAccountId { get; set; }
+
+ ///
+ /// Gets or sets the service bus rule ID of the service bus namespace
+ /// in which you would like to have Event Hubs created for streaming
+ /// the Activity Log. The rule ID is of the format: '{service bus
+ /// resource ID}/authorizationrules/{key name}'.
+ ///
+ [JsonProperty(PropertyName = "properties.serviceBusRuleId")]
+ public string ServiceBusRuleId { get; set; }
+
+ ///
+ /// Gets or sets list of regions for which Activity Log events should
+ /// be stored or streamed. It is a comma separated list of valid ARM
+ /// locations including the 'global' location.
+ ///
+ [JsonProperty(PropertyName = "properties.locations")]
+ public IList Locations { get; set; }
+
+ ///
+ /// Gets or sets the categories of the logs. These categories are
+ /// created as is convenient to the user. Some values are: 'Write',
+ /// 'Delete', and/or 'Action.'
+ ///
+ [JsonProperty(PropertyName = "properties.categories")]
+ public IList Categories { get; set; }
+
+ ///
+ /// Gets or sets the retention policy for the events in the log.
+ ///
+ [JsonProperty(PropertyName = "properties.retentionPolicy")]
+ public RetentionPolicy RetentionPolicy { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Locations == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Locations");
+ }
+ if (Categories == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Categories");
+ }
+ if (RetentionPolicy == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "RetentionPolicy");
+ }
+ if (RetentionPolicy != null)
+ {
+ RetentionPolicy.Validate();
+ }
+ }
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ReceiverStatus.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ReceiverStatus.cs
new file mode 100644
index 000000000000..ba05b4fa8b9c
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ReceiverStatus.cs
@@ -0,0 +1,33 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Azure.Management.Monitor.Management;
+ using Newtonsoft.Json;
+ using Newtonsoft.Json.Converters;
+ using System.Runtime;
+ using System.Runtime.Serialization;
+
+ ///
+ /// Defines values for ReceiverStatus.
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public enum ReceiverStatus
+ {
+ [EnumMember(Value = "NotSpecified")]
+ NotSpecified,
+ [EnumMember(Value = "Enabled")]
+ Enabled,
+ [EnumMember(Value = "Disabled")]
+ Disabled
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ServiceDiagnosticSettingsResourcePatch.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ServiceDiagnosticSettingsResourcePatch.cs
new file mode 100644
index 000000000000..59affa8e5b1d
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/ServiceDiagnosticSettingsResourcePatch.cs
@@ -0,0 +1,115 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Azure.Management.Monitor.Management;
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Service diagnostic setting resource for patch operations
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class ServiceDiagnosticSettingsResourcePatch
+ {
+ ///
+ /// Initializes a new instance of the
+ /// ServiceDiagnosticSettingsResourcePatch class.
+ ///
+ public ServiceDiagnosticSettingsResourcePatch() { }
+
+ ///
+ /// Initializes a new instance of the
+ /// ServiceDiagnosticSettingsResourcePatch class.
+ ///
+ /// Resource tags
+ /// The resource ID of the storage
+ /// account to which you would like to send Diagnostic Logs.
+ /// The service bus rule ID of the
+ /// service bus namespace in which you would like to have Event Hubs
+ /// created for streaming Diagnostic Logs. The rule ID is of the
+ /// format: '{service bus resource ID}/authorizationrules/{key
+ /// name}'.
+ /// The resource Id for the
+ /// event hub authorization rule.
+ /// the list of metric settings.
+ /// the list of logs settings.
+ /// The workspace ID (resource ID of a Log
+ /// Analytics workspace) for a Log Analytics workspace to which you
+ /// would like to send Diagnostic Logs. Example:
+ /// /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2
+ public ServiceDiagnosticSettingsResourcePatch(IDictionary tags = default(IDictionary), string storageAccountId = default(string), string serviceBusRuleId = default(string), string eventHubAuthorizationRuleId = default(string), IList metrics = default(IList), IList logs = default(IList), string workspaceId = default(string))
+ {
+ Tags = tags;
+ StorageAccountId = storageAccountId;
+ ServiceBusRuleId = serviceBusRuleId;
+ EventHubAuthorizationRuleId = eventHubAuthorizationRuleId;
+ Metrics = metrics;
+ Logs = logs;
+ WorkspaceId = workspaceId;
+ }
+
+ ///
+ /// Gets or sets resource tags
+ ///
+ [JsonProperty(PropertyName = "tags")]
+ public IDictionary Tags { get; set; }
+
+ ///
+ /// Gets or sets the resource ID of the storage account to which you
+ /// would like to send Diagnostic Logs.
+ ///
+ [JsonProperty(PropertyName = "properties.storageAccountId")]
+ public string StorageAccountId { get; set; }
+
+ ///
+ /// Gets or sets the service bus rule ID of the service bus namespace
+ /// in which you would like to have Event Hubs created for streaming
+ /// Diagnostic Logs. The rule ID is of the format: '{service bus
+ /// resource ID}/authorizationrules/{key name}'.
+ ///
+ [JsonProperty(PropertyName = "properties.serviceBusRuleId")]
+ public string ServiceBusRuleId { get; set; }
+
+ ///
+ /// Gets or sets the resource Id for the event hub authorization rule.
+ ///
+ [JsonProperty(PropertyName = "properties.eventHubAuthorizationRuleId")]
+ public string EventHubAuthorizationRuleId { get; set; }
+
+ ///
+ /// Gets or sets the list of metric settings.
+ ///
+ [JsonProperty(PropertyName = "properties.metrics")]
+ public IList Metrics { get; set; }
+
+ ///
+ /// Gets or sets the list of logs settings.
+ ///
+ [JsonProperty(PropertyName = "properties.logs")]
+ public IList Logs { get; set; }
+
+ ///
+ /// Gets or sets the workspace ID (resource ID of a Log Analytics
+ /// workspace) for a Log Analytics workspace to which you would like to
+ /// send Diagnostic Logs. Example:
+ /// /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2
+ ///
+ [JsonProperty(PropertyName = "properties.workspaceId")]
+ public string WorkspaceId { get; set; }
+
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/SmsReceiver.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/SmsReceiver.cs
new file mode 100644
index 000000000000..980e591d8dc3
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/SmsReceiver.cs
@@ -0,0 +1,95 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Azure.Management.Monitor.Management;
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// An SMS receiver.
+ ///
+ public partial class SmsReceiver
+ {
+ ///
+ /// Initializes a new instance of the SmsReceiver class.
+ ///
+ public SmsReceiver() { }
+
+ ///
+ /// Initializes a new instance of the SmsReceiver class.
+ ///
+ /// The name of the SMS receiver. Names must be
+ /// unique across all receivers within an action group.
+ /// The country code of the SMS
+ /// receiver.
+ /// The phone number of the SMS
+ /// receiver.
+ /// Possible values include: 'NotSpecified',
+ /// 'Enabled', 'Disabled'
+ public SmsReceiver(string name, string countryCode, string phoneNumber, ReceiverStatus? status = default(ReceiverStatus?))
+ {
+ Name = name;
+ CountryCode = countryCode;
+ PhoneNumber = phoneNumber;
+ Status = status;
+ }
+
+ ///
+ /// Gets or sets the name of the SMS receiver. Names must be unique
+ /// across all receivers within an action group.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets the country code of the SMS receiver.
+ ///
+ [JsonProperty(PropertyName = "countryCode")]
+ public string CountryCode { get; set; }
+
+ ///
+ /// Gets or sets the phone number of the SMS receiver.
+ ///
+ [JsonProperty(PropertyName = "phoneNumber")]
+ public string PhoneNumber { get; set; }
+
+ ///
+ /// Gets possible values include: 'NotSpecified', 'Enabled', 'Disabled'
+ ///
+ [JsonProperty(PropertyName = "status")]
+ public ReceiverStatus? Status { get; private set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Name");
+ }
+ if (CountryCode == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "CountryCode");
+ }
+ if (PhoneNumber == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "PhoneNumber");
+ }
+ }
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/WebhookReceiver.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/WebhookReceiver.cs
new file mode 100644
index 000000000000..d1c82b6c6be3
--- /dev/null
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/Models/WebhookReceiver.cs
@@ -0,0 +1,73 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+
+namespace Microsoft.Azure.Management.Monitor.Management.Models
+{
+ using Microsoft.Azure;
+ using Microsoft.Azure.Management;
+ using Microsoft.Azure.Management.Monitor;
+ using Microsoft.Azure.Management.Monitor.Management;
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// A webhook receiver.
+ ///
+ public partial class WebhookReceiver
+ {
+ ///
+ /// Initializes a new instance of the WebhookReceiver class.
+ ///
+ public WebhookReceiver() { }
+
+ ///
+ /// Initializes a new instance of the WebhookReceiver class.
+ ///
+ /// The name of the webhook receiver. Names must be
+ /// unique across all receivers within an action group.
+ /// The URI where webhooks should be
+ /// sent.
+ public WebhookReceiver(string name, string serviceUri)
+ {
+ Name = name;
+ ServiceUri = serviceUri;
+ }
+
+ ///
+ /// Gets or sets the name of the webhook receiver. Names must be unique
+ /// across all receivers within an action group.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; set; }
+
+ ///
+ /// Gets or sets the URI where webhooks should be sent.
+ ///
+ [JsonProperty(PropertyName = "serviceUri")]
+ public string ServiceUri { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Name");
+ }
+ if (ServiceUri == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "ServiceUri");
+ }
+ }
+ }
+}
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs
index dad9917e3114..71d18258874e 100644
--- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/MonitorManagementClient.cs
@@ -84,6 +84,11 @@ public partial class MonitorManagementClient : ServiceClient
public virtual IAlertRuleIncidentsOperations AlertRuleIncidents { get; private set; }
+ ///
+ /// Gets the IActivityLogAlertsOperations.
+ ///
+ public virtual IActivityLogAlertsOperations ActivityLogAlerts { get; private set; }
+
///
/// Gets the ILogProfilesOperations.
///
@@ -94,6 +99,11 @@ public partial class MonitorManagementClient : ServiceClient
public virtual IServiceDiagnosticSettingsOperations ServiceDiagnosticSettings { get; private set; }
+ ///
+ /// Gets the IActionGroupsOperations.
+ ///
+ public virtual IActionGroupsOperations ActionGroups { get; private set; }
+
///
/// Initializes a new instance of the MonitorManagementClient class.
///
@@ -298,8 +308,10 @@ private void Initialize()
AutoscaleSettings = new AutoscaleSettingsOperations(this);
AlertRules = new AlertRulesOperations(this);
AlertRuleIncidents = new AlertRuleIncidentsOperations(this);
+ ActivityLogAlerts = new ActivityLogAlertsOperations(this);
LogProfiles = new LogProfilesOperations(this);
ServiceDiagnosticSettings = new ServiceDiagnosticSettingsOperations(this);
+ ActionGroups = new ActionGroupsOperations(this);
BaseUri = new System.Uri("https://management.azure.com");
AcceptLanguage = "en-US";
LongRunningOperationRetryTimeout = 30;
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperations.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperations.cs
index b1c72ff89052..e83566d192a5 100644
--- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperations.cs
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperations.cs
@@ -458,7 +458,7 @@ internal ServiceDiagnosticSettingsOperations(MonitorManagementClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> UpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettingsResource serviceDiagnosticSettingsResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> UpdateWithHttpMessagesAsync(string resourceUri, ServiceDiagnosticSettingsResourcePatch serviceDiagnosticSettingsResource, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (resourceUri == null)
{
diff --git a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperationsExtensions.cs b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperationsExtensions.cs
index fd69889bc068..272e8d5e8ba8 100644
--- a/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperationsExtensions.cs
+++ b/src/SDKs/Monitor/Management.Monitor/Generated/Management/Monitor/ServiceDiagnosticSettingsOperationsExtensions.cs
@@ -114,7 +114,7 @@ public static ServiceDiagnosticSettingsResource CreateOrUpdate(this IServiceDiag
///
/// Parameters supplied to the operation.
///
- public static ServiceDiagnosticSettingsResource Update(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettingsResource serviceDiagnosticSettingsResource)
+ public static ServiceDiagnosticSettingsResource Update(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettingsResourcePatch serviceDiagnosticSettingsResource)
{
return operations.UpdateAsync(resourceUri, serviceDiagnosticSettingsResource).GetAwaiter().GetResult();
}
@@ -136,7 +136,7 @@ public static ServiceDiagnosticSettingsResource Update(this IServiceDiagnosticSe
///
/// The cancellation token.
///
- public static async Task UpdateAsync(this IServiceDiagnosticSettingsOperations operations, string resourceUri, ServiceDiagnosticSettingsResource serviceDiagnosticSettingsResource, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task