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)); - /// - /// List IoT alerts - /// - /// - /// 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)); - /// - /// List IoT alerts - /// - /// - /// 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>> List1NextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotDefenderSettingsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotDefenderSettingsOperations.cs deleted file mode 100644 index bed2a48cabac..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotDefenderSettingsOperations.cs +++ /dev/null @@ -1,126 +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; - - /// - /// IotDefenderSettingsOperations operations. - /// - public partial interface IIotDefenderSettingsOperations - { - /// - /// List IoT Defender Settings - /// - /// - /// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get IoT Defender Settings - /// - /// - /// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Create or update IoT Defender settings - /// - /// - /// Size of the device quota (as a opposed to a Pay as You Go billing - /// model). Value is required to be in multiples of 1000. - /// - /// - /// Sentinel Workspace Resource Ids - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(int deviceQuota, IList sentinelWorkspaceResourceIds, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete IoT Defender settings - /// - /// - /// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Information about downloadable packages - /// - /// - /// 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> PackageDownloadsMethodWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotRecommendationTypesOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotRecommendationTypesOperations.cs deleted file mode 100644 index 98c8d9203867..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotRecommendationTypesOperations.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; - - /// - /// IotRecommendationTypesOperations operations. - /// - public partial interface IIotRecommendationTypesOperations - { - /// - /// List IoT recommendation 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 recommendation 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 recommendation 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 iotRecommendationTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// List IoT recommendation 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 recommendation type - /// - /// - /// Name of the recommendation 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 iotRecommendationTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IOnPremiseIotSensorsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IOnPremiseIotSensorsOperations.cs deleted file mode 100644 index c0a284754602..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IOnPremiseIotSensorsOperations.cs +++ /dev/null @@ -1,132 +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.IO; - using System.Threading; - using System.Threading.Tasks; - - /// - /// OnPremiseIotSensorsOperations operations. - /// - public partial interface IOnPremiseIotSensorsOperations - { - /// - /// List on-premise IoT sensors - /// - /// - /// 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(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Get on-premise IoT sensor - /// - /// - /// Name of the on-premise IoT sensor - /// - /// - /// 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 onPremiseIotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Create or update on-premise IoT sensor - /// - /// - /// Name of the on-premise IoT sensor - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - Task> CreateOrUpdateWithHttpMessagesAsync(string onPremiseIotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Delete on-premise IoT sensor - /// - /// - /// Name of the on-premise IoT sensor - /// - /// - /// 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 onPremiseIotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Download sensor activation file - /// - /// - /// Name of the on-premise IoT sensor - /// - /// - /// 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> DownloadActivationWithHttpMessagesAsync(string onPremiseIotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ISecurityCenterClient.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ISecurityCenterClient.cs index 9e8b01ad5fbd..67c8d9b90101 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ISecurityCenterClient.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ISecurityCenterClient.cs @@ -81,11 +81,6 @@ public partial interface ISecurityCenterClient : System.IDisposable /// IPricingsOperations Pricings { get; } - /// - /// Gets the ISettingsOperations. - /// - ISettingsOperations Settings { get; } - /// /// Gets the IAdvancedThreatProtectionOperations. /// @@ -116,26 +111,6 @@ public partial interface ISecurityCenterClient : System.IDisposable /// IIotSecuritySolutionsAnalyticsRecommendationOperations IotSecuritySolutionsAnalyticsRecommendation { get; } - /// - /// Gets the IIotAlertTypesOperations. - /// - IIotAlertTypesOperations IotAlertTypes { get; } - - /// - /// Gets the IIotAlertsOperations. - /// - IIotAlertsOperations IotAlerts { get; } - - /// - /// Gets the IIotRecommendationTypesOperations. - /// - IIotRecommendationTypesOperations IotRecommendationTypes { get; } - - /// - /// Gets the IIotRecommendationsOperations. - /// - IIotRecommendationsOperations IotRecommendations { get; } - /// /// Gets the ILocationsOperations. /// @@ -241,11 +216,6 @@ public partial interface ISecurityCenterClient : System.IDisposable /// ITopologyOperations Topology { get; } - /// - /// Gets the IAlertsOperations. - /// - IAlertsOperations Alerts { get; } - /// /// Gets the IJitNetworkAccessPoliciesOperations. /// @@ -307,34 +277,24 @@ public partial interface ISecurityCenterClient : System.IDisposable ISqlVulnerabilityAssessmentBaselineRulesOperations SqlVulnerabilityAssessmentBaselineRules { get; } /// - /// Gets the IIotDefenderSettingsOperations. - /// - IIotDefenderSettingsOperations IotDefenderSettings { get; } - - /// - /// Gets the IIotSensorsOperations. - /// - IIotSensorsOperations IotSensors { get; } - - /// - /// Gets the IDevicesForSubscriptionOperations. + /// Gets the IAlertsOperations. /// - IDevicesForSubscriptionOperations DevicesForSubscription { get; } + IAlertsOperations Alerts { get; } /// - /// Gets the IDevicesForHubOperations. + /// Gets the ISettingsOperations. /// - IDevicesForHubOperations DevicesForHub { get; } + ISettingsOperations Settings { get; } /// - /// Gets the IDeviceOperations. + /// Gets the IIngestionSettingsOperations. /// - IDeviceOperations Device { get; } + IIngestionSettingsOperations IngestionSettings { get; } /// - /// Gets the IOnPremiseIotSensorsOperations. + /// Gets the ISoftwareInventoriesOperations. /// - IOnPremiseIotSensorsOperations OnPremiseIotSensors { get; } + ISoftwareInventoriesOperations SoftwareInventories { get; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IServerVulnerabilityAssessmentOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IServerVulnerabilityAssessmentOperations.cs index fac304bd74b5..10e0d65f0c6c 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IServerVulnerabilityAssessmentOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IServerVulnerabilityAssessmentOperations.cs @@ -151,5 +151,34 @@ public partial interface IServerVulnerabilityAssessmentOperations /// Thrown when a required parameter is null /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Removing server vulnerability assessment from a resource. + /// + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// The Namespace of the resource. + /// + /// + /// The type of the resource. + /// + /// + /// Name of the resource. + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ISettingsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ISettingsOperations.cs index 56819702e29a..54a44999707e 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ISettingsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ISettingsOperations.cs @@ -46,8 +46,8 @@ public partial interface ISettingsOperations /// Settings of different configurations in security center /// /// - /// Name of setting: (MCAS/WDATP). Possible values include: 'MCAS', - /// 'WDATP' + /// The name of the setting. Possible values include: 'MCAS', 'WDATP', + /// 'WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW', 'Sentinel' /// /// /// The headers that will be added to request. @@ -69,8 +69,8 @@ public partial interface ISettingsOperations /// updating settings about different configurations in security center /// /// - /// Name of setting: (MCAS/WDATP). Possible values include: 'MCAS', - /// 'WDATP' + /// The name of the setting. Possible values include: 'MCAS', 'WDATP', + /// 'WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW', 'Sentinel' /// /// /// Setting object diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotSensorsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ISoftwareInventoriesOperations.cs similarity index 57% rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotSensorsOperations.cs rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ISoftwareInventoriesOperations.cs index 4af820d975d9..fa4696b563ca 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IIotSensorsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ISoftwareInventoriesOperations.cs @@ -15,21 +15,29 @@ namespace Microsoft.Azure.Management.Security using Models; using System.Collections; using System.Collections.Generic; - using System.IO; using System.Threading; using System.Threading.Tasks; /// - /// IotSensorsOperations operations. + /// SoftwareInventoriesOperations operations. /// - public partial interface IIotSensorsOperations + public partial interface ISoftwareInventoriesOperations { /// - /// List IoT sensors + /// Gets the software inventory of the virtual machine. /// - /// - /// Scope of the query (IoT Hub, - /// /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// The namespace of the resource. + /// + /// + /// The type of the resource. + /// + /// + /// Name of the resource. /// /// /// The headers that will be added to request. @@ -46,17 +54,11 @@ public partial interface IIotSensorsOperations /// /// Thrown when a required parameter is null /// - Task> ListWithHttpMessagesAsync(string scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByExtendedResourceWithHttpMessagesAsync(string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Get IoT sensor + /// Gets the software inventory of all virtual machines in the + /// subscriptions. /// - /// - /// Scope of the query (IoT Hub, - /// /providers/Microsoft.Devices/iotHubs/myHub) - /// - /// - /// Name of the IoT sensor - /// /// /// The headers that will be added to request. /// @@ -72,16 +74,25 @@ public partial interface IIotSensorsOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string scope, string iotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Create or update IoT sensor + /// Gets a single software data of the virtual machine. /// - /// - /// Scope of the query (IoT Hub, - /// /providers/Microsoft.Devices/iotHubs/myHub) + /// + /// The name of the resource group within the user's subscription. The + /// name is case insensitive. + /// + /// + /// The namespace of the resource. + /// + /// + /// The type of the resource. /// - /// - /// Name of the IoT sensor + /// + /// Name of the resource. + /// + /// + /// Name of the installed software. /// /// /// The headers that will be added to request. @@ -98,16 +109,12 @@ public partial interface IIotSensorsOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string scope, string iotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string softwareName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Delete IoT sensor + /// Gets the software inventory of the virtual machine. /// - /// - /// Scope of the query (IoT Hub, - /// /providers/Microsoft.Devices/iotHubs/myHub) - /// - /// - /// Name of the IoT sensor + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -118,19 +125,19 @@ public partial interface IIotSensorsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string scope, string iotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListByExtendedResourceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Download sensor activation file + /// Gets the software inventory of all virtual machines in the + /// subscriptions. /// - /// - /// Scope of the query (IoT Hub, - /// /providers/Microsoft.Devices/iotHubs/myHub) - /// - /// - /// Name of the IoT sensor + /// + /// The NextLink from the previous successful call to List operation. /// /// /// The headers that will be added to request. @@ -147,6 +154,6 @@ public partial interface IIotSensorsOperations /// /// Thrown when a required parameter is null /// - Task> DownloadActivationWithHttpMessagesAsync(string scope, string iotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IngestionSettingsOperations.cs similarity index 74% rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationsOperations.cs rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IngestionSettingsOperations.cs index 2d77cef2d004..7da28345d980 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IngestionSettingsOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.Security using System.Threading.Tasks; /// - /// IotRecommendationsOperations operations. + /// IngestionSettingsOperations operations. /// - internal partial class IotRecommendationsOperations : IServiceOperations, IIotRecommendationsOperations + internal partial class IngestionSettingsOperations : IServiceOperations, IIngestionSettingsOperations { /// - /// Initializes a new instance of the IotRecommendationsOperations class. + /// Initializes a new instance of the IngestionSettingsOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class IotRecommendationsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal IotRecommendationsOperations(SecurityCenterClient client) + internal IngestionSettingsOperations(SecurityCenterClient client) { if (client == null) { @@ -51,27 +51,9 @@ internal IotRecommendationsOperations(SecurityCenterClient client) public SecurityCenterClient Client { get; private set; } /// - /// 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 - /// /// /// Headers that will be added to request. /// @@ -93,7 +75,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async 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)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -106,30 +88,7 @@ internal IotRecommendationsOperations(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}$"); } } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (solutionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "solutionName"); - } - string apiVersion = "2019-08-01"; + string apiVersion = "2021-01-15-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -138,42 +97,18 @@ internal IotRecommendationsOperations(SecurityCenterClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("solutionName", solutionName); - tracingParameters.Add("recommendationType", recommendationType); - tracingParameters.Add("deviceId", deviceId); - tracingParameters.Add("limit", limit); - tracingParameters.Add("skipToken", skipToken); 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendations").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{solutionName}", System.Uri.EscapeDataString(solutionName)); List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } - if (recommendationType != null) - { - _queryParameters.Add(string.Format("recommendationType={0}", System.Uri.EscapeDataString(recommendationType))); - } - if (deviceId != null) - { - _queryParameters.Add(string.Format("deviceId={0}", System.Uri.EscapeDataString(deviceId))); - } - 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 (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -267,7 +202,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -280,7 +215,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -300,17 +235,11 @@ internal IotRecommendationsOperations(SecurityCenterClient client) } /// - /// 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 /// /// /// Headers that will be added to request. @@ -333,7 +262,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string solutionName, string iotRecommendationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string ingestionSettingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -346,34 +275,11 @@ internal IotRecommendationsOperations(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}$"); } } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (solutionName == null) + if (ingestionSettingName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "solutionName"); + throw new ValidationException(ValidationRules.CannotBeNull, "ingestionSettingName"); } - if (iotRecommendationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "iotRecommendationId"); - } - string apiVersion = "2019-08-01"; + string apiVersion = "2021-01-15-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -382,19 +288,15 @@ internal IotRecommendationsOperations(SecurityCenterClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("solutionName", solutionName); - tracingParameters.Add("iotRecommendationId", iotRecommendationId); + tracingParameters.Add("ingestionSettingName", ingestionSettingName); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendations/{iotRecommendationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{solutionName}", System.Uri.EscapeDataString(solutionName)); - _url = _url.Replace("{iotRecommendationId}", System.Uri.EscapeDataString(iotRecommendationId)); + _url = _url.Replace("{ingestionSettingName}", System.Uri.EscapeDataString(ingestionSettingName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -493,7 +395,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -506,7 +408,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -526,24 +428,14 @@ internal IotRecommendationsOperations(SecurityCenterClient client) } /// - /// 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 + /// + /// Name of the ingestion setting /// - /// - /// Limit the number of items returned in a single page - /// - /// - /// Skip token used for pagination + /// + /// Ingestion setting data /// /// /// Headers that will be added to request. @@ -566,13 +458,29 @@ internal IotRecommendationsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async 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)) + public async Task> CreateWithHttpMessagesAsync(string ingestionSettingName, object properties = default(object), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (scope == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scope"); + 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 (ingestionSettingName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ingestionSettingName"); + } + string apiVersion = "2021-01-15-preview"; + IngestionSetting ingestionSetting = new IngestionSetting(); + if (properties != null) + { + ingestionSetting.Properties = properties; } - string apiVersion = "2020-08-06-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -581,39 +489,21 @@ internal IotRecommendationsOperations(SecurityCenterClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("scope", scope); - tracingParameters.Add("recommendationType", recommendationType); - tracingParameters.Add("deviceId", deviceId); - tracingParameters.Add("limit", limit); - tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("ingestionSettingName", ingestionSettingName); + tracingParameters.Add("ingestionSetting", ingestionSetting); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List1", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.Security/iotRecommendations").ToString(); - _url = _url.Replace("{scope}", scope); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ingestionSettingName}", System.Uri.EscapeDataString(ingestionSettingName)); List _queryParameters = new List(); if (apiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } - if (recommendationType != null) - { - _queryParameters.Add(string.Format("recommendationType={0}", System.Uri.EscapeDataString(recommendationType))); - } - if (deviceId != null) - { - _queryParameters.Add(string.Format("deviceId={0}", System.Uri.EscapeDataString(deviceId))); - } - 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 (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -621,7 +511,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -652,6 +542,12 @@ internal IotRecommendationsOperations(SecurityCenterClient client) // Serialize Request string _requestContent = null; + if(ingestionSetting != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(ingestionSetting, 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) { @@ -707,7 +603,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -720,7 +616,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -740,15 +636,182 @@ internal IotRecommendationsOperations(SecurityCenterClient client) } /// - /// 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 + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string ingestionSettingName, 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 (ingestionSettingName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ingestionSettingName"); + } + string apiVersion = "2021-01-15-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("ingestionSettingName", ingestionSettingName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ingestionSettingName}", System.Uri.EscapeDataString(ingestionSettingName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Returns the token that is used for correlating ingested telemetry with the + /// resources in the subscription. + /// + /// + /// Name of the ingestion setting /// /// /// Headers that will be added to request. @@ -771,17 +834,24 @@ internal IotRecommendationsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task> Get1WithHttpMessagesAsync(string scope, string iotRecommendationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListTokensWithHttpMessagesAsync(string ingestionSettingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (scope == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "scope"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (iotRecommendationId == null) + if (Client.SubscriptionId != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "iotRecommendationId"); + 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"; + if (ingestionSettingName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ingestionSettingName"); + } + string apiVersion = "2021-01-15-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -790,16 +860,15 @@ internal IotRecommendationsOperations(SecurityCenterClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("scope", scope); - tracingParameters.Add("iotRecommendationId", iotRecommendationId); + tracingParameters.Add("ingestionSettingName", ingestionSettingName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get1", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListTokens", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.Security/iotRecommendations/{iotRecommendationId}").ToString(); - _url = _url.Replace("{scope}", scope); - _url = _url.Replace("{iotRecommendationId}", System.Uri.EscapeDataString(iotRecommendationId)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listTokens").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ingestionSettingName}", System.Uri.EscapeDataString(ingestionSettingName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -812,7 +881,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -898,7 +967,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -911,7 +980,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -931,10 +1000,10 @@ internal IotRecommendationsOperations(SecurityCenterClient client) } /// - /// 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 /// /// /// Headers that will be added to request. @@ -957,12 +1026,24 @@ internal IotRecommendationsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ListConnectionStringsWithHttpMessagesAsync(string ingestionSettingName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (nextPageLink == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + 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 (ingestionSettingName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ingestionSettingName"); } + string apiVersion = "2021-01-15-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -970,14 +1051,21 @@ internal IotRecommendationsOperations(SecurityCenterClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("ingestionSettingName", ingestionSettingName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListConnectionStrings", tracingParameters); } // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listConnectionStrings").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ingestionSettingName}", System.Uri.EscapeDataString(ingestionSettingName)); 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); @@ -985,7 +1073,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1071,7 +1159,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1084,7 +1172,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -1104,7 +1192,8 @@ internal IotRecommendationsOperations(SecurityCenterClient client) } /// - /// 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. @@ -1130,7 +1219,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> List1NextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1145,7 +1234,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List1Next", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -1244,7 +1333,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1257,7 +1346,7 @@ internal IotRecommendationsOperations(SecurityCenterClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IngestionSettingsOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IngestionSettingsOperationsExtensions.cs new file mode 100644 index 000000000000..d83ac2934e02 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IngestionSettingsOperationsExtensions.cs @@ -0,0 +1,270 @@ +// +// 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 IngestionSettingsOperations. + /// + public static partial class IngestionSettingsOperationsExtensions + { + /// + /// Settings for ingesting security data and logs to correlate with resources + /// associated with the subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IIngestionSettingsOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// Settings for ingesting security data and logs to correlate with resources + /// associated with the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IIngestionSettingsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Settings for ingesting security data and logs to correlate with resources + /// associated with the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the ingestion setting + /// + public static IngestionSetting Get(this IIngestionSettingsOperations operations, string ingestionSettingName) + { + return operations.GetAsync(ingestionSettingName).GetAwaiter().GetResult(); + } + + /// + /// Settings for ingesting security data and logs to correlate with resources + /// associated with the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the ingestion setting + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IIngestionSettingsOperations operations, string ingestionSettingName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(ingestionSettingName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create setting for ingesting security data and logs to correlate with + /// resources associated with the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the ingestion setting + /// + /// + /// Ingestion setting data + /// + public static IngestionSetting Create(this IIngestionSettingsOperations operations, string ingestionSettingName, object properties = default(object)) + { + return operations.CreateAsync(ingestionSettingName, properties).GetAwaiter().GetResult(); + } + + /// + /// Create setting for ingesting security data and logs to correlate with + /// resources associated with the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the ingestion setting + /// + /// + /// Ingestion setting data + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IIngestionSettingsOperations operations, string ingestionSettingName, object properties = default(object), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(ingestionSettingName, properties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the ingestion settings for this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the ingestion setting + /// + public static void Delete(this IIngestionSettingsOperations operations, string ingestionSettingName) + { + operations.DeleteAsync(ingestionSettingName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the ingestion settings for this subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the ingestion setting + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IIngestionSettingsOperations operations, string ingestionSettingName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(ingestionSettingName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Returns the token that is used for correlating ingested telemetry with the + /// resources in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the ingestion setting + /// + public static IngestionSettingToken ListTokens(this IIngestionSettingsOperations operations, string ingestionSettingName) + { + return operations.ListTokensAsync(ingestionSettingName).GetAwaiter().GetResult(); + } + + /// + /// Returns the token that is used for correlating ingested telemetry with the + /// resources in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the ingestion setting + /// + /// + /// The cancellation token. + /// + public static async Task ListTokensAsync(this IIngestionSettingsOperations operations, string ingestionSettingName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListTokensWithHttpMessagesAsync(ingestionSettingName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Connection strings for ingesting security scan logs and data. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the ingestion setting + /// + public static ConnectionStrings ListConnectionStrings(this IIngestionSettingsOperations operations, string ingestionSettingName) + { + return operations.ListConnectionStringsAsync(ingestionSettingName).GetAwaiter().GetResult(); + } + + /// + /// Connection strings for ingesting security scan logs and data. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of the ingestion setting + /// + /// + /// The cancellation token. + /// + public static async Task ListConnectionStringsAsync(this IIngestionSettingsOperations operations, string ingestionSettingName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListConnectionStringsWithHttpMessagesAsync(ingestionSettingName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Settings for ingesting security data and logs to correlate with resources + /// associated with the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IIngestionSettingsOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Settings for ingesting security data and logs to correlate with resources + /// associated with the 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 IIngestionSettingsOperations 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/IotAlertTypesOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertTypesOperations.cs deleted file mode 100644 index 61c52ef08a17..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertTypesOperations.cs +++ /dev/null @@ -1,872 +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; - - /// - /// IotAlertTypesOperations operations. - /// - internal partial class IotAlertTypesOperations : IServiceOperations, IIotAlertTypesOperations - { - /// - /// Initializes a new instance of the IotAlertTypesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal IotAlertTypesOperations(SecurityCenterClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the SecurityCenterClient - /// - public SecurityCenterClient Client { get; private set; } - - /// - /// 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. - /// - /// - /// 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 resourceGroupName, string solutionName, 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 (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (solutionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "solutionName"); - } - string apiVersion = "2019-08-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("solutionName", solutionName); - 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlertTypes").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{solutionName}", System.Uri.EscapeDataString(solutionName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get 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 - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string solutionName, string iotAlertTypeName, 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 (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (solutionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "solutionName"); - } - if (iotAlertTypeName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "iotAlertTypeName"); - } - string apiVersion = "2019-08-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("solutionName", solutionName); - tracingParameters.Add("iotAlertTypeName", iotAlertTypeName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlertTypes/{iotAlertTypeName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{solutionName}", System.Uri.EscapeDataString(solutionName)); - _url = _url.Replace("{iotAlertTypeName}", System.Uri.EscapeDataString(iotAlertTypeName)); - 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; - } - - /// - /// List IoT alert types - /// - /// - /// 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> List1WithHttpMessagesAsync(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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List1", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get IoT alert type - /// - /// - /// Name of the alert type - /// - /// - /// 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> Get1WithHttpMessagesAsync(string iotAlertTypeName, 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 (iotAlertTypeName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "iotAlertTypeName"); - } - 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("iotAlertTypeName", iotAlertTypeName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get1", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes/{iotAlertTypeName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{iotAlertTypeName}", System.Uri.EscapeDataString(iotAlertTypeName)); - 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/IotAlertTypesOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertTypesOperationsExtensions.cs deleted file mode 100644 index 8ee11c95c0f7..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertTypesOperationsExtensions.cs +++ /dev/null @@ -1,177 +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 IotAlertTypesOperations. - /// - public static partial class IotAlertTypesOperationsExtensions - { - /// - /// List IoT alert types - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group within the user's subscription. The name is - /// case insensitive. - /// - /// - /// The name of the IoT Security solution. - /// - public static IotAlertTypeList List(this IIotAlertTypesOperations operations, string resourceGroupName, string solutionName) - { - return operations.ListAsync(resourceGroupName, solutionName).GetAwaiter().GetResult(); - } - - /// - /// List IoT alert types - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group within the user's subscription. The name is - /// case insensitive. - /// - /// - /// The name of the IoT Security solution. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IIotAlertTypesOperations operations, string resourceGroupName, string solutionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, solutionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get IoT alert type - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 - /// - public static IotAlertType Get(this IIotAlertTypesOperations operations, string resourceGroupName, string solutionName, string iotAlertTypeName) - { - return operations.GetAsync(resourceGroupName, solutionName, iotAlertTypeName).GetAwaiter().GetResult(); - } - - /// - /// Get IoT alert type - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 cancellation token. - /// - public static async Task GetAsync(this IIotAlertTypesOperations operations, string resourceGroupName, string solutionName, string iotAlertTypeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, solutionName, iotAlertTypeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List IoT alert types - /// - /// - /// The operations group for this extension method. - /// - public static IotAlertTypeList List1(this IIotAlertTypesOperations operations) - { - return operations.List1Async().GetAwaiter().GetResult(); - } - - /// - /// List IoT alert types - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task List1Async(this IIotAlertTypesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.List1WithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get IoT alert type - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the alert type - /// - public static IotAlertType Get1(this IIotAlertTypesOperations operations, string iotAlertTypeName) - { - return operations.Get1Async(iotAlertTypeName).GetAwaiter().GetResult(); - } - - /// - /// Get IoT alert type - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the alert type - /// - /// - /// The cancellation token. - /// - public static async Task Get1Async(this IIotAlertTypesOperations operations, string iotAlertTypeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.Get1WithHttpMessagesAsync(iotAlertTypeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertsOperations.cs deleted file mode 100644 index 27dff89706fd..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertsOperations.cs +++ /dev/null @@ -1,1321 +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; - - /// - /// IotAlertsOperations operations. - /// - internal partial class IotAlertsOperations : IServiceOperations, IIotAlertsOperations - { - /// - /// Initializes a new instance of the IotAlertsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal IotAlertsOperations(SecurityCenterClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the SecurityCenterClient - /// - public SecurityCenterClient Client { get; private set; } - - /// - /// 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 - /// - /// - /// 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 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)) - { - 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 (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (solutionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "solutionName"); - } - string apiVersion = "2019-08-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("solutionName", solutionName); - tracingParameters.Add("minStartTimeUtc", minStartTimeUtc); - tracingParameters.Add("maxStartTimeUtc", maxStartTimeUtc); - tracingParameters.Add("alertType", alertType); - tracingParameters.Add("compromisedEntity", compromisedEntity); - tracingParameters.Add("limit", limit); - tracingParameters.Add("skipToken", skipToken); - 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlerts").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{solutionName}", System.Uri.EscapeDataString(solutionName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (minStartTimeUtc != null) - { - _queryParameters.Add(string.Format("startTimeUtc>={0}", System.Uri.EscapeDataString(minStartTimeUtc))); - } - if (maxStartTimeUtc != null) - { - _queryParameters.Add(string.Format("startTimeUtc<={0}", System.Uri.EscapeDataString(maxStartTimeUtc))); - } - if (alertType != null) - { - _queryParameters.Add(string.Format("alertType={0}", System.Uri.EscapeDataString(alertType))); - } - if (compromisedEntity != null) - { - _queryParameters.Add(string.Format("compromisedEntity={0}", System.Uri.EscapeDataString(compromisedEntity))); - } - 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 (_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 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 - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string solutionName, string iotAlertId, 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 (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (solutionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "solutionName"); - } - if (iotAlertId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "iotAlertId"); - } - string apiVersion = "2019-08-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("solutionName", solutionName); - tracingParameters.Add("iotAlertId", iotAlertId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotAlerts/{iotAlertId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{solutionName}", System.Uri.EscapeDataString(solutionName)); - _url = _url.Replace("{iotAlertId}", System.Uri.EscapeDataString(iotAlertId)); - 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; - } - - /// - /// 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 - /// - /// - /// 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>> 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)) - { - if (scope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "scope"); - } - 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("scope", scope); - tracingParameters.Add("minStartTimeUtc", minStartTimeUtc); - tracingParameters.Add("maxStartTimeUtc", maxStartTimeUtc); - tracingParameters.Add("alertType", alertType); - tracingParameters.Add("deviceManagementType", deviceManagementType); - tracingParameters.Add("compromisedEntity", compromisedEntity); - tracingParameters.Add("limit", limit); - tracingParameters.Add("skipToken", skipToken); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List1", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.Security/iotAlerts").ToString(); - _url = _url.Replace("{scope}", scope); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (minStartTimeUtc != null) - { - _queryParameters.Add(string.Format("startTimeUtc>={0}", System.Uri.EscapeDataString(minStartTimeUtc))); - } - if (maxStartTimeUtc != null) - { - _queryParameters.Add(string.Format("startTimeUtc<={0}", System.Uri.EscapeDataString(maxStartTimeUtc))); - } - if (alertType != null) - { - _queryParameters.Add(string.Format("alertType={0}", System.Uri.EscapeDataString(alertType))); - } - if (deviceManagementType != null) - { - _queryParameters.Add(string.Format("deviceManagementType={0}", System.Uri.EscapeDataString(deviceManagementType))); - } - if (compromisedEntity != null) - { - _queryParameters.Add(string.Format("compromisedEntity={0}", System.Uri.EscapeDataString(compromisedEntity))); - } - 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 (_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 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 - /// - /// - /// 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> Get1WithHttpMessagesAsync(string scope, string iotAlertId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (scope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "scope"); - } - if (iotAlertId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "iotAlertId"); - } - 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("scope", scope); - tracingParameters.Add("iotAlertId", iotAlertId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get1", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.Security/iotAlerts/{iotAlertId}").ToString(); - _url = _url.Replace("{scope}", scope); - _url = _url.Replace("{iotAlertId}", System.Uri.EscapeDataString(iotAlertId)); - 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; - } - - /// - /// List IoT alerts - /// - /// - /// 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; - } - - /// - /// List IoT alerts - /// - /// - /// 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>> List1NextWithHttpMessagesAsync(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, "List1Next", 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/IotAlertsOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertsOperationsExtensions.cs deleted file mode 100644 index 7228b17649ab..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotAlertsOperationsExtensions.cs +++ /dev/null @@ -1,345 +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 IotAlertsOperations. - /// - public static partial class IotAlertsOperationsExtensions - { - /// - /// List IoT alerts - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 - /// - public static IPage List(this IIotAlertsOperations operations, 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)) - { - return operations.ListAsync(resourceGroupName, solutionName, minStartTimeUtc, maxStartTimeUtc, alertType, compromisedEntity, limit, skipToken).GetAwaiter().GetResult(); - } - - /// - /// List IoT alerts - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 cancellation token. - /// - public static async Task> ListAsync(this IIotAlertsOperations operations, 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), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, solutionName, minStartTimeUtc, maxStartTimeUtc, alertType, compromisedEntity, limit, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get IoT alert - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 - /// - public static IotAlert Get(this IIotAlertsOperations operations, string resourceGroupName, string solutionName, string iotAlertId) - { - return operations.GetAsync(resourceGroupName, solutionName, iotAlertId).GetAwaiter().GetResult(); - } - - /// - /// Get IoT alert - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 cancellation token. - /// - public static async Task GetAsync(this IIotAlertsOperations operations, string resourceGroupName, string solutionName, string iotAlertId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, solutionName, iotAlertId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List IoT alerts - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 - /// - public static IPage List1(this IIotAlertsOperations operations, 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)) - { - return operations.List1Async(scope, minStartTimeUtc, maxStartTimeUtc, alertType, deviceManagementType, compromisedEntity, limit, skipToken).GetAwaiter().GetResult(); - } - - /// - /// List IoT alerts - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 cancellation token. - /// - public static async Task> List1Async(this IIotAlertsOperations operations, 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), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.List1WithHttpMessagesAsync(scope, minStartTimeUtc, maxStartTimeUtc, alertType, deviceManagementType, compromisedEntity, limit, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get IoT alert - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 - /// - public static IotAlertModel Get1(this IIotAlertsOperations operations, string scope, string iotAlertId) - { - return operations.Get1Async(scope, iotAlertId).GetAwaiter().GetResult(); - } - - /// - /// Get IoT alert - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 cancellation token. - /// - public static async Task Get1Async(this IIotAlertsOperations operations, string scope, string iotAlertId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.Get1WithHttpMessagesAsync(scope, iotAlertId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List IoT alerts - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IIotAlertsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List IoT alerts - /// - /// - /// 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 IIotAlertsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List IoT alerts - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage List1Next(this IIotAlertsOperations operations, string nextPageLink) - { - return operations.List1NextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List IoT alerts - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> List1NextAsync(this IIotAlertsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.List1NextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotDefenderSettingsOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotDefenderSettingsOperationsExtensions.cs deleted file mode 100644 index caddc0e95049..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotDefenderSettingsOperationsExtensions.cs +++ /dev/null @@ -1,178 +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; - - /// - /// Extension methods for IotDefenderSettingsOperations. - /// - public static partial class IotDefenderSettingsOperationsExtensions - { - /// - /// List IoT Defender Settings - /// - /// - /// The operations group for this extension method. - /// - public static IotDefenderSettingsList List(this IIotDefenderSettingsOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// List IoT Defender Settings - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IIotDefenderSettingsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get IoT Defender Settings - /// - /// - /// The operations group for this extension method. - /// - public static IotDefenderSettingsModel Get(this IIotDefenderSettingsOperations operations) - { - return operations.GetAsync().GetAwaiter().GetResult(); - } - - /// - /// Get IoT Defender Settings - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IIotDefenderSettingsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update IoT Defender settings - /// - /// - /// The operations group for this extension method. - /// - /// - /// Size of the device quota (as a opposed to a Pay as You Go billing model). - /// Value is required to be in multiples of 1000. - /// - /// - /// Sentinel Workspace Resource Ids - /// - public static IotDefenderSettingsModel CreateOrUpdate(this IIotDefenderSettingsOperations operations, int deviceQuota, IList sentinelWorkspaceResourceIds) - { - return operations.CreateOrUpdateAsync(deviceQuota, sentinelWorkspaceResourceIds).GetAwaiter().GetResult(); - } - - /// - /// Create or update IoT Defender settings - /// - /// - /// The operations group for this extension method. - /// - /// - /// Size of the device quota (as a opposed to a Pay as You Go billing model). - /// Value is required to be in multiples of 1000. - /// - /// - /// Sentinel Workspace Resource Ids - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IIotDefenderSettingsOperations operations, int deviceQuota, IList sentinelWorkspaceResourceIds, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(deviceQuota, sentinelWorkspaceResourceIds, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete IoT Defender settings - /// - /// - /// The operations group for this extension method. - /// - public static void Delete(this IIotDefenderSettingsOperations operations) - { - operations.DeleteAsync().GetAwaiter().GetResult(); - } - - /// - /// Delete IoT Defender settings - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IIotDefenderSettingsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Information about downloadable packages - /// - /// - /// The operations group for this extension method. - /// - public static PackageDownloads PackageDownloadsMethod(this IIotDefenderSettingsOperations operations) - { - return operations.PackageDownloadsMethodAsync().GetAwaiter().GetResult(); - } - - /// - /// Information about downloadable packages - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task PackageDownloadsMethodAsync(this IIotDefenderSettingsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.PackageDownloadsMethodWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationTypesOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationTypesOperations.cs deleted file mode 100644 index 12d98eff4a18..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationTypesOperations.cs +++ /dev/null @@ -1,872 +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; - - /// - /// IotRecommendationTypesOperations operations. - /// - internal partial class IotRecommendationTypesOperations : IServiceOperations, IIotRecommendationTypesOperations - { - /// - /// Initializes a new instance of the IotRecommendationTypesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal IotRecommendationTypesOperations(SecurityCenterClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the SecurityCenterClient - /// - public SecurityCenterClient Client { get; private set; } - - /// - /// List IoT recommendation types - /// - /// - /// The name of the resource group within the user's subscription. The name is - /// case insensitive. - /// - /// - /// The name of the IoT Security solution. - /// - /// - /// 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 resourceGroupName, string solutionName, 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 (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (solutionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "solutionName"); - } - string apiVersion = "2019-08-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("solutionName", solutionName); - 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendationTypes").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{solutionName}", System.Uri.EscapeDataString(solutionName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get IoT recommendation 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 recommendation type - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string solutionName, string iotRecommendationTypeName, 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 (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (solutionName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "solutionName"); - } - if (iotRecommendationTypeName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "iotRecommendationTypeName"); - } - string apiVersion = "2019-08-01"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("solutionName", solutionName); - tracingParameters.Add("iotRecommendationTypeName", iotRecommendationTypeName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/iotRecommendationTypes/{iotRecommendationTypeName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{solutionName}", System.Uri.EscapeDataString(solutionName)); - _url = _url.Replace("{iotRecommendationTypeName}", System.Uri.EscapeDataString(iotRecommendationTypeName)); - 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; - } - - /// - /// List IoT recommendation types - /// - /// - /// 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> List1WithHttpMessagesAsync(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("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List1", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get IoT recommendation type - /// - /// - /// Name of the recommendation type - /// - /// - /// 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> Get1WithHttpMessagesAsync(string iotRecommendationTypeName, 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 (iotRecommendationTypeName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "iotRecommendationTypeName"); - } - 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("iotRecommendationTypeName", iotRecommendationTypeName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get1", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes/{iotRecommendationTypeName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{iotRecommendationTypeName}", System.Uri.EscapeDataString(iotRecommendationTypeName)); - 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/IotRecommendationTypesOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationTypesOperationsExtensions.cs deleted file mode 100644 index dfccadbecb6c..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationTypesOperationsExtensions.cs +++ /dev/null @@ -1,177 +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 IotRecommendationTypesOperations. - /// - public static partial class IotRecommendationTypesOperationsExtensions - { - /// - /// List IoT recommendation types - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group within the user's subscription. The name is - /// case insensitive. - /// - /// - /// The name of the IoT Security solution. - /// - public static IotRecommendationTypeList List(this IIotRecommendationTypesOperations operations, string resourceGroupName, string solutionName) - { - return operations.ListAsync(resourceGroupName, solutionName).GetAwaiter().GetResult(); - } - - /// - /// List IoT recommendation types - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group within the user's subscription. The name is - /// case insensitive. - /// - /// - /// The name of the IoT Security solution. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IIotRecommendationTypesOperations operations, string resourceGroupName, string solutionName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, solutionName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get IoT recommendation type - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 recommendation type - /// - public static IotRecommendationType Get(this IIotRecommendationTypesOperations operations, string resourceGroupName, string solutionName, string iotRecommendationTypeName) - { - return operations.GetAsync(resourceGroupName, solutionName, iotRecommendationTypeName).GetAwaiter().GetResult(); - } - - /// - /// Get IoT recommendation type - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 recommendation type - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IIotRecommendationTypesOperations operations, string resourceGroupName, string solutionName, string iotRecommendationTypeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, solutionName, iotRecommendationTypeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List IoT recommendation types - /// - /// - /// The operations group for this extension method. - /// - public static IotRecommendationTypeList List1(this IIotRecommendationTypesOperations operations) - { - return operations.List1Async().GetAwaiter().GetResult(); - } - - /// - /// List IoT recommendation types - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task List1Async(this IIotRecommendationTypesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.List1WithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get IoT recommendation type - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the recommendation type - /// - public static IotRecommendationType Get1(this IIotRecommendationTypesOperations operations, string iotRecommendationTypeName) - { - return operations.Get1Async(iotRecommendationTypeName).GetAwaiter().GetResult(); - } - - /// - /// Get IoT recommendation type - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the recommendation type - /// - /// - /// The cancellation token. - /// - public static async Task Get1Async(this IIotRecommendationTypesOperations operations, string iotRecommendationTypeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.Get1WithHttpMessagesAsync(iotRecommendationTypeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationsOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationsOperationsExtensions.cs deleted file mode 100644 index c55262edd327..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotRecommendationsOperationsExtensions.cs +++ /dev/null @@ -1,313 +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 IotRecommendationsOperations. - /// - public static partial class IotRecommendationsOperationsExtensions - { - /// - /// List IoT recommendations - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 - /// - public static IPage List(this IIotRecommendationsOperations operations, string resourceGroupName, string solutionName, string recommendationType = default(string), string deviceId = default(string), int? limit = default(int?), string skipToken = default(string)) - { - return operations.ListAsync(resourceGroupName, solutionName, recommendationType, deviceId, limit, skipToken).GetAwaiter().GetResult(); - } - - /// - /// List IoT recommendations - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 cancellation token. - /// - public static async Task> ListAsync(this IIotRecommendationsOperations operations, string resourceGroupName, string solutionName, string recommendationType = default(string), string deviceId = default(string), int? limit = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, solutionName, recommendationType, deviceId, limit, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get IoT recommendation - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 - /// - public static IotRecommendation Get(this IIotRecommendationsOperations operations, string resourceGroupName, string solutionName, string iotRecommendationId) - { - return operations.GetAsync(resourceGroupName, solutionName, iotRecommendationId).GetAwaiter().GetResult(); - } - - /// - /// Get IoT recommendation - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IIotRecommendationsOperations operations, string resourceGroupName, string solutionName, string iotRecommendationId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, solutionName, iotRecommendationId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List IoT recommendations - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 - /// - /// - /// Skip token used for pagination - /// - public static IPage List1(this IIotRecommendationsOperations operations, string scope, string recommendationType = default(string), string deviceId = default(string), int? limit = default(int?), string skipToken = default(string)) - { - return operations.List1Async(scope, recommendationType, deviceId, limit, skipToken).GetAwaiter().GetResult(); - } - - /// - /// List IoT recommendations - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 - /// - /// - /// Skip token used for pagination - /// - /// - /// The cancellation token. - /// - public static async Task> List1Async(this IIotRecommendationsOperations operations, string scope, string recommendationType = default(string), string deviceId = default(string), int? limit = default(int?), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.List1WithHttpMessagesAsync(scope, recommendationType, deviceId, limit, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get IoT recommendation - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 recommendation - /// - public static IotRecommendationModel Get1(this IIotRecommendationsOperations operations, string scope, string iotRecommendationId) - { - return operations.Get1Async(scope, iotRecommendationId).GetAwaiter().GetResult(); - } - - /// - /// Get IoT recommendation - /// - /// - /// The operations group for this extension method. - /// - /// - /// 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 recommendation - /// - /// - /// The cancellation token. - /// - public static async Task Get1Async(this IIotRecommendationsOperations operations, string scope, string iotRecommendationId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.Get1WithHttpMessagesAsync(scope, iotRecommendationId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List IoT recommendations - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IIotRecommendationsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List IoT recommendations - /// - /// - /// 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 IIotRecommendationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// List IoT recommendations - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage List1Next(this IIotRecommendationsOperations operations, string nextPageLink) - { - return operations.List1NextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// List IoT recommendations - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> List1NextAsync(this IIotRecommendationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.List1NextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSensorsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSensorsOperations.cs deleted file mode 100644 index 45873dc507b1..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSensorsOperations.cs +++ /dev/null @@ -1,975 +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.IO; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// IotSensorsOperations operations. - /// - internal partial class IotSensorsOperations : IServiceOperations, IIotSensorsOperations - { - /// - /// Initializes a new instance of the IotSensorsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal IotSensorsOperations(SecurityCenterClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the SecurityCenterClient - /// - public SecurityCenterClient Client { get; private set; } - - /// - /// List IoT sensors - /// - /// - /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) - /// - /// - /// 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 scope, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (scope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "scope"); - } - 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("scope", scope); - 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("/") ? "" : "/")), "{scope}/providers/Microsoft.Security/iotSensors").ToString(); - _url = _url.Replace("{scope}", scope); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get IoT sensor - /// - /// - /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) - /// - /// - /// Name of the IoT sensor - /// - /// - /// 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 scope, string iotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (scope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "scope"); - } - if (iotSensorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "iotSensorName"); - } - 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("scope", scope); - tracingParameters.Add("iotSensorName", iotSensorName); - 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("/") ? "" : "/")), "{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}").ToString(); - _url = _url.Replace("{scope}", scope); - _url = _url.Replace("{iotSensorName}", System.Uri.EscapeDataString(iotSensorName)); - 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; - } - - /// - /// Create or update IoT sensor - /// - /// - /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) - /// - /// - /// Name of the IoT sensor - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string scope, string iotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (scope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "scope"); - } - if (iotSensorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "iotSensorName"); - } - 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("scope", scope); - tracingParameters.Add("iotSensorName", iotSensorName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}").ToString(); - _url = _url.Replace("{scope}", scope); - _url = _url.Replace("{iotSensorName}", System.Uri.EscapeDataString(iotSensorName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Delete IoT sensor - /// - /// - /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) - /// - /// - /// Name of the IoT sensor - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task DeleteWithHttpMessagesAsync(string scope, string iotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (scope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "scope"); - } - if (iotSensorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "iotSensorName"); - } - 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("scope", scope); - tracingParameters.Add("iotSensorName", iotSensorName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}").ToString(); - _url = _url.Replace("{scope}", scope); - _url = _url.Replace("{iotSensorName}", System.Uri.EscapeDataString(iotSensorName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Download sensor activation file - /// - /// - /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) - /// - /// - /// Name of the IoT sensor - /// - /// - /// 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> DownloadActivationWithHttpMessagesAsync(string scope, string iotSensorName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (scope == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "scope"); - } - if (iotSensorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "iotSensorName"); - } - 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("scope", scope); - tracingParameters.Add("iotSensorName", iotSensorName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DownloadActivation", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "{scope}/providers/Microsoft.Security/iotSensors/{iotSensorName}/downloadActivation").ToString(); - _url = _url.Replace("{scope}", scope); - _url = _url.Replace("{iotSensorName}", System.Uri.EscapeDataString(iotSensorName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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) - { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSensorsOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSensorsOperationsExtensions.cs deleted file mode 100644 index c5d3a27e2f22..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotSensorsOperationsExtensions.cs +++ /dev/null @@ -1,216 +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.IO; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for IotSensorsOperations. - /// - public static partial class IotSensorsOperationsExtensions - { - /// - /// List IoT sensors - /// - /// - /// The operations group for this extension method. - /// - /// - /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) - /// - public static IotSensorsList List(this IIotSensorsOperations operations, string scope) - { - return operations.ListAsync(scope).GetAwaiter().GetResult(); - } - - /// - /// List IoT sensors - /// - /// - /// The operations group for this extension method. - /// - /// - /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IIotSensorsOperations operations, string scope, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(scope, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get IoT sensor - /// - /// - /// The operations group for this extension method. - /// - /// - /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) - /// - /// - /// Name of the IoT sensor - /// - public static IotSensor Get(this IIotSensorsOperations operations, string scope, string iotSensorName) - { - return operations.GetAsync(scope, iotSensorName).GetAwaiter().GetResult(); - } - - /// - /// Get IoT sensor - /// - /// - /// The operations group for this extension method. - /// - /// - /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) - /// - /// - /// Name of the IoT sensor - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IIotSensorsOperations operations, string scope, string iotSensorName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(scope, iotSensorName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update IoT sensor - /// - /// - /// The operations group for this extension method. - /// - /// - /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) - /// - /// - /// Name of the IoT sensor - /// - public static IotSensor CreateOrUpdate(this IIotSensorsOperations operations, string scope, string iotSensorName) - { - return operations.CreateOrUpdateAsync(scope, iotSensorName).GetAwaiter().GetResult(); - } - - /// - /// Create or update IoT sensor - /// - /// - /// The operations group for this extension method. - /// - /// - /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) - /// - /// - /// Name of the IoT sensor - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IIotSensorsOperations operations, string scope, string iotSensorName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(scope, iotSensorName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete IoT sensor - /// - /// - /// The operations group for this extension method. - /// - /// - /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) - /// - /// - /// Name of the IoT sensor - /// - public static void Delete(this IIotSensorsOperations operations, string scope, string iotSensorName) - { - operations.DeleteAsync(scope, iotSensorName).GetAwaiter().GetResult(); - } - - /// - /// Delete IoT sensor - /// - /// - /// The operations group for this extension method. - /// - /// - /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) - /// - /// - /// Name of the IoT sensor - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IIotSensorsOperations operations, string scope, string iotSensorName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(scope, iotSensorName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Download sensor activation file - /// - /// - /// The operations group for this extension method. - /// - /// - /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) - /// - /// - /// Name of the IoT sensor - /// - public static Stream DownloadActivation(this IIotSensorsOperations operations, string scope, string iotSensorName) - { - return operations.DownloadActivationAsync(scope, iotSensorName).GetAwaiter().GetResult(); - } - - /// - /// Download sensor activation file - /// - /// - /// The operations group for this extension method. - /// - /// - /// Scope of the query (IoT Hub, /providers/Microsoft.Devices/iotHubs/myHub) - /// - /// - /// Name of the IoT sensor - /// - /// - /// The cancellation token. - /// - public static async Task DownloadActivationAsync(this IIotSensorsOperations operations, string scope, string iotSensorName, CancellationToken cancellationToken = default(CancellationToken)) - { - var _result = await operations.DownloadActivationWithHttpMessagesAsync(scope, iotSensorName, null, cancellationToken).ConfigureAwait(false); - _result.Request.Dispose(); - return _result.Body; - } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ActiveConnectionsNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ActiveConnectionsNotInAllowedRange.cs index 3c4aefd5b0a4..1d901cbc4a88 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ActiveConnectionsNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ActiveConnectionsNotInAllowedRange.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of active connections is not in allowed range. /// - [Newtonsoft.Json.JsonObject("ActiveConnectionsNotInAllowedRange")] public partial class ActiveConnectionsNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalData.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalData.cs index efcb3ced1b86..a052f822516a 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalData.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalData.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Details of the sub-assessment /// - [Newtonsoft.Json.JsonObject("AdditionalData")] public partial class AdditionalData { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AuthorizationState.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspaceDataType.cs similarity index 68% rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AuthorizationState.cs rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspaceDataType.cs index 9e9673ebd32c..676173dbafca 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AuthorizationState.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspaceDataType.cs @@ -12,11 +12,11 @@ namespace Microsoft.Azure.Management.Security.Models { /// - /// Defines values for AuthorizationState. + /// Defines values for AdditionalWorkspaceDataType. /// - public static class AuthorizationState + public static class AdditionalWorkspaceDataType { - public const string Authorized = "Authorized"; - public const string Unauthorized = "Unauthorized"; + public const string Alerts = "Alerts"; + public const string RawEvents = "RawEvents"; } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DeviceStatus.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspaceType.cs similarity index 72% rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DeviceStatus.cs rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspaceType.cs index f14d47f34441..62a80cafd8d8 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DeviceStatus.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspaceType.cs @@ -12,11 +12,10 @@ namespace Microsoft.Azure.Management.Security.Models { /// - /// Defines values for DeviceStatus. + /// Defines values for AdditionalWorkspaceType. /// - public static class DeviceStatus + public static class AdditionalWorkspaceType { - public const string Active = "Active"; - public const string Removed = "Removed"; + public const string Sentinel = "Sentinel"; } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspacesProperties.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspacesProperties.cs new file mode 100644 index 000000000000..832e8fc248f4 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdditionalWorkspacesProperties.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Properties of the additional workspaces. + /// + public partial class AdditionalWorkspacesProperties + { + /// + /// Initializes a new instance of the AdditionalWorkspacesProperties + /// class. + /// + public AdditionalWorkspacesProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AdditionalWorkspacesProperties + /// class. + /// + /// Workspace resource id + /// Workspace type. Possible values include: + /// 'Sentinel' + /// List of data types sent to + /// workspace + public AdditionalWorkspacesProperties(string workspace = default(string), string type = default(string), IList dataTypes = default(IList)) + { + Workspace = workspace; + Type = type; + DataTypes = dataTypes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets workspace resource id + /// + [JsonProperty(PropertyName = "workspace")] + public string Workspace { get; set; } + + /// + /// Gets or sets workspace type. Possible values include: 'Sentinel' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets list of data types sent to workspace + /// + [JsonProperty(PropertyName = "dataTypes")] + public IList DataTypes { get; set; } + + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertIntent.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertIntent.cs deleted file mode 100644 index 9ce004f76da4..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertIntent.cs +++ /dev/null @@ -1,36 +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.Models -{ - - /// - /// Defines values for AlertIntent. - /// - public static class AlertIntent - { - public const string Unknown = "Unknown"; - public const string PreAttack = "PreAttack"; - public const string InitialAccess = "InitialAccess"; - public const string Persistence = "Persistence"; - public const string PrivilegeEscalation = "PrivilegeEscalation"; - public const string DefenseEvasion = "DefenseEvasion"; - public const string CredentialAccess = "CredentialAccess"; - public const string Discovery = "Discovery"; - public const string LateralMovement = "LateralMovement"; - public const string Execution = "Execution"; - public const string Collection = "Collection"; - public const string Exfiltration = "Exfiltration"; - public const string CommandAndControl = "CommandAndControl"; - public const string Impact = "Impact"; - public const string Probing = "Probing"; - public const string Exploitation = "Exploitation"; - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertSeverity.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertSeverity.cs index f205d7b00cbc..f54b8f9ca28a 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertSeverity.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertSeverity.cs @@ -16,9 +16,21 @@ namespace Microsoft.Azure.Management.Security.Models /// public static class AlertSeverity { + /// + /// Informational + /// public const string Informational = "Informational"; + /// + /// Low + /// public const string Low = "Low"; + /// + /// Medium + /// public const string Medium = "Medium"; + /// + /// High + /// public const string High = "High"; } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertSimulatorBundlesRequestProperties.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertSimulatorBundlesRequestProperties.cs new file mode 100644 index 000000000000..04aa34c27f51 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertSimulatorBundlesRequestProperties.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Simulate alerts according to this bundles. + /// + [Newtonsoft.Json.JsonObject("Bundles")] + public partial class AlertSimulatorBundlesRequestProperties : AlertSimulatorRequestProperties + { + /// + /// Initializes a new instance of the + /// AlertSimulatorBundlesRequestProperties class. + /// + public AlertSimulatorBundlesRequestProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AlertSimulatorBundlesRequestProperties class. + /// + /// Unmatched properties from the + /// message are deserialized this collection + /// Bundles list. + public AlertSimulatorBundlesRequestProperties(IDictionary additionalProperties = default(IDictionary), IList bundles = default(IList)) + : base(additionalProperties) + { + Bundles = bundles; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets bundles list. + /// + [JsonProperty(PropertyName = "bundles")] + public IList Bundles { get; set; } + + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSensor.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertSimulatorRequestBody.cs similarity index 58% rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSensor.cs rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertSimulatorRequestBody.cs index a78e65a6ae6b..c8bbb95a1506 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSensor.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertSimulatorRequestBody.cs @@ -14,27 +14,23 @@ namespace Microsoft.Azure.Management.Security.Models using System.Linq; /// - /// IoT sensor + /// Alert Simulator request body. /// - public partial class IotSensor : Resource + public partial class AlertSimulatorRequestBody { /// - /// Initializes a new instance of the IotSensor class. + /// Initializes a new instance of the AlertSimulatorRequestBody class. /// - public IotSensor() + public AlertSimulatorRequestBody() { CustomInit(); } /// - /// Initializes a new instance of the IotSensor class. + /// Initializes a new instance of the AlertSimulatorRequestBody class. /// - /// Resource Id - /// Resource name - /// Resource type - /// IoT sensor properties - public IotSensor(string id = default(string), string name = default(string), string type = default(string), object properties = default(object)) - : base(id, name, type) + /// Alert Simulator request body data. + public AlertSimulatorRequestBody(AlertSimulatorRequestProperties properties = default(AlertSimulatorRequestProperties)) { Properties = properties; CustomInit(); @@ -46,10 +42,10 @@ public IotSensor() partial void CustomInit(); /// - /// Gets or sets ioT sensor properties + /// Gets or sets alert Simulator request body data. /// [JsonProperty(PropertyName = "properties")] - public object Properties { get; set; } + public AlertSimulatorRequestProperties Properties { get; set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlertTypeList.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertSimulatorRequestProperties.cs similarity index 51% rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlertTypeList.cs rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertSimulatorRequestProperties.cs index 2ebee5a098f9..eed55ecbc415 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlertTypeList.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertSimulatorRequestProperties.cs @@ -16,25 +16,28 @@ namespace Microsoft.Azure.Management.Security.Models using System.Linq; /// - /// List of alert types + /// Describes properties of an alert simulation request /// - public partial class IotAlertTypeList + public partial class AlertSimulatorRequestProperties { /// - /// Initializes a new instance of the IotAlertTypeList class. + /// Initializes a new instance of the AlertSimulatorRequestProperties + /// class. /// - public IotAlertTypeList() + public AlertSimulatorRequestProperties() { CustomInit(); } /// - /// Initializes a new instance of the IotAlertTypeList class. + /// Initializes a new instance of the AlertSimulatorRequestProperties + /// class. /// - /// List data - public IotAlertTypeList(IList value = default(IList)) + /// Unmatched properties from the + /// message are deserialized this collection + public AlertSimulatorRequestProperties(IDictionary additionalProperties = default(IDictionary)) { - Value = value; + AdditionalProperties = additionalProperties; CustomInit(); } @@ -44,10 +47,11 @@ public IotAlertTypeList() partial void CustomInit(); /// - /// Gets or sets list data + /// Gets or sets unmatched properties from the message are deserialized + /// this collection /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + [JsonExtensionData] + public IDictionary AdditionalProperties { get; set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertSyncSettings.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertSyncSettings.cs new file mode 100644 index 000000000000..8137eb5e0ecc --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AlertSyncSettings.cs @@ -0,0 +1,68 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents an alert sync setting + /// + [Rest.Serialization.JsonTransformation] + public partial class AlertSyncSettings : Setting + { + /// + /// Initializes a new instance of the AlertSyncSettings class. + /// + public AlertSyncSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AlertSyncSettings class. + /// + /// Is the alert sync setting enabled + /// Resource Id + /// Resource name + /// Resource type + public AlertSyncSettings(bool enabled, string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) + { + Enabled = enabled; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets is the alert sync setting enabled + /// + [JsonProperty(PropertyName = "properties.enabled")] + public bool Enabled { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AllowlistCustomAlertRule.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AllowlistCustomAlertRule.cs index 9033e1abbffb..4f1823712b08 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AllowlistCustomAlertRule.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AllowlistCustomAlertRule.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.Security.Models /// A custom alert rule that checks if a value (depends on the custom alert /// type) is allowed. /// - [Newtonsoft.Json.JsonObject("AllowlistCustomAlertRule")] public partial class AllowlistCustomAlertRule : ListCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DMessagesNotInAllowedRange.cs index 83fcf7eef6d5..1ec0be41d31f 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of cloud to device messages (AMQP protocol) is not in allowed /// range. /// - [Newtonsoft.Json.JsonObject("AmqpC2DMessagesNotInAllowedRange")] public partial class AmqpC2DMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DRejectedMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DRejectedMessagesNotInAllowedRange.cs index 61375802e9ea..27ca3c49286e 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DRejectedMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DRejectedMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of rejected cloud to device messages (AMQP protocol) is not in /// allowed range. /// - [Newtonsoft.Json.JsonObject("AmqpC2DRejectedMessagesNotInAllowedRange")] public partial class AmqpC2DRejectedMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpD2CMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpD2CMessagesNotInAllowedRange.cs index fd6dd48b1060..8061c59a72ce 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpD2CMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpD2CMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of device to cloud messages (AMQP protocol) is not in allowed /// range. /// - [Newtonsoft.Json.JsonObject("AmqpD2CMessagesNotInAllowedRange")] public partial class AmqpD2CMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AuthenticationDetailsProperties.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AuthenticationDetailsProperties.cs index bf9f8117be03..4e15389c098a 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AuthenticationDetailsProperties.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AuthenticationDetailsProperties.cs @@ -18,7 +18,6 @@ namespace Microsoft.Azure.Management.Security.Models /// /// Settings for cloud authentication management /// - [Newtonsoft.Json.JsonObject("AuthenticationDetailsProperties")] public partial class AuthenticationDetailsProperties { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AutomationAction.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AutomationAction.cs index e486a3ba01b9..921ecb8ffaf1 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AutomationAction.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AutomationAction.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// The action that should be triggered. /// - [Newtonsoft.Json.JsonObject("AutomationAction")] public partial class AutomationAction { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AutomationSource.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AutomationSource.cs index 8bdc7a2c40c1..9e48941ebb18 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AutomationSource.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AutomationSource.cs @@ -35,7 +35,10 @@ public AutomationSource() /// Initializes a new instance of the AutomationSource class. /// /// A valid event source type. Possible - /// values include: 'Assessments', 'SubAssessments', 'Alerts' + /// values include: 'Assessments', 'SubAssessments', 'Alerts', + /// 'SecureScores', 'SecureScoresSnapshot', 'SecureScoreControls', + /// 'SecureScoreControlsSnapshot', 'RegulatoryComplianceAssessment', + /// 'RegulatoryComplianceAssessmentSnapshot' /// A set of rules which evaluate upon event /// interception. A logical disjunction is applied between defined rule /// sets (logical 'or'). @@ -53,7 +56,10 @@ public AutomationSource() /// /// Gets or sets a valid event source type. Possible values include: - /// 'Assessments', 'SubAssessments', 'Alerts' + /// 'Assessments', 'SubAssessments', 'Alerts', 'SecureScores', + /// 'SecureScoresSnapshot', 'SecureScoreControls', + /// 'SecureScoreControlsSnapshot', 'RegulatoryComplianceAssessment', + /// 'RegulatoryComplianceAssessmentSnapshot' /// [JsonProperty(PropertyName = "eventSource")] public string EventSource { get; set; } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/BundleType.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/BundleType.cs new file mode 100644 index 000000000000..60da8696f4e5 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/BundleType.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + + /// + /// Defines values for BundleType. + /// + public static class BundleType + { + public const string AppServices = "AppServices"; + public const string DNS = "DNS"; + public const string KeyVaults = "KeyVaults"; + public const string KubernetesService = "KubernetesService"; + public const string ResourceManager = "ResourceManager"; + public const string SqlServers = "SqlServers"; + public const string StorageAccounts = "StorageAccounts"; + public const string VirtualMachines = "VirtualMachines"; + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Category.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Categories.cs similarity index 90% rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Category.cs rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Categories.cs index 4f210dc3da43..822bbff8ba38 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Category.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Categories.cs @@ -12,9 +12,9 @@ namespace Microsoft.Azure.Management.Security.Models { /// - /// Defines values for Category. + /// Defines values for Categories. /// - public static class Category + public static class Categories { public const string Compute = "Compute"; public const string Networking = "Networking"; diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionFromIpNotAllowed.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionFromIpNotAllowed.cs new file mode 100644 index 000000000000..1c567d2fc44c --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionFromIpNotAllowed.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Inbound connection from an ip that isn't allowed. Allow list consists + /// of ipv4 or ipv6 range in CIDR notation. + /// + public partial class ConnectionFromIpNotAllowed : AllowlistCustomAlertRule + { + /// + /// Initializes a new instance of the ConnectionFromIpNotAllowed class. + /// + public ConnectionFromIpNotAllowed() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConnectionFromIpNotAllowed class. + /// + /// Status of the custom alert. + /// The values to allow. The format of + /// the values depends on the rule type. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + /// The value type of the items in the list. + /// Possible values include: 'IpCidr', 'String' + public ConnectionFromIpNotAllowed(bool isEnabled, IList allowlistValues, string displayName = default(string), string description = default(string), string valueType = default(string)) + : base(isEnabled, allowlistValues, displayName, description, valueType) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotRecommendationTypeList.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionStrings.cs similarity index 52% rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotRecommendationTypeList.cs rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionStrings.cs index d2681eedc651..3f8d150af8f3 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotRecommendationTypeList.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionStrings.cs @@ -10,29 +10,30 @@ namespace Microsoft.Azure.Management.Security.Models { + using Microsoft.Rest; using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; /// - /// List of recommendation types + /// Connection string for ingesting security data and logs /// - public partial class IotRecommendationTypeList + public partial class ConnectionStrings { /// - /// Initializes a new instance of the IotRecommendationTypeList class. + /// Initializes a new instance of the ConnectionStrings class. /// - public IotRecommendationTypeList() + public ConnectionStrings() { CustomInit(); } /// - /// Initializes a new instance of the IotRecommendationTypeList class. + /// Initializes a new instance of the ConnectionStrings class. /// - /// List data - public IotRecommendationTypeList(IList value = default(IList)) + /// Connection strings + public ConnectionStrings(IList value) { Value = value; CustomInit(); @@ -44,10 +45,23 @@ public IotRecommendationTypeList() partial void CustomInit(); /// - /// Gets or sets list data + /// Gets or sets connection strings /// [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + public IList Value { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Value == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + } + } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionToIpNotAllowed.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionToIpNotAllowed.cs index 19cc63c8934c..16d02941054a 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionToIpNotAllowed.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionToIpNotAllowed.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.Security.Models /// Outbound connection to an ip that isn't allowed. Allow list consists of /// ipv4 or ipv6 range in CIDR notation. /// - [Newtonsoft.Json.JsonObject("ConnectionToIpNotAllowed")] public partial class ConnectionToIpNotAllowed : AllowlistCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MacSignificance.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/CreatedByType.cs similarity index 61% rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MacSignificance.cs rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/CreatedByType.cs index 5941e418045b..a18acdd38fdf 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MacSignificance.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/CreatedByType.cs @@ -12,11 +12,13 @@ namespace Microsoft.Azure.Management.Security.Models { /// - /// Defines values for MacSignificance. + /// Defines values for CreatedByType. /// - public static class MacSignificance + public static class CreatedByType { - public const string Primary = "Primary"; - public const string Secondary = "Secondary"; + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/CustomAlertRule.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/CustomAlertRule.cs index a581bbf4f832..c52d16896c22 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/CustomAlertRule.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/CustomAlertRule.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.Security.Models /// /// A custom alert rule. /// - [Newtonsoft.Json.JsonObject("CustomAlertRule")] public partial class CustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DataExportSettings.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DataExportSettings.cs index 3c01ebcc5c17..e9c06204304c 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DataExportSettings.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DataExportSettings.cs @@ -18,7 +18,6 @@ namespace Microsoft.Azure.Management.Security.Models /// /// Represents a data export setting /// - [Newtonsoft.Json.JsonObject("DataExportSettings")] [Rest.Serialization.JsonTransformation] public partial class DataExportSettings : Setting { @@ -33,7 +32,7 @@ public DataExportSettings() /// /// Initializes a new instance of the DataExportSettings class. /// - /// Is the data export setting is enabled + /// Is the data export setting enabled /// Resource Id /// Resource name /// Resource type @@ -50,7 +49,7 @@ public DataExportSettings() partial void CustomInit(); /// - /// Gets or sets is the data export setting is enabled + /// Gets or sets is the data export setting enabled /// [JsonProperty(PropertyName = "properties.enabled")] public bool Enabled { get; set; } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DenylistCustomAlertRule.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DenylistCustomAlertRule.cs index 1bfe4ef2944a..fefdebb7ccad 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DenylistCustomAlertRule.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DenylistCustomAlertRule.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.Security.Models /// A custom alert rule that checks if a value (depends on the custom alert /// type) is denied. /// - [Newtonsoft.Json.JsonObject("DenylistCustomAlertRule")] public partial class DenylistCustomAlertRule : ListCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Device.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Device.cs deleted file mode 100644 index 3b43ed623c18..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Device.cs +++ /dev/null @@ -1,285 +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.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Device model - /// - [Rest.Serialization.JsonTransformation] - public partial class Device : Resource - { - /// - /// Initializes a new instance of the Device class. - /// - public Device() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Device class. - /// - /// Resource Id - /// Resource name - /// Resource type - /// Device display name given by the - /// collector - /// Device type. - /// The source that created the device - /// List of network interfaces. - /// Device vendor - /// Device operating system name. - /// List of protocols. - /// last time the device was active in the - /// network - /// last time the device was - /// updated - /// Managed state of the device. Possible - /// values include: 'Managed', 'Unmanaged' - /// Authorized state of the device. - /// Possible values include: 'Authorized', 'Unauthorized' - /// Device criticality. Possible values - /// include: 'Important', 'Standard' - /// Purdue level of the device. Possible - /// values include: 'ProcessControl', 'Supervisory', - /// 'Enterprise' - /// user notes for the device, up to 300 - /// characters. - /// List of device firmwares. - /// Discovered time of the device. - /// Indicates whether this device is - /// programming. Possible values include: 'ProgrammingDevice', - /// 'NotProgrammingDevice' - /// last time the device was - /// programming or programed. - /// Indicates whether the device is - /// a scanner. Possible values include: 'ScannerDevice', - /// 'NotScannerDevice' - /// last time the device was - /// scanning. - /// risk score of the device. - /// List of sensors that scanned this - /// device. - /// Device status. Possible values include: - /// 'Active', 'Removed' - public Device(string id = default(string), string name = default(string), string type = default(string), string displayName = default(string), string deviceType = default(string), string sourceName = default(string), IList networkInterfaces = default(IList), string vendor = default(string), string osName = default(string), IList protocols = default(IList), System.DateTime? lastActiveTime = default(System.DateTime?), System.DateTime? lastUpdateTime = default(System.DateTime?), string managementState = default(string), string authorizationState = default(string), string deviceCriticality = default(string), string purdueLevel = default(string), string notes = default(string), IList firmwares = default(IList), System.DateTime? discoveryTime = default(System.DateTime?), string programmingState = default(string), System.DateTime? lastProgrammingTime = default(System.DateTime?), string scanningFunctionality = default(string), System.DateTime? lastScanTime = default(System.DateTime?), int? riskScore = default(int?), IList sensors = default(IList), Site site = default(Site), string deviceStatus = default(string)) - : base(id, name, type) - { - DisplayName = displayName; - DeviceType = deviceType; - SourceName = sourceName; - NetworkInterfaces = networkInterfaces; - Vendor = vendor; - OsName = osName; - Protocols = protocols; - LastActiveTime = lastActiveTime; - LastUpdateTime = lastUpdateTime; - ManagementState = managementState; - AuthorizationState = authorizationState; - DeviceCriticality = deviceCriticality; - PurdueLevel = purdueLevel; - Notes = notes; - Firmwares = firmwares; - DiscoveryTime = discoveryTime; - ProgrammingState = programmingState; - LastProgrammingTime = lastProgrammingTime; - ScanningFunctionality = scanningFunctionality; - LastScanTime = lastScanTime; - RiskScore = riskScore; - Sensors = sensors; - Site = site; - DeviceStatus = deviceStatus; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets device display name given by the collector - /// - [JsonProperty(PropertyName = "properties.displayName")] - public string DisplayName { get; set; } - - /// - /// Gets or sets device type. - /// - [JsonProperty(PropertyName = "properties.deviceType")] - public string DeviceType { get; set; } - - /// - /// Gets the source that created the device - /// - [JsonProperty(PropertyName = "properties.sourceName")] - public string SourceName { get; private set; } - - /// - /// Gets list of network interfaces. - /// - [JsonProperty(PropertyName = "properties.networkInterfaces")] - public IList NetworkInterfaces { get; private set; } - - /// - /// Gets device vendor - /// - [JsonProperty(PropertyName = "properties.vendor")] - public string Vendor { get; private set; } - - /// - /// Gets or sets device operating system name. - /// - [JsonProperty(PropertyName = "properties.osName")] - public string OsName { get; set; } - - /// - /// Gets list of protocols. - /// - [JsonProperty(PropertyName = "properties.protocols")] - public IList Protocols { get; private set; } - - /// - /// Gets last time the device was active in the network - /// - [JsonProperty(PropertyName = "properties.lastActiveTime")] - public System.DateTime? LastActiveTime { get; private set; } - - /// - /// Gets last time the device was updated - /// - [JsonProperty(PropertyName = "properties.lastUpdateTime")] - public System.DateTime? LastUpdateTime { get; private set; } - - /// - /// Gets managed state of the device. Possible values include: - /// 'Managed', 'Unmanaged' - /// - [JsonProperty(PropertyName = "properties.managementState")] - public string ManagementState { get; private set; } - - /// - /// Gets or sets authorized state of the device. Possible values - /// include: 'Authorized', 'Unauthorized' - /// - [JsonProperty(PropertyName = "properties.authorizationState")] - public string AuthorizationState { get; set; } - - /// - /// Gets or sets device criticality. Possible values include: - /// 'Important', 'Standard' - /// - [JsonProperty(PropertyName = "properties.deviceCriticality")] - public string DeviceCriticality { get; set; } - - /// - /// Gets or sets purdue level of the device. Possible values include: - /// 'ProcessControl', 'Supervisory', 'Enterprise' - /// - [JsonProperty(PropertyName = "properties.purdueLevel")] - public string PurdueLevel { get; set; } - - /// - /// Gets or sets user notes for the device, up to 300 characters. - /// - [JsonProperty(PropertyName = "properties.notes")] - public string Notes { get; set; } - - /// - /// Gets list of device firmwares. - /// - [JsonProperty(PropertyName = "properties.firmwares")] - public IList Firmwares { get; private set; } - - /// - /// Gets discovered time of the device. - /// - [JsonProperty(PropertyName = "properties.discoveryTime")] - public System.DateTime? DiscoveryTime { get; private set; } - - /// - /// Gets indicates whether this device is programming. Possible values - /// include: 'ProgrammingDevice', 'NotProgrammingDevice' - /// - [JsonProperty(PropertyName = "properties.programmingState")] - public string ProgrammingState { get; private set; } - - /// - /// Gets last time the device was programming or programed. - /// - [JsonProperty(PropertyName = "properties.lastProgrammingTime")] - public System.DateTime? LastProgrammingTime { get; private set; } - - /// - /// Gets indicates whether the device is a scanner. Possible values - /// include: 'ScannerDevice', 'NotScannerDevice' - /// - [JsonProperty(PropertyName = "properties.scanningFunctionality")] - public string ScanningFunctionality { get; private set; } - - /// - /// Gets last time the device was scanning. - /// - [JsonProperty(PropertyName = "properties.lastScanTime")] - public System.DateTime? LastScanTime { get; private set; } - - /// - /// Gets risk score of the device. - /// - [JsonProperty(PropertyName = "properties.riskScore")] - public int? RiskScore { get; private set; } - - /// - /// Gets list of sensors that scanned this device. - /// - [JsonProperty(PropertyName = "properties.sensors")] - public IList Sensors { get; private set; } - - /// - /// - [JsonProperty(PropertyName = "properties.site")] - public Site Site { get; private set; } - - /// - /// Gets device status. Possible values include: 'Active', 'Removed' - /// - [JsonProperty(PropertyName = "properties.deviceStatus")] - public string DeviceStatus { get; private set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (RiskScore != null) - { - if (RiskScore > 100) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "RiskScore", 100); - } - if (RiskScore < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "RiskScore", 0); - } - } - } - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DeviceCriticality.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DeviceCriticality.cs deleted file mode 100644 index e463f8a38c99..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DeviceCriticality.cs +++ /dev/null @@ -1,22 +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.Models -{ - - /// - /// Defines values for DeviceCriticality. - /// - public static class DeviceCriticality - { - public const string Important = "Important"; - public const string Standard = "Standard"; - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DirectMethodInvokesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DirectMethodInvokesNotInAllowedRange.cs index 5965d3547967..efb160b104ec 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DirectMethodInvokesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DirectMethodInvokesNotInAllowedRange.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of direct method invokes is not in allowed range. /// - [Newtonsoft.Json.JsonObject("DirectMethodInvokesNotInAllowedRange")] public partial class DirectMethodInvokesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/EndOfSupportStatus.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/EndOfSupportStatus.cs new file mode 100644 index 000000000000..711d2f3fa86d --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/EndOfSupportStatus.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + + /// + /// Defines values for EndOfSupportStatus. + /// + public static class EndOfSupportStatus + { + public const string None = "None"; + public const string NoLongerSupported = "noLongerSupported"; + public const string VersionNoLongerSupported = "versionNoLongerSupported"; + public const string UpcomingNoLongerSupported = "upcomingNoLongerSupported"; + public const string UpcomingVersionNoLongerSupported = "upcomingVersionNoLongerSupported"; + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Protocol1.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ErrorAdditionalInfo.cs similarity index 53% rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Protocol1.cs rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ErrorAdditionalInfo.cs index 2bd92aa67191..9beab3502ae2 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Protocol1.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ErrorAdditionalInfo.cs @@ -14,27 +14,27 @@ namespace Microsoft.Azure.Management.Security.Models using System.Linq; /// - /// Protocol data + /// The resource management error additional info. /// - public partial class Protocol1 + public partial class ErrorAdditionalInfo { /// - /// Initializes a new instance of the Protocol1 class. + /// Initializes a new instance of the ErrorAdditionalInfo class. /// - public Protocol1() + public ErrorAdditionalInfo() { CustomInit(); } /// - /// Initializes a new instance of the Protocol1 class. + /// Initializes a new instance of the ErrorAdditionalInfo class. /// - /// Protocol name - /// list of protocol identifiers. - public Protocol1(string name = default(string), string identifiers = default(string)) + /// The additional info type. + /// The additional info. + public ErrorAdditionalInfo(string type = default(string), object info = default(object)) { - Name = name; - Identifiers = identifiers; + Type = type; + Info = info; CustomInit(); } @@ -44,16 +44,16 @@ public Protocol1() partial void CustomInit(); /// - /// Gets protocol name + /// Gets the additional info type. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } /// - /// Gets or sets list of protocol identifiers. + /// Gets the additional info. /// - [JsonProperty(PropertyName = "identifiers")] - public string Identifiers { get; set; } + [JsonProperty(PropertyName = "info")] + public object Info { get; private set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/EventSource.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/EventSource.cs index 33c257f4f0b4..78f7630e6c2e 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/EventSource.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/EventSource.cs @@ -19,5 +19,11 @@ public static class EventSource public const string Assessments = "Assessments"; public const string SubAssessments = "SubAssessments"; public const string Alerts = "Alerts"; + public const string SecureScores = "SecureScores"; + public const string SecureScoresSnapshot = "SecureScoresSnapshot"; + public const string SecureScoreControls = "SecureScoreControls"; + public const string SecureScoreControlsSnapshot = "SecureScoreControlsSnapshot"; + public const string RegulatoryComplianceAssessment = "RegulatoryComplianceAssessment"; + public const string RegulatoryComplianceAssessmentSnapshot = "RegulatoryComplianceAssessmentSnapshot"; } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ExternalSecuritySolution.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ExternalSecuritySolution.cs index 6391dffca8f2..119f870c19ad 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ExternalSecuritySolution.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ExternalSecuritySolution.cs @@ -18,7 +18,6 @@ namespace Microsoft.Azure.Management.Security.Models /// sends information to an OMS workspace and whose data is displayed by /// Azure Security Center. /// - [Newtonsoft.Json.JsonObject("ExternalSecuritySolution")] public partial class ExternalSecuritySolution { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FailedLocalLoginsNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FailedLocalLoginsNotInAllowedRange.cs index 940afb4c7ce2..d2d8d1166ae2 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FailedLocalLoginsNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FailedLocalLoginsNotInAllowedRange.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of failed local logins is not in allowed range. /// - [Newtonsoft.Json.JsonObject("FailedLocalLoginsNotInAllowedRange")] public partial class FailedLocalLoginsNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FileUploadsNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FileUploadsNotInAllowedRange.cs index b35c49246449..55109af42dc0 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FileUploadsNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FileUploadsNotInAllowedRange.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of file uploads is not in allowed range. /// - [Newtonsoft.Json.JsonObject("FileUploadsNotInAllowedRange")] public partial class FileUploadsNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Firmware.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Firmware.cs deleted file mode 100644 index 8ba7a03c5320..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Firmware.cs +++ /dev/null @@ -1,103 +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.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Firmware information - /// - public partial class Firmware - { - /// - /// Initializes a new instance of the Firmware class. - /// - public Firmware() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Firmware class. - /// - /// Address of the specific module a - /// firmware is related to - /// Rack number of the module a firmware is related - /// to. - /// Slot number in the rack of the module a firmware - /// is related to - /// Serial of the firmware - /// Firmware model - /// Firmware version - /// A bag of fields which extends the - /// firmware information. - public Firmware(string moduleAddress = default(string), string rack = default(string), string slot = default(string), string serial = default(string), string model = default(string), string version = default(string), object additionalData = default(object)) - { - ModuleAddress = moduleAddress; - Rack = rack; - Slot = slot; - Serial = serial; - Model = model; - Version = version; - AdditionalData = additionalData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets address of the specific module a firmware is related to - /// - [JsonProperty(PropertyName = "moduleAddress")] - public string ModuleAddress { get; private set; } - - /// - /// Gets rack number of the module a firmware is related to. - /// - [JsonProperty(PropertyName = "rack")] - public string Rack { get; private set; } - - /// - /// Gets slot number in the rack of the module a firmware is related to - /// - [JsonProperty(PropertyName = "slot")] - public string Slot { get; private set; } - - /// - /// Gets serial of the firmware - /// - [JsonProperty(PropertyName = "serial")] - public string Serial { get; private set; } - - /// - /// Gets firmware model - /// - [JsonProperty(PropertyName = "model")] - public string Model { get; private set; } - - /// - /// Gets firmware version - /// - [JsonProperty(PropertyName = "version")] - public string Version { get; private set; } - - /// - /// Gets A bag of fields which extends the firmware information. - /// - [JsonProperty(PropertyName = "additionalData")] - public object AdditionalData { get; private set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DMessagesNotInAllowedRange.cs index b4c92a0347b1..21b2e8bf7d9e 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of cloud to device messages (HTTP protocol) is not in allowed /// range. /// - [Newtonsoft.Json.JsonObject("HttpC2DMessagesNotInAllowedRange")] public partial class HttpC2DMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DRejectedMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DRejectedMessagesNotInAllowedRange.cs index a9d06f027578..73f69e0b71b0 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DRejectedMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DRejectedMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of rejected cloud to device messages (HTTP protocol) is not in /// allowed range. /// - [Newtonsoft.Json.JsonObject("HttpC2DRejectedMessagesNotInAllowedRange")] public partial class HttpC2DRejectedMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpD2CMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpD2CMessagesNotInAllowedRange.cs index d9ecd22c241b..820edd41c00a 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpD2CMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpD2CMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of device to cloud messages (HTTP protocol) is not in allowed /// range. /// - [Newtonsoft.Json.JsonObject("HttpD2CMessagesNotInAllowedRange")] public partial class HttpD2CMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSensorsList.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IngestionConnectionString.cs similarity index 51% rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSensorsList.cs rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IngestionConnectionString.cs index aac5bc83d934..f3dfa012394b 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotSensorsList.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IngestionConnectionString.cs @@ -11,29 +11,30 @@ namespace Microsoft.Azure.Management.Security.Models { using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// List of IoT sensors + /// Connection string for ingesting security data and logs /// - public partial class IotSensorsList + public partial class IngestionConnectionString { /// - /// Initializes a new instance of the IotSensorsList class. + /// Initializes a new instance of the IngestionConnectionString class. /// - public IotSensorsList() + public IngestionConnectionString() { CustomInit(); } /// - /// Initializes a new instance of the IotSensorsList class. + /// Initializes a new instance of the IngestionConnectionString class. /// - /// List data - public IotSensorsList(IList value = default(IList)) + /// The region where ingested logs and data + /// resides + /// Connection string value + public IngestionConnectionString(string location = default(string), string value = default(string)) { + Location = location; Value = value; CustomInit(); } @@ -44,10 +45,16 @@ public IotSensorsList() partial void CustomInit(); /// - /// Gets list data + /// Gets the region where ingested logs and data resides + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// Gets connection string value /// [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } + public string Value { get; private set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/OnPremiseIotSensor.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IngestionSetting.cs similarity index 66% rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/OnPremiseIotSensor.cs rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IngestionSetting.cs index da0ef2cc817f..c7a6adc3d336 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/OnPremiseIotSensor.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IngestionSetting.cs @@ -14,26 +14,27 @@ namespace Microsoft.Azure.Management.Security.Models using System.Linq; /// - /// On-premise IoT sensor + /// Configures how to correlate scan data and logs with resources + /// associated with the subscription. /// - public partial class OnPremiseIotSensor : Resource + public partial class IngestionSetting : Resource { /// - /// Initializes a new instance of the OnPremiseIotSensor class. + /// Initializes a new instance of the IngestionSetting class. /// - public OnPremiseIotSensor() + public IngestionSetting() { CustomInit(); } /// - /// Initializes a new instance of the OnPremiseIotSensor class. + /// Initializes a new instance of the IngestionSetting class. /// /// Resource Id /// Resource name /// Resource type - /// On-premise IoT sensor properties - public OnPremiseIotSensor(string id = default(string), string name = default(string), string type = default(string), object properties = default(object)) + /// Ingestion setting data + public IngestionSetting(string id = default(string), string name = default(string), string type = default(string), object properties = default(object)) : base(id, name, type) { Properties = properties; @@ -46,7 +47,7 @@ public OnPremiseIotSensor() partial void CustomInit(); /// - /// Gets or sets on-premise IoT sensor properties + /// Gets or sets ingestion setting data /// [JsonProperty(PropertyName = "properties")] public object Properties { get; set; } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotDefenderSettingsList.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IngestionSettingToken.cs similarity index 52% rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotDefenderSettingsList.cs rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IngestionSettingToken.cs index 43b7a5c0d4ed..75bb1556dcb4 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotDefenderSettingsList.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IngestionSettingToken.cs @@ -11,30 +11,30 @@ namespace Microsoft.Azure.Management.Security.Models { using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// - /// List of IoT Defender settings + /// Configures how to correlate scan data and logs with resources + /// associated with the subscription. /// - public partial class IotDefenderSettingsList + public partial class IngestionSettingToken { /// - /// Initializes a new instance of the IotDefenderSettingsList class. + /// Initializes a new instance of the IngestionSettingToken class. /// - public IotDefenderSettingsList() + public IngestionSettingToken() { CustomInit(); } /// - /// Initializes a new instance of the IotDefenderSettingsList class. + /// Initializes a new instance of the IngestionSettingToken class. /// - /// List data - public IotDefenderSettingsList(IList value = default(IList)) + /// The token is used for correlating security data + /// and logs with the resources in the subscription. + public IngestionSettingToken(string token = default(string)) { - Value = value; + Token = token; CustomInit(); } @@ -44,10 +44,11 @@ public IotDefenderSettingsList() partial void CustomInit(); /// - /// Gets list data + /// Gets the token is used for correlating security data and logs with + /// the resources in the subscription. /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } + [JsonProperty(PropertyName = "token")] + public string Token { get; private set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedAlert.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedAlert.cs index 576c441f6737..6976cdba2dbb 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedAlert.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedAlert.cs @@ -62,7 +62,7 @@ public IoTSecurityAggregatedAlert() /// list of affected devices/alerts. /// 10 devices with the highest number of /// occurrences of this alert type, on this day. - public IoTSecurityAggregatedAlert(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string alertType = default(string), string alertDisplayName = default(string), System.DateTime? aggregatedDateUtc = default(System.DateTime?), string vendorName = default(string), string reportedSeverity = default(string), string remediationSteps = default(string), string description = default(string), int? count = default(int?), string effectedResourceType = default(string), string systemSource = default(string), string actionTaken = default(string), string logAnalyticsQuery = default(string), IList topDevicesList = default(IList)) + public IoTSecurityAggregatedAlert(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string alertType = default(string), string alertDisplayName = default(string), System.DateTime? aggregatedDateUtc = default(System.DateTime?), string vendorName = default(string), string reportedSeverity = default(string), string remediationSteps = default(string), string description = default(string), long? count = default(long?), string effectedResourceType = default(string), string systemSource = default(string), string actionTaken = default(string), string logAnalyticsQuery = default(string), IList topDevicesList = default(IList)) { Id = id; Name = name; @@ -162,7 +162,7 @@ public IoTSecurityAggregatedAlert() /// window. /// [JsonProperty(PropertyName = "properties.count")] - public int? Count { get; private set; } + public long? Count { get; private set; } /// /// Gets azure resource ID of the resource that received the alerts. diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.cs index fe7313395686..e99cf861e643 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedAlertPropertiesTopDevicesListItem.cs @@ -33,7 +33,7 @@ public IoTSecurityAggregatedAlertPropertiesTopDevicesListItem() /// device. /// Most recent time this alert was raised /// for this device, on this day. - public IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(string deviceId = default(string), int? alertsCount = default(int?), string lastOccurrence = default(string)) + public IoTSecurityAggregatedAlertPropertiesTopDevicesListItem(string deviceId = default(string), long? alertsCount = default(long?), string lastOccurrence = default(string)) { DeviceId = deviceId; AlertsCount = alertsCount; @@ -56,7 +56,7 @@ public IoTSecurityAggregatedAlertPropertiesTopDevicesListItem() /// Gets number of alerts raised for this device. /// [JsonProperty(PropertyName = "alertsCount")] - public int? AlertsCount { get; private set; } + public long? AlertsCount { get; private set; } /// /// Gets most recent time this alert was raised for this device, on diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedRecommendation.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedRecommendation.cs index 8a9bb666b275..10cb785cc6f8 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedRecommendation.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAggregatedRecommendation.cs @@ -61,7 +61,7 @@ public IoTSecurityAggregatedRecommendation() /// within the IoT Security solution. /// Log analytics query for getting the /// list of affected devices/alerts. - public IoTSecurityAggregatedRecommendation(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string recommendationName = default(string), string recommendationDisplayName = default(string), string description = default(string), string recommendationTypeId = default(string), string detectedBy = default(string), string remediationSteps = default(string), string reportedSeverity = default(string), int? healthyDevices = default(int?), int? unhealthyDeviceCount = default(int?), string logAnalyticsQuery = default(string)) + public IoTSecurityAggregatedRecommendation(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string recommendationName = default(string), string recommendationDisplayName = default(string), string description = default(string), string recommendationTypeId = default(string), string detectedBy = default(string), string remediationSteps = default(string), string reportedSeverity = default(string), long? healthyDevices = default(long?), long? unhealthyDeviceCount = default(long?), string logAnalyticsQuery = default(string)) { Id = id; Name = name; @@ -156,13 +156,13 @@ public IoTSecurityAggregatedRecommendation() /// Gets number of healthy devices within the IoT Security solution. /// [JsonProperty(PropertyName = "properties.healthyDevices")] - public int? HealthyDevices { get; private set; } + public long? HealthyDevices { get; private set; } /// /// Gets number of unhealthy devices within the IoT Security solution. /// [JsonProperty(PropertyName = "properties.unhealthyDeviceCount")] - public int? UnhealthyDeviceCount { get; private set; } + public long? UnhealthyDeviceCount { get; private set; } /// /// Gets log analytics query for getting the list of affected diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAlertedDevice.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAlertedDevice.cs index c4a2dece5c37..370ea29693b8 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAlertedDevice.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityAlertedDevice.cs @@ -33,7 +33,7 @@ public IoTSecurityAlertedDevice() /// Device identifier. /// Number of alerts raised for this /// device. - public IoTSecurityAlertedDevice(string deviceId = default(string), int? alertsCount = default(int?)) + public IoTSecurityAlertedDevice(string deviceId = default(string), long? alertsCount = default(long?)) { DeviceId = deviceId; AlertsCount = alertsCount; @@ -55,7 +55,7 @@ public IoTSecurityAlertedDevice() /// Gets number of alerts raised for this device. /// [JsonProperty(PropertyName = "alertsCount")] - public int? AlertsCount { get; private set; } + public long? AlertsCount { get; private set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityDeviceAlert.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityDeviceAlert.cs index 2a3591bb89da..fcc0b588b6c1 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityDeviceAlert.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityDeviceAlert.cs @@ -35,7 +35,7 @@ public IoTSecurityDeviceAlert() /// values include: 'Informational', 'Low', 'Medium', 'High' /// Number of alerts raised for this alert /// type. - public IoTSecurityDeviceAlert(string alertDisplayName = default(string), string reportedSeverity = default(string), int? alertsCount = default(int?)) + public IoTSecurityDeviceAlert(string alertDisplayName = default(string), string reportedSeverity = default(string), long? alertsCount = default(long?)) { AlertDisplayName = alertDisplayName; ReportedSeverity = reportedSeverity; @@ -65,7 +65,7 @@ public IoTSecurityDeviceAlert() /// Gets number of alerts raised for this alert type. /// [JsonProperty(PropertyName = "alertsCount")] - public int? AlertsCount { get; private set; } + public long? AlertsCount { get; private set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityDeviceRecommendation.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityDeviceRecommendation.cs index fbafa0d2216d..273a5f40b9c5 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityDeviceRecommendation.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecurityDeviceRecommendation.cs @@ -39,7 +39,7 @@ public IoTSecurityDeviceRecommendation() /// 'High' /// Number of devices with this /// recommendation. - public IoTSecurityDeviceRecommendation(string recommendationDisplayName = default(string), string reportedSeverity = default(string), int? devicesCount = default(int?)) + public IoTSecurityDeviceRecommendation(string recommendationDisplayName = default(string), string reportedSeverity = default(string), long? devicesCount = default(long?)) { RecommendationDisplayName = recommendationDisplayName; ReportedSeverity = reportedSeverity; @@ -69,7 +69,7 @@ public IoTSecurityDeviceRecommendation() /// Gets number of devices with this recommendation. /// [JsonProperty(PropertyName = "devicesCount")] - public int? DevicesCount { get; private set; } + public long? DevicesCount { get; private set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecuritySolutionAnalyticsModel.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecuritySolutionAnalyticsModel.cs index c9573fa848cd..d9b4829a9e80 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecuritySolutionAnalyticsModel.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecuritySolutionAnalyticsModel.cs @@ -51,7 +51,7 @@ public IoTSecuritySolutionAnalyticsModel() /// prevalent device alerts. /// List of the 3 most /// prevalent device recommendations. - public IoTSecuritySolutionAnalyticsModel(string id = default(string), string name = default(string), string type = default(string), IoTSeverityMetrics metrics = default(IoTSeverityMetrics), int? unhealthyDeviceCount = default(int?), IList devicesMetrics = default(IList), IList topAlertedDevices = default(IList), IList mostPrevalentDeviceAlerts = default(IList), IList mostPrevalentDeviceRecommendations = default(IList)) + public IoTSecuritySolutionAnalyticsModel(string id = default(string), string name = default(string), string type = default(string), IoTSeverityMetrics metrics = default(IoTSeverityMetrics), long? unhealthyDeviceCount = default(long?), IList devicesMetrics = default(IList), IList topAlertedDevices = default(IList), IList mostPrevalentDeviceAlerts = default(IList), IList mostPrevalentDeviceRecommendations = default(IList)) : base(id, name, type) { Metrics = metrics; @@ -78,7 +78,7 @@ public IoTSecuritySolutionAnalyticsModel() /// Gets number of unhealthy devices within your IoT Security solution. /// [JsonProperty(PropertyName = "properties.unhealthyDeviceCount")] - public int? UnhealthyDeviceCount { get; private set; } + public long? UnhealthyDeviceCount { get; private set; } /// /// Gets list of device metrics by the aggregation date. diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecuritySolutionModel.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecuritySolutionModel.cs index 30c128604d47..513d7a6b5754 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecuritySolutionModel.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSecuritySolutionModel.cs @@ -53,7 +53,11 @@ public IoTSecuritySolutionModel() /// solution. /// Unmasked IP address logging /// status. Possible values include: 'Disabled', 'Enabled' - public IoTSecuritySolutionModel(string displayName, IList iotHubs, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), string workspace = default(string), string status = default(string), IList export = default(IList), IList disabledDataSources = default(IList), UserDefinedResourcesProperties userDefinedResources = default(UserDefinedResourcesProperties), IList autoDiscoveredResources = default(IList), IList recommendationsConfiguration = default(IList), string unmaskedIpLoggingStatus = default(string)) + /// List of additional + /// workspaces + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + public IoTSecuritySolutionModel(string displayName, IList iotHubs, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string location = default(string), string workspace = default(string), string status = default(string), IList export = default(IList), IList disabledDataSources = default(IList), UserDefinedResourcesProperties userDefinedResources = default(UserDefinedResourcesProperties), IList autoDiscoveredResources = default(IList), IList recommendationsConfiguration = default(IList), string unmaskedIpLoggingStatus = default(string), IList additionalWorkspaces = default(IList), SystemData systemData = default(SystemData)) { Id = id; Name = name; @@ -70,6 +74,8 @@ public IoTSecuritySolutionModel() AutoDiscoveredResources = autoDiscoveredResources; RecommendationsConfiguration = recommendationsConfiguration; UnmaskedIpLoggingStatus = unmaskedIpLoggingStatus; + AdditionalWorkspaces = additionalWorkspaces; + SystemData = systemData; CustomInit(); } @@ -171,6 +177,19 @@ public IoTSecuritySolutionModel() [JsonProperty(PropertyName = "properties.unmaskedIpLoggingStatus")] public string UnmaskedIpLoggingStatus { get; set; } + /// + /// Gets or sets list of additional workspaces + /// + [JsonProperty(PropertyName = "properties.additionalWorkspaces")] + public IList AdditionalWorkspaces { get; set; } + + /// + /// Gets azure Resource Manager metadata containing createdBy and + /// modifiedBy information. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + /// /// Validate the object. /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSeverityMetrics.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSeverityMetrics.cs index 31723ada6abe..71fc0a7748c7 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSeverityMetrics.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IoTSeverityMetrics.cs @@ -35,7 +35,7 @@ public IoTSeverityMetrics() /// alerts/recommendations. /// Count of low severity /// alerts/recommendations. - public IoTSeverityMetrics(int? high = default(int?), int? medium = default(int?), int? low = default(int?)) + public IoTSeverityMetrics(long? high = default(long?), long? medium = default(long?), long? low = default(long?)) { High = high; Medium = medium; @@ -52,19 +52,19 @@ public IoTSeverityMetrics() /// Gets or sets count of high severity alerts/recommendations. /// [JsonProperty(PropertyName = "high")] - public int? High { get; set; } + public long? High { get; set; } /// /// Gets or sets count of medium severity alerts/recommendations. /// [JsonProperty(PropertyName = "medium")] - public int? Medium { get; set; } + public long? Medium { get; set; } /// /// Gets or sets count of low severity alerts/recommendations. /// [JsonProperty(PropertyName = "low")] - public int? Low { get; set; } + public long? Low { get; set; } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlert.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlert.cs deleted file mode 100644 index 03e3833029c3..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlert.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.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// IoT alert - /// - [Rest.Serialization.JsonTransformation] - public partial class IotAlert - { - /// - /// Initializes a new instance of the IotAlert class. - /// - public IotAlert() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IotAlert class. - /// - /// Holds the product canonical identifier - /// of the alert within the scope of a product - /// Display name of the main entity - /// being reported on - /// The type name of the alert - /// The impact start time of the alert (the - /// time of the first event or activity included in the alert) - /// The impact end time of the alert (the time - /// of the last event or activity included in the alert) - /// A list of entities related to the - /// alert - /// A bag of fields which extends the - /// alert information - public IotAlert(string systemAlertId = default(string), string compromisedEntity = default(string), string alertType = default(string), string startTimeUtc = default(string), string endTimeUtc = default(string), IList entities = default(IList), object extendedProperties = default(object)) - { - SystemAlertId = systemAlertId; - CompromisedEntity = compromisedEntity; - AlertType = alertType; - StartTimeUtc = startTimeUtc; - EndTimeUtc = endTimeUtc; - Entities = entities; - ExtendedProperties = extendedProperties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets holds the product canonical identifier of the alert within the - /// scope of a product - /// - [JsonProperty(PropertyName = "properties.systemAlertId")] - public string SystemAlertId { get; private set; } - - /// - /// Gets display name of the main entity being reported on - /// - [JsonProperty(PropertyName = "properties.compromisedEntity")] - public string CompromisedEntity { get; private set; } - - /// - /// Gets the type name of the alert - /// - [JsonProperty(PropertyName = "properties.alertType")] - public string AlertType { get; private set; } - - /// - /// Gets the impact start time of the alert (the time of the first - /// event or activity included in the alert) - /// - [JsonProperty(PropertyName = "properties.startTimeUtc")] - public string StartTimeUtc { get; private set; } - - /// - /// Gets the impact end time of the alert (the time of the last event - /// or activity included in the alert) - /// - [JsonProperty(PropertyName = "properties.endTimeUtc")] - public string EndTimeUtc { get; private set; } - - /// - /// Gets or sets a list of entities related to the alert - /// - [JsonProperty(PropertyName = "properties.entities")] - public IList Entities { get; set; } - - /// - /// Gets or sets a bag of fields which extends the alert information - /// - [JsonProperty(PropertyName = "properties.extendedProperties")] - public object ExtendedProperties { get; set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlertModel.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlertModel.cs deleted file mode 100644 index d1555b4f7452..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlertModel.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.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// IoT alert - /// - [Rest.Serialization.JsonTransformation] - public partial class IotAlertModel - { - /// - /// Initializes a new instance of the IotAlertModel class. - /// - public IotAlertModel() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IotAlertModel class. - /// - /// Holds the product canonical identifier - /// of the alert within the scope of a product - /// Display name of the main entity - /// being reported on - /// The type name of the alert - /// The impact start time of the alert (the - /// time of the first event or activity included in the alert) - /// The impact end time of the alert (the time - /// of the last event or activity included in the alert) - /// A list of entities related to the - /// alert - /// A bag of fields which extends the - /// alert information - public IotAlertModel(string systemAlertId = default(string), string compromisedEntity = default(string), string alertType = default(string), string startTimeUtc = default(string), string endTimeUtc = default(string), IList entities = default(IList), object extendedProperties = default(object)) - { - SystemAlertId = systemAlertId; - CompromisedEntity = compromisedEntity; - AlertType = alertType; - StartTimeUtc = startTimeUtc; - EndTimeUtc = endTimeUtc; - Entities = entities; - ExtendedProperties = extendedProperties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets holds the product canonical identifier of the alert within the - /// scope of a product - /// - [JsonProperty(PropertyName = "properties.systemAlertId")] - public string SystemAlertId { get; private set; } - - /// - /// Gets display name of the main entity being reported on - /// - [JsonProperty(PropertyName = "properties.compromisedEntity")] - public string CompromisedEntity { get; private set; } - - /// - /// Gets the type name of the alert - /// - [JsonProperty(PropertyName = "properties.alertType")] - public string AlertType { get; private set; } - - /// - /// Gets the impact start time of the alert (the time of the first - /// event or activity included in the alert) - /// - [JsonProperty(PropertyName = "properties.startTimeUtc")] - public string StartTimeUtc { get; private set; } - - /// - /// Gets the impact end time of the alert (the time of the last event - /// or activity included in the alert) - /// - [JsonProperty(PropertyName = "properties.endTimeUtc")] - public string EndTimeUtc { get; private set; } - - /// - /// Gets or sets a list of entities related to the alert - /// - [JsonProperty(PropertyName = "properties.entities")] - public IList Entities { get; set; } - - /// - /// Gets or sets a bag of fields which extends the alert information - /// - [JsonProperty(PropertyName = "properties.extendedProperties")] - public object ExtendedProperties { get; set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlertType.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlertType.cs deleted file mode 100644 index bfc9317b2794..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotAlertType.cs +++ /dev/null @@ -1,146 +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.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// IoT alert type. - /// - [Rest.Serialization.JsonTransformation] - public partial class IotAlertType : Resource - { - /// - /// Initializes a new instance of the IotAlertType class. - /// - public IotAlertType() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IotAlertType class. - /// - /// Resource Id - /// Resource name - /// Resource type - /// The display name of the - /// alert - /// The severity of the alert. Possible values - /// include: 'Informational', 'Low', 'Medium', 'High' - /// Description of the suspected - /// vulnerability and meaning. - /// The name of the alert provider or - /// internal partner - /// The name of the product which published - /// this alert - /// The name of a component inside - /// the product which generated the alert - /// The name of the vendor that raise the - /// alert - /// Kill chain related intent behind the alert. - /// Could contain multiple enum values (separated by commas). Possible - /// values include: 'Unknown', 'PreAttack', 'InitialAccess', - /// 'Persistence', 'PrivilegeEscalation', 'DefenseEvasion', - /// 'CredentialAccess', 'Discovery', 'LateralMovement', 'Execution', - /// 'Collection', 'Exfiltration', 'CommandAndControl', 'Impact', - /// 'Probing', 'Exploitation' - /// Manual action items to take to - /// remediate the alert - public IotAlertType(string id = default(string), string name = default(string), string type = default(string), string alertDisplayName = default(string), string severity = default(string), string description = default(string), string providerName = default(string), string productName = default(string), string productComponentName = default(string), string vendorName = default(string), string intent = default(string), IList remediationSteps = default(IList)) - : base(id, name, type) - { - AlertDisplayName = alertDisplayName; - Severity = severity; - Description = description; - ProviderName = providerName; - ProductName = productName; - ProductComponentName = productComponentName; - VendorName = vendorName; - Intent = intent; - RemediationSteps = remediationSteps; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the display name of the alert - /// - [JsonProperty(PropertyName = "properties.alertDisplayName")] - public string AlertDisplayName { get; private set; } - - /// - /// Gets the severity of the alert. Possible values include: - /// 'Informational', 'Low', 'Medium', 'High' - /// - [JsonProperty(PropertyName = "properties.severity")] - public string Severity { get; private set; } - - /// - /// Gets description of the suspected vulnerability and meaning. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; private set; } - - /// - /// Gets the name of the alert provider or internal partner - /// - [JsonProperty(PropertyName = "properties.providerName")] - public string ProviderName { get; private set; } - - /// - /// Gets the name of the product which published this alert - /// - [JsonProperty(PropertyName = "properties.productName")] - public string ProductName { get; private set; } - - /// - /// Gets the name of a component inside the product which generated the - /// alert - /// - [JsonProperty(PropertyName = "properties.productComponentName")] - public string ProductComponentName { get; private set; } - - /// - /// Gets the name of the vendor that raise the alert - /// - [JsonProperty(PropertyName = "properties.vendorName")] - public string VendorName { get; private set; } - - /// - /// Gets kill chain related intent behind the alert. Could contain - /// multiple enum values (separated by commas). Possible values - /// include: 'Unknown', 'PreAttack', 'InitialAccess', 'Persistence', - /// 'PrivilegeEscalation', 'DefenseEvasion', 'CredentialAccess', - /// 'Discovery', 'LateralMovement', 'Execution', 'Collection', - /// 'Exfiltration', 'CommandAndControl', 'Impact', 'Probing', - /// 'Exploitation' - /// - [JsonProperty(PropertyName = "properties.intent")] - public string Intent { get; private set; } - - /// - /// Gets manual action items to take to remediate the alert - /// - [JsonProperty(PropertyName = "properties.remediationSteps")] - public IList RemediationSteps { get; private set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotDefenderSettingsModel.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotDefenderSettingsModel.cs deleted file mode 100644 index 75daffa95c3c..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotDefenderSettingsModel.cs +++ /dev/null @@ -1,89 +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.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// IoT Defender settings - /// - [Rest.Serialization.JsonTransformation] - public partial class IotDefenderSettingsModel : Resource - { - /// - /// Initializes a new instance of the IotDefenderSettingsModel class. - /// - public IotDefenderSettingsModel() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IotDefenderSettingsModel class. - /// - /// Size of the device quota (as a opposed to - /// a Pay as You Go billing model). Value is required to be in - /// multiples of 1000. - /// Sentinel Workspace - /// Resource Ids - /// Resource Id - /// Resource name - /// Resource type - public IotDefenderSettingsModel(int deviceQuota, IList sentinelWorkspaceResourceIds, string id = default(string), string name = default(string), string type = default(string)) - : base(id, name, type) - { - DeviceQuota = deviceQuota; - SentinelWorkspaceResourceIds = sentinelWorkspaceResourceIds; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets size of the device quota (as a opposed to a Pay as You - /// Go billing model). Value is required to be in multiples of 1000. - /// - [JsonProperty(PropertyName = "properties.deviceQuota")] - public int DeviceQuota { get; set; } - - /// - /// Gets or sets sentinel Workspace Resource Ids - /// - [JsonProperty(PropertyName = "properties.sentinelWorkspaceResourceIds")] - public IList SentinelWorkspaceResourceIds { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (SentinelWorkspaceResourceIds == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "SentinelWorkspaceResourceIds"); - } - if (DeviceQuota < 1000) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "DeviceQuota", 1000); - } - } - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotRecommendation.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotRecommendation.cs deleted file mode 100644 index c535de1be9c0..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotRecommendation.cs +++ /dev/null @@ -1,87 +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.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// IoT recommendation - /// - [Rest.Serialization.JsonTransformation] - public partial class IotRecommendation : Resource - { - /// - /// Initializes a new instance of the IotRecommendation class. - /// - public IotRecommendation() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IotRecommendation class. - /// - /// Resource Id - /// Resource name - /// Resource type - /// Identifier of the device being reported - /// on - /// The type name of the - /// recommendation - /// The discovery time of the - /// recommendation - /// A bag of fields which - /// extends the recommendation information - public IotRecommendation(string id = default(string), string name = default(string), string type = default(string), string deviceId = default(string), string recommendationType = default(string), string discoveredTimeUtc = default(string), object recommendationAdditionalData = default(object)) - : base(id, name, type) - { - DeviceId = deviceId; - RecommendationType = recommendationType; - DiscoveredTimeUtc = discoveredTimeUtc; - RecommendationAdditionalData = recommendationAdditionalData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets identifier of the device being reported on - /// - [JsonProperty(PropertyName = "properties.deviceId")] - public string DeviceId { get; private set; } - - /// - /// Gets the type name of the recommendation - /// - [JsonProperty(PropertyName = "properties.recommendationType")] - public string RecommendationType { get; private set; } - - /// - /// Gets the discovery time of the recommendation - /// - [JsonProperty(PropertyName = "properties.discoveredTimeUtc")] - public string DiscoveredTimeUtc { get; private set; } - - /// - /// Gets or sets a bag of fields which extends the recommendation - /// information - /// - [JsonProperty(PropertyName = "properties.recommendationAdditionalData")] - public object RecommendationAdditionalData { get; set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotRecommendationModel.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotRecommendationModel.cs deleted file mode 100644 index f59146eb9a03..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotRecommendationModel.cs +++ /dev/null @@ -1,87 +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.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Linq; - - /// - /// IoT recommendation - /// - [Rest.Serialization.JsonTransformation] - public partial class IotRecommendationModel : Resource - { - /// - /// Initializes a new instance of the IotRecommendationModel class. - /// - public IotRecommendationModel() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IotRecommendationModel class. - /// - /// Resource Id - /// Resource name - /// Resource type - /// Identifier of the device being reported - /// on - /// The type name of the - /// recommendation - /// The discovery time of the - /// recommendation - /// A bag of fields which - /// extends the recommendation information - public IotRecommendationModel(string id = default(string), string name = default(string), string type = default(string), string deviceId = default(string), string recommendationType = default(string), string discoveredTimeUtc = default(string), object recommendationAdditionalData = default(object)) - : base(id, name, type) - { - DeviceId = deviceId; - RecommendationType = recommendationType; - DiscoveredTimeUtc = discoveredTimeUtc; - RecommendationAdditionalData = recommendationAdditionalData; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets identifier of the device being reported on - /// - [JsonProperty(PropertyName = "properties.deviceId")] - public string DeviceId { get; private set; } - - /// - /// Gets the type name of the recommendation - /// - [JsonProperty(PropertyName = "properties.recommendationType")] - public string RecommendationType { get; private set; } - - /// - /// Gets the discovery time of the recommendation - /// - [JsonProperty(PropertyName = "properties.discoveredTimeUtc")] - public string DiscoveredTimeUtc { get; private set; } - - /// - /// Gets or sets a bag of fields which extends the recommendation - /// information - /// - [JsonProperty(PropertyName = "properties.recommendationAdditionalData")] - public object RecommendationAdditionalData { get; set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotRecommendationType.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotRecommendationType.cs deleted file mode 100644 index 8cc99a60a9bd..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IotRecommendationType.cs +++ /dev/null @@ -1,136 +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.Models -{ - using Microsoft.Rest; - using Microsoft.Rest.Serialization; - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// IoT recommendation type. - /// - [Rest.Serialization.JsonTransformation] - public partial class IotRecommendationType : Resource - { - /// - /// Initializes a new instance of the IotRecommendationType class. - /// - public IotRecommendationType() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IotRecommendationType class. - /// - /// Resource Id - /// Resource name - /// Resource type - /// The display name of the - /// recommendation - /// The severity of the recommendation. Possible - /// values include: 'Unknown', 'NotApplicable', 'Healthy', - /// 'OffByPolicy', 'Low', 'Medium', 'High' - /// Description of the suspected - /// vulnerability and meaning. - /// The name of the product which published - /// this recommendation - /// The name of a component inside - /// the product which generated the recommendation - /// The name of the vendor that raised the - /// recommendation - /// The name of the recommendation's control - /// category - /// Manual action items to take to - /// resolve the recommendation - /// The alert's data source - public IotRecommendationType(string id = default(string), string name = default(string), string type = default(string), string recommendationDisplayName = default(string), string severity = default(string), string description = default(string), string productName = default(string), string productComponentName = default(string), string vendorName = default(string), string control = default(string), IList remediationSteps = default(IList), string dataSource = default(string)) - : base(id, name, type) - { - RecommendationDisplayName = recommendationDisplayName; - Severity = severity; - Description = description; - ProductName = productName; - ProductComponentName = productComponentName; - VendorName = vendorName; - Control = control; - RemediationSteps = remediationSteps; - DataSource = dataSource; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the display name of the recommendation - /// - [JsonProperty(PropertyName = "properties.recommendationDisplayName")] - public string RecommendationDisplayName { get; private set; } - - /// - /// Gets the severity of the recommendation. Possible values include: - /// 'Unknown', 'NotApplicable', 'Healthy', 'OffByPolicy', 'Low', - /// 'Medium', 'High' - /// - [JsonProperty(PropertyName = "properties.severity")] - public string Severity { get; private set; } - - /// - /// Gets description of the suspected vulnerability and meaning. - /// - [JsonProperty(PropertyName = "properties.description")] - public string Description { get; private set; } - - /// - /// Gets the name of the product which published this recommendation - /// - [JsonProperty(PropertyName = "properties.productName")] - public string ProductName { get; private set; } - - /// - /// Gets the name of a component inside the product which generated the - /// recommendation - /// - [JsonProperty(PropertyName = "properties.productComponentName")] - public string ProductComponentName { get; private set; } - - /// - /// Gets the name of the vendor that raised the recommendation - /// - [JsonProperty(PropertyName = "properties.vendorName")] - public string VendorName { get; private set; } - - /// - /// Gets the name of the recommendation's control category - /// - [JsonProperty(PropertyName = "properties.control")] - public string Control { get; private set; } - - /// - /// Gets manual action items to take to resolve the recommendation - /// - [JsonProperty(PropertyName = "properties.remediationSteps")] - public IList RemediationSteps { get; private set; } - - /// - /// Gets the alert's data source - /// - [JsonProperty(PropertyName = "properties.dataSource")] - public string DataSource { get; private set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IpAddress.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IpAddress.cs deleted file mode 100644 index 816fa1f54c92..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/IpAddress.cs +++ /dev/null @@ -1,85 +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.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// IP Address information - /// - public partial class IpAddress - { - /// - /// Initializes a new instance of the IpAddress class. - /// - public IpAddress() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IpAddress class. - /// - /// IPV4 address - /// Detection time of the ip - /// address. - /// Subnet Classless Inter-Domain - /// Routing - /// Fully qualified domain name - /// FQDN last lookup time. - public IpAddress(string v4Address = default(string), System.DateTime? detectionTime = default(System.DateTime?), string subnetCidr = default(string), string fqdn = default(string), System.DateTime? fqdnLastLookupTime = default(System.DateTime?)) - { - V4Address = v4Address; - DetectionTime = detectionTime; - SubnetCidr = subnetCidr; - Fqdn = fqdn; - FqdnLastLookupTime = fqdnLastLookupTime; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets IPV4 address - /// - [JsonProperty(PropertyName = "v4Address")] - public string V4Address { get; private set; } - - /// - /// Gets detection time of the ip address. - /// - [JsonProperty(PropertyName = "detectionTime")] - public System.DateTime? DetectionTime { get; private set; } - - /// - /// Gets subnet Classless Inter-Domain Routing - /// - [JsonProperty(PropertyName = "subnetCidr")] - public string SubnetCidr { get; private set; } - - /// - /// Gets fully qualified domain name - /// - [JsonProperty(PropertyName = "fqdn")] - public string Fqdn { get; private set; } - - /// - /// Gets FQDN last lookup time. - /// - [JsonProperty(PropertyName = "fqdnLastLookupTime")] - public System.DateTime? FqdnLastLookupTime { get; private set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ListCustomAlertRule.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ListCustomAlertRule.cs index 763959ad3860..528d183316de 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ListCustomAlertRule.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ListCustomAlertRule.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.Security.Models /// /// A List custom alert rule. /// - [Newtonsoft.Json.JsonObject("ListCustomAlertRule")] public partial class ListCustomAlertRule : CustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/LocalUserNotAllowed.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/LocalUserNotAllowed.cs index 27e661e467c1..0005bd059e44 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/LocalUserNotAllowed.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/LocalUserNotAllowed.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.Security.Models /// Login by a local user that isn't allowed. Allow list consists of login /// names to allow. /// - [Newtonsoft.Json.JsonObject("LocalUserNotAllowed")] public partial class LocalUserNotAllowed : AllowlistCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MacAddress.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MacAddress.cs deleted file mode 100644 index 94fcbc2b4946..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MacAddress.cs +++ /dev/null @@ -1,82 +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.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// MAC Address information - /// - public partial class MacAddress - { - /// - /// Initializes a new instance of the MacAddress class. - /// - public MacAddress() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the MacAddress class. - /// - /// MAC address - /// Detection time of the mac - /// address. - /// Indicates whether this is the primary - /// secondary MAC address of the device. Possible values include: - /// 'Primary', 'Secondary' - /// Indicates whether the relation of - /// the mac to the ip address is certain or a guess. Possible values - /// include: 'Guess', 'Certain' - public MacAddress(string address = default(string), System.DateTime? detectionTime = default(System.DateTime?), string significance = default(string), string relationToIpStatus = default(string)) - { - Address = address; - DetectionTime = detectionTime; - Significance = significance; - RelationToIpStatus = relationToIpStatus; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets MAC address - /// - [JsonProperty(PropertyName = "address")] - public string Address { get; private set; } - - /// - /// Gets detection time of the mac address. - /// - [JsonProperty(PropertyName = "detectionTime")] - public System.DateTime? DetectionTime { get; private set; } - - /// - /// Gets indicates whether this is the primary secondary MAC address of - /// the device. Possible values include: 'Primary', 'Secondary' - /// - [JsonProperty(PropertyName = "significance")] - public string Significance { get; private set; } - - /// - /// Gets indicates whether the relation of the mac to the ip address is - /// certain or a guess. Possible values include: 'Guess', 'Certain' - /// - [JsonProperty(PropertyName = "relationToIpStatus")] - public string RelationToIpStatus { get; private set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ManagementState.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ManagementState.cs deleted file mode 100644 index 8185b78777e1..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ManagementState.cs +++ /dev/null @@ -1,22 +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.Models -{ - - /// - /// Defines values for ManagementState. - /// - public static class ManagementState - { - public const string Managed = "Managed"; - public const string Unmanaged = "Unmanaged"; - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DMessagesNotInAllowedRange.cs index 50ce5fe30a68..3df534833527 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of cloud to device messages (MQTT protocol) is not in allowed /// range. /// - [Newtonsoft.Json.JsonObject("MqttC2DMessagesNotInAllowedRange")] public partial class MqttC2DMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DRejectedMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DRejectedMessagesNotInAllowedRange.cs index 55fb3039b11a..6607cb5285c9 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DRejectedMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DRejectedMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of rejected cloud to device messages (MQTT protocol) is not in /// allowed range. /// - [Newtonsoft.Json.JsonObject("MqttC2DRejectedMessagesNotInAllowedRange")] public partial class MqttC2DRejectedMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttD2CMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttD2CMessagesNotInAllowedRange.cs index 358bb0c6e4f8..1bba936ed591 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttD2CMessagesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttD2CMessagesNotInAllowedRange.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of device to cloud messages (MQTT protocol) is not in allowed /// range. /// - [Newtonsoft.Json.JsonObject("MqttD2CMessagesNotInAllowedRange")] public partial class MqttD2CMessagesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/NetworkInterface.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/NetworkInterface.cs deleted file mode 100644 index 054c4b49fc35..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/NetworkInterface.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.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Network interface - /// - public partial class NetworkInterface - { - /// - /// Initializes a new instance of the NetworkInterface class. - /// - public NetworkInterface() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the NetworkInterface class. - /// - /// List of device vlans. - public NetworkInterface(IpAddress ipAddress = default(IpAddress), MacAddress macAddress = default(MacAddress), IList vlans = default(IList)) - { - IpAddress = ipAddress; - MacAddress = macAddress; - Vlans = vlans; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "ipAddress")] - public IpAddress IpAddress { get; set; } - - /// - /// - [JsonProperty(PropertyName = "macAddress")] - public MacAddress MacAddress { get; set; } - - /// - /// Gets list of device vlans. - /// - [JsonProperty(PropertyName = "vlans")] - public IList Vlans { get; private set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/OnPremiseIotSensorsList.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/OnPremiseIotSensorsList.cs deleted file mode 100644 index 894a64a8ed83..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/OnPremiseIotSensorsList.cs +++ /dev/null @@ -1,53 +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.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// List of on-premise IoT sensors - /// - public partial class OnPremiseIotSensorsList - { - /// - /// Initializes a new instance of the OnPremiseIotSensorsList class. - /// - public OnPremiseIotSensorsList() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the OnPremiseIotSensorsList class. - /// - /// List data - public OnPremiseIotSensorsList(IList value = default(IList)) - { - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets list data - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; private set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/OperatorModel.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/OperatorModel.cs index b15324dea8c0..2f7657382ce4 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/OperatorModel.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/OperatorModel.cs @@ -16,14 +16,41 @@ namespace Microsoft.Azure.Management.Security.Models /// public static class OperatorModel { + /// + /// Applies for decimal and non-decimal operands + /// public const string Equals = "Equals"; + /// + /// Applies only for decimal operands + /// public const string GreaterThan = "GreaterThan"; + /// + /// Applies only for decimal operands + /// public const string GreaterThanOrEqualTo = "GreaterThanOrEqualTo"; + /// + /// Applies only for decimal operands + /// public const string LesserThan = "LesserThan"; + /// + /// Applies only for decimal operands + /// public const string LesserThanOrEqualTo = "LesserThanOrEqualTo"; + /// + /// Applies for decimal and non-decimal operands + /// public const string NotEquals = "NotEquals"; + /// + /// Applies only for non-decimal operands + /// public const string Contains = "Contains"; + /// + /// Applies only for non-decimal operands + /// public const string StartsWith = "StartsWith"; + /// + /// Applies only for non-decimal operands + /// public const string EndsWith = "EndsWith"; } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadInfo.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadInfo.cs deleted file mode 100644 index 42a89b6b7df2..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadInfo.cs +++ /dev/null @@ -1,69 +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.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Information on a specific package download - /// - public partial class PackageDownloadInfo - { - /// - /// Initializes a new instance of the PackageDownloadInfo class. - /// - public PackageDownloadInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PackageDownloadInfo class. - /// - /// Version number - /// Download link - /// Kind of the version. Possible values - /// include: 'Latest', 'Previous', 'Preview' - public PackageDownloadInfo(string version = default(string), string link = default(string), string versionKind = default(string)) - { - Version = version; - Link = link; - VersionKind = versionKind; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets version number - /// - [JsonProperty(PropertyName = "version")] - public string Version { get; private set; } - - /// - /// Gets or sets download link - /// - [JsonProperty(PropertyName = "link")] - public string Link { get; set; } - - /// - /// Gets kind of the version. Possible values include: 'Latest', - /// 'Previous', 'Preview' - /// - [JsonProperty(PropertyName = "versionKind")] - public string VersionKind { get; private set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloads.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloads.cs deleted file mode 100644 index fc5f9bb7fc97..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloads.cs +++ /dev/null @@ -1,69 +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.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Information about package downloads - /// - public partial class PackageDownloads - { - /// - /// Initializes a new instance of the PackageDownloads class. - /// - public PackageDownloads() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PackageDownloads class. - /// - /// Contains all Sensor binary downloads - /// All downloads for Central - /// Manager - /// All downloads for threat - /// intelligence - public PackageDownloads(PackageDownloadsSensor sensor = default(PackageDownloadsSensor), PackageDownloadsCentralManager centralManager = default(PackageDownloadsCentralManager), PackageDownloadsThreatIntelligence threatIntelligence = default(PackageDownloadsThreatIntelligence)) - { - Sensor = sensor; - CentralManager = centralManager; - ThreatIntelligence = threatIntelligence; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets contains all Sensor binary downloads - /// - [JsonProperty(PropertyName = "sensor")] - public PackageDownloadsSensor Sensor { get; private set; } - - /// - /// Gets all downloads for Central Manager - /// - [JsonProperty(PropertyName = "centralManager")] - public PackageDownloadsCentralManager CentralManager { get; private set; } - - /// - /// Gets all downloads for threat intelligence - /// - [JsonProperty(PropertyName = "threatIntelligence")] - public PackageDownloadsThreatIntelligence ThreatIntelligence { get; private set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsCentralManager.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsCentralManager.cs deleted file mode 100644 index f2172606f5e2..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsCentralManager.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.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// All downloads for Central Manager - /// - public partial class PackageDownloadsCentralManager - { - /// - /// Initializes a new instance of the PackageDownloadsCentralManager - /// class. - /// - public PackageDownloadsCentralManager() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PackageDownloadsCentralManager - /// class. - /// - /// Contains full package downloads - /// Central Manager upgrade package downloads (on - /// existing installations) - public PackageDownloadsCentralManager(PackageDownloadsCentralManagerFull full = default(PackageDownloadsCentralManagerFull), IList upgrade = default(IList)) - { - Full = full; - Upgrade = upgrade; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets contains full package downloads - /// - [JsonProperty(PropertyName = "full")] - public PackageDownloadsCentralManagerFull Full { get; private set; } - - /// - /// Gets central Manager upgrade package downloads (on existing - /// installations) - /// - [JsonProperty(PropertyName = "upgrade")] - public IList Upgrade { get; private set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsCentralManagerFull.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsCentralManagerFull.cs deleted file mode 100644 index 5243cc8a5712..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsCentralManagerFull.cs +++ /dev/null @@ -1,66 +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.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Contains full package downloads - /// - public partial class PackageDownloadsCentralManagerFull - { - /// - /// Initializes a new instance of the - /// PackageDownloadsCentralManagerFull class. - /// - public PackageDownloadsCentralManagerFull() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// PackageDownloadsCentralManagerFull class. - /// - /// Contains all ISO full versions of the Central - /// Manager - /// Contains all OVF (virtual machine) full versions - /// of the Central Manager - public PackageDownloadsCentralManagerFull(IList iso = default(IList), PackageDownloadsCentralManagerFullOvf ovf = default(PackageDownloadsCentralManagerFullOvf)) - { - Iso = iso; - Ovf = ovf; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets contains all ISO full versions of the Central Manager - /// - [JsonProperty(PropertyName = "iso")] - public IList Iso { get; private set; } - - /// - /// Gets contains all OVF (virtual machine) full versions of the - /// Central Manager - /// - [JsonProperty(PropertyName = "ovf")] - public PackageDownloadsCentralManagerFullOvf Ovf { get; private set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsCentralManagerFullOvf.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsCentralManagerFullOvf.cs deleted file mode 100644 index d16c6b7b3d3f..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsCentralManagerFullOvf.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.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Contains all OVF (virtual machine) full versions of the Central Manager - /// - public partial class PackageDownloadsCentralManagerFullOvf - { - /// - /// Initializes a new instance of the - /// PackageDownloadsCentralManagerFullOvf class. - /// - public PackageDownloadsCentralManagerFullOvf() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// PackageDownloadsCentralManagerFullOvf class. - /// - /// The Enterprise package type - /// The - /// EnterpriseHighAvailability package type - /// The Medium package type - /// The MediumHighAvailability - /// package type - public PackageDownloadsCentralManagerFullOvf(IList enterprise = default(IList), IList enterpriseHighAvailability = default(IList), IList medium = default(IList), IList mediumHighAvailability = default(IList)) - { - Enterprise = enterprise; - EnterpriseHighAvailability = enterpriseHighAvailability; - Medium = medium; - MediumHighAvailability = mediumHighAvailability; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the Enterprise package type - /// - [JsonProperty(PropertyName = "enterprise")] - public IList Enterprise { get; private set; } - - /// - /// Gets the EnterpriseHighAvailability package type - /// - [JsonProperty(PropertyName = "enterpriseHighAvailability")] - public IList EnterpriseHighAvailability { get; private set; } - - /// - /// Gets the Medium package type - /// - [JsonProperty(PropertyName = "medium")] - public IList Medium { get; private set; } - - /// - /// Gets the MediumHighAvailability package type - /// - [JsonProperty(PropertyName = "mediumHighAvailability")] - public IList MediumHighAvailability { get; private set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsSensor.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsSensor.cs deleted file mode 100644 index 06a65fb7899c..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsSensor.cs +++ /dev/null @@ -1,63 +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.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Contains all Sensor binary downloads - /// - public partial class PackageDownloadsSensor - { - /// - /// Initializes a new instance of the PackageDownloadsSensor class. - /// - public PackageDownloadsSensor() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PackageDownloadsSensor class. - /// - /// Contains full package downloads - /// Sensor upgrade package downloads (on existing - /// installations) - public PackageDownloadsSensor(PackageDownloadsSensorFull full = default(PackageDownloadsSensorFull), IList upgrade = default(IList)) - { - Full = full; - Upgrade = upgrade; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets contains full package downloads - /// - [JsonProperty(PropertyName = "full")] - public PackageDownloadsSensorFull Full { get; private set; } - - /// - /// Gets or sets sensor upgrade package downloads (on existing - /// installations) - /// - [JsonProperty(PropertyName = "upgrade")] - public IList Upgrade { get; set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsSensorFull.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsSensorFull.cs deleted file mode 100644 index 3f5f6aee3a49..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsSensorFull.cs +++ /dev/null @@ -1,64 +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.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Contains full package downloads - /// - public partial class PackageDownloadsSensorFull - { - /// - /// Initializes a new instance of the PackageDownloadsSensorFull class. - /// - public PackageDownloadsSensorFull() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PackageDownloadsSensorFull class. - /// - /// Contains all ISO full versions for the - /// sensor - /// Contains all OVF (virtual machine) full versions - /// for the sensor - public PackageDownloadsSensorFull(IList iso = default(IList), PackageDownloadsSensorFullOvf ovf = default(PackageDownloadsSensorFullOvf)) - { - Iso = iso; - Ovf = ovf; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets contains all ISO full versions for the sensor - /// - [JsonProperty(PropertyName = "iso")] - public IList Iso { get; private set; } - - /// - /// Gets or sets contains all OVF (virtual machine) full versions for - /// the sensor - /// - [JsonProperty(PropertyName = "ovf")] - public PackageDownloadsSensorFullOvf Ovf { get; set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsSensorFullOvf.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsSensorFullOvf.cs deleted file mode 100644 index 94f357b0cd71..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsSensorFullOvf.cs +++ /dev/null @@ -1,71 +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.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Contains all OVF (virtual machine) full versions for the sensor - /// - public partial class PackageDownloadsSensorFullOvf - { - /// - /// Initializes a new instance of the PackageDownloadsSensorFullOvf - /// class. - /// - public PackageDownloadsSensorFullOvf() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the PackageDownloadsSensorFullOvf - /// class. - /// - /// Enterprise package type - /// Medium package type - /// Line package type - public PackageDownloadsSensorFullOvf(IList enterprise = default(IList), IList medium = default(IList), IList line = default(IList)) - { - Enterprise = enterprise; - Medium = medium; - Line = line; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets enterprise package type - /// - [JsonProperty(PropertyName = "enterprise")] - public IList Enterprise { get; private set; } - - /// - /// Gets medium package type - /// - [JsonProperty(PropertyName = "medium")] - public IList Medium { get; private set; } - - /// - /// Gets line package type - /// - [JsonProperty(PropertyName = "line")] - public IList Line { get; private set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsThreatIntelligence.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsThreatIntelligence.cs deleted file mode 100644 index 38058ad743fc..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PackageDownloadsThreatIntelligence.cs +++ /dev/null @@ -1,53 +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.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// All downloads for threat intelligence - /// - public partial class PackageDownloadsThreatIntelligence - { - /// - /// Initializes a new instance of the - /// PackageDownloadsThreatIntelligence class. - /// - public PackageDownloadsThreatIntelligence() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// PackageDownloadsThreatIntelligence class. - /// - /// Download link - public PackageDownloadsThreatIntelligence(string link = default(string)) - { - Link = link; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets download link - /// - [JsonProperty(PropertyName = "link")] - public string Link { get; set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ProcessNotAllowed.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ProcessNotAllowed.cs index 66e7dc1f46f9..a69d3dc5f932 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ProcessNotAllowed.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ProcessNotAllowed.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.Security.Models /// Execution of a process that isn't allowed. Allow list consists of /// process names to allow. /// - [Newtonsoft.Json.JsonObject("ProcessNotAllowed")] public partial class ProcessNotAllowed : AllowlistCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ProgrammingState.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ProgrammingState.cs deleted file mode 100644 index c157c76a1e66..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ProgrammingState.cs +++ /dev/null @@ -1,22 +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.Models -{ - - /// - /// Defines values for ProgrammingState. - /// - public static class ProgrammingState - { - public const string ProgrammingDevice = "ProgrammingDevice"; - public const string NotProgrammingDevice = "NotProgrammingDevice"; - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PurdueLevel.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PurdueLevel.cs deleted file mode 100644 index 95e824791b1e..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/PurdueLevel.cs +++ /dev/null @@ -1,23 +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.Models -{ - - /// - /// Defines values for PurdueLevel. - /// - public static class PurdueLevel - { - public const string ProcessControl = "ProcessControl"; - public const string Supervisory = "Supervisory"; - public const string Enterprise = "Enterprise"; - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/QueuePurgesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/QueuePurgesNotInAllowedRange.cs index e7a506d93b60..6845776d0aed 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/QueuePurgesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/QueuePurgesNotInAllowedRange.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of device queue purges is not in allowed range. /// - [Newtonsoft.Json.JsonObject("QueuePurgesNotInAllowedRange")] public partial class QueuePurgesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/RecommendationSeverity.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/RecommendationSeverity.cs deleted file mode 100644 index 7752a3f4f198..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/RecommendationSeverity.cs +++ /dev/null @@ -1,27 +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.Models -{ - - /// - /// Defines values for RecommendationSeverity. - /// - public static class RecommendationSeverity - { - public const string Unknown = "Unknown"; - public const string NotApplicable = "NotApplicable"; - public const string Healthy = "Healthy"; - public const string OffByPolicy = "OffByPolicy"; - public const string Low = "Low"; - public const string Medium = "Medium"; - public const string High = "High"; - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/RelationToIpStatus.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/RelationToIpStatus.cs deleted file mode 100644 index 5e97e16405b9..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/RelationToIpStatus.cs +++ /dev/null @@ -1,22 +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.Models -{ - - /// - /// Defines values for RelationToIpStatus. - /// - public static class RelationToIpStatus - { - public const string Guess = "Guess"; - public const string Certain = "Certain"; - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResourceDetails.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResourceDetails.cs index 6ab1d4f7544f..14c1aa733667 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResourceDetails.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResourceDetails.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Details of the resource that was assessed /// - [Newtonsoft.Json.JsonObject("ResourceDetails")] public partial class ResourceDetails { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResourceIdentifier.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResourceIdentifier.cs index 261c4ea106f6..bc31b41d1edd 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResourceIdentifier.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResourceIdentifier.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -18,7 +17,6 @@ namespace Microsoft.Azure.Management.Security.Models /// alert to the right product exposure group (tenant, workspace, /// subscription etc.). /// - [Newtonsoft.Json.JsonObject("ResourceIdentifier")] public partial class ResourceIdentifier { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ScanningFunctionality.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ScanningFunctionality.cs deleted file mode 100644 index 1c5b576b6f8d..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ScanningFunctionality.cs +++ /dev/null @@ -1,22 +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.Models -{ - - /// - /// Defines values for ScanningFunctionality. - /// - public static class ScanningFunctionality - { - public const string ScannerDevice = "ScannerDevice"; - public const string NotScannerDevice = "NotScannerDevice"; - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionItem.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionItem.cs index 8692c1b52ee5..b00aa0b76545 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionItem.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionItem.cs @@ -110,16 +110,13 @@ public virtual void Validate() throw new ValidationException(ValidationRules.MaxLength, "Description", 256); } } - if (MaxScore != null) + if (MaxScore > 10) { - if (MaxScore > 10) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxScore", 10); - } - if (MaxScore < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxScore", 0); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "MaxScore", 10); + } + if (MaxScore < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxScore", 0); } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlDetails.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlDetails.cs index a85e38cb2ff4..731ad402ecdc 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlDetails.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlDetails.cs @@ -135,37 +135,25 @@ public SecureScoreControlDetails() /// public virtual void Validate() { - if (Max != null) + if (Max < 0) { - if (Max < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Max", 0); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "Max", 0); } - if (Current != null) + if (Current < 0) { - if (Current < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Current", 0); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "Current", 0); } - if (Percentage != null) + if (Percentage > 1) { - if (Percentage > 1) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Percentage", 1); - } - if (Percentage < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Percentage", 0); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "Percentage", 1); } - if (Weight != null) + if (Percentage < 0) { - if (Weight < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Weight", 0); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "Percentage", 0); + } + if (Weight < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Weight", 0); } if (Definition != null) { diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlScore.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlScore.cs index c13205cd0a70..0c5bcb1169af 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlScore.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreControlScore.cs @@ -78,38 +78,29 @@ public SecureScoreControlScore() /// public virtual void Validate() { - if (Max != null) + if (Max > 10) { - if (Max > 10) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Max", 10); - } - if (Max < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Max", 0); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "Max", 10); } - if (Current != null) + if (Max < 0) { - if (Current > 10) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Current", 10); - } - if (Current < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Current", 0); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "Max", 0); } - if (Percentage != null) + if (Current > 10) { - if (Percentage > 1) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Percentage", 1); - } - if (Percentage < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Percentage", 0); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "Current", 10); + } + if (Current < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Current", 0); + } + if (Percentage > 1) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Percentage", 1); + } + if (Percentage < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Percentage", 0); } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreItem.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreItem.cs index aa0e2ba185d2..eef77dd1344f 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreItem.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecureScoreItem.cs @@ -99,37 +99,25 @@ public SecureScoreItem() /// public virtual void Validate() { - if (Max != null) + if (Max < 0) { - if (Max < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Max", 0); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "Max", 0); } - if (Current != null) + if (Current < 0) { - if (Current < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Current", 0); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "Current", 0); } - if (Percentage != null) + if (Percentage > 1) { - if (Percentage > 1) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Percentage", 1); - } - if (Percentage < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Percentage", 0); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "Percentage", 1); } - if (Weight != null) + if (Percentage < 0) { - if (Weight < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Weight", 0); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "Percentage", 0); + } + if (Weight < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Weight", 0); } } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadata.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadata.cs index a23426f9a8c5..6e117714f897 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadata.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadata.cs @@ -58,14 +58,14 @@ public SecurityAssessmentMetadata() /// 'Low', 'Moderate', 'High' /// True if this assessment is in preview release /// status - public SecurityAssessmentMetadata(string displayName, string severity, string assessmentType, string id = default(string), string name = default(string), string type = default(string), string policyDefinitionId = default(string), string description = default(string), string remediationDescription = default(string), IList category = default(IList), string userImpact = default(string), string implementationEffort = default(string), IList threats = default(IList), bool? preview = default(bool?), SecurityAssessmentMetadataPartnerData partnerData = default(SecurityAssessmentMetadataPartnerData)) + public SecurityAssessmentMetadata(string displayName, string severity, string assessmentType, string id = default(string), string name = default(string), string type = default(string), string policyDefinitionId = default(string), string description = default(string), string remediationDescription = default(string), IList categories = default(IList), string userImpact = default(string), string implementationEffort = default(string), IList threats = default(IList), bool? preview = default(bool?), SecurityAssessmentMetadataPartnerData partnerData = default(SecurityAssessmentMetadataPartnerData)) : base(id, name, type) { DisplayName = displayName; PolicyDefinitionId = policyDefinitionId; Description = description; RemediationDescription = remediationDescription; - Category = category; + Categories = categories; Severity = severity; UserImpact = userImpact; ImplementationEffort = implementationEffort; @@ -109,8 +109,8 @@ public SecurityAssessmentMetadata() /// /// - [JsonProperty(PropertyName = "properties.category")] - public IList Category { get; set; } + [JsonProperty(PropertyName = "properties.categories")] + public IList Categories { get; set; } /// /// Gets or sets the severity level of the assessment. Possible values diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataProperties.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataProperties.cs index 2804ee154565..56d202538867 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataProperties.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataProperties.cs @@ -55,13 +55,13 @@ public SecurityAssessmentMetadataProperties() /// 'Low', 'Moderate', 'High' /// True if this assessment is in preview release /// status - public SecurityAssessmentMetadataProperties(string displayName, string severity, string assessmentType, string policyDefinitionId = default(string), string description = default(string), string remediationDescription = default(string), IList category = default(IList), string userImpact = default(string), string implementationEffort = default(string), IList threats = default(IList), bool? preview = default(bool?), SecurityAssessmentMetadataPartnerData partnerData = default(SecurityAssessmentMetadataPartnerData)) + public SecurityAssessmentMetadataProperties(string displayName, string severity, string assessmentType, string policyDefinitionId = default(string), string description = default(string), string remediationDescription = default(string), IList categories = default(IList), string userImpact = default(string), string implementationEffort = default(string), IList threats = default(IList), bool? preview = default(bool?), SecurityAssessmentMetadataPartnerData partnerData = default(SecurityAssessmentMetadataPartnerData)) { DisplayName = displayName; PolicyDefinitionId = policyDefinitionId; Description = description; RemediationDescription = remediationDescription; - Category = category; + Categories = categories; Severity = severity; UserImpact = userImpact; ImplementationEffort = implementationEffort; @@ -105,8 +105,8 @@ public SecurityAssessmentMetadataProperties() /// /// - [JsonProperty(PropertyName = "category")] - public IList Category { get; set; } + [JsonProperty(PropertyName = "categories")] + public IList Categories { get; set; } /// /// Gets or sets the severity level of the assessment. Possible values diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Sensor.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Sensor.cs deleted file mode 100644 index 6f783da74561..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Sensor.cs +++ /dev/null @@ -1,59 +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.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Sensor data - /// - public partial class Sensor - { - /// - /// Initializes a new instance of the Sensor class. - /// - public Sensor() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Sensor class. - /// - /// Sensor name - /// Zone Name. - public Sensor(string name = default(string), string zone = default(string)) - { - Name = name; - Zone = zone; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets sensor name - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - - /// - /// Gets zone Name. - /// - [JsonProperty(PropertyName = "zone")] - public string Zone { get; private set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Setting.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Setting.cs index 3d55e2d4a964..6b8f43e31e7d 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Setting.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Setting.cs @@ -10,14 +10,12 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// - /// Represents a security setting in Azure Security Center. + /// The kind of the security setting /// - [Newtonsoft.Json.JsonObject("Setting")] - public partial class Setting : SettingResource + public partial class Setting : Resource { /// /// Initializes a new instance of the Setting class. diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SettingResource.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SettingResource.cs deleted file mode 100644 index 1f6f76dbf11a..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SettingResource.cs +++ /dev/null @@ -1,48 +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.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// The kind of the security setting - /// - [Newtonsoft.Json.JsonObject("SettingResource")] - public partial class SettingResource : Resource - { - /// - /// Initializes a new instance of the SettingResource class. - /// - public SettingResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the SettingResource class. - /// - /// Resource Id - /// Resource name - /// Resource type - public SettingResource(string id = default(string), string name = default(string), string type = default(string)) - : base(id, name, type) - { - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Site.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Site.cs deleted file mode 100644 index 1d6c9cdc2106..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Site.cs +++ /dev/null @@ -1,51 +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.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Site data - /// - public partial class Site - { - /// - /// Initializes a new instance of the Site class. - /// - public Site() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the Site class. - /// - /// Site display name - public Site(string displayName = default(string)) - { - DisplayName = displayName; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets site display name - /// - [JsonProperty(PropertyName = "displayName")] - public string DisplayName { get; private set; } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Software.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Software.cs new file mode 100644 index 000000000000..fd19673fdb03 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Software.cs @@ -0,0 +1,136 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents a software data + /// + [Rest.Serialization.JsonTransformation] + public partial class Software : Resource + { + /// + /// Initializes a new instance of the Software class. + /// + public Software() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Software class. + /// + /// Resource Id + /// Resource name + /// Resource type + /// Unique identifier for the virtual machine in + /// the service. + /// Platform of the operating system running + /// on the device. + /// Name of the software vendor. + /// Name of the software product. + /// Version number of the software + /// product. + /// End of support status. Possible + /// values include: 'None', 'noLongerSupported', + /// 'versionNoLongerSupported', 'upcomingNoLongerSupported', + /// 'upcomingVersionNoLongerSupported' + /// The end of support date in case the + /// product is upcoming end of support. + /// Number of + /// weaknesses. + /// First time that the software was seen in + /// the device. + public Software(string id = default(string), string name = default(string), string type = default(string), string deviceId = default(string), string osPlatform = default(string), string vendor = default(string), string softwareName = default(string), string version = default(string), string endOfSupportStatus = default(string), string endOfSupportDate = default(string), int? numberOfKnownVulnerabilities = default(int?), string firstSeenAt = default(string)) + : base(id, name, type) + { + DeviceId = deviceId; + OsPlatform = osPlatform; + Vendor = vendor; + SoftwareName = softwareName; + Version = version; + EndOfSupportStatus = endOfSupportStatus; + EndOfSupportDate = endOfSupportDate; + NumberOfKnownVulnerabilities = numberOfKnownVulnerabilities; + FirstSeenAt = firstSeenAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets unique identifier for the virtual machine in the + /// service. + /// + [JsonProperty(PropertyName = "properties.deviceId")] + public string DeviceId { get; set; } + + /// + /// Gets or sets platform of the operating system running on the + /// device. + /// + [JsonProperty(PropertyName = "properties.osPlatform")] + public string OsPlatform { get; set; } + + /// + /// Gets or sets name of the software vendor. + /// + [JsonProperty(PropertyName = "properties.vendor")] + public string Vendor { get; set; } + + /// + /// Gets or sets name of the software product. + /// + [JsonProperty(PropertyName = "properties.softwareName")] + public string SoftwareName { get; set; } + + /// + /// Gets or sets version number of the software product. + /// + [JsonProperty(PropertyName = "properties.version")] + public string Version { get; set; } + + /// + /// Gets or sets end of support status. Possible values include: + /// 'None', 'noLongerSupported', 'versionNoLongerSupported', + /// 'upcomingNoLongerSupported', 'upcomingVersionNoLongerSupported' + /// + [JsonProperty(PropertyName = "properties.endOfSupportStatus")] + public string EndOfSupportStatus { get; set; } + + /// + /// Gets or sets the end of support date in case the product is + /// upcoming end of support. + /// + [JsonProperty(PropertyName = "properties.endOfSupportDate")] + public string EndOfSupportDate { get; set; } + + /// + /// Gets or sets number of weaknesses. + /// + [JsonProperty(PropertyName = "properties.numberOfKnownVulnerabilities")] + public int? NumberOfKnownVulnerabilities { get; set; } + + /// + /// Gets or sets first time that the software was seen in the device. + /// + [JsonProperty(PropertyName = "properties.firstSeenAt")] + public string FirstSeenAt { get; set; } + + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SystemData.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..07d83ce36f45 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SystemData.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. Possible values include: 'User', 'Application', + /// 'ManagedIdentity', 'Key' + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. Possible values include: 'User', + /// 'Application', 'ManagedIdentity', 'Key' + /// The timestamp of resource last + /// modification (UTC) + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', + /// 'Key' + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource last modification (UTC) + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ThresholdCustomAlertRule.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ThresholdCustomAlertRule.cs index 7df8da76196b..47f1dfdf2e8f 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ThresholdCustomAlertRule.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ThresholdCustomAlertRule.cs @@ -17,7 +17,6 @@ namespace Microsoft.Azure.Management.Security.Models /// A custom alert rule that checks if a value (depends on the custom alert /// type) is within the given range. /// - [Newtonsoft.Json.JsonObject("ThresholdCustomAlertRule")] public partial class ThresholdCustomAlertRule : CustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TimeWindowCustomAlertRule.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TimeWindowCustomAlertRule.cs index eaeb685da1b5..e6fdc3230f94 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TimeWindowCustomAlertRule.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TimeWindowCustomAlertRule.cs @@ -17,7 +17,6 @@ namespace Microsoft.Azure.Management.Security.Models /// A custom alert rule that checks if the number of activities (depends on /// the custom alert type) in a time window is within the given range. /// - [Newtonsoft.Json.JsonObject("TimeWindowCustomAlertRule")] public partial class TimeWindowCustomAlertRule : ThresholdCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TwinUpdatesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TwinUpdatesNotInAllowedRange.cs index e0b4415251e9..047ed484cb7e 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TwinUpdatesNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TwinUpdatesNotInAllowedRange.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of twin updates is not in allowed range. /// - [Newtonsoft.Json.JsonObject("TwinUpdatesNotInAllowedRange")] public partial class TwinUpdatesNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/UnauthorizedOperationsNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/UnauthorizedOperationsNotInAllowedRange.cs index f57c05fd4648..757b89fe6a5f 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/UnauthorizedOperationsNotInAllowedRange.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/UnauthorizedOperationsNotInAllowedRange.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.Security.Models { - using Newtonsoft.Json; using System.Linq; /// /// Number of unauthorized operations is not in allowed range. /// - [Newtonsoft.Json.JsonObject("UnauthorizedOperationsNotInAllowedRange")] public partial class UnauthorizedOperationsNotInAllowedRange : TimeWindowCustomAlertRule { /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/VersionKind.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/VersionKind.cs deleted file mode 100644 index a65157494913..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/VersionKind.cs +++ /dev/null @@ -1,23 +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.Models -{ - - /// - /// Defines values for VersionKind. - /// - public static class VersionKind - { - public const string Latest = "Latest"; - public const string Previous = "Previous"; - public const string Preview = "Preview"; - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/OnPremiseIotSensorsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/OnPremiseIotSensorsOperations.cs deleted file mode 100644 index 256212b665bc..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/OnPremiseIotSensorsOperations.cs +++ /dev/null @@ -1,990 +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.IO; - using System.Linq; - using System.Net; - using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; - - /// - /// OnPremiseIotSensorsOperations operations. - /// - internal partial class OnPremiseIotSensorsOperations : IServiceOperations, IOnPremiseIotSensorsOperations - { - /// - /// Initializes a new instance of the OnPremiseIotSensorsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal OnPremiseIotSensorsOperations(SecurityCenterClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the SecurityCenterClient - /// - public SecurityCenterClient Client { get; private set; } - - /// - /// List on-premise IoT sensors - /// - /// - /// 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(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("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/onPremiseIotSensors").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Get on-premise IoT sensor - /// - /// - /// Name of the on-premise IoT sensor - /// - /// - /// 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 onPremiseIotSensorName, 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 (onPremiseIotSensorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "onPremiseIotSensorName"); - } - 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("onPremiseIotSensorName", onPremiseIotSensorName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{onPremiseIotSensorName}", System.Uri.EscapeDataString(onPremiseIotSensorName)); - 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; - } - - /// - /// Create or update on-premise IoT sensor - /// - /// - /// Name of the on-premise IoT sensor - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string onPremiseIotSensorName, 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 (onPremiseIotSensorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "onPremiseIotSensorName"); - } - 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("onPremiseIotSensorName", onPremiseIotSensorName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{onPremiseIotSensorName}", System.Uri.EscapeDataString(onPremiseIotSensorName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Delete on-premise IoT sensor - /// - /// - /// Name of the on-premise IoT sensor - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task DeleteWithHttpMessagesAsync(string onPremiseIotSensorName, 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 (onPremiseIotSensorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "onPremiseIotSensorName"); - } - 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("onPremiseIotSensorName", onPremiseIotSensorName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{onPremiseIotSensorName}", System.Uri.EscapeDataString(onPremiseIotSensorName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Download sensor activation file - /// - /// - /// Name of the on-premise IoT sensor - /// - /// - /// 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> DownloadActivationWithHttpMessagesAsync(string onPremiseIotSensorName, 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 (onPremiseIotSensorName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "onPremiseIotSensorName"); - } - 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("onPremiseIotSensorName", onPremiseIotSensorName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "DownloadActivation", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/onPremiseIotSensors/{onPremiseIotSensorName}/downloadActivation").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{onPremiseIotSensorName}", System.Uri.EscapeDataString(onPremiseIotSensorName)); - List _queryParameters = new List(); - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, 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) - { - _result.Body = await _httpResponse.Content.ReadAsStreamAsync().ConfigureAwait(false); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/OnPremiseIotSensorsOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/OnPremiseIotSensorsOperationsExtensions.cs deleted file mode 100644 index 47615b98c03c..000000000000 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/OnPremiseIotSensorsOperationsExtensions.cs +++ /dev/null @@ -1,186 +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.IO; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for OnPremiseIotSensorsOperations. - /// - public static partial class OnPremiseIotSensorsOperationsExtensions - { - /// - /// List on-premise IoT sensors - /// - /// - /// The operations group for this extension method. - /// - public static OnPremiseIotSensorsList List(this IOnPremiseIotSensorsOperations operations) - { - return operations.ListAsync().GetAwaiter().GetResult(); - } - - /// - /// List on-premise IoT sensors - /// - /// - /// The operations group for this extension method. - /// - /// - /// The cancellation token. - /// - public static async Task ListAsync(this IOnPremiseIotSensorsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Get on-premise IoT sensor - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the on-premise IoT sensor - /// - public static OnPremiseIotSensor Get(this IOnPremiseIotSensorsOperations operations, string onPremiseIotSensorName) - { - return operations.GetAsync(onPremiseIotSensorName).GetAwaiter().GetResult(); - } - - /// - /// Get on-premise IoT sensor - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the on-premise IoT sensor - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IOnPremiseIotSensorsOperations operations, string onPremiseIotSensorName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(onPremiseIotSensorName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Create or update on-premise IoT sensor - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the on-premise IoT sensor - /// - public static OnPremiseIotSensor CreateOrUpdate(this IOnPremiseIotSensorsOperations operations, string onPremiseIotSensorName) - { - return operations.CreateOrUpdateAsync(onPremiseIotSensorName).GetAwaiter().GetResult(); - } - - /// - /// Create or update on-premise IoT sensor - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the on-premise IoT sensor - /// - /// - /// The cancellation token. - /// - public static async Task CreateOrUpdateAsync(this IOnPremiseIotSensorsOperations operations, string onPremiseIotSensorName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(onPremiseIotSensorName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Delete on-premise IoT sensor - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the on-premise IoT sensor - /// - public static void Delete(this IOnPremiseIotSensorsOperations operations, string onPremiseIotSensorName) - { - operations.DeleteAsync(onPremiseIotSensorName).GetAwaiter().GetResult(); - } - - /// - /// Delete on-premise IoT sensor - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the on-premise IoT sensor - /// - /// - /// The cancellation token. - /// - public static async Task DeleteAsync(this IOnPremiseIotSensorsOperations operations, string onPremiseIotSensorName, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.DeleteWithHttpMessagesAsync(onPremiseIotSensorName, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Download sensor activation file - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the on-premise IoT sensor - /// - public static Stream DownloadActivation(this IOnPremiseIotSensorsOperations operations, string onPremiseIotSensorName) - { - return operations.DownloadActivationAsync(onPremiseIotSensorName).GetAwaiter().GetResult(); - } - - /// - /// Download sensor activation file - /// - /// - /// The operations group for this extension method. - /// - /// - /// Name of the on-premise IoT sensor - /// - /// - /// The cancellation token. - /// - public static async Task DownloadActivationAsync(this IOnPremiseIotSensorsOperations operations, string onPremiseIotSensorName, CancellationToken cancellationToken = default(CancellationToken)) - { - var _result = await operations.DownloadActivationWithHttpMessagesAsync(onPremiseIotSensorName, null, cancellationToken).ConfigureAwait(false); - _result.Request.Dispose(); - return _result.Body; - } - - } -} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs index 19968c9a9ea6..388707a2fd3c 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs @@ -22,7 +22,7 @@ public static IEnumerable> ApiInfo_SecurityCenter new Tuple("Security", "AdaptiveApplicationControls", "2020-01-01"), new Tuple("Security", "AdaptiveNetworkHardenings", "2020-01-01"), new Tuple("Security", "AdvancedThreatProtection", "2019-01-01"), - new Tuple("Security", "Alerts", "2020-01-01"), + new Tuple("Security", "Alerts", "2021-01-01"), new Tuple("Security", "AlertsSuppressionRules", "2019-01-01-preview"), new Tuple("Security", "AllowedConnections", "2020-01-01"), new Tuple("Security", "Assessments", "2020-01-01"), @@ -32,30 +32,17 @@ public static IEnumerable> ApiInfo_SecurityCenter new Tuple("Security", "ComplianceResults", "2017-08-01"), new Tuple("Security", "Compliances", "2017-08-01-preview"), new Tuple("Security", "Connectors", "2020-01-01-preview"), - new Tuple("Security", "Device", "2020-08-06-preview"), new Tuple("Security", "DeviceSecurityGroups", "2019-08-01"), - new Tuple("Security", "DevicesForHub", "2020-08-06-preview"), - new Tuple("Security", "DevicesForSubscription", "2020-08-06-preview"), new Tuple("Security", "DiscoveredSecuritySolutions", "2020-01-01"), new Tuple("Security", "ExternalSecuritySolutions", "2020-01-01"), new Tuple("Security", "InformationProtectionPolicies", "2017-08-01-preview"), - new Tuple("Security", "IotAlertTypes", "2019-08-01"), - new Tuple("Security", "IotAlertTypes", "2020-08-06-preview"), - new Tuple("Security", "IotAlerts", "2019-08-01"), - new Tuple("Security", "IotAlerts", "2020-08-06-preview"), - new Tuple("Security", "IotDefenderSettings", "2020-08-06-preview"), - new Tuple("Security", "IotRecommendationTypes", "2019-08-01"), - new Tuple("Security", "IotRecommendationTypes", "2020-08-06-preview"), - new Tuple("Security", "IotRecommendations", "2019-08-01"), - new Tuple("Security", "IotRecommendations", "2020-08-06-preview"), + new Tuple("Security", "IngestionSettings", "2021-01-15-preview"), new Tuple("Security", "IotSecuritySolution", "2019-08-01"), new Tuple("Security", "IotSecuritySolutionAnalytics", "2019-08-01"), new Tuple("Security", "IotSecuritySolutionsAnalyticsAggregatedAlert", "2019-08-01"), new Tuple("Security", "IotSecuritySolutionsAnalyticsRecommendation", "2019-08-01"), - new Tuple("Security", "IotSensors", "2020-08-06-preview"), new Tuple("Security", "JitNetworkAccessPolicies", "2020-01-01"), new Tuple("Security", "Locations", "2015-06-01-preview"), - new Tuple("Security", "OnPremiseIotSensors", "2020-08-06-preview"), new Tuple("Security", "Operations", "2015-06-01-preview"), new Tuple("Security", "Pricings", "2018-06-01"), new Tuple("Security", "RegulatoryComplianceAssessments", "2019-01-01-preview"), @@ -68,7 +55,8 @@ public static IEnumerable> ApiInfo_SecurityCenter new Tuple("Security", "SecuritySolutions", "2020-01-01"), new Tuple("Security", "SecuritySolutionsReferenceData", "2020-01-01"), new Tuple("Security", "ServerVulnerabilityAssessment", "2020-01-01"), - new Tuple("Security", "Settings", "2019-01-01"), + new Tuple("Security", "Settings", "2021-07-01"), + new Tuple("Security", "SoftwareInventories", "2021-05-01-preview"), new Tuple("Security", "SqlVulnerabilityAssessmentBaselineRules", "2020-07-01-preview"), new Tuple("Security", "SqlVulnerabilityAssessmentScanResults", "2020-07-01-preview"), new Tuple("Security", "SqlVulnerabilityAssessmentScans", "2020-07-01-preview"), @@ -80,16 +68,5 @@ public static IEnumerable> ApiInfo_SecurityCenter }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/security/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\Rome\\apiVteam\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "32b4d058d54d206bdf6b336677a3182feab7c07b"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SecurityCenterClient.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SecurityCenterClient.cs index fa6209f9af3b..d987a9b88202 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SecurityCenterClient.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SecurityCenterClient.cs @@ -86,11 +86,6 @@ public partial class SecurityCenterClient : ServiceClient, /// public virtual IPricingsOperations Pricings { get; private set; } - /// - /// Gets the ISettingsOperations. - /// - public virtual ISettingsOperations Settings { get; private set; } - /// /// Gets the IAdvancedThreatProtectionOperations. /// @@ -121,26 +116,6 @@ public partial class SecurityCenterClient : ServiceClient, /// public virtual IIotSecuritySolutionsAnalyticsRecommendationOperations IotSecuritySolutionsAnalyticsRecommendation { get; private set; } - /// - /// Gets the IIotAlertTypesOperations. - /// - public virtual IIotAlertTypesOperations IotAlertTypes { get; private set; } - - /// - /// Gets the IIotAlertsOperations. - /// - public virtual IIotAlertsOperations IotAlerts { get; private set; } - - /// - /// Gets the IIotRecommendationTypesOperations. - /// - public virtual IIotRecommendationTypesOperations IotRecommendationTypes { get; private set; } - - /// - /// Gets the IIotRecommendationsOperations. - /// - public virtual IIotRecommendationsOperations IotRecommendations { get; private set; } - /// /// Gets the ILocationsOperations. /// @@ -246,11 +221,6 @@ public partial class SecurityCenterClient : ServiceClient, /// public virtual ITopologyOperations Topology { get; private set; } - /// - /// Gets the IAlertsOperations. - /// - public virtual IAlertsOperations Alerts { get; private set; } - /// /// Gets the IJitNetworkAccessPoliciesOperations. /// @@ -312,34 +282,24 @@ public partial class SecurityCenterClient : ServiceClient, public virtual ISqlVulnerabilityAssessmentBaselineRulesOperations SqlVulnerabilityAssessmentBaselineRules { get; private set; } /// - /// Gets the IIotDefenderSettingsOperations. - /// - public virtual IIotDefenderSettingsOperations IotDefenderSettings { get; private set; } - - /// - /// Gets the IIotSensorsOperations. - /// - public virtual IIotSensorsOperations IotSensors { get; private set; } - - /// - /// Gets the IDevicesForSubscriptionOperations. + /// Gets the IAlertsOperations. /// - public virtual IDevicesForSubscriptionOperations DevicesForSubscription { get; private set; } + public virtual IAlertsOperations Alerts { get; private set; } /// - /// Gets the IDevicesForHubOperations. + /// Gets the ISettingsOperations. /// - public virtual IDevicesForHubOperations DevicesForHub { get; private set; } + public virtual ISettingsOperations Settings { get; private set; } /// - /// Gets the IDeviceOperations. + /// Gets the IIngestionSettingsOperations. /// - public virtual IDeviceOperations Device { get; private set; } + public virtual IIngestionSettingsOperations IngestionSettings { get; private set; } /// - /// Gets the IOnPremiseIotSensorsOperations. + /// Gets the ISoftwareInventoriesOperations. /// - public virtual IOnPremiseIotSensorsOperations OnPremiseIotSensors { get; private set; } + public virtual ISoftwareInventoriesOperations SoftwareInventories { get; private set; } /// /// Initializes a new instance of the SecurityCenterClient class. @@ -584,17 +544,12 @@ private void Initialize() { ComplianceResults = new ComplianceResultsOperations(this); Pricings = new PricingsOperations(this); - Settings = new SettingsOperations(this); AdvancedThreatProtection = new AdvancedThreatProtectionOperations(this); DeviceSecurityGroups = new DeviceSecurityGroupsOperations(this); IotSecuritySolution = new IotSecuritySolutionOperations(this); IotSecuritySolutionAnalytics = new IotSecuritySolutionAnalyticsOperations(this); IotSecuritySolutionsAnalyticsAggregatedAlert = new IotSecuritySolutionsAnalyticsAggregatedAlertOperations(this); IotSecuritySolutionsAnalyticsRecommendation = new IotSecuritySolutionsAnalyticsRecommendationOperations(this); - IotAlertTypes = new IotAlertTypesOperations(this); - IotAlerts = new IotAlertsOperations(this); - IotRecommendationTypes = new IotRecommendationTypesOperations(this); - IotRecommendations = new IotRecommendationsOperations(this); Locations = new LocationsOperations(this); Operations = new Operations(this); Tasks = new TasksOperations(this); @@ -616,7 +571,6 @@ private void Initialize() AdaptiveNetworkHardenings = new AdaptiveNetworkHardeningsOperations(this); AllowedConnections = new AllowedConnectionsOperations(this); Topology = new TopologyOperations(this); - Alerts = new AlertsOperations(this); JitNetworkAccessPolicies = new JitNetworkAccessPoliciesOperations(this); DiscoveredSecuritySolutions = new DiscoveredSecuritySolutionsOperations(this); SecuritySolutionsReferenceData = new SecuritySolutionsReferenceDataOperations(this); @@ -629,12 +583,10 @@ private void Initialize() SqlVulnerabilityAssessmentScans = new SqlVulnerabilityAssessmentScansOperations(this); SqlVulnerabilityAssessmentScanResults = new SqlVulnerabilityAssessmentScanResultsOperations(this); SqlVulnerabilityAssessmentBaselineRules = new SqlVulnerabilityAssessmentBaselineRulesOperations(this); - IotDefenderSettings = new IotDefenderSettingsOperations(this); - IotSensors = new IotSensorsOperations(this); - DevicesForSubscription = new DevicesForSubscriptionOperations(this); - DevicesForHub = new DevicesForHubOperations(this); - Device = new DeviceOperations(this); - OnPremiseIotSensors = new OnPremiseIotSensorsOperations(this); + Alerts = new AlertsOperations(this); + Settings = new SettingsOperations(this); + IngestionSettings = new IngestionSettingsOperations(this); + SoftwareInventories = new SoftwareInventoriesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; @@ -665,8 +617,6 @@ private void Initialize() new Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("ruleType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("ruleType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("source")); @@ -675,12 +625,16 @@ private void Initialize() DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("assessedResourceType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("actionType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("actionType")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("authenticationType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("authenticationType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ServerVulnerabilityAssessmentOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ServerVulnerabilityAssessmentOperations.cs index 01d9a79676f6..cee80b002e95 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ServerVulnerabilityAssessmentOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ServerVulnerabilityAssessmentOperations.cs @@ -764,6 +764,35 @@ internal ServerVulnerabilityAssessmentOperations(SecurityCenterClient client) return _result; } + /// + /// Removing server vulnerability assessment from a resource. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The Namespace of the resource. + /// + /// + /// The type of the resource. + /// + /// + /// Name of the resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Removing server vulnerability assessment from a resource. /// @@ -798,7 +827,7 @@ internal ServerVulnerabilityAssessmentOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -858,7 +887,7 @@ internal ServerVulnerabilityAssessmentOperations(SecurityCenterClient client) tracingParameters.Add("serverVulnerabilityAssessment", serverVulnerabilityAssessment); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -932,7 +961,7 @@ internal ServerVulnerabilityAssessmentOperations(SecurityCenterClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ServerVulnerabilityAssessmentOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ServerVulnerabilityAssessmentOperationsExtensions.cs index 97efe1460c78..fd4c58871da3 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ServerVulnerabilityAssessmentOperationsExtensions.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ServerVulnerabilityAssessmentOperationsExtensions.cs @@ -240,5 +240,56 @@ public static void Delete(this IServerVulnerabilityAssessmentOperations operatio (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Removing server vulnerability assessment from a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The Namespace of the resource. + /// + /// + /// The type of the resource. + /// + /// + /// Name of the resource. + /// + public static void BeginDelete(this IServerVulnerabilityAssessmentOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName) + { + operations.BeginDeleteAsync(resourceGroupName, resourceNamespace, resourceType, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Removing server vulnerability assessment from a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The Namespace of the resource. + /// + /// + /// The type of the resource. + /// + /// + /// Name of the resource. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IServerVulnerabilityAssessmentOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SettingsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SettingsOperations.cs index d989cf712ee9..68953ec2e798 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SettingsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SettingsOperations.cs @@ -87,7 +87,7 @@ internal SettingsOperations(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 = "2019-01-01"; + string apiVersion = "2021-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -237,7 +237,8 @@ internal SettingsOperations(SecurityCenterClient client) /// Settings of different configurations in security center /// /// - /// Name of setting: (MCAS/WDATP). Possible values include: 'MCAS', 'WDATP' + /// The name of the setting. Possible values include: 'MCAS', 'WDATP', + /// 'WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW', 'Sentinel' /// /// /// Headers that will be added to request. @@ -277,7 +278,7 @@ internal SettingsOperations(SecurityCenterClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "settingName"); } - string apiVersion = "2019-01-01"; + string apiVersion = "2021-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -429,7 +430,8 @@ internal SettingsOperations(SecurityCenterClient client) /// updating settings about different configurations in security center /// /// - /// Name of setting: (MCAS/WDATP). Possible values include: 'MCAS', 'WDATP' + /// The name of the setting. Possible values include: 'MCAS', 'WDATP', + /// 'WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW', 'Sentinel' /// /// /// Setting object @@ -476,7 +478,7 @@ internal SettingsOperations(SecurityCenterClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "setting"); } - string apiVersion = "2019-01-01"; + string apiVersion = "2021-07-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SettingsOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SettingsOperationsExtensions.cs index ebda219dd299..5a07659a7ca4 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SettingsOperationsExtensions.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SettingsOperationsExtensions.cs @@ -56,7 +56,8 @@ public static IPage List(this ISettingsOperations operations) /// The operations group for this extension method. /// /// - /// Name of setting: (MCAS/WDATP). Possible values include: 'MCAS', 'WDATP' + /// The name of the setting. Possible values include: 'MCAS', 'WDATP', + /// 'WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW', 'Sentinel' /// public static Setting Get(this ISettingsOperations operations, string settingName) { @@ -70,7 +71,8 @@ public static Setting Get(this ISettingsOperations operations, string settingNam /// The operations group for this extension method. /// /// - /// Name of setting: (MCAS/WDATP). Possible values include: 'MCAS', 'WDATP' + /// The name of the setting. Possible values include: 'MCAS', 'WDATP', + /// 'WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW', 'Sentinel' /// /// /// The cancellation token. @@ -90,7 +92,8 @@ public static Setting Get(this ISettingsOperations operations, string settingNam /// The operations group for this extension method. /// /// - /// Name of setting: (MCAS/WDATP). Possible values include: 'MCAS', 'WDATP' + /// The name of the setting. Possible values include: 'MCAS', 'WDATP', + /// 'WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW', 'Sentinel' /// /// /// Setting object @@ -107,7 +110,8 @@ public static Setting Update(this ISettingsOperations operations, string setting /// The operations group for this extension method. /// /// - /// Name of setting: (MCAS/WDATP). Possible values include: 'MCAS', 'WDATP' + /// The name of the setting. Possible values include: 'MCAS', 'WDATP', + /// 'WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW', 'Sentinel' /// /// /// Setting object diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotDefenderSettingsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SoftwareInventoriesOperations.cs similarity index 80% rename from sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotDefenderSettingsOperations.cs rename to sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SoftwareInventoriesOperations.cs index 40ddad2dc077..79f3935d59fa 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IotDefenderSettingsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SoftwareInventoriesOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.Security using System.Threading.Tasks; /// - /// IotDefenderSettingsOperations operations. + /// SoftwareInventoriesOperations operations. /// - internal partial class IotDefenderSettingsOperations : IServiceOperations, IIotDefenderSettingsOperations + internal partial class SoftwareInventoriesOperations : IServiceOperations, ISoftwareInventoriesOperations { /// - /// Initializes a new instance of the IotDefenderSettingsOperations class. + /// Initializes a new instance of the SoftwareInventoriesOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class IotDefenderSettingsOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal IotDefenderSettingsOperations(SecurityCenterClient client) + internal SoftwareInventoriesOperations(SecurityCenterClient client) { if (client == null) { @@ -51,8 +51,21 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) public SecurityCenterClient Client { get; private set; } /// - /// List IoT Defender Settings + /// Gets the software inventory of the virtual machine. /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The namespace of the resource. + /// + /// + /// The type of the resource. + /// + /// + /// Name of the resource. + /// /// /// Headers that will be added to request. /// @@ -74,7 +87,7 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByExtendedResourceWithHttpMessagesAsync(string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -87,7 +100,38 @@ internal IotDefenderSettingsOperations(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-08-06-preview"; + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (resourceNamespace == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceNamespace"); + } + if (resourceType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceType"); + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); + } + string apiVersion = "2021-05-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -95,14 +139,22 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceNamespace", resourceNamespace); + tracingParameters.Add("resourceType", resourceType); + tracingParameters.Add("resourceName", resourceName); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByExtendedResource", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceNamespace}", System.Uri.EscapeDataString(resourceNamespace)); + _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -201,7 +253,7 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -214,7 +266,7 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -234,7 +286,7 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) } /// - /// Get IoT Defender Settings + /// Gets the software inventory of all virtual machines in the subscriptions. /// /// /// Headers that will be added to request. @@ -257,7 +309,7 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -270,7 +322,7 @@ internal IotDefenderSettingsOperations(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-08-06-preview"; + string apiVersion = "2021-05-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -280,11 +332,11 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); if (apiVersion != null) @@ -384,7 +436,7 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -397,7 +449,7 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -417,14 +469,23 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) } /// - /// Create or update IoT Defender settings + /// Gets a single software data of the virtual machine. /// - /// - /// Size of the device quota (as a opposed to a Pay as You Go billing model). - /// Value is required to be in multiples of 1000. + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The namespace of the resource. /// - /// - /// Sentinel Workspace Resource Ids + /// + /// The type of the resource. + /// + /// + /// Name of the resource. + /// + /// + /// Name of the installed software. /// /// /// Headers that will be added to request. @@ -447,7 +508,7 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(int deviceQuota, IList sentinelWorkspaceResourceIds, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string softwareName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -460,21 +521,42 @@ internal IotDefenderSettingsOperations(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}$"); } } - if (deviceQuota < 1000) + if (resourceGroupName == null) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "deviceQuota", 1000); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (sentinelWorkspaceResourceIds == null) + if (resourceGroupName != null) { - throw new ValidationException(ValidationRules.CannotBeNull, "sentinelWorkspaceResourceIds"); + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (resourceNamespace == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceNamespace"); + } + if (resourceType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceType"); + } + if (resourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceName"); } - string apiVersion = "2020-08-06-preview"; - IotDefenderSettingsModel iotDefenderSettingsModel = new IotDefenderSettingsModel(); - if (sentinelWorkspaceResourceIds != null) + if (softwareName == null) { - iotDefenderSettingsModel.DeviceQuota = deviceQuota; - iotDefenderSettingsModel.SentinelWorkspaceResourceIds = sentinelWorkspaceResourceIds; + throw new ValidationException(ValidationRules.CannotBeNull, "softwareName"); } + string apiVersion = "2021-05-01-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -482,15 +564,24 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceNamespace", resourceNamespace); + tracingParameters.Add("resourceType", resourceType); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("softwareName", softwareName); tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("iotDefenderSettingsModel", iotDefenderSettingsModel); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{resourceNamespace}", System.Uri.EscapeDataString(resourceNamespace)); + _url = _url.Replace("{resourceType}", System.Uri.EscapeDataString(resourceType)); + _url = _url.Replace("{resourceName}", System.Uri.EscapeDataString(resourceName)); + _url = _url.Replace("{softwareName}", System.Uri.EscapeDataString(softwareName)); List _queryParameters = new List(); if (apiVersion != null) { @@ -503,7 +594,7 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -534,12 +625,6 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) // Serialize Request string _requestContent = null; - if(iotDefenderSettingsModel != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(iotDefenderSettingsModel, 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) { @@ -560,7 +645,7 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -595,7 +680,7 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -608,25 +693,7 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -646,8 +713,11 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) } /// - /// Delete IoT Defender settings + /// Gets the software inventory of the virtual machine. /// + /// + /// The NextLink from the previous successful call to List operation. + /// /// /// Headers that will be added to request. /// @@ -657,6 +727,9 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -666,20 +739,12 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task DeleteWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListByExtendedResourceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) + if (nextPageLink == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } - 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; @@ -687,19 +752,14 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByExtendedResourceNext", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); 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); @@ -707,7 +767,7 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -758,7 +818,7 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -793,13 +853,31 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _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); @@ -808,8 +886,11 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) } /// - /// Information about downloadable packages + /// Gets the software inventory of all virtual machines in the subscriptions. /// + /// + /// The NextLink from the previous successful call to List operation. + /// /// /// Headers that will be added to request. /// @@ -831,20 +912,12 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task> PackageDownloadsMethodWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (Client.SubscriptionId != null) + if (nextPageLink == 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}$"); - } + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } - string apiVersion = "2020-08-06-preview"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -852,19 +925,14 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "PackageDownloadsMethod", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionNext", tracingParameters); } // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/iotDefenderSettings/default/packageDownloads").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); 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); @@ -872,7 +940,7 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -958,7 +1026,7 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -971,7 +1039,7 @@ internal IotDefenderSettingsOperations(SecurityCenterClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SoftwareInventoriesOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SoftwareInventoriesOperationsExtensions.cs new file mode 100644 index 000000000000..622f67f67bc9 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SoftwareInventoriesOperationsExtensions.cs @@ -0,0 +1,235 @@ +// +// 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 SoftwareInventoriesOperations. + /// + public static partial class SoftwareInventoriesOperationsExtensions + { + /// + /// Gets the software inventory of the virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The namespace of the resource. + /// + /// + /// The type of the resource. + /// + /// + /// Name of the resource. + /// + public static IPage ListByExtendedResource(this ISoftwareInventoriesOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName) + { + return operations.ListByExtendedResourceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets the software inventory of the virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The namespace of the resource. + /// + /// + /// The type of the resource. + /// + /// + /// Name of the resource. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByExtendedResourceAsync(this ISoftwareInventoriesOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByExtendedResourceWithHttpMessagesAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the software inventory of all virtual machines in the subscriptions. + /// + /// + /// The operations group for this extension method. + /// + public static IPage ListBySubscription(this ISoftwareInventoriesOperations operations) + { + return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets the software inventory of all virtual machines in the subscriptions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionAsync(this ISoftwareInventoriesOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a single software data of the virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The namespace of the resource. + /// + /// + /// The type of the resource. + /// + /// + /// Name of the resource. + /// + /// + /// Name of the installed software. + /// + public static Software Get(this ISoftwareInventoriesOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string softwareName) + { + return operations.GetAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName).GetAwaiter().GetResult(); + } + + /// + /// Gets a single software data of the virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group within the user's subscription. The name is + /// case insensitive. + /// + /// + /// The namespace of the resource. + /// + /// + /// The type of the resource. + /// + /// + /// Name of the resource. + /// + /// + /// Name of the installed software. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISoftwareInventoriesOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string softwareName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the software inventory of the virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByExtendedResourceNext(this ISoftwareInventoriesOperations operations, string nextPageLink) + { + return operations.ListByExtendedResourceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the software inventory of the virtual machine. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByExtendedResourceNextAsync(this ISoftwareInventoriesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByExtendedResourceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the software inventory of all virtual machines in the subscriptions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySubscriptionNext(this ISoftwareInventoriesOperations operations, string nextPageLink) + { + return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the software inventory of all virtual machines in the subscriptions. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionNextAsync(this ISoftwareInventoriesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +}