From e3b57a0111690eef5e296c15a9b192ef6ade7e9e Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 26 Mar 2020 02:57:14 +0000 Subject: [PATCH] Generated from 040fb3afa0e1a43471c1219e1e74c014f89c9b2e Update CreateOrUpdateInformationProtectionPolicy_example.json --- .../AdaptiveApplicationControlsOperations.cs | 176 +++ ...ApplicationControlsOperationsExtensions.cs | 31 + .../AdaptiveNetworkHardeningsOperations.cs | 1003 +++++++++++++++++ ...veNetworkHardeningsOperationsExtensions.cs | 325 ++++++ .../Generated/AllowedConnectionsOperations.cs | 6 +- .../IAdaptiveApplicationControlsOperations.cs | 19 + .../IAdaptiveNetworkHardeningsOperations.cs | 198 ++++ ...InformationProtectionPoliciesOperations.cs | 8 +- .../src/Generated/ISecurityCenterClient.cs | 25 +- ...InformationProtectionPoliciesOperations.cs | 21 +- ...nProtectionPoliciesOperationsExtensions.cs | 22 +- .../Models/AdaptiveNetworkHardening.cs | 83 ++ .../AdaptiveNetworkHardeningEnforceRequest.cs | 83 ++ .../src/Generated/Models/Direction.cs | 22 + .../Models/EffectiveNetworkSecurityGroups.cs | 66 ++ .../src/Generated/Models/InformationType.cs | 11 +- .../src/Generated/Models/Rank.cs | 78 ++ .../src/Generated/Models/Rule.cs | 93 ++ .../src/Generated/Models/SensitivityLabel.cs | 21 +- .../src/Generated/Models/TransportProtocol.cs | 22 + .../src/Generated/SdkInfo_SecurityCenter.cs | 16 +- .../src/Generated/SecurityCenterClient.cs | 30 +- .../src/Generated/TopologyOperations.cs | 6 +- 23 files changed, 2316 insertions(+), 49 deletions(-) create mode 100644 sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AdaptiveNetworkHardeningsOperations.cs create mode 100644 sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/AdaptiveNetworkHardeningsOperationsExtensions.cs create mode 100644 sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IAdaptiveNetworkHardeningsOperations.cs create mode 100644 sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardening.cs create mode 100644 sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningEnforceRequest.cs create mode 100644 sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Direction.cs create mode 100644 sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/EffectiveNetworkSecurityGroups.cs create mode 100644 sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Rank.cs create mode 100644 sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Rule.cs create mode 100644 sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/TransportProtocol.cs 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 32f99eec7b49..060e4dda85ce 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 853291accad2..7fc7b6c141e0 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 000000000000..b40d5fa63f44 --- /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 000000000000..1f698f88bf8a --- /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 b71a319d63c6..683054249d40 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 1712fb74f5dc..4cbd277b7c35 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 000000000000..4b9f355f44a6 --- /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/IInformationProtectionPoliciesOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IInformationProtectionPoliciesOperations.cs index 0a77a1f39dbc..96cca84bafc9 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IInformationProtectionPoliciesOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/IInformationProtectionPoliciesOperations.cs @@ -63,6 +63,12 @@ public partial interface IInformationProtectionPoliciesOperations /// Name of the information protection policy. Possible values include: /// 'effective', 'custom' /// + /// + /// Dictionary of sensitivity labels. + /// + /// + /// The sensitivity information types. + /// /// /// The headers that will be added to request. /// @@ -78,7 +84,7 @@ public partial interface IInformationProtectionPoliciesOperations /// /// Thrown when a required parameter is null /// - Task> CreateOrUpdateWithHttpMessagesAsync(string scope, string informationProtectionPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string scope, string informationProtectionPolicyName, IDictionary labels = default(IDictionary), IDictionary informationTypes = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Information protection policies of a specific management group. /// 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 933b86e14b6f..897d7e4ca6a6 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. /// @@ -161,11 +156,6 @@ public partial interface ISecurityCenterClient : System.IDisposable /// ITasksOperations Tasks { get; } - /// - /// Gets the ITopologyOperations. - /// - ITopologyOperations Topology { get; } - /// /// Gets the IAutoProvisioningSettingsOperations. /// @@ -231,5 +221,20 @@ 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; } + } } diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/InformationProtectionPoliciesOperations.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/InformationProtectionPoliciesOperations.cs index 36f19cf2cc87..304398e4e426 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/InformationProtectionPoliciesOperations.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/InformationProtectionPoliciesOperations.cs @@ -254,6 +254,12 @@ internal InformationProtectionPoliciesOperations(SecurityCenterClient client) /// Name of the information protection policy. Possible values include: /// 'effective', 'custom' /// + /// + /// Dictionary of sensitivity labels. + /// + /// + /// The sensitivity information types. + /// /// /// Headers that will be added to request. /// @@ -275,7 +281,7 @@ internal InformationProtectionPoliciesOperations(SecurityCenterClient client) /// /// A response object containing the response body and response headers. /// - public async Task> CreateOrUpdateWithHttpMessagesAsync(string scope, string informationProtectionPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string scope, string informationProtectionPolicyName, IDictionary labels = default(IDictionary), IDictionary informationTypes = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (scope == null) { @@ -286,6 +292,12 @@ internal InformationProtectionPoliciesOperations(SecurityCenterClient client) throw new ValidationException(ValidationRules.CannotBeNull, "informationProtectionPolicyName"); } string apiVersion = "2017-08-01-preview"; + InformationProtectionPolicy informationProtectionPolicy = new InformationProtectionPolicy(); + if (labels != null || informationTypes != null) + { + informationProtectionPolicy.Labels = labels; + informationProtectionPolicy.InformationTypes = informationTypes; + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -296,6 +308,7 @@ internal InformationProtectionPoliciesOperations(SecurityCenterClient client) tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("scope", scope); tracingParameters.Add("informationProtectionPolicyName", informationProtectionPolicyName); + tracingParameters.Add("informationProtectionPolicy", informationProtectionPolicy); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } @@ -347,6 +360,12 @@ internal InformationProtectionPoliciesOperations(SecurityCenterClient client) // Serialize Request string _requestContent = null; + if(informationProtectionPolicy != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(informationProtectionPolicy, 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) { diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/InformationProtectionPoliciesOperationsExtensions.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/InformationProtectionPoliciesOperationsExtensions.cs index af9ee2443fc3..ce2a37d655f9 100644 --- a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/InformationProtectionPoliciesOperationsExtensions.cs +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/InformationProtectionPoliciesOperationsExtensions.cs @@ -13,6 +13,8 @@ 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; @@ -82,9 +84,15 @@ public static InformationProtectionPolicy Get(this IInformationProtectionPolicie /// Name of the information protection policy. Possible values include: /// 'effective', 'custom' /// - public static InformationProtectionPolicy CreateOrUpdate(this IInformationProtectionPoliciesOperations operations, string scope, string informationProtectionPolicyName) + /// + /// Dictionary of sensitivity labels. + /// + /// + /// The sensitivity information types. + /// + public static InformationProtectionPolicy CreateOrUpdate(this IInformationProtectionPoliciesOperations operations, string scope, string informationProtectionPolicyName, IDictionary labels = default(IDictionary), IDictionary informationTypes = default(IDictionary)) { - return operations.CreateOrUpdateAsync(scope, informationProtectionPolicyName).GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(scope, informationProtectionPolicyName, labels, informationTypes).GetAwaiter().GetResult(); } /// @@ -102,12 +110,18 @@ public static InformationProtectionPolicy CreateOrUpdate(this IInformationProtec /// Name of the information protection policy. Possible values include: /// 'effective', 'custom' /// + /// + /// Dictionary of sensitivity labels. + /// + /// + /// The sensitivity information types. + /// /// /// The cancellation token. /// - public static async Task CreateOrUpdateAsync(this IInformationProtectionPoliciesOperations operations, string scope, string informationProtectionPolicyName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task CreateOrUpdateAsync(this IInformationProtectionPoliciesOperations operations, string scope, string informationProtectionPolicyName, IDictionary labels = default(IDictionary), IDictionary informationTypes = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(scope, informationProtectionPolicyName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(scope, informationProtectionPolicyName, labels, informationTypes, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } 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 000000000000..f2f530b17ae7 --- /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 000000000000..6ec2af5cda64 --- /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/Direction.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Direction.cs new file mode 100644 index 000000000000..1f13287d7fa6 --- /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 000000000000..17b9f1c49622 --- /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/InformationType.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/InformationType.cs index e980ded13b0c..83ddb1886adf 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 @@ -32,6 +32,8 @@ public InformationType() /// Initializes a new instance of the InformationType class. /// /// The name of the information type. + /// The description of the information + /// type. /// The order of the information type. /// The recommended label id to be /// associated with this information type. @@ -40,9 +42,10 @@ public InformationType() /// Indicates whether the information type is /// custom or not. /// The information type keywords. - public InformationType(string displayName = 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), double? order = default(double?), System.Guid? recommendedLabelId = default(System.Guid?), bool? enabled = default(bool?), bool? custom = default(bool?), IList keywords = default(IList)) { DisplayName = displayName; + Description = description; Order = order; RecommendedLabelId = recommendedLabelId; Enabled = enabled; @@ -62,6 +65,12 @@ public InformationType() [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } + /// + /// Gets or sets the description of the information type. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + /// /// Gets or sets the order of the information type. /// diff --git a/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Rank.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Rank.cs new file mode 100644 index 000000000000..a3b52881e9ca --- /dev/null +++ b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/Models/Rank.cs @@ -0,0 +1,78 @@ +// +// 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 Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for Rank. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum Rank + { + [EnumMember(Value = "None")] + None, + [EnumMember(Value = "Low")] + Low, + [EnumMember(Value = "Medium")] + Medium, + [EnumMember(Value = "High")] + High, + [EnumMember(Value = "Critical")] + Critical + } + internal static class RankEnumExtension + { + internal static string ToSerializedValue(this Rank? value) + { + return value == null ? null : ((Rank)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this Rank value) + { + switch( value ) + { + case Rank.None: + return "None"; + case Rank.Low: + return "Low"; + case Rank.Medium: + return "Medium"; + case Rank.High: + return "High"; + case Rank.Critical: + return "Critical"; + } + return null; + } + + internal static Rank? ParseRank(this string value) + { + switch( value ) + { + case "None": + return Rank.None; + case "Low": + return Rank.Low; + case "Medium": + return Rank.Medium; + case "High": + return Rank.High; + case "Critical": + return Rank.Critical; + } + return null; + } + } +} 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 000000000000..7ca280d9e7c5 --- /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 5e50c727c52e..4800baa01d11 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 @@ -31,12 +31,18 @@ public SensitivityLabel() /// /// The name of the sensitivity /// label. + /// The description of the sensitivity + /// label. + /// The rank of the sensitivity label. Possible + /// values include: 'None', 'Low', 'Medium', 'High', 'Critical' /// The order of the sensitivity label. /// Indicates whether the label is enabled or /// not. - public SensitivityLabel(string displayName = default(string), double? order = default(double?), bool? enabled = default(bool?)) + public SensitivityLabel(string displayName = default(string), string description = default(string), Rank? rank = default(Rank?), double? order = default(double?), bool? enabled = default(bool?)) { DisplayName = displayName; + Description = description; + Rank = rank; Order = order; Enabled = enabled; CustomInit(); @@ -53,6 +59,19 @@ public SensitivityLabel() [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } + /// + /// Gets or sets the description of the sensitivity label. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + /// + /// Gets or sets the rank of the sensitivity label. Possible values + /// include: 'None', 'Low', 'Medium', 'High', 'Critical' + /// + [JsonProperty(PropertyName = "rank")] + public Rank? Rank { get; set; } + /// /// Gets or sets the order of the sensitivity label. /// 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 000000000000..6471d37ae648 --- /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/SdkInfo_SecurityCenter.cs b/sdk/securitycenter/Microsoft.Azure.Management.SecurityCenter/src/Generated/SdkInfo_SecurityCenter.cs index 0cefe946888d..b66be4808d11 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"), @@ -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 d58a8fbea119..a349f9d04163 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. /// @@ -166,11 +161,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 +226,21 @@ 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; } + /// /// Initializes a new instance of the SecurityCenterClient class. /// @@ -487,7 +492,6 @@ 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); @@ -495,7 +499,6 @@ private void Initialize() 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 +512,9 @@ 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); BaseUri = new System.Uri("https://management.azure.com"); AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; 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 81ff455dfaec..4a971359baa8 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;