diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ActionsOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ActionsOperations.cs
index 2b96c54e0bc51..d74d588b56189 100644
--- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ActionsOperations.cs
+++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/ActionsOperations.cs
@@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights
///
/// ActionsOperations operations.
///
- internal partial class ActionsOperations : IServiceOperations, IActionsOperations
+ internal partial class ActionsOperations : IServiceOperations, IActionsOperations
{
///
/// Initializes a new instance of the ActionsOperations class.
@@ -36,7 +36,7 @@ internal partial class ActionsOperations : IServiceOperations
/// Thrown when a required parameter is null
///
- internal ActionsOperations(SecurityInsightsClient client)
+ internal ActionsOperations(SecurityInsights client)
{
if (client == null)
{
@@ -46,9 +46,9 @@ internal ActionsOperations(SecurityInsightsClient client)
}
///
- /// Gets a reference to the SecurityInsightsClient
+ /// Gets a reference to the SecurityInsights
///
- public SecurityInsightsClient Client { get; private set; }
+ public SecurityInsights Client { get; private set; }
///
/// Gets all actions of alert rule.
diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRuleTemplatesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRuleTemplatesOperations.cs
index f17c3df4d9fca..422cdc0e61c70 100644
--- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRuleTemplatesOperations.cs
+++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRuleTemplatesOperations.cs
@@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights
///
/// AlertRuleTemplatesOperations operations.
///
- internal partial class AlertRuleTemplatesOperations : IServiceOperations, IAlertRuleTemplatesOperations
+ internal partial class AlertRuleTemplatesOperations : IServiceOperations, IAlertRuleTemplatesOperations
{
///
/// Initializes a new instance of the AlertRuleTemplatesOperations class.
@@ -36,7 +36,7 @@ internal partial class AlertRuleTemplatesOperations : IServiceOperations
/// Thrown when a required parameter is null
///
- internal AlertRuleTemplatesOperations(SecurityInsightsClient client)
+ internal AlertRuleTemplatesOperations(SecurityInsights client)
{
if (client == null)
{
@@ -46,9 +46,9 @@ internal AlertRuleTemplatesOperations(SecurityInsightsClient client)
}
///
- /// Gets a reference to the SecurityInsightsClient
+ /// Gets a reference to the SecurityInsights
///
- public SecurityInsightsClient Client { get; private set; }
+ public SecurityInsights Client { get; private set; }
///
/// Gets all alert rule templates.
diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRulesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRulesOperations.cs
index a0fef971c4042..eacafd1cf40ab 100644
--- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRulesOperations.cs
+++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AlertRulesOperations.cs
@@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights
///
/// AlertRulesOperations operations.
///
- internal partial class AlertRulesOperations : IServiceOperations, IAlertRulesOperations
+ internal partial class AlertRulesOperations : IServiceOperations, IAlertRulesOperations
{
///
/// Initializes a new instance of the AlertRulesOperations class.
@@ -36,7 +36,7 @@ internal partial class AlertRulesOperations : IServiceOperations
/// Thrown when a required parameter is null
///
- internal AlertRulesOperations(SecurityInsightsClient client)
+ internal AlertRulesOperations(SecurityInsights client)
{
if (client == null)
{
@@ -46,9 +46,9 @@ internal AlertRulesOperations(SecurityInsightsClient client)
}
///
- /// Gets a reference to the SecurityInsightsClient
+ /// Gets a reference to the SecurityInsights
///
- public SecurityInsightsClient Client { get; private set; }
+ public SecurityInsights Client { get; private set; }
///
/// Gets all alert rules.
diff --git a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AutomationRulesOperations.cs b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AutomationRulesOperations.cs
index 9349b9a661b72..5b527e584adeb 100644
--- a/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AutomationRulesOperations.cs
+++ b/sdk/securityinsights/Microsoft.Azure.Management.SecurityInsights/src/Generated/AutomationRulesOperations.cs
@@ -25,7 +25,7 @@ namespace Microsoft.Azure.Management.SecurityInsights
///
/// AutomationRulesOperations operations.
///
- internal partial class AutomationRulesOperations : IServiceOperations, IAutomationRulesOperations
+ internal partial class AutomationRulesOperations : IServiceOperations, IAutomationRulesOperations
{
///
/// Initializes a new instance of the AutomationRulesOperations class.
@@ -36,7 +36,7 @@ internal partial class AutomationRulesOperations : IServiceOperations
/// Thrown when a required parameter is null
///
- internal AutomationRulesOperations(SecurityInsightsClient client)
+ internal AutomationRulesOperations(SecurityInsights client)
{
if (client == null)
{
@@ -46,12 +46,12 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
}
///
- /// Gets a reference to the SecurityInsightsClient
+ /// Gets a reference to the SecurityInsights
///
- public SecurityInsightsClient Client { get; private set; }
+ public SecurityInsights Client { get; private set; }
///
- /// Gets all automation rules.
+ /// Gets the automation rule.
///
///
/// The name of the resource group. The name is case insensitive.
@@ -59,6 +59,9 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
///
/// The name of the workspace.
///
+ ///
+ /// Automation rule ID
+ ///
///
/// Headers that will be added to request.
///
@@ -80,7 +83,7 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string workspaceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string automationRuleId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
@@ -134,6 +137,10 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
throw new ValidationException(ValidationRules.MinLength, "workspaceName", 1);
}
}
+ if (automationRuleId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "automationRuleId");
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -143,15 +150,17 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("workspaceName", workspaceName);
+ tracingParameters.Add("automationRuleId", automationRuleId);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ 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.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/automationRules/{automationRuleId}").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{workspaceName}", System.Uri.EscapeDataString(workspaceName));
+ _url = _url.Replace("{automationRuleId}", System.Uri.EscapeDataString(automationRuleId));
List _queryParameters = new List();
if (Client.ApiVersion != null)
{
@@ -250,7 +259,7 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -263,7 +272,7 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -283,7 +292,7 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
}
///
- /// Gets the automation rule.
+ /// Creates or updates the automation rule.
///
///
/// The name of the resource group. The name is case insensitive.
@@ -294,6 +303,9 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
///
/// Automation rule ID
///
+ ///
+ /// The automation rule
+ ///
///
/// Headers that will be added to request.
///
@@ -315,7 +327,7 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string automationRuleId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string automationRuleId, AutomationRule automationRuleToUpsert = default(AutomationRule), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
@@ -373,6 +385,10 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "automationRuleId");
}
+ if (automationRuleToUpsert != null)
+ {
+ automationRuleToUpsert.Validate();
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -383,8 +399,9 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("workspaceName", workspaceName);
tracingParameters.Add("automationRuleId", automationRuleId);
+ tracingParameters.Add("automationRuleToUpsert", automationRuleToUpsert);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
@@ -405,7 +422,7 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.Method = new HttpMethod("PUT");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -436,6 +453,12 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
// Serialize Request
string _requestContent = null;
+ if(automationRuleToUpsert != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(automationRuleToUpsert, 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)
{
@@ -456,7 +479,7 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200)
+ if ((int)_statusCode != 200 && (int)_statusCode != 201)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -516,6 +539,24 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
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);
@@ -524,7 +565,7 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
}
///
- /// Creates or updates the automation rule.
+ /// Delete the automation rule.
///
///
/// The name of the resource group. The name is case insensitive.
@@ -535,9 +576,6 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
///
/// Automation rule ID
///
- ///
- /// The automation rule
- ///
///
/// Headers that will be added to request.
///
@@ -559,7 +597,7 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string automationRuleId, AutomationRule automationRule, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string workspaceName, string automationRuleId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.ApiVersion == null)
{
@@ -617,14 +655,6 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "automationRuleId");
}
- if (automationRule == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "automationRule");
- }
- if (automationRule != null)
- {
- automationRule.Validate();
- }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -635,9 +665,8 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("workspaceName", workspaceName);
tracingParameters.Add("automationRuleId", automationRuleId);
- tracingParameters.Add("automationRule", automationRule);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
@@ -658,7 +687,7 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.Method = new HttpMethod("DELETE");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
@@ -689,12 +718,6 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
// Serialize Request
string _requestContent = null;
- if(automationRule != null)
- {
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(automationRule, 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)
{
@@ -715,7 +738,7 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ if ((int)_statusCode != 200 && (int)_statusCode != 204)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
@@ -750,7 +773,7 @@ internal AutomationRulesOperations(SecurityInsightsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse