diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AlertsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AlertsOperations.cs
index 24ea7b0f63e5..c3eeac560762 100644
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AlertsOperations.cs
+++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AlertsOperations.cs
@@ -1366,10 +1366,6 @@ internal AlertsOperations(SecurityCenterClient client)
///
/// Name of the alert object
///
- ///
- /// Type of the action to do on the alert. Possible values include: 'Dismiss',
- /// 'Reactivate'
- ///
///
/// Headers that will be added to request.
///
@@ -1388,7 +1384,7 @@ internal AlertsOperations(SecurityCenterClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task UpdateSubscriptionLevelAlertStateWithHttpMessagesAsync(string alertName, string alertUpdateActionType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task UpdateSubscriptionLevelAlertStateToDismissWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -1409,9 +1405,181 @@ internal AlertsOperations(SecurityCenterClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "alertName");
}
- if (alertUpdateActionType == null)
+ string apiVersion = "2019-01-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("alertName", alertName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "UpdateSubscriptionLevelAlertStateToDismiss", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation));
+ _url = _url.Replace("{alertName}", System.Uri.EscapeDataString(alertName));
+ List _queryParameters = new List();
+ if (apiVersion != null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "alertUpdateActionType");
+ _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;
+ // 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 != 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;
+ }
+
+ ///
+ /// Update the alert's state
+ ///
+ ///
+ /// Name of the alert object
+ ///
+ ///
+ /// 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 UpdateSubscriptionLevelAlertStateToReactivateWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$");
+ }
+ }
+ if (Client.AscLocation == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation");
+ }
+ if (alertName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "alertName");
}
string apiVersion = "2019-01-01";
// Tracing
@@ -1423,17 +1591,15 @@ internal AlertsOperations(SecurityCenterClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("alertName", alertName);
- tracingParameters.Add("alertUpdateActionType", alertUpdateActionType);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "UpdateSubscriptionLevelAlertState", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "UpdateSubscriptionLevelAlertStateToReactivate", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/{alertUpdateActionType}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/reactivate").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation));
_url = _url.Replace("{alertName}", System.Uri.EscapeDataString(alertName));
- _url = _url.Replace("{alertUpdateActionType}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(alertUpdateActionType, Client.SerializationSettings).Trim('"')));
List _queryParameters = new List();
if (apiVersion != null)
{
@@ -1552,10 +1718,6 @@ internal AlertsOperations(SecurityCenterClient client)
///
/// Name of the alert object
///
- ///
- /// Type of the action to do on the alert. Possible values include: 'Dismiss',
- /// 'Reactivate'
- ///
///
/// The name of the resource group within the user's subscription. The name is
/// case insensitive.
@@ -1578,7 +1740,7 @@ internal AlertsOperations(SecurityCenterClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task UpdateResourceGroupLevelAlertStateWithHttpMessagesAsync(string alertName, string alertUpdateActionType, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task UpdateResourceGroupLevelAlertStateToDismissWithHttpMessagesAsync(string alertName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -1599,9 +1761,206 @@ internal AlertsOperations(SecurityCenterClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "alertName");
}
- if (alertUpdateActionType == null)
+ if (resourceGroupName == null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "alertUpdateActionType");
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
+ }
+ }
+ string apiVersion = "2019-01-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("alertName", alertName);
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "UpdateResourceGroupLevelAlertStateToDismiss", 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.Security/locations/{ascLocation}/alerts/{alertName}/dismiss").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation));
+ _url = _url.Replace("{alertName}", System.Uri.EscapeDataString(alertName));
+ _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("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;
+ // 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 != 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;
+ }
+
+ ///
+ /// Update the alert's state
+ ///
+ ///
+ /// Name of the alert object
+ ///
+ ///
+ /// The name of the resource group within the user's subscription. The name is
+ /// case insensitive.
+ ///
+ ///
+ /// 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 UpdateResourceGroupLevelAlertStateToReactivateWithHttpMessagesAsync(string alertName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"))
+ {
+ throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$");
+ }
+ }
+ if (Client.AscLocation == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation");
+ }
+ if (alertName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "alertName");
}
if (resourceGroupName == null)
{
@@ -1632,18 +1991,16 @@ internal AlertsOperations(SecurityCenterClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("alertName", alertName);
- tracingParameters.Add("alertUpdateActionType", alertUpdateActionType);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "UpdateResourceGroupLevelAlertState", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "UpdateResourceGroupLevelAlertStateToReactivate", 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.Security/locations/{ascLocation}/alerts/{alertName}/{alertUpdateActionType}").ToString();
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/reactivate").ToString();
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
_url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation));
_url = _url.Replace("{alertName}", System.Uri.EscapeDataString(alertName));
- _url = _url.Replace("{alertUpdateActionType}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(alertUpdateActionType, Client.SerializationSettings).Trim('"')));
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
List _queryParameters = new List();
if (apiVersion != null)
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AlertsOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AlertsOperationsExtensions.cs
index 0634f8dfdb26..b0c9b6285371 100644
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AlertsOperationsExtensions.cs
+++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AlertsOperationsExtensions.cs
@@ -312,13 +312,26 @@ public static Alert GetResourceGroupLevelAlerts(this IAlertsOperations operation
///
/// Name of the alert object
///
- ///
- /// Type of the action to do on the alert. Possible values include: 'Dismiss',
- /// 'Reactivate'
+ public static void UpdateSubscriptionLevelAlertStateToDismiss(this IAlertsOperations operations, string alertName)
+ {
+ operations.UpdateSubscriptionLevelAlertStateToDismissAsync(alertName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Update the alert's state
+ ///
+ ///
+ /// The operations group for this extension method.
///
- public static void UpdateSubscriptionLevelAlertState(this IAlertsOperations operations, string alertName, string alertUpdateActionType)
+ ///
+ /// Name of the alert object
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task UpdateSubscriptionLevelAlertStateToDismissAsync(this IAlertsOperations operations, string alertName, CancellationToken cancellationToken = default(CancellationToken))
{
- operations.UpdateSubscriptionLevelAlertStateAsync(alertName, alertUpdateActionType).GetAwaiter().GetResult();
+ (await operations.UpdateSubscriptionLevelAlertStateToDismissWithHttpMessagesAsync(alertName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
///
@@ -330,16 +343,26 @@ public static void UpdateSubscriptionLevelAlertState(this IAlertsOperations oper
///
/// Name of the alert object
///
- ///
- /// Type of the action to do on the alert. Possible values include: 'Dismiss',
- /// 'Reactivate'
+ public static void UpdateSubscriptionLevelAlertStateToReactivate(this IAlertsOperations operations, string alertName)
+ {
+ operations.UpdateSubscriptionLevelAlertStateToReactivateAsync(alertName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Update the alert's state
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Name of the alert object
///
///
/// The cancellation token.
///
- public static async Task UpdateSubscriptionLevelAlertStateAsync(this IAlertsOperations operations, string alertName, string alertUpdateActionType, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task UpdateSubscriptionLevelAlertStateToReactivateAsync(this IAlertsOperations operations, string alertName, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.UpdateSubscriptionLevelAlertStateWithHttpMessagesAsync(alertName, alertUpdateActionType, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ (await operations.UpdateSubscriptionLevelAlertStateToReactivateWithHttpMessagesAsync(alertName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
///
@@ -351,17 +374,34 @@ public static void UpdateSubscriptionLevelAlertState(this IAlertsOperations oper
///
/// Name of the alert object
///
- ///
- /// Type of the action to do on the alert. Possible values include: 'Dismiss',
- /// 'Reactivate'
+ ///
+ /// The name of the resource group within the user's subscription. The name is
+ /// case insensitive.
+ ///
+ public static void UpdateResourceGroupLevelAlertStateToDismiss(this IAlertsOperations operations, string alertName, string resourceGroupName)
+ {
+ operations.UpdateResourceGroupLevelAlertStateToDismissAsync(alertName, resourceGroupName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Update the alert's state
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Name of the alert object
///
///
/// The name of the resource group within the user's subscription. The name is
/// case insensitive.
///
- public static void UpdateResourceGroupLevelAlertState(this IAlertsOperations operations, string alertName, string alertUpdateActionType, string resourceGroupName)
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task UpdateResourceGroupLevelAlertStateToDismissAsync(this IAlertsOperations operations, string alertName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
{
- operations.UpdateResourceGroupLevelAlertStateAsync(alertName, alertUpdateActionType, resourceGroupName).GetAwaiter().GetResult();
+ (await operations.UpdateResourceGroupLevelAlertStateToDismissWithHttpMessagesAsync(alertName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
///
@@ -373,9 +413,23 @@ public static void UpdateResourceGroupLevelAlertState(this IAlertsOperations ope
///
/// Name of the alert object
///
- ///
- /// Type of the action to do on the alert. Possible values include: 'Dismiss',
- /// 'Reactivate'
+ ///
+ /// The name of the resource group within the user's subscription. The name is
+ /// case insensitive.
+ ///
+ public static void UpdateResourceGroupLevelAlertStateToReactivate(this IAlertsOperations operations, string alertName, string resourceGroupName)
+ {
+ operations.UpdateResourceGroupLevelAlertStateToReactivateAsync(alertName, resourceGroupName).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Update the alert's state
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Name of the alert object
///
///
/// The name of the resource group within the user's subscription. The name is
@@ -384,9 +438,9 @@ public static void UpdateResourceGroupLevelAlertState(this IAlertsOperations ope
///
/// The cancellation token.
///
- public static async Task UpdateResourceGroupLevelAlertStateAsync(this IAlertsOperations operations, string alertName, string alertUpdateActionType, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task UpdateResourceGroupLevelAlertStateToReactivateAsync(this IAlertsOperations operations, string alertName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.UpdateResourceGroupLevelAlertStateWithHttpMessagesAsync(alertName, alertUpdateActionType, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ (await operations.UpdateResourceGroupLevelAlertStateToReactivateWithHttpMessagesAsync(alertName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
///
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IAlertsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IAlertsOperations.cs
index 7a5007b36cb7..e8e473c619fe 100644
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IAlertsOperations.cs
+++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IAlertsOperations.cs
@@ -200,9 +200,24 @@ public partial interface IAlertsOperations
///
/// Name of the alert object
///
- ///
- /// Type of the action to do on the alert. Possible values include:
- /// 'Dismiss', 'Reactivate'
+ ///
+ /// 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 UpdateSubscriptionLevelAlertStateToDismissWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Update the alert's state
+ ///
+ ///
+ /// Name of the alert object
///
///
/// The headers that will be added to request.
@@ -216,16 +231,35 @@ public partial interface IAlertsOperations
///
/// Thrown when a required parameter is null
///
- Task UpdateSubscriptionLevelAlertStateWithHttpMessagesAsync(string alertName, string alertUpdateActionType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task UpdateSubscriptionLevelAlertStateToReactivateWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Update the alert's state
///
///
/// Name of the alert object
///
- ///
- /// Type of the action to do on the alert. Possible values include:
- /// 'Dismiss', 'Reactivate'
+ ///
+ /// The name of the resource group within the user's subscription. The
+ /// name is case insensitive.
+ ///
+ ///
+ /// 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 UpdateResourceGroupLevelAlertStateToDismissWithHttpMessagesAsync(string alertName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Update the alert's state
+ ///
+ ///
+ /// Name of the alert object
///
///
/// The name of the resource group within the user's subscription. The
@@ -243,7 +277,7 @@ public partial interface IAlertsOperations
///
/// Thrown when a required parameter is null
///
- Task UpdateResourceGroupLevelAlertStateWithHttpMessagesAsync(string alertName, string alertUpdateActionType, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task UpdateResourceGroupLevelAlertStateToReactivateWithHttpMessagesAsync(string alertName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// List all the alerts that are associated with the subscription
///
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ETag.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ETag.cs
new file mode 100644
index 000000000000..1909408527d8
--- /dev/null
+++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ETag.cs
@@ -0,0 +1,54 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Security.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Entity tag is used for comparing two or more entities from the same
+ /// requested resource.
+ ///
+ public partial class ETag
+ {
+ ///
+ /// Initializes a new instance of the ETag class.
+ ///
+ public ETag()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ETag class.
+ ///
+ /// Entity tag is used for comparing two or more
+ /// entities from the same requested resource.
+ public ETag(string etag = default(string))
+ {
+ Etag = etag;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets entity tag is used for comparing two or more entities
+ /// from the same requested resource.
+ ///
+ [JsonProperty(PropertyName = "etag")]
+ public string Etag { get; set; }
+
+ }
+}
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Tags.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Tags.cs
new file mode 100644
index 000000000000..a217d6f42095
--- /dev/null
+++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Tags.cs
@@ -0,0 +1,54 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Security.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// A list of key value pairs that describe the resource.
+ ///
+ public partial class Tags
+ {
+ ///
+ /// Initializes a new instance of the Tags class.
+ ///
+ public Tags()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the Tags class.
+ ///
+ /// A list of key value pairs that describe
+ /// the resource.
+ public Tags(IDictionary tagsProperty = default(IDictionary))
+ {
+ TagsProperty = tagsProperty;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets a list of key value pairs that describe the resource.
+ ///
+ [JsonProperty(PropertyName = "tags")]
+ public IDictionary TagsProperty { get; set; }
+
+ }
+}
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TrackedResource.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TrackedResource.cs
new file mode 100644
index 000000000000..0eda4aeb3d48
--- /dev/null
+++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TrackedResource.cs
@@ -0,0 +1,105 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.Security.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Describes an Azure tracked resource.
+ ///
+ public partial class TrackedResource
+ {
+ ///
+ /// Initializes a new instance of the TrackedResource class.
+ ///
+ public TrackedResource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the TrackedResource class.
+ ///
+ /// Resource Id
+ /// Resource name
+ /// Resource type
+ /// Location where the resource is
+ /// stored
+ /// Kind of the resource
+ /// Entity tag is used for comparing two or more
+ /// entities from the same requested resource.
+ /// A list of key value pairs that describe the
+ /// resource.
+ public TrackedResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), string kind = default(string), string etag = default(string), IDictionary tags = default(IDictionary))
+ {
+ Id = id;
+ Name = name;
+ Type = type;
+ Location = location;
+ Kind = kind;
+ Etag = etag;
+ Tags = tags;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets resource Id
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ ///
+ /// Gets resource name
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets resource type
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; private set; }
+
+ ///
+ /// Gets location where the resource is stored
+ ///
+ [JsonProperty(PropertyName = "location")]
+ public string Location { get; private set; }
+
+ ///
+ /// Gets or sets kind of the resource
+ ///
+ [JsonProperty(PropertyName = "kind")]
+ public string Kind { get; set; }
+
+ ///
+ /// Gets or sets entity tag is used for comparing two or more entities
+ /// from the same requested resource.
+ ///
+ [JsonProperty(PropertyName = "etag")]
+ public string Etag { get; set; }
+
+ ///
+ /// Gets or sets a list of key value pairs that describe the resource.
+ ///
+ [JsonProperty(PropertyName = "tags")]
+ public IDictionary Tags { get; set; }
+
+ }
+}
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs
index a8ab6266b61b..63c9766c4e73 100644
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs
+++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs
@@ -51,16 +51,5 @@ public static IEnumerable> ApiInfo_SecurityCenter
}.AsEnumerable();
}
}
- // BEGIN: Code Generation Metadata Section
- public static readonly String AutoRestVersion = "latest";
- public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4407";
- public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/security/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=C:\\github\\liran\\azure-sdk-for-net\\sdk";
- public static readonly String GithubForkName = "Azure";
- public static readonly String GithubBranchName = "master";
- public static readonly String GithubCommidId = "80a458c51677166e259b90316678e16c1ec614a0";
- public static readonly String CodeGenerationErrors = "";
- public static readonly String GithubRepoName = "azure-rest-api-specs";
- // END: Code Generation Metadata Section
}
}
-