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 2db369a32189..1bc78bd210d0 100644
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AlertsOperations.cs
+++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AlertsOperations.cs
@@ -87,7 +87,7 @@ internal AlertsOperations(SecurityCenterClient client)
throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$");
}
}
- string apiVersion = "2020-01-01";
+ string apiVersion = "2021-01-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -293,7 +293,7 @@ internal AlertsOperations(SecurityCenterClient client)
throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
}
}
- string apiVersion = "2020-01-01";
+ string apiVersion = "2021-01-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -466,7 +466,7 @@ internal AlertsOperations(SecurityCenterClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListSubscriptionLevelAlertsByRegionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListSubscriptionLevelByRegionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -483,7 +483,7 @@ internal AlertsOperations(SecurityCenterClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation");
}
- string apiVersion = "2020-01-01";
+ string apiVersion = "2021-01-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -493,7 +493,7 @@ internal AlertsOperations(SecurityCenterClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListSubscriptionLevelAlertsByRegion", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListSubscriptionLevelByRegion", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
@@ -659,7 +659,7 @@ internal AlertsOperations(SecurityCenterClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListResourceGroupLevelAlertsByRegionWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListResourceGroupLevelByRegionWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -695,7 +695,7 @@ internal AlertsOperations(SecurityCenterClient client)
throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
}
}
- string apiVersion = "2020-01-01";
+ string apiVersion = "2021-01-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -706,7 +706,7 @@ internal AlertsOperations(SecurityCenterClient client)
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListResourceGroupLevelAlertsByRegion", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListResourceGroupLevelByRegion", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
@@ -871,7 +871,7 @@ internal AlertsOperations(SecurityCenterClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetSubscriptionLevelAlertWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetSubscriptionLevelWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -892,7 +892,7 @@ internal AlertsOperations(SecurityCenterClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "alertName");
}
- string apiVersion = "2020-01-01";
+ string apiVersion = "2021-01-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -903,7 +903,7 @@ internal AlertsOperations(SecurityCenterClient client)
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("alertName", alertName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "GetSubscriptionLevelAlert", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "GetSubscriptionLevel", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
@@ -1073,7 +1073,7 @@ internal AlertsOperations(SecurityCenterClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetResourceGroupLevelAlertsWithHttpMessagesAsync(string alertName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetResourceGroupLevelWithHttpMessagesAsync(string alertName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -1113,7 +1113,7 @@ internal AlertsOperations(SecurityCenterClient client)
throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
}
}
- string apiVersion = "2020-01-01";
+ string apiVersion = "2021-01-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1125,7 +1125,7 @@ internal AlertsOperations(SecurityCenterClient client)
tracingParameters.Add("alertName", alertName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "GetResourceGroupLevelAlerts", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "GetResourceGroupLevel", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
@@ -1288,7 +1288,7 @@ internal AlertsOperations(SecurityCenterClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task UpdateSubscriptionLevelAlertStateToDismissWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task UpdateSubscriptionLevelStateToDismissWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -1309,7 +1309,7 @@ internal AlertsOperations(SecurityCenterClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "alertName");
}
- string apiVersion = "2020-01-01";
+ string apiVersion = "2021-01-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1320,7 +1320,7 @@ internal AlertsOperations(SecurityCenterClient client)
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("alertName", alertName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "UpdateSubscriptionLevelAlertStateToDismiss", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "UpdateSubscriptionLevelStateToDismiss", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
@@ -1485,7 +1485,7 @@ internal AlertsOperations(SecurityCenterClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "alertName");
}
- string apiVersion = "2020-01-01";
+ string apiVersion = "2021-01-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1640,7 +1640,7 @@ internal AlertsOperations(SecurityCenterClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task UpdateSubscriptionLevelAlertStateToReactivateWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task UpdateSubscriptionLevelStateToActivateWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -1661,7 +1661,7 @@ internal AlertsOperations(SecurityCenterClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "alertName");
}
- string apiVersion = "2020-01-01";
+ string apiVersion = "2021-01-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1672,7 +1672,7 @@ internal AlertsOperations(SecurityCenterClient client)
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("alertName", alertName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "UpdateSubscriptionLevelAlertStateToReactivate", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "UpdateSubscriptionLevelStateToActivate", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
@@ -1860,7 +1860,7 @@ internal AlertsOperations(SecurityCenterClient client)
throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
}
}
- string apiVersion = "2020-01-01";
+ string apiVersion = "2021-01-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2021,7 +2021,7 @@ internal AlertsOperations(SecurityCenterClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task UpdateResourceGroupLevelAlertStateToDismissWithHttpMessagesAsync(string alertName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task UpdateResourceGroupLevelStateToDismissWithHttpMessagesAsync(string alertName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -2061,7 +2061,7 @@ internal AlertsOperations(SecurityCenterClient client)
throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
}
}
- string apiVersion = "2020-01-01";
+ string apiVersion = "2021-01-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2073,7 +2073,7 @@ internal AlertsOperations(SecurityCenterClient client)
tracingParameters.Add("alertName", alertName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "UpdateResourceGroupLevelAlertStateToDismiss", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "UpdateResourceGroupLevelStateToDismiss", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
@@ -2222,7 +2222,7 @@ internal AlertsOperations(SecurityCenterClient client)
///
/// 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))
+ public async Task UpdateResourceGroupLevelStateToActivateWithHttpMessagesAsync(string alertName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
@@ -2262,7 +2262,7 @@ internal AlertsOperations(SecurityCenterClient client)
throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
}
}
- string apiVersion = "2020-01-01";
+ string apiVersion = "2021-01-01";
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -2274,7 +2274,7 @@ internal AlertsOperations(SecurityCenterClient client)
tracingParameters.Add("alertName", alertName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "UpdateResourceGroupLevelAlertStateToReactivate", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "UpdateResourceGroupLevelStateToActivate", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
@@ -2395,6 +2395,207 @@ internal AlertsOperations(SecurityCenterClient client)
return _result;
}
+ ///
+ /// Simulate security alerts
+ ///
+ ///
+ /// Alert Simulator request body data.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task SimulateWithHttpMessagesAsync(AlertSimulatorRequestProperties properties = default(AlertSimulatorRequestProperties), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send request
+ AzureOperationResponse _response = await BeginSimulateWithHttpMessagesAsync(properties, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Simulate security alerts
+ ///
+ ///
+ /// Alert Simulator request body data.
+ ///
+ ///
+ /// 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 BeginSimulateWithHttpMessagesAsync(AlertSimulatorRequestProperties properties = default(AlertSimulatorRequestProperties), 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");
+ }
+ string apiVersion = "2021-01-01";
+ AlertSimulatorRequestBody alertSimulatorRequestBody = new AlertSimulatorRequestBody();
+ if (properties != null)
+ {
+ alertSimulatorRequestBody.Properties = properties;
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("apiVersion", apiVersion);
+ tracingParameters.Add("alertSimulatorRequestBody", alertSimulatorRequestBody);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginSimulate", 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/default/simulate").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation));
+ 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(alertSimulatorRequestBody != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(alertSimulatorRequestBody, 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 != 202)
+ {
+ 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;
+ }
+
///
/// List all the alerts that are associated with the subscription
///
@@ -2769,7 +2970,7 @@ internal AlertsOperations(SecurityCenterClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListSubscriptionLevelAlertsByRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListSubscriptionLevelByRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -2784,7 +2985,7 @@ internal AlertsOperations(SecurityCenterClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListSubscriptionLevelAlertsByRegionNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListSubscriptionLevelByRegionNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
@@ -2943,7 +3144,7 @@ internal AlertsOperations(SecurityCenterClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListResourceGroupLevelAlertsByRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListResourceGroupLevelByRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -2958,7 +3159,7 @@ internal AlertsOperations(SecurityCenterClient client)
Dictionary tracingParameters = new Dictionary();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListResourceGroupLevelAlertsByRegionNext", tracingParameters);
+ ServiceClientTracing.Enter(_invocationId, this, "ListResourceGroupLevelByRegionNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
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 a6fa8ea8e4ad..df7eed486658 100644
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AlertsOperationsExtensions.cs
+++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AlertsOperationsExtensions.cs
@@ -92,9 +92,9 @@ public static IPage ListByResourceGroup(this IAlertsOperations operations
///
/// The operations group for this extension method.
///
- public static IPage ListSubscriptionLevelAlertsByRegion(this IAlertsOperations operations)
+ public static IPage ListSubscriptionLevelByRegion(this IAlertsOperations operations)
{
- return operations.ListSubscriptionLevelAlertsByRegionAsync().GetAwaiter().GetResult();
+ return operations.ListSubscriptionLevelByRegionAsync().GetAwaiter().GetResult();
}
///
@@ -107,9 +107,9 @@ public static IPage ListSubscriptionLevelAlertsByRegion(this IAlertsOpera
///
/// The cancellation token.
///
- public static async Task> ListSubscriptionLevelAlertsByRegionAsync(this IAlertsOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListSubscriptionLevelByRegionAsync(this IAlertsOperations operations, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListSubscriptionLevelAlertsByRegionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.ListSubscriptionLevelByRegionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -126,9 +126,9 @@ public static IPage ListSubscriptionLevelAlertsByRegion(this IAlertsOpera
/// The name of the resource group within the user's subscription. The name is
/// case insensitive.
///
- public static IPage ListResourceGroupLevelAlertsByRegion(this IAlertsOperations operations, string resourceGroupName)
+ public static IPage ListResourceGroupLevelByRegion(this IAlertsOperations operations, string resourceGroupName)
{
- return operations.ListResourceGroupLevelAlertsByRegionAsync(resourceGroupName).GetAwaiter().GetResult();
+ return operations.ListResourceGroupLevelByRegionAsync(resourceGroupName).GetAwaiter().GetResult();
}
///
@@ -145,9 +145,9 @@ public static IPage ListResourceGroupLevelAlertsByRegion(this IAlertsOper
///
/// The cancellation token.
///
- public static async Task> ListResourceGroupLevelAlertsByRegionAsync(this IAlertsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListResourceGroupLevelByRegionAsync(this IAlertsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListResourceGroupLevelAlertsByRegionWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.ListResourceGroupLevelByRegionWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -162,9 +162,9 @@ public static IPage ListResourceGroupLevelAlertsByRegion(this IAlertsOper
///
/// Name of the alert object
///
- public static Alert GetSubscriptionLevelAlert(this IAlertsOperations operations, string alertName)
+ public static Alert GetSubscriptionLevel(this IAlertsOperations operations, string alertName)
{
- return operations.GetSubscriptionLevelAlertAsync(alertName).GetAwaiter().GetResult();
+ return operations.GetSubscriptionLevelAsync(alertName).GetAwaiter().GetResult();
}
///
@@ -179,9 +179,9 @@ public static Alert GetSubscriptionLevelAlert(this IAlertsOperations operations,
///
/// The cancellation token.
///
- public static async Task GetSubscriptionLevelAlertAsync(this IAlertsOperations operations, string alertName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetSubscriptionLevelAsync(this IAlertsOperations operations, string alertName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetSubscriptionLevelAlertWithHttpMessagesAsync(alertName, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.GetSubscriptionLevelWithHttpMessagesAsync(alertName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -201,9 +201,9 @@ public static Alert GetSubscriptionLevelAlert(this IAlertsOperations operations,
/// The name of the resource group within the user's subscription. The name is
/// case insensitive.
///
- public static Alert GetResourceGroupLevelAlerts(this IAlertsOperations operations, string alertName, string resourceGroupName)
+ public static Alert GetResourceGroupLevel(this IAlertsOperations operations, string alertName, string resourceGroupName)
{
- return operations.GetResourceGroupLevelAlertsAsync(alertName, resourceGroupName).GetAwaiter().GetResult();
+ return operations.GetResourceGroupLevelAsync(alertName, resourceGroupName).GetAwaiter().GetResult();
}
///
@@ -223,9 +223,9 @@ public static Alert GetResourceGroupLevelAlerts(this IAlertsOperations operation
///
/// The cancellation token.
///
- public static async Task GetResourceGroupLevelAlertsAsync(this IAlertsOperations operations, string alertName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetResourceGroupLevelAsync(this IAlertsOperations operations, string alertName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetResourceGroupLevelAlertsWithHttpMessagesAsync(alertName, resourceGroupName, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.GetResourceGroupLevelWithHttpMessagesAsync(alertName, resourceGroupName, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -240,9 +240,9 @@ public static Alert GetResourceGroupLevelAlerts(this IAlertsOperations operation
///
/// Name of the alert object
///
- public static void UpdateSubscriptionLevelAlertStateToDismiss(this IAlertsOperations operations, string alertName)
+ public static void UpdateSubscriptionLevelStateToDismiss(this IAlertsOperations operations, string alertName)
{
- operations.UpdateSubscriptionLevelAlertStateToDismissAsync(alertName).GetAwaiter().GetResult();
+ operations.UpdateSubscriptionLevelStateToDismissAsync(alertName).GetAwaiter().GetResult();
}
///
@@ -257,9 +257,9 @@ public static void UpdateSubscriptionLevelAlertStateToDismiss(this IAlertsOperat
///
/// The cancellation token.
///
- public static async Task UpdateSubscriptionLevelAlertStateToDismissAsync(this IAlertsOperations operations, string alertName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task UpdateSubscriptionLevelStateToDismissAsync(this IAlertsOperations operations, string alertName, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.UpdateSubscriptionLevelAlertStateToDismissWithHttpMessagesAsync(alertName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ (await operations.UpdateSubscriptionLevelStateToDismissWithHttpMessagesAsync(alertName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
///
@@ -302,9 +302,9 @@ public static void UpdateSubscriptionLevelStateToResolve(this IAlertsOperations
///
/// Name of the alert object
///
- public static void UpdateSubscriptionLevelAlertStateToReactivate(this IAlertsOperations operations, string alertName)
+ public static void UpdateSubscriptionLevelStateToActivate(this IAlertsOperations operations, string alertName)
{
- operations.UpdateSubscriptionLevelAlertStateToReactivateAsync(alertName).GetAwaiter().GetResult();
+ operations.UpdateSubscriptionLevelStateToActivateAsync(alertName).GetAwaiter().GetResult();
}
///
@@ -319,9 +319,9 @@ public static void UpdateSubscriptionLevelAlertStateToReactivate(this IAlertsOpe
///
/// The cancellation token.
///
- public static async Task UpdateSubscriptionLevelAlertStateToReactivateAsync(this IAlertsOperations operations, string alertName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task UpdateSubscriptionLevelStateToActivateAsync(this IAlertsOperations operations, string alertName, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.UpdateSubscriptionLevelAlertStateToReactivateWithHttpMessagesAsync(alertName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ (await operations.UpdateSubscriptionLevelStateToActivateWithHttpMessagesAsync(alertName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
///
@@ -376,9 +376,9 @@ public static void UpdateResourceGroupLevelStateToResolve(this IAlertsOperations
/// 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)
+ public static void UpdateResourceGroupLevelStateToDismiss(this IAlertsOperations operations, string alertName, string resourceGroupName)
{
- operations.UpdateResourceGroupLevelAlertStateToDismissAsync(alertName, resourceGroupName).GetAwaiter().GetResult();
+ operations.UpdateResourceGroupLevelStateToDismissAsync(alertName, resourceGroupName).GetAwaiter().GetResult();
}
///
@@ -397,9 +397,9 @@ public static void UpdateResourceGroupLevelAlertStateToDismiss(this IAlertsOpera
///
/// The cancellation token.
///
- public static async Task UpdateResourceGroupLevelAlertStateToDismissAsync(this IAlertsOperations operations, string alertName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task UpdateResourceGroupLevelStateToDismissAsync(this IAlertsOperations operations, string alertName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.UpdateResourceGroupLevelAlertStateToDismissWithHttpMessagesAsync(alertName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ (await operations.UpdateResourceGroupLevelStateToDismissWithHttpMessagesAsync(alertName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
///
@@ -415,9 +415,9 @@ public static void UpdateResourceGroupLevelAlertStateToDismiss(this IAlertsOpera
/// 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)
+ public static void UpdateResourceGroupLevelStateToActivate(this IAlertsOperations operations, string alertName, string resourceGroupName)
{
- operations.UpdateResourceGroupLevelAlertStateToReactivateAsync(alertName, resourceGroupName).GetAwaiter().GetResult();
+ operations.UpdateResourceGroupLevelStateToActivateAsync(alertName, resourceGroupName).GetAwaiter().GetResult();
}
///
@@ -436,9 +436,71 @@ public static void UpdateResourceGroupLevelAlertStateToReactivate(this IAlertsOp
///
/// The cancellation token.
///
- public static async Task UpdateResourceGroupLevelAlertStateToReactivateAsync(this IAlertsOperations operations, string alertName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task UpdateResourceGroupLevelStateToActivateAsync(this IAlertsOperations operations, string alertName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken))
{
- (await operations.UpdateResourceGroupLevelAlertStateToReactivateWithHttpMessagesAsync(alertName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ (await operations.UpdateResourceGroupLevelStateToActivateWithHttpMessagesAsync(alertName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// Simulate security alerts
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Alert Simulator request body data.
+ ///
+ public static void Simulate(this IAlertsOperations operations, AlertSimulatorRequestProperties properties = default(AlertSimulatorRequestProperties))
+ {
+ operations.SimulateAsync(properties).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Simulate security alerts
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Alert Simulator request body data.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task SimulateAsync(this IAlertsOperations operations, AlertSimulatorRequestProperties properties = default(AlertSimulatorRequestProperties), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.SimulateWithHttpMessagesAsync(properties, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// Simulate security alerts
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Alert Simulator request body data.
+ ///
+ public static void BeginSimulate(this IAlertsOperations operations, AlertSimulatorRequestProperties properties = default(AlertSimulatorRequestProperties))
+ {
+ operations.BeginSimulateAsync(properties).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Simulate security alerts
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Alert Simulator request body data.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task BeginSimulateAsync(this IAlertsOperations operations, AlertSimulatorRequestProperties properties = default(AlertSimulatorRequestProperties), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.BeginSimulateWithHttpMessagesAsync(properties, null, cancellationToken).ConfigureAwait(false)).Dispose();
}
///
@@ -519,9 +581,9 @@ public static IPage ListByResourceGroupNext(this IAlertsOperations operat
///
/// The NextLink from the previous successful call to List operation.
///
- public static IPage ListSubscriptionLevelAlertsByRegionNext(this IAlertsOperations operations, string nextPageLink)
+ public static IPage ListSubscriptionLevelByRegionNext(this IAlertsOperations operations, string nextPageLink)
{
- return operations.ListSubscriptionLevelAlertsByRegionNextAsync(nextPageLink).GetAwaiter().GetResult();
+ return operations.ListSubscriptionLevelByRegionNextAsync(nextPageLink).GetAwaiter().GetResult();
}
///
@@ -537,9 +599,9 @@ public static IPage ListSubscriptionLevelAlertsByRegionNext(this IAlertsO
///
/// The cancellation token.
///
- public static async Task> ListSubscriptionLevelAlertsByRegionNextAsync(this IAlertsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListSubscriptionLevelByRegionNextAsync(this IAlertsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListSubscriptionLevelAlertsByRegionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.ListSubscriptionLevelByRegionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -555,9 +617,9 @@ public static IPage ListSubscriptionLevelAlertsByRegionNext(this IAlertsO
///
/// The NextLink from the previous successful call to List operation.
///
- public static IPage ListResourceGroupLevelAlertsByRegionNext(this IAlertsOperations operations, string nextPageLink)
+ public static IPage ListResourceGroupLevelByRegionNext(this IAlertsOperations operations, string nextPageLink)
{
- return operations.ListResourceGroupLevelAlertsByRegionNextAsync(nextPageLink).GetAwaiter().GetResult();
+ return operations.ListResourceGroupLevelByRegionNextAsync(nextPageLink).GetAwaiter().GetResult();
}
///
@@ -573,9 +635,9 @@ public static IPage ListResourceGroupLevelAlertsByRegionNext(this IAlerts
///
/// The cancellation token.
///
- public static async Task> ListResourceGroupLevelAlertsByRegionNextAsync(this IAlertsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListResourceGroupLevelByRegionNextAsync(this IAlertsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.ListResourceGroupLevelAlertsByRegionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.ListResourceGroupLevelByRegionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DeviceOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DeviceOperations.cs
deleted file mode 100644
index fdf84d888ffd..000000000000
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DeviceOperations.cs
+++ /dev/null
@@ -1,243 +0,0 @@
-//
-// 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
-{
- 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;
-
- ///
- /// DeviceOperations operations.
- ///
- internal partial class DeviceOperations : IServiceOperations, IDeviceOperations
- {
- ///
- /// Initializes a new instance of the DeviceOperations class.
- ///
- ///
- /// Reference to the service client.
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- internal DeviceOperations(SecurityCenterClient client)
- {
- if (client == null)
- {
- throw new System.ArgumentNullException("client");
- }
- Client = client;
- }
-
- ///
- /// Gets a reference to the SecurityCenterClient
- ///
- public SecurityCenterClient Client { get; private set; }
-
- ///
- /// Get device.
- ///
- ///
- /// The identifier of the resource.
- ///
- ///
- /// Identifier of the device.
- ///
- ///
- /// 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 resourceId, string deviceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- if (resourceId == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceId");
- }
- if (deviceId == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "deviceId");
- }
- string apiVersion = "2020-08-06-preview";
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("apiVersion", apiVersion);
- tracingParameters.Add("resourceId", resourceId);
- tracingParameters.Add("deviceId", deviceId);
- 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("/") ? "" : "/")), "{resourceId}/providers/Microsoft.Security/devices/{deviceId}").ToString();
- _url = _url.Replace("{resourceId}", resourceId);
- _url = _url.Replace("{deviceId}", System.Uri.EscapeDataString(deviceId));
- 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;
- }
-
- }
-}
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DeviceOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DeviceOperationsExtensions.cs
deleted file mode 100644
index b5f731974a69..000000000000
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DeviceOperationsExtensions.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-//
-// 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
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// Extension methods for DeviceOperations.
- ///
- public static partial class DeviceOperationsExtensions
- {
- ///
- /// Get device.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The identifier of the resource.
- ///
- ///
- /// Identifier of the device.
- ///
- public static Device Get(this IDeviceOperations operations, string resourceId, string deviceId)
- {
- return operations.GetAsync(resourceId, deviceId).GetAwaiter().GetResult();
- }
-
- ///
- /// Get device.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The identifier of the resource.
- ///
- ///
- /// Identifier of the device.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task GetAsync(this IDeviceOperations operations, string resourceId, string deviceId, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.GetWithHttpMessagesAsync(resourceId, deviceId, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- }
-}
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DevicesForHubOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DevicesForHubOperations.cs
deleted file mode 100644
index c152521ca69d..000000000000
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DevicesForHubOperations.cs
+++ /dev/null
@@ -1,432 +0,0 @@
-//
-// 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
-{
- 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;
-
- ///
- /// DevicesForHubOperations operations.
- ///
- internal partial class DevicesForHubOperations : IServiceOperations, IDevicesForHubOperations
- {
- ///
- /// Initializes a new instance of the DevicesForHubOperations class.
- ///
- ///
- /// Reference to the service client.
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- internal DevicesForHubOperations(SecurityCenterClient client)
- {
- if (client == null)
- {
- throw new System.ArgumentNullException("client");
- }
- Client = client;
- }
-
- ///
- /// Gets a reference to the SecurityCenterClient
- ///
- public SecurityCenterClient Client { get; private set; }
-
- ///
- /// Get list of the devices for the specified IoT Hub resource.
- ///
- ///
- /// The identifier of the resource.
- ///
- ///
- /// Limit the number of items returned in a single page
- ///
- ///
- /// Skip token used for pagination
- ///
- ///
- /// Get devices only from specific type, Managed or Unmanaged. Possible values
- /// include: 'Managed', 'Unmanaged'
- ///
- ///
- /// 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>> ListWithHttpMessagesAsync(string resourceId, int? limit = default(int?), string skipToken = default(string), string deviceManagementType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- if (resourceId == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "resourceId");
- }
- string apiVersion = "2020-08-06-preview";
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("apiVersion", apiVersion);
- tracingParameters.Add("resourceId", resourceId);
- tracingParameters.Add("limit", limit);
- tracingParameters.Add("skipToken", skipToken);
- tracingParameters.Add("deviceManagementType", deviceManagementType);
- tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
- }
- // Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{resourceId}/providers/Microsoft.Security/devices").ToString();
- _url = _url.Replace("{resourceId}", resourceId);
- List _queryParameters = new List();
- if (apiVersion != null)
- {
- _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
- }
- if (limit != null)
- {
- _queryParameters.Add(string.Format("$limit={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(limit, Client.SerializationSettings).Trim('"'))));
- }
- if (skipToken != null)
- {
- _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken)));
- }
- if (deviceManagementType != null)
- {
- _queryParameters.Add(string.Format("deviceManagementType={0}", System.Uri.EscapeDataString(deviceManagementType)));
- }
- 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 list of the devices for the specified IoT Hub resource.
- ///
- ///
- /// The NextLink from the previous successful call to List 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- if (nextPageLink == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
- }
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("nextPageLink", nextPageLink);
- tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
- }
- // Construct URL
- string _url = "{nextLink}";
- _url = _url.Replace("{nextLink}", nextPageLink);
- List _queryParameters = new List();
- if (_queryParameters.Count > 0)
- {
- _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
- }
- // Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
- _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;
- }
-
- }
-}
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DevicesForHubOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DevicesForHubOperationsExtensions.cs
deleted file mode 100644
index fd720b59218f..000000000000
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DevicesForHubOperationsExtensions.cs
+++ /dev/null
@@ -1,113 +0,0 @@
-//
-// 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
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// Extension methods for DevicesForHubOperations.
- ///
- public static partial class DevicesForHubOperationsExtensions
- {
- ///
- /// Get list of the devices for the specified IoT Hub resource.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The identifier of the resource.
- ///
- ///
- /// Limit the number of items returned in a single page
- ///
- ///
- /// Skip token used for pagination
- ///
- ///
- /// Get devices only from specific type, Managed or Unmanaged. Possible values
- /// include: 'Managed', 'Unmanaged'
- ///
- public static IPage List(this IDevicesForHubOperations operations, string resourceId, int? limit = default(int?), string skipToken = default(string), string deviceManagementType = default(string))
- {
- return operations.ListAsync(resourceId, limit, skipToken, deviceManagementType).GetAwaiter().GetResult();
- }
-
- ///
- /// Get list of the devices for the specified IoT Hub resource.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The identifier of the resource.
- ///
- ///
- /// Limit the number of items returned in a single page
- ///
- ///
- /// Skip token used for pagination
- ///
- ///
- /// Get devices only from specific type, Managed or Unmanaged. Possible values
- /// include: 'Managed', 'Unmanaged'
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task> ListAsync(this IDevicesForHubOperations operations, string resourceId, int? limit = default(int?), string skipToken = default(string), string deviceManagementType = default(string), CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.ListWithHttpMessagesAsync(resourceId, limit, skipToken, deviceManagementType, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- ///
- /// Get list of the devices for the specified IoT Hub resource.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The NextLink from the previous successful call to List operation.
- ///
- public static IPage ListNext(this IDevicesForHubOperations operations, string nextPageLink)
- {
- return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
- }
-
- ///
- /// Get list of the devices for the specified IoT Hub resource.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The NextLink from the previous successful call to List operation.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task> ListNextAsync(this IDevicesForHubOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- }
-}
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DevicesForSubscriptionOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DevicesForSubscriptionOperations.cs
deleted file mode 100644
index 3a225ef704bc..000000000000
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DevicesForSubscriptionOperations.cs
+++ /dev/null
@@ -1,435 +0,0 @@
-//
-// 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
-{
- 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;
-
- ///
- /// DevicesForSubscriptionOperations operations.
- ///
- internal partial class DevicesForSubscriptionOperations : IServiceOperations, IDevicesForSubscriptionOperations
- {
- ///
- /// Initializes a new instance of the DevicesForSubscriptionOperations class.
- ///
- ///
- /// Reference to the service client.
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- internal DevicesForSubscriptionOperations(SecurityCenterClient client)
- {
- if (client == null)
- {
- throw new System.ArgumentNullException("client");
- }
- Client = client;
- }
-
- ///
- /// Gets a reference to the SecurityCenterClient
- ///
- public SecurityCenterClient Client { get; private set; }
-
- ///
- /// Get list of the devices by their subscription.
- ///
- ///
- /// Limit the number of items returned in a single page
- ///
- ///
- /// Skip token used for pagination
- ///
- ///
- /// Get devices only from specific type, Managed or Unmanaged. Possible values
- /// include: 'Managed', 'Unmanaged'
- ///
- ///
- /// 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>> ListWithHttpMessagesAsync(int? limit = default(int?), string skipToken = default(string), string deviceManagementType = default(string), 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}$");
- }
- }
- string apiVersion = "2020-08-06-preview";
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("apiVersion", apiVersion);
- tracingParameters.Add("limit", limit);
- tracingParameters.Add("skipToken", skipToken);
- tracingParameters.Add("deviceManagementType", deviceManagementType);
- tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
- }
- // Construct URL
- var _baseUrl = Client.BaseUri.AbsoluteUri;
- var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/devices").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 (limit != null)
- {
- _queryParameters.Add(string.Format("$limit={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(limit, Client.SerializationSettings).Trim('"'))));
- }
- if (skipToken != null)
- {
- _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken)));
- }
- if (deviceManagementType != null)
- {
- _queryParameters.Add(string.Format("deviceManagementType={0}", System.Uri.EscapeDataString(deviceManagementType)));
- }
- 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 list of the devices by their subscription.
- ///
- ///
- /// The NextLink from the previous successful call to List 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
- {
- if (nextPageLink == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
- }
- // Tracing
- bool _shouldTrace = ServiceClientTracing.IsEnabled;
- string _invocationId = null;
- if (_shouldTrace)
- {
- _invocationId = ServiceClientTracing.NextInvocationId.ToString();
- Dictionary tracingParameters = new Dictionary();
- tracingParameters.Add("nextPageLink", nextPageLink);
- tracingParameters.Add("cancellationToken", cancellationToken);
- ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
- }
- // Construct URL
- string _url = "{nextLink}";
- _url = _url.Replace("{nextLink}", nextPageLink);
- List _queryParameters = new List();
- if (_queryParameters.Count > 0)
- {
- _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
- }
- // Create HTTP transport objects
- var _httpRequest = new HttpRequestMessage();
- HttpResponseMessage _httpResponse = null;
- _httpRequest.Method = new HttpMethod("GET");
- _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;
- }
-
- }
-}
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DevicesForSubscriptionOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DevicesForSubscriptionOperationsExtensions.cs
deleted file mode 100644
index 0e7a5eb6e2fd..000000000000
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/DevicesForSubscriptionOperationsExtensions.cs
+++ /dev/null
@@ -1,107 +0,0 @@
-//
-// 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
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// Extension methods for DevicesForSubscriptionOperations.
- ///
- public static partial class DevicesForSubscriptionOperationsExtensions
- {
- ///
- /// Get list of the devices by their subscription.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Limit the number of items returned in a single page
- ///
- ///
- /// Skip token used for pagination
- ///
- ///
- /// Get devices only from specific type, Managed or Unmanaged. Possible values
- /// include: 'Managed', 'Unmanaged'
- ///
- public static IPage List(this IDevicesForSubscriptionOperations operations, int? limit = default(int?), string skipToken = default(string), string deviceManagementType = default(string))
- {
- return operations.ListAsync(limit, skipToken, deviceManagementType).GetAwaiter().GetResult();
- }
-
- ///
- /// Get list of the devices by their subscription.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// Limit the number of items returned in a single page
- ///
- ///
- /// Skip token used for pagination
- ///
- ///
- /// Get devices only from specific type, Managed or Unmanaged. Possible values
- /// include: 'Managed', 'Unmanaged'
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task> ListAsync(this IDevicesForSubscriptionOperations operations, int? limit = default(int?), string skipToken = default(string), string deviceManagementType = default(string), CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.ListWithHttpMessagesAsync(limit, skipToken, deviceManagementType, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- ///
- /// Get list of the devices by their subscription.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The NextLink from the previous successful call to List operation.
- ///
- public static IPage ListNext(this IDevicesForSubscriptionOperations operations, string nextPageLink)
- {
- return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
- }
-
- ///
- /// Get list of the devices by their subscription.
- ///
- ///
- /// The operations group for this extension method.
- ///
- ///
- /// The NextLink from the previous successful call to List operation.
- ///
- ///
- /// The cancellation token.
- ///
- public static async Task> ListNextAsync(this IDevicesForSubscriptionOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
- {
- using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
- {
- return _result.Body;
- }
- }
-
- }
-}
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 c494d1bdb73e..2e56aeefc2b3 100644
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IAlertsOperations.cs
+++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IAlertsOperations.cs
@@ -84,7 +84,7 @@ public partial interface IAlertsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListSubscriptionLevelAlertsByRegionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListSubscriptionLevelByRegionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// List all the alerts that are associated with the resource group
/// that are stored in a specific location
@@ -108,7 +108,7 @@ public partial interface IAlertsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListResourceGroupLevelAlertsByRegionWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListResourceGroupLevelByRegionWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Get an alert that is associated with a subscription
///
@@ -130,7 +130,7 @@ public partial interface IAlertsOperations
///
/// Thrown when a required parameter is null
///
- Task> GetSubscriptionLevelAlertWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> GetSubscriptionLevelWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Get an alert that is associated a resource group or a resource in a
/// resource group
@@ -157,7 +157,7 @@ public partial interface IAlertsOperations
///
/// Thrown when a required parameter is null
///
- Task> GetResourceGroupLevelAlertsWithHttpMessagesAsync(string alertName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> GetResourceGroupLevelWithHttpMessagesAsync(string alertName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Update the alert's state
///
@@ -176,7 +176,7 @@ public partial interface IAlertsOperations
///
/// Thrown when a required parameter is null
///
- Task UpdateSubscriptionLevelAlertStateToDismissWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task UpdateSubscriptionLevelStateToDismissWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Update the alert's state
///
@@ -214,7 +214,7 @@ public partial interface IAlertsOperations
///
/// Thrown when a required parameter is null
///
- Task UpdateSubscriptionLevelAlertStateToReactivateWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task UpdateSubscriptionLevelStateToActivateWithHttpMessagesAsync(string alertName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Update the alert's state
///
@@ -260,7 +260,7 @@ public partial interface IAlertsOperations
///
/// Thrown when a required parameter is null
///
- Task UpdateResourceGroupLevelAlertStateToDismissWithHttpMessagesAsync(string alertName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task UpdateResourceGroupLevelStateToDismissWithHttpMessagesAsync(string alertName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// Update the alert's state
///
@@ -283,7 +283,45 @@ public partial interface IAlertsOperations
///
/// Thrown when a required parameter is null
///
- Task UpdateResourceGroupLevelAlertStateToReactivateWithHttpMessagesAsync(string alertName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task UpdateResourceGroupLevelStateToActivateWithHttpMessagesAsync(string alertName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Simulate security alerts
+ ///
+ ///
+ /// Alert Simulator request body data.
+ ///
+ ///
+ /// 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 SimulateWithHttpMessagesAsync(AlertSimulatorRequestProperties properties = default(AlertSimulatorRequestProperties), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Simulate security alerts
+ ///
+ ///
+ /// Alert Simulator request body data.
+ ///
+ ///
+ /// 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 BeginSimulateWithHttpMessagesAsync(AlertSimulatorRequestProperties properties = default(AlertSimulatorRequestProperties), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// List all the alerts that are associated with the subscription
///
@@ -350,7 +388,7 @@ public partial interface IAlertsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListSubscriptionLevelAlertsByRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListSubscriptionLevelByRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
/// List all the alerts that are associated with the resource group
/// that are stored in a specific location
@@ -373,6 +411,6 @@ public partial interface IAlertsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListResourceGroupLevelAlertsByRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListResourceGroupLevelByRegionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IDeviceOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IDeviceOperations.cs
deleted file mode 100644
index bcebea1beb02..000000000000
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IDeviceOperations.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//
-// 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
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// DeviceOperations operations.
- ///
- public partial interface IDeviceOperations
- {
- ///
- /// Get device.
- ///
- ///
- /// The identifier of the resource.
- ///
- ///
- /// Identifier of the device.
- ///
- ///
- /// 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 resourceId, string deviceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- }
-}
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IDevicesForHubOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IDevicesForHubOperations.cs
deleted file mode 100644
index 42778b8f70fb..000000000000
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IDevicesForHubOperations.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-//
-// 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
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// DevicesForHubOperations operations.
- ///
- public partial interface IDevicesForHubOperations
- {
- ///
- /// Get list of the devices for the specified IoT Hub resource.
- ///
- ///
- /// The identifier of the resource.
- ///
- ///
- /// Limit the number of items returned in a single page
- ///
- ///
- /// Skip token used for pagination
- ///
- ///
- /// Get devices only from specific type, Managed or Unmanaged. Possible
- /// values include: 'Managed', 'Unmanaged'
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task>> ListWithHttpMessagesAsync(string resourceId, int? limit = default(int?), string skipToken = default(string), string deviceManagementType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Get list of the devices for the specified IoT Hub resource.
- ///
- ///
- /// The NextLink from the previous successful call to List 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- }
-}
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IDevicesForSubscriptionOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IDevicesForSubscriptionOperations.cs
deleted file mode 100644
index 71294f34df7b..000000000000
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IDevicesForSubscriptionOperations.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-//
-// 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
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// DevicesForSubscriptionOperations operations.
- ///
- public partial interface IDevicesForSubscriptionOperations
- {
- ///
- /// Get list of the devices by their subscription.
- ///
- ///
- /// Limit the number of items returned in a single page
- ///
- ///
- /// Skip token used for pagination
- ///
- ///
- /// Get devices only from specific type, Managed or Unmanaged. Possible
- /// values include: 'Managed', 'Unmanaged'
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task>> ListWithHttpMessagesAsync(int? limit = default(int?), string skipToken = default(string), string deviceManagementType = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Get list of the devices by their subscription.
- ///
- ///
- /// The NextLink from the previous successful call to List 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- }
-}
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotRecommendationsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIngestionSettingsOperations.cs
similarity index 56%
rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotRecommendationsOperations.cs
rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIngestionSettingsOperations.cs
index 28e840a01ffa..04f385265d58 100644
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotRecommendationsOperations.cs
+++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIngestionSettingsOperations.cs
@@ -19,32 +19,14 @@ namespace Microsoft.Azure.Management.Security
using System.Threading.Tasks;
///
- /// IotRecommendationsOperations operations.
+ /// IngestionSettingsOperations operations.
///
- public partial interface IIotRecommendationsOperations
+ public partial interface IIngestionSettingsOperations
{
///
- /// List IoT recommendations
+ /// Settings for ingesting security data and logs to correlate with
+ /// resources associated with the subscription.
///
- ///
- /// The name of the resource group within the user's subscription. The
- /// name is case insensitive.
- ///
- ///
- /// The name of the IoT Security solution.
- ///
- ///
- /// Filter by recommendation type
- ///
- ///
- /// Filter by device id
- ///
- ///
- /// Limit the number of items returned in a single page
- ///
- ///
- /// Skip token used for pagination
- ///
///
/// The headers that will be added to request.
///
@@ -60,19 +42,13 @@ public partial interface IIotRecommendationsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListWithHttpMessagesAsync(string resourceGroupName, string solutionName, string recommendationType = default(string), string deviceId = default(string), int? limit = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Get IoT recommendation
+ /// Settings for ingesting security data and logs to correlate with
+ /// resources associated with the subscription.
///
- ///
- /// The name of the resource group within the user's subscription. The
- /// name is case insensitive.
- ///
- ///
- /// The name of the IoT Security solution.
- ///
- ///
- /// Id of the recommendation
+ ///
+ /// Name of the ingestion setting
///
///
/// The headers that will be added to request.
@@ -89,26 +65,16 @@ public partial interface IIotRecommendationsOperations
///
/// Thrown when a required parameter is null
///
- Task> GetWithHttpMessagesAsync(string resourceGroupName, string solutionName, string iotRecommendationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> GetWithHttpMessagesAsync(string ingestionSettingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// List IoT recommendations
+ /// Create setting for ingesting security data and logs to correlate
+ /// with resources associated with the subscription.
///
- ///
- /// Scope of the query: Subscription (i.e.
- /// /subscriptions/{subscriptionId}) or IoT Hub (i.e.
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName})
- ///
- ///
- /// Filter by recommendation type
- ///
- ///
- /// Filter by device id
- ///
- ///
- /// Limit the number of items returned in a single page
+ ///
+ /// Name of the ingestion setting
///
- ///
- /// Skip token used for pagination
+ ///
+ /// Ingestion setting data
///
///
/// The headers that will be added to request.
@@ -125,17 +91,32 @@ public partial interface IIotRecommendationsOperations
///
/// Thrown when a required parameter is null
///
- Task>> List1WithHttpMessagesAsync(string scope, string recommendationType = default(string), string deviceId = default(string), int? limit = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> CreateWithHttpMessagesAsync(string ingestionSettingName, object properties = default(object), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// Get IoT recommendation
+ /// Deletes the ingestion settings for this subscription.
///
- ///
- /// Scope of the query: Subscription (i.e.
- /// /subscriptions/{subscriptionId}) or IoT Hub (i.e.
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName})
+ ///
+ /// Name of the ingestion setting
///
- ///
- /// Id of the recommendation
+ ///
+ /// 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 ingestionSettingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Returns the token that is used for correlating ingested telemetry
+ /// with the resources in the subscription.
+ ///
+ ///
+ /// Name of the ingestion setting
///
///
/// The headers that will be added to request.
@@ -152,12 +133,12 @@ public partial interface IIotRecommendationsOperations
///
/// Thrown when a required parameter is null
///
- Task> Get1WithHttpMessagesAsync(string scope, string iotRecommendationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> ListTokensWithHttpMessagesAsync(string ingestionSettingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// List IoT recommendations
+ /// Connection strings for ingesting security scan logs and data.
///
- ///
- /// The NextLink from the previous successful call to List operation.
+ ///
+ /// Name of the ingestion setting
///
///
/// The headers that will be added to request.
@@ -174,9 +155,10 @@ public partial interface IIotRecommendationsOperations
///
/// Thrown when a required parameter is null
///
- Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task> ListConnectionStringsWithHttpMessagesAsync(string ingestionSettingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
- /// List IoT recommendations
+ /// Settings for ingesting security data and logs to correlate with
+ /// resources associated with the subscription.
///
///
/// The NextLink from the previous successful call to List operation.
@@ -196,6 +178,6 @@ public partial interface IIotRecommendationsOperations
///
/// Thrown when a required parameter is null
///
- Task>> List1NextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotAlertTypesOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotAlertTypesOperations.cs
deleted file mode 100644
index bfa0d7fc1dcf..000000000000
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotAlertTypesOperations.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-//
-// 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
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// IotAlertTypesOperations operations.
- ///
- public partial interface IIotAlertTypesOperations
- {
- ///
- /// List IoT alert types
- ///
- ///
- /// The name of the resource group within the user's subscription. The
- /// name is case insensitive.
- ///
- ///
- /// The name of the IoT Security solution.
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task> ListWithHttpMessagesAsync(string resourceGroupName, string solutionName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Get IoT alert type
- ///
- ///
- /// The name of the resource group within the user's subscription. The
- /// name is case insensitive.
- ///
- ///
- /// The name of the IoT Security solution.
- ///
- ///
- /// Name of the alert type
- ///
- ///
- /// 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 solutionName, string iotAlertTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// List IoT alert types
- ///
- ///
- /// 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> List1WithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Get IoT alert type
- ///
- ///
- /// Name of the alert type
- ///
- ///
- /// 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> Get1WithHttpMessagesAsync(string iotAlertTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- }
-}
diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotAlertsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotAlertsOperations.cs
deleted file mode 100644
index 54ad8b08ba93..000000000000
--- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotAlertsOperations.cs
+++ /dev/null
@@ -1,217 +0,0 @@
-//
-// 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
-{
- using Microsoft.Rest;
- using Microsoft.Rest.Azure;
- using Models;
- using System.Collections;
- using System.Collections.Generic;
- using System.Threading;
- using System.Threading.Tasks;
-
- ///
- /// IotAlertsOperations operations.
- ///
- public partial interface IIotAlertsOperations
- {
- ///
- /// List IoT alerts
- ///
- ///
- /// The name of the resource group within the user's subscription. The
- /// name is case insensitive.
- ///
- ///
- /// The name of the IoT Security solution.
- ///
- ///
- /// Filter by minimum startTimeUtc (ISO 8601 format)
- ///
- ///
- /// Filter by maximum startTimeUtc (ISO 8601 format)
- ///
- ///
- /// Filter by alert type
- ///
- ///
- /// Filter by compromised device
- ///
- ///
- /// Limit the number of items returned in a single page
- ///
- ///
- /// Skip token used for pagination
- ///
- ///
- /// The headers that will be added to request.
- ///
- ///
- /// The cancellation token.
- ///
- ///
- /// Thrown when the operation returned an invalid status code
- ///
- ///
- /// Thrown when unable to deserialize the response
- ///
- ///
- /// Thrown when a required parameter is null
- ///
- Task>> ListWithHttpMessagesAsync(string resourceGroupName, string solutionName, string minStartTimeUtc = default(string), string maxStartTimeUtc = default(string), string alertType = default(string), string compromisedEntity = default(string), int? limit = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Get IoT alert
- ///
- ///
- /// The name of the resource group within the user's subscription. The
- /// name is case insensitive.
- ///
- ///
- /// The name of the IoT Security solution.
- ///
- ///
- /// Id of the 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 solutionName, string iotAlertId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// List IoT alerts
- ///
- ///
- /// Scope of the query: Subscription (i.e.
- /// /subscriptions/{subscriptionId}) or IoT Hub (i.e.
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName})
- ///
- ///
- /// Filter by minimum startTimeUtc (ISO 8601 format)
- ///
- ///
- /// Filter by maximum startTimeUtc (ISO 8601 format)
- ///
- ///
- /// Filter by alert type
- ///
- ///
- /// Get devices only from specific type, Managed or Unmanaged. Possible
- /// values include: 'Managed', 'Unmanaged'
- ///
- ///
- /// Filter by compromised device
- ///
- ///
- /// Limit the number of items returned in a single page
- ///
- ///
- /// Skip token used for pagination
- ///
- ///
- /// 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>> List1WithHttpMessagesAsync(string scope, string minStartTimeUtc = default(string), string maxStartTimeUtc = default(string), string alertType = default(string), string deviceManagementType = default(string), string compromisedEntity = default(string), int? limit = default(int?), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///
- /// Get IoT alert
- ///
- ///
- /// Scope of the query: Subscription (i.e.
- /// /subscriptions/{subscriptionId}) or IoT Hub (i.e.
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName})
- ///
- ///
- /// Id of the 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> Get1WithHttpMessagesAsync(string scope, string iotAlertId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
- ///