diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AdaptiveApplicationControlsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AdaptiveApplicationControlsOperations.cs index 32f99eec7b498..060e4dda85ce9 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AdaptiveApplicationControlsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AdaptiveApplicationControlsOperations.cs @@ -657,5 +657,181 @@ internal AdaptiveApplicationControlsOperations(SecurityCenterClient client) return _result; } + /// + /// Delete an application control VM/server group + /// + /// + /// Name of an application control VM/server group + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task DeleteWithHttpMessagesAsync(string groupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.SubscriptionId != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Client.SubscriptionId, "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "Client.SubscriptionId", "^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$"); + } + } + if (Client.AscLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); + } + if (groupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "groupName"); + } + string apiVersion = "2015-06-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("groupName", groupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{ascLocation}", System.Uri.EscapeDataString(Client.AscLocation)); + _url = _url.Replace("{groupName}", System.Uri.EscapeDataString(groupName)); + 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 != 202 && (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; + } + } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AdaptiveApplicationControlsOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AdaptiveApplicationControlsOperationsExtensions.cs index 853291accad27..7fc7b6c141e07 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AdaptiveApplicationControlsOperationsExtensions.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AdaptiveApplicationControlsOperationsExtensions.cs @@ -135,5 +135,36 @@ public static AppWhitelistingGroup Put(this IAdaptiveApplicationControlsOperatio } } + /// + /// Delete an application control VM/server group + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an application control VM/server group + /// + public static void Delete(this IAdaptiveApplicationControlsOperations operations, string groupName) + { + operations.DeleteAsync(groupName).GetAwaiter().GetResult(); + } + + /// + /// Delete an application control VM/server group + /// + /// + /// The operations group for this extension method. + /// + /// + /// Name of an application control VM/server group + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IAdaptiveApplicationControlsOperations operations, string groupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(groupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AdaptiveNetworkHardeningsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AdaptiveNetworkHardeningsOperations.cs new file mode 100644 index 0000000000000..b40d5fa63f44b --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AdaptiveNetworkHardeningsOperations.cs @@ -0,0 +1,1003 @@ +// +// 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; + + /// + /// AdaptiveNetworkHardeningsOperations operations. + /// + internal partial class AdaptiveNetworkHardeningsOperations : IServiceOperations, IAdaptiveNetworkHardeningsOperations + { + /// + /// Initializes a new instance of the AdaptiveNetworkHardeningsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AdaptiveNetworkHardeningsOperations(SecurityCenterClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the SecurityCenterClient + /// + public SecurityCenterClient Client { get; private set; } + + /// + /// Gets a list of Adaptive Network Hardenings resources in scope of an + /// extended 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. + /// + /// + /// 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>> ListByExtendedResourceWithHttpMessagesAsync(string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, 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 (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-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceNamespace", resourceNamespace); + tracingParameters.Add("resourceType", resourceType); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + 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}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings").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) + { + _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; + } + + /// + /// Gets a single Adaptive Network Hardening 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 name of the Adaptive Network Hardening resource. + /// + /// + /// 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 resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, 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 (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"); + } + if (adaptiveNetworkHardeningResourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "adaptiveNetworkHardeningResourceName"); + } + string apiVersion = "2020-01-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("resourceNamespace", resourceNamespace); + tracingParameters.Add("resourceType", resourceType); + tracingParameters.Add("resourceName", resourceName); + tracingParameters.Add("adaptiveNetworkHardeningResourceName", adaptiveNetworkHardeningResourceName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}").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("{adaptiveNetworkHardeningResourceName}", System.Uri.EscapeDataString(adaptiveNetworkHardeningResourceName)); + 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; + } + + /// + /// Enforces the given rules on the NSG(s) listed in the request + /// + /// + /// 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 name of the Adaptive Network Hardening resource. + /// + /// + /// The rules to enforce + /// + /// + /// The Azure resource IDs of the effective network security groups that will + /// be updated with the created security rules from the Adaptive Network + /// Hardening rules + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task EnforceWithHttpMessagesAsync(string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, IList rules, IList networkSecurityGroups, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginEnforceWithHttpMessagesAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, rules, networkSecurityGroups, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Enforces the given rules on the NSG(s) listed in the request + /// + /// + /// 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 name of the Adaptive Network Hardening resource. + /// + /// + /// The rules to enforce + /// + /// + /// The Azure resource IDs of the effective network security groups that will + /// be updated with the created security rules from the Adaptive Network + /// Hardening rules + /// + /// + /// 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 BeginEnforceWithHttpMessagesAsync(string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, IList rules, IList networkSecurityGroups, 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 (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"); + } + if (adaptiveNetworkHardeningResourceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "adaptiveNetworkHardeningResourceName"); + } + if (rules == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "rules"); + } + if (networkSecurityGroups == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "networkSecurityGroups"); + } + string adaptiveNetworkHardeningEnforceAction = "enforce"; + string apiVersion = "2020-01-01"; + AdaptiveNetworkHardeningEnforceRequest body = new AdaptiveNetworkHardeningEnforceRequest(); + if (rules != null || networkSecurityGroups != null) + { + body.Rules = rules; + body.NetworkSecurityGroups = networkSecurityGroups; + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _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("adaptiveNetworkHardeningResourceName", adaptiveNetworkHardeningResourceName); + tracingParameters.Add("adaptiveNetworkHardeningEnforceAction", adaptiveNetworkHardeningEnforceAction); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginEnforce", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}").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("{adaptiveNetworkHardeningResourceName}", System.Uri.EscapeDataString(adaptiveNetworkHardeningResourceName)); + _url = _url.Replace("{adaptiveNetworkHardeningEnforceAction}", System.Uri.EscapeDataString(adaptiveNetworkHardeningEnforceAction)); + 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(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 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; + } + + /// + /// Gets a list of Adaptive Network Hardenings resources in scope of an + /// extended 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>> ListByExtendedResourceNextWithHttpMessagesAsync(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, "ListByExtendedResourceNext", 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/AdaptiveNetworkHardeningsOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AdaptiveNetworkHardeningsOperationsExtensions.cs new file mode 100644 index 0000000000000..1f698f88bf8a7 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AdaptiveNetworkHardeningsOperationsExtensions.cs @@ -0,0 +1,325 @@ +// +// 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 AdaptiveNetworkHardeningsOperations. + /// + public static partial class AdaptiveNetworkHardeningsOperationsExtensions + { + /// + /// Gets a list of Adaptive Network Hardenings resources in scope of an + /// extended 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 IPage ListByExtendedResource(this IAdaptiveNetworkHardeningsOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName) + { + return operations.ListByExtendedResourceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of Adaptive Network Hardenings resources in scope of an + /// extended 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> ListByExtendedResourceAsync(this IAdaptiveNetworkHardeningsOperations 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 a single Adaptive Network Hardening 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 name of the Adaptive Network Hardening resource. + /// + public static AdaptiveNetworkHardening Get(this IAdaptiveNetworkHardeningsOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName) + { + return operations.GetAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName).GetAwaiter().GetResult(); + } + + /// + /// Gets a single Adaptive Network Hardening 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 name of the Adaptive Network Hardening resource. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IAdaptiveNetworkHardeningsOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Enforces the given rules on the NSG(s) listed in the request + /// + /// + /// 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 name of the Adaptive Network Hardening resource. + /// + /// + /// The rules to enforce + /// + /// + /// The Azure resource IDs of the effective network security groups that will + /// be updated with the created security rules from the Adaptive Network + /// Hardening rules + /// + public static void Enforce(this IAdaptiveNetworkHardeningsOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, IList rules, IList networkSecurityGroups) + { + operations.EnforceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, rules, networkSecurityGroups).GetAwaiter().GetResult(); + } + + /// + /// Enforces the given rules on the NSG(s) listed in the request + /// + /// + /// 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 name of the Adaptive Network Hardening resource. + /// + /// + /// The rules to enforce + /// + /// + /// The Azure resource IDs of the effective network security groups that will + /// be updated with the created security rules from the Adaptive Network + /// Hardening rules + /// + /// + /// The cancellation token. + /// + public static async Task EnforceAsync(this IAdaptiveNetworkHardeningsOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, IList rules, IList networkSecurityGroups, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.EnforceWithHttpMessagesAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, rules, networkSecurityGroups, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Enforces the given rules on the NSG(s) listed in the request + /// + /// + /// 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 name of the Adaptive Network Hardening resource. + /// + /// + /// The rules to enforce + /// + /// + /// The Azure resource IDs of the effective network security groups that will + /// be updated with the created security rules from the Adaptive Network + /// Hardening rules + /// + public static void BeginEnforce(this IAdaptiveNetworkHardeningsOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, IList rules, IList networkSecurityGroups) + { + operations.BeginEnforceAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, rules, networkSecurityGroups).GetAwaiter().GetResult(); + } + + /// + /// Enforces the given rules on the NSG(s) listed in the request + /// + /// + /// 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 name of the Adaptive Network Hardening resource. + /// + /// + /// The rules to enforce + /// + /// + /// The Azure resource IDs of the effective network security groups that will + /// be updated with the created security rules from the Adaptive Network + /// Hardening rules + /// + /// + /// The cancellation token. + /// + public static async Task BeginEnforceAsync(this IAdaptiveNetworkHardeningsOperations operations, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, IList rules, IList networkSecurityGroups, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginEnforceWithHttpMessagesAsync(resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, rules, networkSecurityGroups, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a list of Adaptive Network Hardenings resources in scope of an + /// extended resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByExtendedResourceNext(this IAdaptiveNetworkHardeningsOperations operations, string nextPageLink) + { + return operations.ListByExtendedResourceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a list of Adaptive Network Hardenings resources in scope of an + /// extended 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> ListByExtendedResourceNextAsync(this IAdaptiveNetworkHardeningsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByExtendedResourceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AllowedConnectionsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AllowedConnectionsOperations.cs index b71a319d63c6d..683054249d40a 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AllowedConnectionsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AllowedConnectionsOperations.cs @@ -88,7 +88,7 @@ internal AllowedConnectionsOperations(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 = "2015-06-01-preview"; + string apiVersion = "2020-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -276,7 +276,7 @@ internal AllowedConnectionsOperations(SecurityCenterClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); } - string apiVersion = "2015-06-01-preview"; + string apiVersion = "2020-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -496,7 +496,7 @@ internal AllowedConnectionsOperations(SecurityCenterClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "connectionType"); } - string apiVersion = "2015-06-01-preview"; + string apiVersion = "2020-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IAdaptiveApplicationControlsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IAdaptiveApplicationControlsOperations.cs index 1712fb74f5dc1..4cbd277b7c358 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IAdaptiveApplicationControlsOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IAdaptiveApplicationControlsOperations.cs @@ -96,5 +96,24 @@ public partial interface IAdaptiveApplicationControlsOperations /// Thrown when a required parameter is null /// Task> PutWithHttpMessagesAsync(string groupName, AppWhitelistingPutGroupData body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete an application control VM/server group + /// + /// + /// Name of an application control VM/server group + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string groupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IAdaptiveNetworkHardeningsOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IAdaptiveNetworkHardeningsOperations.cs new file mode 100644 index 0000000000000..4b9f355f44a66 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IAdaptiveNetworkHardeningsOperations.cs @@ -0,0 +1,198 @@ +// +// 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; + + /// + /// AdaptiveNetworkHardeningsOperations operations. + /// + public partial interface IAdaptiveNetworkHardeningsOperations + { + /// + /// Gets a list of Adaptive Network Hardenings resources in scope of an + /// extended 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 unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByExtendedResourceWithHttpMessagesAsync(string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a single Adaptive Network Hardening 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 name of the Adaptive Network Hardening resource. + /// + /// + /// 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 resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Enforces the given rules on the NSG(s) listed in the request + /// + /// + /// 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 name of the Adaptive Network Hardening resource. + /// + /// + /// The rules to enforce + /// + /// + /// The Azure resource IDs of the effective network security groups + /// that will be updated with the created security rules from the + /// Adaptive Network Hardening rules + /// + /// + /// 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 EnforceWithHttpMessagesAsync(string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, IList rules, IList networkSecurityGroups, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Enforces the given rules on the NSG(s) listed in the request + /// + /// + /// 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 name of the Adaptive Network Hardening resource. + /// + /// + /// The rules to enforce + /// + /// + /// The Azure resource IDs of the effective network security groups + /// that will be updated with the created security rules from the + /// Adaptive Network Hardening rules + /// + /// + /// 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 BeginEnforceWithHttpMessagesAsync(string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, IList rules, IList networkSecurityGroups, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a list of Adaptive Network Hardenings resources in scope of an + /// extended 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>> ListByExtendedResourceNextWithHttpMessagesAsync(string nextPageLink, 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 933b86e14b6f2..dc8a715037775 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ISecurityCenterClient.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/ISecurityCenterClient.cs @@ -121,11 +121,6 @@ public partial interface ISecurityCenterClient : System.IDisposable /// IIotSecuritySolutionsAnalyticsRecommendationOperations IotSecuritySolutionsAnalyticsRecommendation { get; } - /// - /// Gets the IAllowedConnectionsOperations. - /// - IAllowedConnectionsOperations AllowedConnections { get; } - /// /// Gets the IDiscoveredSecuritySolutionsOperations. /// @@ -136,11 +131,6 @@ public partial interface ISecurityCenterClient : System.IDisposable /// IExternalSecuritySolutionsOperations ExternalSecuritySolutions { get; } - /// - /// Gets the IJitNetworkAccessPoliciesOperations. - /// - IJitNetworkAccessPoliciesOperations JitNetworkAccessPolicies { get; } - /// /// Gets the IAdaptiveApplicationControlsOperations. /// @@ -161,11 +151,6 @@ public partial interface ISecurityCenterClient : System.IDisposable /// ITasksOperations Tasks { get; } - /// - /// Gets the ITopologyOperations. - /// - ITopologyOperations Topology { get; } - /// /// Gets the IAutoProvisioningSettingsOperations. /// @@ -231,5 +216,25 @@ public partial interface ISecurityCenterClient : System.IDisposable /// IAssessmentsOperations Assessments { get; } + /// + /// Gets the IAdaptiveNetworkHardeningsOperations. + /// + IAdaptiveNetworkHardeningsOperations AdaptiveNetworkHardenings { get; } + + /// + /// Gets the IAllowedConnectionsOperations. + /// + IAllowedConnectionsOperations AllowedConnections { get; } + + /// + /// Gets the ITopologyOperations. + /// + ITopologyOperations Topology { get; } + + /// + /// Gets the IJitNetworkAccessPoliciesOperations. + /// + IJitNetworkAccessPoliciesOperations JitNetworkAccessPolicies { get; } + } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/JitNetworkAccessPoliciesOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/JitNetworkAccessPoliciesOperations.cs index 7b1095845e411..e600a09702061 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/JitNetworkAccessPoliciesOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/JitNetworkAccessPoliciesOperations.cs @@ -87,7 +87,7 @@ internal JitNetworkAccessPoliciesOperations(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 = "2015-06-01-preview"; + string apiVersion = "2020-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -275,7 +275,7 @@ internal JitNetworkAccessPoliciesOperations(SecurityCenterClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); } - string apiVersion = "2015-06-01-preview"; + string apiVersion = "2020-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -483,7 +483,7 @@ internal JitNetworkAccessPoliciesOperations(SecurityCenterClient client) throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); } } - string apiVersion = "2015-06-01-preview"; + string apiVersion = "2020-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -696,7 +696,7 @@ internal JitNetworkAccessPoliciesOperations(SecurityCenterClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); } - string apiVersion = "2015-06-01-preview"; + string apiVersion = "2020-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -917,7 +917,7 @@ internal JitNetworkAccessPoliciesOperations(SecurityCenterClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jitNetworkAccessPolicyName"); } - string apiVersion = "2015-06-01-preview"; + string apiVersion = "2020-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1149,7 +1149,7 @@ internal JitNetworkAccessPoliciesOperations(SecurityCenterClient client) { body.Validate(); } - string apiVersion = "2015-06-01-preview"; + string apiVersion = "2020-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1375,7 +1375,7 @@ internal JitNetworkAccessPoliciesOperations(SecurityCenterClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jitNetworkAccessPolicyName"); } - string apiVersion = "2015-06-01-preview"; + string apiVersion = "2020-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1600,7 +1600,7 @@ internal JitNetworkAccessPoliciesOperations(SecurityCenterClient client) } } string jitNetworkAccessPolicyInitiateType = "initiate"; - string apiVersion = "2015-06-01-preview"; + string apiVersion = "2020-01-01"; JitNetworkAccessPolicyInitiateRequest body = new JitNetworkAccessPolicyInitiateRequest(); if (virtualMachines != null || justification != null) { 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 new file mode 100644 index 0000000000000..3c4aefd5b0a4a --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ActiveConnectionsNotInAllowedRange.cs @@ -0,0 +1,66 @@ +// +// 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; + + /// + /// Number of active connections is not in allowed range. + /// + [Newtonsoft.Json.JsonObject("ActiveConnectionsNotInAllowedRange")] + public partial class ActiveConnectionsNotInAllowedRange : TimeWindowCustomAlertRule + { + /// + /// Initializes a new instance of the + /// ActiveConnectionsNotInAllowedRange class. + /// + public ActiveConnectionsNotInAllowedRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ActiveConnectionsNotInAllowedRange class. + /// + /// Status of the custom alert. + /// The minimum threshold. + /// The maximum threshold. + /// The time window size in iso8601 + /// format. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + public ActiveConnectionsNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) + : base(isEnabled, minThreshold, maxThreshold, timeWindowSize, displayName, description) + { + 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/AdaptiveNetworkHardening.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardening.cs new file mode 100644 index 0000000000000..f2f530b17ae7a --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardening.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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; + + /// + /// The resource whose properties describes the Adaptive Network Hardening + /// settings for some Azure resource + /// + [Rest.Serialization.JsonTransformation] + public partial class AdaptiveNetworkHardening : Resource + { + /// + /// Initializes a new instance of the AdaptiveNetworkHardening class. + /// + public AdaptiveNetworkHardening() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AdaptiveNetworkHardening class. + /// + /// Resource Id + /// Resource name + /// Resource type + /// The security rules which are recommended to be + /// effective on the VM + /// The UTC time on which the rules + /// were calculated + /// The Network Security + /// Groups effective on the network interfaces of the protected + /// resource + public AdaptiveNetworkHardening(string id = default(string), string name = default(string), string type = default(string), IList rules = default(IList), System.DateTime? rulesCalculationTime = default(System.DateTime?), IList effectiveNetworkSecurityGroups = default(IList)) + : base(id, name, type) + { + Rules = rules; + RulesCalculationTime = rulesCalculationTime; + EffectiveNetworkSecurityGroups = effectiveNetworkSecurityGroups; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the security rules which are recommended to be + /// effective on the VM + /// + [JsonProperty(PropertyName = "properties.rules")] + public IList Rules { get; set; } + + /// + /// Gets or sets the UTC time on which the rules were calculated + /// + [JsonProperty(PropertyName = "properties.rulesCalculationTime")] + public System.DateTime? RulesCalculationTime { get; set; } + + /// + /// Gets or sets the Network Security Groups effective on the network + /// interfaces of the protected resource + /// + [JsonProperty(PropertyName = "properties.effectiveNetworkSecurityGroups")] + public IList EffectiveNetworkSecurityGroups { get; set; } + + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningEnforceRequest.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningEnforceRequest.cs new file mode 100644 index 0000000000000..6ec2af5cda64c --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningEnforceRequest.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class AdaptiveNetworkHardeningEnforceRequest + { + /// + /// Initializes a new instance of the + /// AdaptiveNetworkHardeningEnforceRequest class. + /// + public AdaptiveNetworkHardeningEnforceRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AdaptiveNetworkHardeningEnforceRequest class. + /// + /// The rules to enforce + /// The Azure resource IDs of the + /// effective network security groups that will be updated with the + /// created security rules from the Adaptive Network Hardening + /// rules + public AdaptiveNetworkHardeningEnforceRequest(IList rules, IList networkSecurityGroups) + { + Rules = rules; + NetworkSecurityGroups = networkSecurityGroups; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the rules to enforce + /// + [JsonProperty(PropertyName = "rules")] + public IList Rules { get; set; } + + /// + /// Gets or sets the Azure resource IDs of the effective network + /// security groups that will be updated with the created security + /// rules from the Adaptive Network Hardening rules + /// + [JsonProperty(PropertyName = "networkSecurityGroups")] + public IList NetworkSecurityGroups { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Rules == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Rules"); + } + if (NetworkSecurityGroups == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "NetworkSecurityGroups"); + } + } + } +} 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 a052f822516ac..efcb3ced1b862 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,11 +10,13 @@ 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/AllowlistCustomAlertRule.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AllowlistCustomAlertRule.cs index 42ef3fe3761ce..9033e1abbffb7 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,6 +20,7 @@ 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 { /// @@ -34,7 +35,6 @@ public AllowlistCustomAlertRule() /// Initializes a new instance of the AllowlistCustomAlertRule class. /// /// Status of the custom alert. - /// The type of the custom alert rule. /// The values to allow. The format of /// the values depends on the rule type. /// The display name of the custom @@ -43,8 +43,8 @@ public AllowlistCustomAlertRule() /// alert. /// The value type of the items in the list. /// Possible values include: 'IpCidr', 'String' - public AllowlistCustomAlertRule(bool isEnabled, string ruleType, IList allowlistValues, string displayName = default(string), string description = default(string), string valueType = default(string)) - : base(isEnabled, ruleType, displayName, description, valueType) + public AllowlistCustomAlertRule(bool isEnabled, IList allowlistValues, string displayName = default(string), string description = default(string), string valueType = default(string)) + : base(isEnabled, displayName, description, valueType) { AllowlistValues = allowlistValues; CustomInit(); 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 new file mode 100644 index 0000000000000..83fcf7eef6d5e --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DMessagesNotInAllowedRange.cs @@ -0,0 +1,67 @@ +// +// 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; + + /// + /// Number of cloud to device messages (AMQP protocol) is not in allowed + /// range. + /// + [Newtonsoft.Json.JsonObject("AmqpC2DMessagesNotInAllowedRange")] + public partial class AmqpC2DMessagesNotInAllowedRange : TimeWindowCustomAlertRule + { + /// + /// Initializes a new instance of the AmqpC2DMessagesNotInAllowedRange + /// class. + /// + public AmqpC2DMessagesNotInAllowedRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AmqpC2DMessagesNotInAllowedRange + /// class. + /// + /// Status of the custom alert. + /// The minimum threshold. + /// The maximum threshold. + /// The time window size in iso8601 + /// format. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + public AmqpC2DMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) + : base(isEnabled, minThreshold, maxThreshold, timeWindowSize, displayName, description) + { + 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/AmqpC2DRejectedMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DRejectedMessagesNotInAllowedRange.cs new file mode 100644 index 0000000000000..61375802e9ea5 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpC2DRejectedMessagesNotInAllowedRange.cs @@ -0,0 +1,67 @@ +// +// 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; + + /// + /// Number of rejected cloud to device messages (AMQP protocol) is not in + /// allowed range. + /// + [Newtonsoft.Json.JsonObject("AmqpC2DRejectedMessagesNotInAllowedRange")] + public partial class AmqpC2DRejectedMessagesNotInAllowedRange : TimeWindowCustomAlertRule + { + /// + /// Initializes a new instance of the + /// AmqpC2DRejectedMessagesNotInAllowedRange class. + /// + public AmqpC2DRejectedMessagesNotInAllowedRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AmqpC2DRejectedMessagesNotInAllowedRange class. + /// + /// Status of the custom alert. + /// The minimum threshold. + /// The maximum threshold. + /// The time window size in iso8601 + /// format. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + public AmqpC2DRejectedMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) + : base(isEnabled, minThreshold, maxThreshold, timeWindowSize, displayName, description) + { + 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/AmqpD2CMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpD2CMessagesNotInAllowedRange.cs new file mode 100644 index 0000000000000..fd6dd48b1060b --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AmqpD2CMessagesNotInAllowedRange.cs @@ -0,0 +1,67 @@ +// +// 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; + + /// + /// Number of device to cloud messages (AMQP protocol) is not in allowed + /// range. + /// + [Newtonsoft.Json.JsonObject("AmqpD2CMessagesNotInAllowedRange")] + public partial class AmqpD2CMessagesNotInAllowedRange : TimeWindowCustomAlertRule + { + /// + /// Initializes a new instance of the AmqpD2CMessagesNotInAllowedRange + /// class. + /// + public AmqpD2CMessagesNotInAllowedRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AmqpD2CMessagesNotInAllowedRange + /// class. + /// + /// Status of the custom alert. + /// The minimum threshold. + /// The maximum threshold. + /// The time window size in iso8601 + /// format. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + public AmqpD2CMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) + : base(isEnabled, minThreshold, maxThreshold, timeWindowSize, displayName, description) + { + 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/AutomationAction.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AutomationAction.cs index 921ecb8ffaf1e..e486a3ba01b92 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,11 +10,13 @@ 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/ConnectionToIpNotAllowed.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionToIpNotAllowed.cs new file mode 100644 index 0000000000000..19cc63c8934cd --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ConnectionToIpNotAllowed.cs @@ -0,0 +1,67 @@ +// +// 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; + + /// + /// 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 + { + /// + /// Initializes a new instance of the ConnectionToIpNotAllowed class. + /// + public ConnectionToIpNotAllowed() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConnectionToIpNotAllowed 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 ConnectionToIpNotAllowed(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/CustomAlertRule.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/CustomAlertRule.cs index 2b9dcbd774e86..a581bbf4f832f 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 @@ -10,13 +10,13 @@ namespace Microsoft.Azure.Management.Security.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// /// A custom alert rule. /// + [Newtonsoft.Json.JsonObject("CustomAlertRule")] public partial class CustomAlertRule { /// @@ -31,17 +31,15 @@ public CustomAlertRule() /// Initializes a new instance of the CustomAlertRule class. /// /// Status of the custom alert. - /// The type of the custom alert rule. /// The display name of the custom /// alert. /// The description of the custom /// alert. - public CustomAlertRule(bool isEnabled, string ruleType, string displayName = default(string), string description = default(string)) + public CustomAlertRule(bool isEnabled, string displayName = default(string), string description = default(string)) { DisplayName = displayName; Description = description; IsEnabled = isEnabled; - RuleType = ruleType; CustomInit(); } @@ -68,24 +66,15 @@ public CustomAlertRule() [JsonProperty(PropertyName = "isEnabled")] public bool IsEnabled { get; set; } - /// - /// Gets or sets the type of the custom alert rule. - /// - [JsonProperty(PropertyName = "ruleType")] - public string RuleType { get; set; } - /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (RuleType == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "RuleType"); - } + //Nothing to validate } } } 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 f122dc8f024f9..1bfe4ef2944a7 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,6 +20,7 @@ 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 { /// @@ -34,7 +35,6 @@ public DenylistCustomAlertRule() /// Initializes a new instance of the DenylistCustomAlertRule class. /// /// Status of the custom alert. - /// The type of the custom alert rule. /// The values to deny. The format of the /// values depends on the rule type. /// The display name of the custom @@ -43,8 +43,8 @@ public DenylistCustomAlertRule() /// alert. /// The value type of the items in the list. /// Possible values include: 'IpCidr', 'String' - public DenylistCustomAlertRule(bool isEnabled, string ruleType, IList denylistValues, string displayName = default(string), string description = default(string), string valueType = default(string)) - : base(isEnabled, ruleType, displayName, description, valueType) + public DenylistCustomAlertRule(bool isEnabled, IList denylistValues, string displayName = default(string), string description = default(string), string valueType = default(string)) + : base(isEnabled, displayName, description, valueType) { DenylistValues = denylistValues; CustomInit(); 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 new file mode 100644 index 0000000000000..5965d35479674 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/DirectMethodInvokesNotInAllowedRange.cs @@ -0,0 +1,66 @@ +// +// 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; + + /// + /// Number of direct method invokes is not in allowed range. + /// + [Newtonsoft.Json.JsonObject("DirectMethodInvokesNotInAllowedRange")] + public partial class DirectMethodInvokesNotInAllowedRange : TimeWindowCustomAlertRule + { + /// + /// Initializes a new instance of the + /// DirectMethodInvokesNotInAllowedRange class. + /// + public DirectMethodInvokesNotInAllowedRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// DirectMethodInvokesNotInAllowedRange class. + /// + /// Status of the custom alert. + /// The minimum threshold. + /// The maximum threshold. + /// The time window size in iso8601 + /// format. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + public DirectMethodInvokesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) + : base(isEnabled, minThreshold, maxThreshold, timeWindowSize, displayName, description) + { + 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/Direction.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Direction.cs new file mode 100644 index 0000000000000..1f13287d7fa65 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Direction.cs @@ -0,0 +1,22 @@ +// +// 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 Direction. + /// + public static class Direction + { + public const string Inbound = "Inbound"; + public const string Outbound = "Outbound"; + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/EffectiveNetworkSecurityGroups.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/EffectiveNetworkSecurityGroups.cs new file mode 100644 index 0000000000000..17b9f1c49622d --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/EffectiveNetworkSecurityGroups.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes the Network Security Groups effective on a network interface + /// + public partial class EffectiveNetworkSecurityGroups + { + /// + /// Initializes a new instance of the EffectiveNetworkSecurityGroups + /// class. + /// + public EffectiveNetworkSecurityGroups() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EffectiveNetworkSecurityGroups + /// class. + /// + /// The Azure resource ID of the network + /// interface + /// The Network Security Groups + /// effective on the network interface + public EffectiveNetworkSecurityGroups(string networkInterface = default(string), IList networkSecurityGroups = default(IList)) + { + NetworkInterface = networkInterface; + NetworkSecurityGroups = networkSecurityGroups; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Azure resource ID of the network interface + /// + [JsonProperty(PropertyName = "networkInterface")] + public string NetworkInterface { get; set; } + + /// + /// Gets or sets the Network Security Groups effective on the network + /// interface + /// + [JsonProperty(PropertyName = "networkSecurityGroups")] + public IList NetworkSecurityGroups { get; set; } + + } +} 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 119f870c19ad7..6391dffca8f2f 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,6 +18,7 @@ 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 new file mode 100644 index 0000000000000..940afb4c7ce2c --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FailedLocalLoginsNotInAllowedRange.cs @@ -0,0 +1,66 @@ +// +// 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; + + /// + /// Number of failed local logins is not in allowed range. + /// + [Newtonsoft.Json.JsonObject("FailedLocalLoginsNotInAllowedRange")] + public partial class FailedLocalLoginsNotInAllowedRange : TimeWindowCustomAlertRule + { + /// + /// Initializes a new instance of the + /// FailedLocalLoginsNotInAllowedRange class. + /// + public FailedLocalLoginsNotInAllowedRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// FailedLocalLoginsNotInAllowedRange class. + /// + /// Status of the custom alert. + /// The minimum threshold. + /// The maximum threshold. + /// The time window size in iso8601 + /// format. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + public FailedLocalLoginsNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) + : base(isEnabled, minThreshold, maxThreshold, timeWindowSize, displayName, description) + { + 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/FileUploadsNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FileUploadsNotInAllowedRange.cs new file mode 100644 index 0000000000000..b35c49246449d --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/FileUploadsNotInAllowedRange.cs @@ -0,0 +1,66 @@ +// +// 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; + + /// + /// Number of file uploads is not in allowed range. + /// + [Newtonsoft.Json.JsonObject("FileUploadsNotInAllowedRange")] + public partial class FileUploadsNotInAllowedRange : TimeWindowCustomAlertRule + { + /// + /// Initializes a new instance of the FileUploadsNotInAllowedRange + /// class. + /// + public FileUploadsNotInAllowedRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FileUploadsNotInAllowedRange + /// class. + /// + /// Status of the custom alert. + /// The minimum threshold. + /// The maximum threshold. + /// The time window size in iso8601 + /// format. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + public FileUploadsNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) + : base(isEnabled, minThreshold, maxThreshold, timeWindowSize, displayName, description) + { + 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/HttpC2DMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DMessagesNotInAllowedRange.cs new file mode 100644 index 0000000000000..b4c92a0347b10 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DMessagesNotInAllowedRange.cs @@ -0,0 +1,67 @@ +// +// 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; + + /// + /// Number of cloud to device messages (HTTP protocol) is not in allowed + /// range. + /// + [Newtonsoft.Json.JsonObject("HttpC2DMessagesNotInAllowedRange")] + public partial class HttpC2DMessagesNotInAllowedRange : TimeWindowCustomAlertRule + { + /// + /// Initializes a new instance of the HttpC2DMessagesNotInAllowedRange + /// class. + /// + public HttpC2DMessagesNotInAllowedRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HttpC2DMessagesNotInAllowedRange + /// class. + /// + /// Status of the custom alert. + /// The minimum threshold. + /// The maximum threshold. + /// The time window size in iso8601 + /// format. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + public HttpC2DMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) + : base(isEnabled, minThreshold, maxThreshold, timeWindowSize, displayName, description) + { + 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/HttpC2DRejectedMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DRejectedMessagesNotInAllowedRange.cs new file mode 100644 index 0000000000000..a9d06f0275783 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpC2DRejectedMessagesNotInAllowedRange.cs @@ -0,0 +1,67 @@ +// +// 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; + + /// + /// Number of rejected cloud to device messages (HTTP protocol) is not in + /// allowed range. + /// + [Newtonsoft.Json.JsonObject("HttpC2DRejectedMessagesNotInAllowedRange")] + public partial class HttpC2DRejectedMessagesNotInAllowedRange : TimeWindowCustomAlertRule + { + /// + /// Initializes a new instance of the + /// HttpC2DRejectedMessagesNotInAllowedRange class. + /// + public HttpC2DRejectedMessagesNotInAllowedRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// HttpC2DRejectedMessagesNotInAllowedRange class. + /// + /// Status of the custom alert. + /// The minimum threshold. + /// The maximum threshold. + /// The time window size in iso8601 + /// format. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + public HttpC2DRejectedMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) + : base(isEnabled, minThreshold, maxThreshold, timeWindowSize, displayName, description) + { + 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/HttpD2CMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpD2CMessagesNotInAllowedRange.cs new file mode 100644 index 0000000000000..d9ecd22c241b8 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/HttpD2CMessagesNotInAllowedRange.cs @@ -0,0 +1,67 @@ +// +// 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; + + /// + /// Number of device to cloud messages (HTTP protocol) is not in allowed + /// range. + /// + [Newtonsoft.Json.JsonObject("HttpD2CMessagesNotInAllowedRange")] + public partial class HttpD2CMessagesNotInAllowedRange : TimeWindowCustomAlertRule + { + /// + /// Initializes a new instance of the HttpD2CMessagesNotInAllowedRange + /// class. + /// + public HttpD2CMessagesNotInAllowedRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HttpD2CMessagesNotInAllowedRange + /// class. + /// + /// Status of the custom alert. + /// The minimum threshold. + /// The maximum threshold. + /// The time window size in iso8601 + /// format. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + public HttpD2CMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) + : base(isEnabled, minThreshold, maxThreshold, timeWindowSize, displayName, description) + { + 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/InformationProtectionPolicy.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/InformationProtectionPolicy.cs index c2c698211eec1..ec242a463632e 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/InformationProtectionPolicy.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/InformationProtectionPolicy.cs @@ -41,13 +41,15 @@ public InformationProtectionPolicy() /// Resource type /// Describes the last UTC time the /// policy was modified. + /// Describes the version of the policy. /// Dictionary of sensitivity labels. /// The sensitivity information /// types. - public InformationProtectionPolicy(string id = default(string), string name = default(string), string type = default(string), System.DateTime? lastModifiedUtc = default(System.DateTime?), IDictionary labels = default(IDictionary), IDictionary informationTypes = default(IDictionary)) + public InformationProtectionPolicy(string id = default(string), string name = default(string), string type = default(string), System.DateTime? lastModifiedUtc = default(System.DateTime?), string version = default(string), IDictionary labels = default(IDictionary), IDictionary informationTypes = default(IDictionary)) : base(id, name, type) { LastModifiedUtc = lastModifiedUtc; + Version = version; Labels = labels; InformationTypes = informationTypes; CustomInit(); @@ -64,6 +66,12 @@ public InformationProtectionPolicy() [JsonProperty(PropertyName = "properties.lastModifiedUtc")] public System.DateTime? LastModifiedUtc { get; private set; } + /// + /// Gets describes the version of the policy. + /// + [JsonProperty(PropertyName = "properties.version")] + public string Version { get; private set; } + /// /// Gets or sets dictionary of sensitivity labels. /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/InformationType.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/InformationType.cs index 83ddb1886adfe..928cd94183745 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/InformationType.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/InformationType.cs @@ -42,7 +42,7 @@ public InformationType() /// Indicates whether the information type is /// custom or not. /// The information type keywords. - public InformationType(string displayName = default(string), string description = default(string), double? order = default(double?), System.Guid? recommendedLabelId = default(System.Guid?), bool? enabled = default(bool?), bool? custom = default(bool?), IList keywords = default(IList)) + public InformationType(string displayName = default(string), string description = default(string), int? order = default(int?), System.Guid? recommendedLabelId = default(System.Guid?), bool? enabled = default(bool?), bool? custom = default(bool?), IList keywords = default(IList)) { DisplayName = displayName; Description = description; @@ -75,7 +75,7 @@ public InformationType() /// Gets or sets the order of the information type. /// [JsonProperty(PropertyName = "order")] - public double? Order { get; set; } + public int? Order { get; set; } /// /// Gets or sets the recommended label id to be associated with this 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 54e2617ed4155..763959ad3860f 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,6 +16,7 @@ namespace Microsoft.Azure.Management.Security.Models /// /// A List custom alert rule. /// + [Newtonsoft.Json.JsonObject("ListCustomAlertRule")] public partial class ListCustomAlertRule : CustomAlertRule { /// @@ -30,15 +31,14 @@ public ListCustomAlertRule() /// Initializes a new instance of the ListCustomAlertRule class. /// /// Status of the custom alert. - /// The type of the custom alert rule. /// 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 ListCustomAlertRule(bool isEnabled, string ruleType, string displayName = default(string), string description = default(string), string valueType = default(string)) - : base(isEnabled, ruleType, displayName, description) + public ListCustomAlertRule(bool isEnabled, string displayName = default(string), string description = default(string), string valueType = default(string)) + : base(isEnabled, displayName, description) { ValueType = valueType; CustomInit(); 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 new file mode 100644 index 0000000000000..27e661e467c1e --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/LocalUserNotAllowed.cs @@ -0,0 +1,67 @@ +// +// 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; + + /// + /// 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 + { + /// + /// Initializes a new instance of the LocalUserNotAllowed class. + /// + public LocalUserNotAllowed() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LocalUserNotAllowed 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 LocalUserNotAllowed(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/MqttC2DMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DMessagesNotInAllowedRange.cs new file mode 100644 index 0000000000000..50ce5fe30a68a --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DMessagesNotInAllowedRange.cs @@ -0,0 +1,67 @@ +// +// 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; + + /// + /// Number of cloud to device messages (MQTT protocol) is not in allowed + /// range. + /// + [Newtonsoft.Json.JsonObject("MqttC2DMessagesNotInAllowedRange")] + public partial class MqttC2DMessagesNotInAllowedRange : TimeWindowCustomAlertRule + { + /// + /// Initializes a new instance of the MqttC2DMessagesNotInAllowedRange + /// class. + /// + public MqttC2DMessagesNotInAllowedRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MqttC2DMessagesNotInAllowedRange + /// class. + /// + /// Status of the custom alert. + /// The minimum threshold. + /// The maximum threshold. + /// The time window size in iso8601 + /// format. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + public MqttC2DMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) + : base(isEnabled, minThreshold, maxThreshold, timeWindowSize, displayName, description) + { + 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/MqttC2DRejectedMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DRejectedMessagesNotInAllowedRange.cs new file mode 100644 index 0000000000000..55fb3039b11ad --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttC2DRejectedMessagesNotInAllowedRange.cs @@ -0,0 +1,67 @@ +// +// 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; + + /// + /// Number of rejected cloud to device messages (MQTT protocol) is not in + /// allowed range. + /// + [Newtonsoft.Json.JsonObject("MqttC2DRejectedMessagesNotInAllowedRange")] + public partial class MqttC2DRejectedMessagesNotInAllowedRange : TimeWindowCustomAlertRule + { + /// + /// Initializes a new instance of the + /// MqttC2DRejectedMessagesNotInAllowedRange class. + /// + public MqttC2DRejectedMessagesNotInAllowedRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// MqttC2DRejectedMessagesNotInAllowedRange class. + /// + /// Status of the custom alert. + /// The minimum threshold. + /// The maximum threshold. + /// The time window size in iso8601 + /// format. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + public MqttC2DRejectedMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) + : base(isEnabled, minThreshold, maxThreshold, timeWindowSize, displayName, description) + { + 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/MqttD2CMessagesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttD2CMessagesNotInAllowedRange.cs new file mode 100644 index 0000000000000..358bb0c6e4f81 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/MqttD2CMessagesNotInAllowedRange.cs @@ -0,0 +1,67 @@ +// +// 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; + + /// + /// Number of device to cloud messages (MQTT protocol) is not in allowed + /// range. + /// + [Newtonsoft.Json.JsonObject("MqttD2CMessagesNotInAllowedRange")] + public partial class MqttD2CMessagesNotInAllowedRange : TimeWindowCustomAlertRule + { + /// + /// Initializes a new instance of the MqttD2CMessagesNotInAllowedRange + /// class. + /// + public MqttD2CMessagesNotInAllowedRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MqttD2CMessagesNotInAllowedRange + /// class. + /// + /// Status of the custom alert. + /// The minimum threshold. + /// The maximum threshold. + /// The time window size in iso8601 + /// format. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + public MqttD2CMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) + : base(isEnabled, minThreshold, maxThreshold, timeWindowSize, displayName, description) + { + 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/ProcessNotAllowed.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ProcessNotAllowed.cs new file mode 100644 index 0000000000000..66e7dc1f46f90 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ProcessNotAllowed.cs @@ -0,0 +1,67 @@ +// +// 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; + + /// + /// 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 + { + /// + /// Initializes a new instance of the ProcessNotAllowed class. + /// + public ProcessNotAllowed() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProcessNotAllowed 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 ProcessNotAllowed(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/QueuePurgesNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/QueuePurgesNotInAllowedRange.cs new file mode 100644 index 0000000000000..e7a506d93b606 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/QueuePurgesNotInAllowedRange.cs @@ -0,0 +1,66 @@ +// +// 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; + + /// + /// Number of device queue purges is not in allowed range. + /// + [Newtonsoft.Json.JsonObject("QueuePurgesNotInAllowedRange")] + public partial class QueuePurgesNotInAllowedRange : TimeWindowCustomAlertRule + { + /// + /// Initializes a new instance of the QueuePurgesNotInAllowedRange + /// class. + /// + public QueuePurgesNotInAllowedRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the QueuePurgesNotInAllowedRange + /// class. + /// + /// Status of the custom alert. + /// The minimum threshold. + /// The maximum threshold. + /// The time window size in iso8601 + /// format. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + public QueuePurgesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) + : base(isEnabled, minThreshold, maxThreshold, timeWindowSize, displayName, description) + { + 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/ResourceDetails.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/ResourceDetails.cs index 14c1aa7336673..6ab1d4f7544fb 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,11 +10,13 @@ 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/Rule.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Rule.cs new file mode 100644 index 0000000000000..7ca280d9e7c59 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Rule.cs @@ -0,0 +1,93 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.Security.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes remote addresses that is recommended to communicate with the + /// Azure resource on some (Protocol, Port, Direction). All other remote + /// addresses are recommended to be blocked + /// + public partial class Rule + { + /// + /// Initializes a new instance of the Rule class. + /// + public Rule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Rule class. + /// + /// The name of the rule + /// The rule's direction. Possible values + /// include: 'Inbound', 'Outbound' + /// The rule's destination port + /// The rule's transport protocols + /// The remote IP addresses that should be + /// able to communicate with the Azure resource on the rule's + /// destination port and protocol + public Rule(string name = default(string), string direction = default(string), int? destinationPort = default(int?), IList protocols = default(IList), IList ipAddresses = default(IList)) + { + Name = name; + Direction = direction; + DestinationPort = destinationPort; + Protocols = protocols; + IpAddresses = ipAddresses; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the rule + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the rule's direction. Possible values include: + /// 'Inbound', 'Outbound' + /// + [JsonProperty(PropertyName = "direction")] + public string Direction { get; set; } + + /// + /// Gets or sets the rule's destination port + /// + [JsonProperty(PropertyName = "destinationPort")] + public int? DestinationPort { get; set; } + + /// + /// Gets or sets the rule's transport protocols + /// + [JsonProperty(PropertyName = "protocols")] + public IList Protocols { get; set; } + + /// + /// Gets or sets the remote IP addresses that should be able to + /// communicate with the Azure resource on the rule's destination port + /// and protocol + /// + [JsonProperty(PropertyName = "ipAddresses")] + public IList IpAddresses { get; set; } + + } +} diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SensitivityLabel.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SensitivityLabel.cs index 4800baa01d116..eab74c284f0af 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SensitivityLabel.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/SensitivityLabel.cs @@ -38,7 +38,7 @@ public SensitivityLabel() /// The order of the sensitivity label. /// Indicates whether the label is enabled or /// not. - public SensitivityLabel(string displayName = default(string), string description = default(string), Rank? rank = default(Rank?), double? order = default(double?), bool? enabled = default(bool?)) + public SensitivityLabel(string displayName = default(string), string description = default(string), Rank? rank = default(Rank?), int? order = default(int?), bool? enabled = default(bool?)) { DisplayName = displayName; Description = description; @@ -76,7 +76,7 @@ public SensitivityLabel() /// Gets or sets the order of the sensitivity label. /// [JsonProperty(PropertyName = "order")] - public double? Order { get; set; } + public int? Order { get; set; } /// /// Gets or sets indicates whether the label is enabled or not. 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 e2d1c2cd67e54..7df8da76196bc 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,6 +17,7 @@ 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 { /// @@ -31,15 +32,14 @@ public ThresholdCustomAlertRule() /// Initializes a new instance of the ThresholdCustomAlertRule class. /// /// Status of the custom alert. - /// The type of the custom alert rule. /// The minimum threshold. /// The maximum threshold. /// The display name of the custom /// alert. /// The description of the custom /// alert. - public ThresholdCustomAlertRule(bool isEnabled, string ruleType, int minThreshold, int maxThreshold, string displayName = default(string), string description = default(string)) - : base(isEnabled, ruleType, displayName, description) + public ThresholdCustomAlertRule(bool isEnabled, int minThreshold, int maxThreshold, string displayName = default(string), string description = default(string)) + : base(isEnabled, displayName, description) { MinThreshold = minThreshold; MaxThreshold = maxThreshold; 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 331b0b69e8dca..eaeb685da1b5a 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,6 +17,7 @@ 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 { /// @@ -31,7 +32,6 @@ public TimeWindowCustomAlertRule() /// Initializes a new instance of the TimeWindowCustomAlertRule class. /// /// Status of the custom alert. - /// The type of the custom alert rule. /// The minimum threshold. /// The maximum threshold. /// The time window size in iso8601 @@ -40,8 +40,8 @@ public TimeWindowCustomAlertRule() /// alert. /// The description of the custom /// alert. - public TimeWindowCustomAlertRule(bool isEnabled, string ruleType, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) - : base(isEnabled, ruleType, minThreshold, maxThreshold, displayName, description) + public TimeWindowCustomAlertRule(bool isEnabled, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) + : base(isEnabled, minThreshold, maxThreshold, displayName, description) { TimeWindowSize = timeWindowSize; CustomInit(); diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TransportProtocol.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TransportProtocol.cs new file mode 100644 index 0000000000000..6471d37ae648d --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TransportProtocol.cs @@ -0,0 +1,22 @@ +// +// 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 TransportProtocol. + /// + public static class TransportProtocol + { + public const string TCP = "TCP"; + public const string UDP = "UDP"; + } +} 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 new file mode 100644 index 0000000000000..e0b4415251e92 --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TwinUpdatesNotInAllowedRange.cs @@ -0,0 +1,66 @@ +// +// 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; + + /// + /// Number of twin updates is not in allowed range. + /// + [Newtonsoft.Json.JsonObject("TwinUpdatesNotInAllowedRange")] + public partial class TwinUpdatesNotInAllowedRange : TimeWindowCustomAlertRule + { + /// + /// Initializes a new instance of the TwinUpdatesNotInAllowedRange + /// class. + /// + public TwinUpdatesNotInAllowedRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TwinUpdatesNotInAllowedRange + /// class. + /// + /// Status of the custom alert. + /// The minimum threshold. + /// The maximum threshold. + /// The time window size in iso8601 + /// format. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + public TwinUpdatesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) + : base(isEnabled, minThreshold, maxThreshold, timeWindowSize, displayName, description) + { + 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/UnauthorizedOperationsNotInAllowedRange.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/UnauthorizedOperationsNotInAllowedRange.cs new file mode 100644 index 0000000000000..f57c05fd4648b --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/UnauthorizedOperationsNotInAllowedRange.cs @@ -0,0 +1,66 @@ +// +// 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; + + /// + /// Number of unauthorized operations is not in allowed range. + /// + [Newtonsoft.Json.JsonObject("UnauthorizedOperationsNotInAllowedRange")] + public partial class UnauthorizedOperationsNotInAllowedRange : TimeWindowCustomAlertRule + { + /// + /// Initializes a new instance of the + /// UnauthorizedOperationsNotInAllowedRange class. + /// + public UnauthorizedOperationsNotInAllowedRange() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// UnauthorizedOperationsNotInAllowedRange class. + /// + /// Status of the custom alert. + /// The minimum threshold. + /// The maximum threshold. + /// The time window size in iso8601 + /// format. + /// The display name of the custom + /// alert. + /// The description of the custom + /// alert. + public UnauthorizedOperationsNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, System.TimeSpan timeWindowSize, string displayName = default(string), string description = default(string)) + : base(isEnabled, minThreshold, maxThreshold, timeWindowSize, displayName, description) + { + 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/SdkInfo_SecurityCenter.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs index 0cefe946888d4..965f2df3b5163 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 @@ -20,9 +20,10 @@ public static IEnumerable> ApiInfo_SecurityCenter return new Tuple[] { new Tuple("Security", "AdaptiveApplicationControls", "2015-06-01-preview"), + new Tuple("Security", "AdaptiveNetworkHardenings", "2020-01-01"), new Tuple("Security", "AdvancedThreatProtection", "2019-01-01"), new Tuple("Security", "Alerts", "2019-01-01"), - new Tuple("Security", "AllowedConnections", "2015-06-01-preview"), + new Tuple("Security", "AllowedConnections", "2020-01-01"), new Tuple("Security", "Assessments", "2020-01-01"), new Tuple("Security", "AssessmentsMetadata", "2020-01-01"), new Tuple("Security", "AutoProvisioningSettings", "2017-08-01-preview"), @@ -37,7 +38,7 @@ public static IEnumerable> ApiInfo_SecurityCenter new Tuple("Security", "IotSecuritySolutionAnalytics", "2019-08-01"), new Tuple("Security", "IotSecuritySolutionsAnalyticsAggregatedAlert", "2019-08-01"), new Tuple("Security", "IotSecuritySolutionsAnalyticsRecommendation", "2019-08-01"), - new Tuple("Security", "JitNetworkAccessPolicies", "2015-06-01-preview"), + new Tuple("Security", "JitNetworkAccessPolicies", "2020-01-01"), new Tuple("Security", "Locations", "2015-06-01-preview"), new Tuple("Security", "Operations", "2015-06-01-preview"), new Tuple("Security", "Pricings", "2018-06-01"), @@ -49,21 +50,10 @@ public static IEnumerable> ApiInfo_SecurityCenter new Tuple("Security", "Settings", "2019-01-01"), new Tuple("Security", "SubAssessments", "2019-01-01-preview"), new Tuple("Security", "Tasks", "2015-06-01-preview"), - new Tuple("Security", "Topology", "2015-06-01-preview"), + new Tuple("Security", "Topology", "2020-01-01"), new Tuple("Security", "WorkspaceSettings", "2017-08-01-preview"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - 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=latest --reflect-api-versions --csharp-sdks-folder=C:\\vs\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "b76a3d26f56067bb939f069fd5481580a9504c32"; - 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 d58a8fbea1195..8085df8eaf38a 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SecurityCenterClient.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SecurityCenterClient.cs @@ -126,11 +126,6 @@ public partial class SecurityCenterClient : ServiceClient, /// public virtual IIotSecuritySolutionsAnalyticsRecommendationOperations IotSecuritySolutionsAnalyticsRecommendation { get; private set; } - /// - /// Gets the IAllowedConnectionsOperations. - /// - public virtual IAllowedConnectionsOperations AllowedConnections { get; private set; } - /// /// Gets the IDiscoveredSecuritySolutionsOperations. /// @@ -141,11 +136,6 @@ public partial class SecurityCenterClient : ServiceClient, /// public virtual IExternalSecuritySolutionsOperations ExternalSecuritySolutions { get; private set; } - /// - /// Gets the IJitNetworkAccessPoliciesOperations. - /// - public virtual IJitNetworkAccessPoliciesOperations JitNetworkAccessPolicies { get; private set; } - /// /// Gets the IAdaptiveApplicationControlsOperations. /// @@ -166,11 +156,6 @@ public partial class SecurityCenterClient : ServiceClient, /// public virtual ITasksOperations Tasks { get; private set; } - /// - /// Gets the ITopologyOperations. - /// - public virtual ITopologyOperations Topology { get; private set; } - /// /// Gets the IAutoProvisioningSettingsOperations. /// @@ -236,6 +221,26 @@ public partial class SecurityCenterClient : ServiceClient, /// public virtual IAssessmentsOperations Assessments { get; private set; } + /// + /// Gets the IAdaptiveNetworkHardeningsOperations. + /// + public virtual IAdaptiveNetworkHardeningsOperations AdaptiveNetworkHardenings { get; private set; } + + /// + /// Gets the IAllowedConnectionsOperations. + /// + public virtual IAllowedConnectionsOperations AllowedConnections { get; private set; } + + /// + /// Gets the ITopologyOperations. + /// + public virtual ITopologyOperations Topology { get; private set; } + + /// + /// Gets the IJitNetworkAccessPoliciesOperations. + /// + public virtual IJitNetworkAccessPoliciesOperations JitNetworkAccessPolicies { get; private set; } + /// /// Initializes a new instance of the SecurityCenterClient class. /// @@ -487,15 +492,12 @@ private void Initialize() IotSecuritySolutionAnalytics = new IotSecuritySolutionAnalyticsOperations(this); IotSecuritySolutionsAnalyticsAggregatedAlert = new IotSecuritySolutionsAnalyticsAggregatedAlertOperations(this); IotSecuritySolutionsAnalyticsRecommendation = new IotSecuritySolutionsAnalyticsRecommendationOperations(this); - AllowedConnections = new AllowedConnectionsOperations(this); DiscoveredSecuritySolutions = new DiscoveredSecuritySolutionsOperations(this); ExternalSecuritySolutions = new ExternalSecuritySolutionsOperations(this); - JitNetworkAccessPolicies = new JitNetworkAccessPoliciesOperations(this); AdaptiveApplicationControls = new AdaptiveApplicationControlsOperations(this); Locations = new LocationsOperations(this); Operations = new Operations(this); Tasks = new TasksOperations(this); - Topology = new TopologyOperations(this); AutoProvisioningSettings = new AutoProvisioningSettingsOperations(this); Compliances = new CompliancesOperations(this); InformationProtectionPolicies = new InformationProtectionPoliciesOperations(this); @@ -509,6 +511,10 @@ private void Initialize() Automations = new AutomationsOperations(this); AssessmentsMetadata = new AssessmentsMetadataOperations(this); Assessments = new AssessmentsOperations(this); + AdaptiveNetworkHardenings = new AdaptiveNetworkHardeningsOperations(this); + AllowedConnections = new AllowedConnectionsOperations(this); + Topology = new TopologyOperations(this); + JitNetworkAccessPolicies = new JitNetworkAccessPoliciesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; @@ -539,6 +545,8 @@ private void Initialize() new Iso8601TimeSpanConverter() } }; + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("ruleType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("ruleType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("source")); diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/TopologyOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/TopologyOperations.cs index 81ff455dfaecb..4a971359baa8c 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/TopologyOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/TopologyOperations.cs @@ -87,7 +87,7 @@ internal TopologyOperations(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 = "2015-06-01-preview"; + string apiVersion = "2020-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -275,7 +275,7 @@ internal TopologyOperations(SecurityCenterClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.AscLocation"); } - string apiVersion = "2015-06-01-preview"; + string apiVersion = "2020-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -493,7 +493,7 @@ internal TopologyOperations(SecurityCenterClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "topologyResourceName"); } - string apiVersion = "2015-06-01-preview"; + string apiVersion = "2020-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null;