diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveApplicationControlGroupCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveApplicationControlGroupCollection.cs deleted file mode 100644 index 5fc878b27aff..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveApplicationControlGroupCollection.cs +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get an instance call the GetAdaptiveApplicationControlGroups method from an instance of . - /// - public partial class AdaptiveApplicationControlGroupCollection : ArmCollection - { - private readonly ClientDiagnostics _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics; - private readonly AdaptiveApplicationControlsRestOperations _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient; - - /// Initializes a new instance of the class for mocking. - protected AdaptiveApplicationControlGroupCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal AdaptiveApplicationControlGroupCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", AdaptiveApplicationControlGroupResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(AdaptiveApplicationControlGroupResource.ResourceType, out string adaptiveApplicationControlGroupAdaptiveApplicationControlsApiVersion); - _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient = new AdaptiveApplicationControlsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, adaptiveApplicationControlGroupAdaptiveApplicationControlsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SecurityCenterLocationResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SecurityCenterLocationResource.ResourceType), nameof(id)); - } - - /// - /// Update an application control machine group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName} - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_Put - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of an application control machine group. - /// The AdaptiveApplicationControlGroup to use. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string groupName, AdaptiveApplicationControlGroupData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics.CreateScope("AdaptiveApplicationControlGroupCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient.PutAsync(Id.SubscriptionId, new AzureLocation(Id.Name), groupName, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new AdaptiveApplicationControlGroupResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update an application control machine group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName} - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_Put - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of an application control machine group. - /// The AdaptiveApplicationControlGroup to use. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string groupName, AdaptiveApplicationControlGroupData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics.CreateScope("AdaptiveApplicationControlGroupCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient.Put(Id.SubscriptionId, new AzureLocation(Id.Name), groupName, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new AdaptiveApplicationControlGroupResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets an application control VM/server group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName} - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_Get - /// - /// - /// - /// Name of an application control machine group. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string groupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); - - using var scope = _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics.CreateScope("AdaptiveApplicationControlGroupCollection.Get"); - scope.Start(); - try - { - var response = await _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Name), groupName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AdaptiveApplicationControlGroupResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets an application control VM/server group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName} - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_Get - /// - /// - /// - /// Name of an application control machine group. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string groupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); - - using var scope = _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics.CreateScope("AdaptiveApplicationControlGroupCollection.Get"); - scope.Start(); - try - { - var response = _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Name), groupName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AdaptiveApplicationControlGroupResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName} - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_Get - /// - /// - /// - /// Name of an application control machine group. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string groupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); - - using var scope = _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics.CreateScope("AdaptiveApplicationControlGroupCollection.Exists"); - scope.Start(); - try - { - var response = await _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Name), groupName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName} - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_Get - /// - /// - /// - /// Name of an application control machine group. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string groupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); - - using var scope = _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics.CreateScope("AdaptiveApplicationControlGroupCollection.Exists"); - scope.Start(); - try - { - var response = _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Name), groupName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveApplicationControlGroupData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveApplicationControlGroupData.cs deleted file mode 100644 index 12f39b3bd732..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveApplicationControlGroupData.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// A class representing the AdaptiveApplicationControlGroup data model. - public partial class AdaptiveApplicationControlGroupData : ResourceData - { - /// Initializes a new instance of AdaptiveApplicationControlGroupData. - public AdaptiveApplicationControlGroupData() - { - Issues = new ChangeTrackingList(); - VmRecommendations = new ChangeTrackingList(); - PathRecommendations = new ChangeTrackingList(); - } - - /// Initializes a new instance of AdaptiveApplicationControlGroupData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The application control policy enforcement/protection mode of the machine group. - /// The protection mode of the collection/file types. Exe/Msi/Script are used for Windows, Executable is used for Linux. - /// The configuration status of the machines group or machine or rule. - /// The initial recommendation status of the machine group or machine. - /// - /// The source type of the machine group. - /// - /// - /// Location where the resource is stored. - internal AdaptiveApplicationControlGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AdaptiveApplicationControlEnforcementMode? enforcementMode, SecurityCenterFileProtectionMode protectionMode, SecurityCenterConfigurationStatus? configurationStatus, RecommendationStatus? recommendationStatus, IReadOnlyList issues, AdaptiveApplicationControlGroupSourceSystem? sourceSystem, IList vmRecommendations, IList pathRecommendations, AzureLocation? location) : base(id, name, resourceType, systemData) - { - EnforcementMode = enforcementMode; - ProtectionMode = protectionMode; - ConfigurationStatus = configurationStatus; - RecommendationStatus = recommendationStatus; - Issues = issues; - SourceSystem = sourceSystem; - VmRecommendations = vmRecommendations; - PathRecommendations = pathRecommendations; - Location = location; - } - - /// The application control policy enforcement/protection mode of the machine group. - public AdaptiveApplicationControlEnforcementMode? EnforcementMode { get; set; } - /// The protection mode of the collection/file types. Exe/Msi/Script are used for Windows, Executable is used for Linux. - public SecurityCenterFileProtectionMode ProtectionMode { get; set; } - /// The configuration status of the machines group or machine or rule. - public SecurityCenterConfigurationStatus? ConfigurationStatus { get; } - /// The initial recommendation status of the machine group or machine. - public RecommendationStatus? RecommendationStatus { get; } - /// Gets the issues. - public IReadOnlyList Issues { get; } - /// The source type of the machine group. - public AdaptiveApplicationControlGroupSourceSystem? SourceSystem { get; } - /// Gets the vm recommendations. - public IList VmRecommendations { get; } - /// Gets the path recommendations. - public IList PathRecommendations { get; } - /// Location where the resource is stored. - public AzureLocation? Location { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveApplicationControlGroupResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveApplicationControlGroupResource.cs deleted file mode 100644 index 72c0081c84d7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveApplicationControlGroupResource.cs +++ /dev/null @@ -1,297 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing an AdaptiveApplicationControlGroup along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetAdaptiveApplicationControlGroupResource method. - /// Otherwise you can get one from its parent resource using the GetAdaptiveApplicationControlGroup method. - /// - public partial class AdaptiveApplicationControlGroupResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation ascLocation, string groupName) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics; - private readonly AdaptiveApplicationControlsRestOperations _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient; - private readonly AdaptiveApplicationControlGroupData _data; - - /// Initializes a new instance of the class for mocking. - protected AdaptiveApplicationControlGroupResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal AdaptiveApplicationControlGroupResource(ArmClient client, AdaptiveApplicationControlGroupData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal AdaptiveApplicationControlGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string adaptiveApplicationControlGroupAdaptiveApplicationControlsApiVersion); - _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient = new AdaptiveApplicationControlsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, adaptiveApplicationControlGroupAdaptiveApplicationControlsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/locations/applicationWhitelistings"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual AdaptiveApplicationControlGroupData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets an application control VM/server group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName} - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics.CreateScope("AdaptiveApplicationControlGroupResource.Get"); - scope.Start(); - try - { - var response = await _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AdaptiveApplicationControlGroupResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets an application control VM/server group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName} - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics.CreateScope("AdaptiveApplicationControlGroupResource.Get"); - scope.Start(); - try - { - var response = _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AdaptiveApplicationControlGroupResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete an application control machine group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName} - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics.CreateScope("AdaptiveApplicationControlGroupResource.Delete"); - scope.Start(); - try - { - var response = await _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient.DeleteAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete an application control machine group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName} - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics.CreateScope("AdaptiveApplicationControlGroupResource.Delete"); - scope.Start(); - try - { - var response = _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient.Delete(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update an application control machine group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName} - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_Put - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The AdaptiveApplicationControlGroup to use. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, AdaptiveApplicationControlGroupData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics.CreateScope("AdaptiveApplicationControlGroupResource.Update"); - scope.Start(); - try - { - var response = await _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient.PutAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new AdaptiveApplicationControlGroupResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update an application control machine group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName} - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_Put - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The AdaptiveApplicationControlGroup to use. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, AdaptiveApplicationControlGroupData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics.CreateScope("AdaptiveApplicationControlGroupResource.Update"); - scope.Start(); - try - { - var response = _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient.Put(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new AdaptiveApplicationControlGroupResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveNetworkHardeningCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveNetworkHardeningCollection.cs deleted file mode 100644 index 21079170bf8c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveNetworkHardeningCollection.cs +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get an instance call the GetAdaptiveNetworkHardenings method from an instance of . - /// - public partial class AdaptiveNetworkHardeningCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _adaptiveNetworkHardeningClientDiagnostics; - private readonly AdaptiveNetworkHardeningsRestOperations _adaptiveNetworkHardeningRestClient; - private readonly string _resourceNamespace; - private readonly string _resourceType; - private readonly string _resourceName; - - /// Initializes a new instance of the class for mocking. - protected AdaptiveNetworkHardeningCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - /// The Namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - internal AdaptiveNetworkHardeningCollection(ArmClient client, ResourceIdentifier id, string resourceNamespace, string resourceType, string resourceName) : base(client, id) - { - _resourceNamespace = resourceNamespace; - _resourceType = resourceType; - _resourceName = resourceName; - _adaptiveNetworkHardeningClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", AdaptiveNetworkHardeningResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(AdaptiveNetworkHardeningResource.ResourceType, out string adaptiveNetworkHardeningApiVersion); - _adaptiveNetworkHardeningRestClient = new AdaptiveNetworkHardeningsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, adaptiveNetworkHardeningApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Gets a single Adaptive Network Hardening resource - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName} - /// - /// - /// Operation Id - /// AdaptiveNetworkHardenings_Get - /// - /// - /// - /// The name of the Adaptive Network Hardening resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string adaptiveNetworkHardeningResourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(adaptiveNetworkHardeningResourceName, nameof(adaptiveNetworkHardeningResourceName)); - - using var scope = _adaptiveNetworkHardeningClientDiagnostics.CreateScope("AdaptiveNetworkHardeningCollection.Get"); - scope.Start(); - try - { - var response = await _adaptiveNetworkHardeningRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName, adaptiveNetworkHardeningResourceName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AdaptiveNetworkHardeningResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a single Adaptive Network Hardening resource - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName} - /// - /// - /// Operation Id - /// AdaptiveNetworkHardenings_Get - /// - /// - /// - /// The name of the Adaptive Network Hardening resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string adaptiveNetworkHardeningResourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(adaptiveNetworkHardeningResourceName, nameof(adaptiveNetworkHardeningResourceName)); - - using var scope = _adaptiveNetworkHardeningClientDiagnostics.CreateScope("AdaptiveNetworkHardeningCollection.Get"); - scope.Start(); - try - { - var response = _adaptiveNetworkHardeningRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName, adaptiveNetworkHardeningResourceName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AdaptiveNetworkHardeningResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings - /// - /// - /// Operation Id - /// AdaptiveNetworkHardenings_ListByExtendedResource - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _adaptiveNetworkHardeningRestClient.CreateListByExtendedResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _adaptiveNetworkHardeningRestClient.CreateListByExtendedResourceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AdaptiveNetworkHardeningResource(Client, AdaptiveNetworkHardeningData.DeserializeAdaptiveNetworkHardeningData(e)), _adaptiveNetworkHardeningClientDiagnostics, Pipeline, "AdaptiveNetworkHardeningCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings - /// - /// - /// Operation Id - /// AdaptiveNetworkHardenings_ListByExtendedResource - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _adaptiveNetworkHardeningRestClient.CreateListByExtendedResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _adaptiveNetworkHardeningRestClient.CreateListByExtendedResourceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AdaptiveNetworkHardeningResource(Client, AdaptiveNetworkHardeningData.DeserializeAdaptiveNetworkHardeningData(e)), _adaptiveNetworkHardeningClientDiagnostics, Pipeline, "AdaptiveNetworkHardeningCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName} - /// - /// - /// Operation Id - /// AdaptiveNetworkHardenings_Get - /// - /// - /// - /// The name of the Adaptive Network Hardening resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string adaptiveNetworkHardeningResourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(adaptiveNetworkHardeningResourceName, nameof(adaptiveNetworkHardeningResourceName)); - - using var scope = _adaptiveNetworkHardeningClientDiagnostics.CreateScope("AdaptiveNetworkHardeningCollection.Exists"); - scope.Start(); - try - { - var response = await _adaptiveNetworkHardeningRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName, adaptiveNetworkHardeningResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName} - /// - /// - /// Operation Id - /// AdaptiveNetworkHardenings_Get - /// - /// - /// - /// The name of the Adaptive Network Hardening resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string adaptiveNetworkHardeningResourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(adaptiveNetworkHardeningResourceName, nameof(adaptiveNetworkHardeningResourceName)); - - using var scope = _adaptiveNetworkHardeningClientDiagnostics.CreateScope("AdaptiveNetworkHardeningCollection.Exists"); - scope.Start(); - try - { - var response = _adaptiveNetworkHardeningRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName, adaptiveNetworkHardeningResourceName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveNetworkHardeningData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveNetworkHardeningData.cs deleted file mode 100644 index 72b4ee783d90..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveNetworkHardeningData.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the AdaptiveNetworkHardening data model. - /// The resource whose properties describes the Adaptive Network Hardening settings for some Azure resource - /// - public partial class AdaptiveNetworkHardeningData : ResourceData - { - /// Initializes a new instance of AdaptiveNetworkHardeningData. - public AdaptiveNetworkHardeningData() - { - Rules = new ChangeTrackingList(); - EffectiveNetworkSecurityGroups = new ChangeTrackingList(); - } - - /// Initializes a new instance of AdaptiveNetworkHardeningData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// 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. - internal AdaptiveNetworkHardeningData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList rules, DateTimeOffset? rulesCalculatedOn, IList effectiveNetworkSecurityGroups) : base(id, name, resourceType, systemData) - { - Rules = rules; - RulesCalculatedOn = rulesCalculatedOn; - EffectiveNetworkSecurityGroups = effectiveNetworkSecurityGroups; - } - - /// The security rules which are recommended to be effective on the VM. - public IList Rules { get; } - /// The UTC time on which the rules were calculated. - public DateTimeOffset? RulesCalculatedOn { get; set; } - /// The Network Security Groups effective on the network interfaces of the protected resource. - public IList EffectiveNetworkSecurityGroups { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveNetworkHardeningResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveNetworkHardeningResource.cs deleted file mode 100644 index baedacd1c405..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdaptiveNetworkHardeningResource.cs +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing an AdaptiveNetworkHardening along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetAdaptiveNetworkHardeningResource method. - /// Otherwise you can get one from its parent resource using the GetAdaptiveNetworkHardening method. - /// - public partial class AdaptiveNetworkHardeningResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _adaptiveNetworkHardeningClientDiagnostics; - private readonly AdaptiveNetworkHardeningsRestOperations _adaptiveNetworkHardeningRestClient; - private readonly AdaptiveNetworkHardeningData _data; - - /// Initializes a new instance of the class for mocking. - protected AdaptiveNetworkHardeningResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal AdaptiveNetworkHardeningResource(ArmClient client, AdaptiveNetworkHardeningData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal AdaptiveNetworkHardeningResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _adaptiveNetworkHardeningClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string adaptiveNetworkHardeningApiVersion); - _adaptiveNetworkHardeningRestClient = new AdaptiveNetworkHardeningsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, adaptiveNetworkHardeningApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/adaptiveNetworkHardenings"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual AdaptiveNetworkHardeningData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets a single Adaptive Network Hardening resource - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName} - /// - /// - /// Operation Id - /// AdaptiveNetworkHardenings_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _adaptiveNetworkHardeningClientDiagnostics.CreateScope("AdaptiveNetworkHardeningResource.Get"); - scope.Start(); - try - { - var response = await _adaptiveNetworkHardeningRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.ResourceType.Namespace, Id.Parent.ResourceType.GetLastType(), Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AdaptiveNetworkHardeningResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a single Adaptive Network Hardening resource - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName} - /// - /// - /// Operation Id - /// AdaptiveNetworkHardenings_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _adaptiveNetworkHardeningClientDiagnostics.CreateScope("AdaptiveNetworkHardeningResource.Get"); - scope.Start(); - try - { - var response = _adaptiveNetworkHardeningRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.ResourceType.Namespace, Id.Parent.ResourceType.GetLastType(), Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AdaptiveNetworkHardeningResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Enforces the given rules on the NSG(s) listed in the request - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction} - /// - /// - /// Operation Id - /// AdaptiveNetworkHardenings_Enforce - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The AdaptiveNetworkHardeningEnforceContent to use. - /// The cancellation token to use. - /// is null. - public virtual async Task EnforceAsync(WaitUntil waitUntil, AdaptiveNetworkHardeningEnforceContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _adaptiveNetworkHardeningClientDiagnostics.CreateScope("AdaptiveNetworkHardeningResource.Enforce"); - scope.Start(); - try - { - var response = await _adaptiveNetworkHardeningRestClient.EnforceAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.ResourceType.Namespace, Id.Parent.ResourceType.GetLastType(), Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(_adaptiveNetworkHardeningClientDiagnostics, Pipeline, _adaptiveNetworkHardeningRestClient.CreateEnforceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.ResourceType.Namespace, Id.Parent.ResourceType.GetLastType(), Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Enforces the given rules on the NSG(s) listed in the request - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction} - /// - /// - /// Operation Id - /// AdaptiveNetworkHardenings_Enforce - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The AdaptiveNetworkHardeningEnforceContent to use. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Enforce(WaitUntil waitUntil, AdaptiveNetworkHardeningEnforceContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _adaptiveNetworkHardeningClientDiagnostics.CreateScope("AdaptiveNetworkHardeningResource.Enforce"); - scope.Start(); - try - { - var response = _adaptiveNetworkHardeningRestClient.Enforce(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.ResourceType.Namespace, Id.Parent.ResourceType.GetLastType(), Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new SecurityCenterArmOperation(_adaptiveNetworkHardeningClientDiagnostics, Pipeline, _adaptiveNetworkHardeningRestClient.CreateEnforceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.ResourceType.Namespace, Id.Parent.ResourceType.GetLastType(), Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdvancedThreatProtectionSettingData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdvancedThreatProtectionSettingData.cs deleted file mode 100644 index 0aba539118f5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdvancedThreatProtectionSettingData.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the AdvancedThreatProtectionSetting data model. - /// The Advanced Threat Protection resource. - /// - public partial class AdvancedThreatProtectionSettingData : ResourceData - { - /// Initializes a new instance of AdvancedThreatProtectionSettingData. - public AdvancedThreatProtectionSettingData() - { - } - - /// Initializes a new instance of AdvancedThreatProtectionSettingData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Indicates whether Advanced Threat Protection is enabled. - internal AdvancedThreatProtectionSettingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, bool? isEnabled) : base(id, name, resourceType, systemData) - { - IsEnabled = isEnabled; - } - - /// Indicates whether Advanced Threat Protection is enabled. - public bool? IsEnabled { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdvancedThreatProtectionSettingResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdvancedThreatProtectionSettingResource.cs deleted file mode 100644 index e693dc964016..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AdvancedThreatProtectionSettingResource.cs +++ /dev/null @@ -1,229 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing an AdvancedThreatProtectionSetting along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetAdvancedThreatProtectionSettingResource method. - /// Otherwise you can get one from its parent resource using the GetAdvancedThreatProtectionSetting method. - /// - public partial class AdvancedThreatProtectionSettingResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string resourceId) - { - var resourceId0 = $"{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/current"; - return new ResourceIdentifier(resourceId0); - } - - private readonly ClientDiagnostics _advancedThreatProtectionSettingAdvancedThreatProtectionClientDiagnostics; - private readonly AdvancedThreatProtectionRestOperations _advancedThreatProtectionSettingAdvancedThreatProtectionRestClient; - private readonly AdvancedThreatProtectionSettingData _data; - - /// Initializes a new instance of the class for mocking. - protected AdvancedThreatProtectionSettingResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal AdvancedThreatProtectionSettingResource(ArmClient client, AdvancedThreatProtectionSettingData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal AdvancedThreatProtectionSettingResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _advancedThreatProtectionSettingAdvancedThreatProtectionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string advancedThreatProtectionSettingAdvancedThreatProtectionApiVersion); - _advancedThreatProtectionSettingAdvancedThreatProtectionRestClient = new AdvancedThreatProtectionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, advancedThreatProtectionSettingAdvancedThreatProtectionApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/advancedThreatProtectionSettings"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual AdvancedThreatProtectionSettingData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets the Advanced Threat Protection settings for the specified resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName} - /// - /// - /// Operation Id - /// AdvancedThreatProtection_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _advancedThreatProtectionSettingAdvancedThreatProtectionClientDiagnostics.CreateScope("AdvancedThreatProtectionSettingResource.Get"); - scope.Start(); - try - { - var response = await _advancedThreatProtectionSettingAdvancedThreatProtectionRestClient.GetAsync(Id.Parent, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AdvancedThreatProtectionSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the Advanced Threat Protection settings for the specified resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName} - /// - /// - /// Operation Id - /// AdvancedThreatProtection_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _advancedThreatProtectionSettingAdvancedThreatProtectionClientDiagnostics.CreateScope("AdvancedThreatProtectionSettingResource.Get"); - scope.Start(); - try - { - var response = _advancedThreatProtectionSettingAdvancedThreatProtectionRestClient.Get(Id.Parent, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AdvancedThreatProtectionSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates the Advanced Threat Protection settings on a specified resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName} - /// - /// - /// Operation Id - /// AdvancedThreatProtection_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Advanced Threat Protection Settings. - /// The cancellation token to use. - /// is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, AdvancedThreatProtectionSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _advancedThreatProtectionSettingAdvancedThreatProtectionClientDiagnostics.CreateScope("AdvancedThreatProtectionSettingResource.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _advancedThreatProtectionSettingAdvancedThreatProtectionRestClient.CreateAsync(Id.Parent, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new AdvancedThreatProtectionSettingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates the Advanced Threat Protection settings on a specified resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName} - /// - /// - /// Operation Id - /// AdvancedThreatProtection_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Advanced Threat Protection Settings. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, AdvancedThreatProtectionSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _advancedThreatProtectionSettingAdvancedThreatProtectionClientDiagnostics.CreateScope("AdvancedThreatProtectionSettingResource.CreateOrUpdate"); - scope.Start(); - try - { - var response = _advancedThreatProtectionSettingAdvancedThreatProtectionRestClient.Create(Id.Parent, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new AdvancedThreatProtectionSettingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AssignmentCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AssignmentCollection.cs new file mode 100644 index 000000000000..227eaf2ab38d --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AssignmentCollection.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.SecurityCenter +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAssignments method from an instance of . + /// + public partial class AssignmentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _assignmentClientDiagnostics; + private readonly AssignmentsRestOperations _assignmentRestClient; + + /// Initializes a new instance of the class for mocking. + protected AssignmentCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal AssignmentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _assignmentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", AssignmentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AssignmentResource.ResourceType, out string assignmentApiVersion); + _assignmentRestClient = new AssignmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, assignmentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a security assignment on the given scope. Will create/update the required standard assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} + /// + /// + /// Operation Id + /// Assignments_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The security assignment key - unique key for the standard assignment. + /// Custom standard assignment over a pre-defined scope. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string assignmentId, AssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assignmentId, nameof(assignmentId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _assignmentRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, assignmentId, data, cancellationToken).ConfigureAwait(false); + var operation = new SecurityCenterArmOperation(Response.FromValue(new AssignmentResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a security assignment on the given scope. Will create/update the required standard assignment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} + /// + /// + /// Operation Id + /// Assignments_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The security assignment key - unique key for the standard assignment. + /// Custom standard assignment over a pre-defined scope. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string assignmentId, AssignmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assignmentId, nameof(assignmentId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _assignmentRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, assignmentId, data, cancellationToken); + var operation = new SecurityCenterArmOperation(Response.FromValue(new AssignmentResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a specific standard assignment for the requested scope by resourceId + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} + /// + /// + /// Operation Id + /// Assignments_Get + /// + /// + /// + /// The security assignment key - unique key for the standard assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string assignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assignmentId, nameof(assignmentId)); + + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentCollection.Get"); + scope.Start(); + try + { + var response = await _assignmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, assignmentId, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a specific standard assignment for the requested scope by resourceId + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} + /// + /// + /// Operation Id + /// Assignments_Get + /// + /// + /// + /// The security assignment key - unique key for the standard assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string assignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assignmentId, nameof(assignmentId)); + + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentCollection.Get"); + scope.Start(); + try + { + var response = _assignmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, assignmentId, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AssignmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a list of all relevant standardAssignments available for scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments + /// + /// + /// Operation Id + /// Assignments_List + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _assignmentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _assignmentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AssignmentResource(Client, AssignmentData.DeserializeAssignmentData(e)), _assignmentClientDiagnostics, Pipeline, "AssignmentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Get a list of all relevant standardAssignments available for scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments + /// + /// + /// Operation Id + /// Assignments_List + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _assignmentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _assignmentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AssignmentResource(Client, AssignmentData.DeserializeAssignmentData(e)), _assignmentClientDiagnostics, Pipeline, "AssignmentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} + /// + /// + /// Operation Id + /// Assignments_Get + /// + /// + /// + /// The security assignment key - unique key for the standard assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string assignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assignmentId, nameof(assignmentId)); + + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentCollection.Exists"); + scope.Start(); + try + { + var response = await _assignmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, assignmentId, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} + /// + /// + /// Operation Id + /// Assignments_Get + /// + /// + /// + /// The security assignment key - unique key for the standard assignment. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string assignmentId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(assignmentId, nameof(assignmentId)); + + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentCollection.Exists"); + scope.Start(); + try + { + var response = _assignmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, assignmentId, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AssignmentData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AssignmentData.cs new file mode 100644 index 000000000000..eca13b71582a --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AssignmentData.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; +using Azure.ResourceManager.SecurityCenter.Models; + +namespace Azure.ResourceManager.SecurityCenter +{ + /// + /// A class representing the Assignment data model. + /// Security Assignment on a resource group over a given scope + /// + public partial class AssignmentData : TrackedResourceData + { + /// Initializes a new instance of AssignmentData. + /// The location. + public AssignmentData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of AssignmentData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// display name of the standardAssignment. + /// description of the standardAssignment. + /// Standard item with key as applied to this standard assignment over the given scope. + /// Component item with key as applied to this standard assignment over the given scope. + /// Scope to which the standardAssignment applies - can be a subscription path or a resource group under that subscription. + /// expected effect of this assignment (Disable/Exempt/etc). + /// Expiration date of this assignment as a full ISO date. + /// Additional data about the assignment. + /// The assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs. + /// Kind of the resource. + /// Entity tag is used for comparing two or more entities from the same requested resource. + internal AssignmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string displayName, string description, WritableSubResource assignedStandard, AssignedComponentItem assignedComponent, string scope, string effect, DateTimeOffset? expiresOn, AssignmentPropertiesAdditionalData additionalData, BinaryData metadata, string kind, ETag? eTag) : base(id, name, resourceType, systemData, tags, location) + { + DisplayName = displayName; + Description = description; + AssignedStandard = assignedStandard; + AssignedComponent = assignedComponent; + Scope = scope; + Effect = effect; + ExpiresOn = expiresOn; + AdditionalData = additionalData; + Metadata = metadata; + Kind = kind; + ETag = eTag; + } + + /// display name of the standardAssignment. + public string DisplayName { get; set; } + /// description of the standardAssignment. + public string Description { get; set; } + /// Standard item with key as applied to this standard assignment over the given scope. + internal WritableSubResource AssignedStandard { get; set; } + /// Gets or sets Id. + public ResourceIdentifier AssignedStandardId + { + get => AssignedStandard is null ? default : AssignedStandard.Id; + set + { + if (AssignedStandard is null) + AssignedStandard = new WritableSubResource(); + AssignedStandard.Id = value; + } + } + + /// Component item with key as applied to this standard assignment over the given scope. + internal AssignedComponentItem AssignedComponent { get; set; } + /// unique key to a security assessment object. + public string AssignedComponentKey + { + get => AssignedComponent is null ? default : AssignedComponent.Key; + set + { + if (AssignedComponent is null) + AssignedComponent = new AssignedComponentItem(); + AssignedComponent.Key = value; + } + } + + /// Scope to which the standardAssignment applies - can be a subscription path or a resource group under that subscription. + public string Scope { get; set; } + /// expected effect of this assignment (Disable/Exempt/etc). + public string Effect { get; set; } + /// Expiration date of this assignment as a full ISO date. + public DateTimeOffset? ExpiresOn { get; set; } + /// Additional data about the assignment. + internal AssignmentPropertiesAdditionalData AdditionalData { get; set; } + /// Exemption category of this assignment. + public string AdditionalDataExemptionCategory + { + get => AdditionalData is null ? default : AdditionalData.ExemptionCategory; + set + { + if (AdditionalData is null) + AdditionalData = new AssignmentPropertiesAdditionalData(); + AdditionalData.ExemptionCategory = value; + } + } + + /// + /// The assignment metadata. Metadata is an open ended object and is typically a collection of key value pairs. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formated json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public BinaryData Metadata { get; set; } + /// Kind of the resource. + public string Kind { get; set; } + /// Entity tag is used for comparing two or more entities from the same requested resource. + public ETag? ETag { get; set; } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AssignmentResource.cs similarity index 57% rename from sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionResource.cs rename to sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AssignmentResource.cs index 6a65ac8503eb..7ab7355d68ab 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionResource.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AssignmentResource.cs @@ -15,65 +15,64 @@ using Azure.Core.Pipeline; using Azure.ResourceManager; using Azure.ResourceManager.Resources; -using Azure.ResourceManager.SecurityCenter.Models; namespace Azure.ResourceManager.SecurityCenter { /// - /// A Class representing an IotSecuritySolution along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetIotSecuritySolutionResource method. - /// Otherwise you can get one from its parent resource using the GetIotSecuritySolution method. + /// A Class representing an Assignment along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetAssignmentResource method. + /// Otherwise you can get one from its parent resource using the GetAssignment method. /// - public partial class IotSecuritySolutionResource : ArmResource + public partial class AssignmentResource : ArmResource { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string solutionName) + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string assignmentId) { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId}"; return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _iotSecuritySolutionClientDiagnostics; - private readonly IotSecuritySolutionRestOperations _iotSecuritySolutionRestClient; - private readonly IotSecuritySolutionData _data; + private readonly ClientDiagnostics _assignmentClientDiagnostics; + private readonly AssignmentsRestOperations _assignmentRestClient; + private readonly AssignmentData _data; - /// Initializes a new instance of the class for mocking. - protected IotSecuritySolutionResource() + /// Initializes a new instance of the class for mocking. + protected AssignmentResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal IotSecuritySolutionResource(ArmClient client, IotSecuritySolutionData data) : this(client, data.Id) + internal AssignmentResource(ArmClient client, AssignmentData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal IotSecuritySolutionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal AssignmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _iotSecuritySolutionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string iotSecuritySolutionApiVersion); - _iotSecuritySolutionRestClient = new IotSecuritySolutionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotSecuritySolutionApiVersion); + _assignmentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string assignmentApiVersion); + _assignmentRestClient = new AssignmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, assignmentApiVersion); #if DEBUG ValidateResourceId(Id); #endif } /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/iotSecuritySolutions"; + public static readonly ResourceType ResourceType = "Microsoft.Security/assignments"; /// Gets whether or not the current instance has data. public virtual bool HasData { get; } /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual IotSecuritySolutionData Data + public virtual AssignmentData Data { get { @@ -89,37 +88,30 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } - /// Gets an object representing a IotSecuritySolutionAnalyticsModelResource along with the instance operations that can be performed on it in the IotSecuritySolution. - /// Returns a object. - public virtual IotSecuritySolutionAnalyticsModelResource GetIotSecuritySolutionAnalyticsModel() - { - return new IotSecuritySolutionAnalyticsModelResource(Client, Id.AppendChildResource("analyticsModels", "default")); - } - /// - /// User this method to get details of a specific IoT Security solution based on solution name + /// Get a specific standard assignment for the requested scope by resourceId /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} /// /// /// Operation Id - /// IotSecuritySolution_Get + /// Assignments_Get /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionResource.Get"); + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentResource.Get"); scope.Start(); try { - var response = await _iotSecuritySolutionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _assignmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IotSecuritySolutionResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new AssignmentResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -129,29 +121,29 @@ public virtual async Task> GetAsync(Cancel } /// - /// User this method to get details of a specific IoT Security solution based on solution name + /// Get a specific standard assignment for the requested scope by resourceId /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} /// /// /// Operation Id - /// IotSecuritySolution_Get + /// Assignments_Get /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionResource.Get"); + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentResource.Get"); scope.Start(); try { - var response = _iotSecuritySolutionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _assignmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IotSecuritySolutionResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new AssignmentResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -161,15 +153,15 @@ public virtual Response Get(CancellationToken cance } /// - /// Use this method to delete yours IoT Security solution + /// Delete a standard assignment over a given scope /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} /// /// /// Operation Id - /// IotSecuritySolution_Delete + /// Assignments_Delete /// /// /// @@ -177,11 +169,11 @@ public virtual Response Get(CancellationToken cance /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionResource.Delete"); + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentResource.Delete"); scope.Start(); try { - var response = await _iotSecuritySolutionRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _assignmentRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); var operation = new SecurityCenterArmOperation(response); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); @@ -195,15 +187,15 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Use this method to delete yours IoT Security solution + /// Delete a standard assignment over a given scope /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} /// /// /// Operation Id - /// IotSecuritySolution_Delete + /// Assignments_Delete /// /// /// @@ -211,11 +203,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionResource.Delete"); + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentResource.Delete"); scope.Start(); try { - var response = _iotSecuritySolutionRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _assignmentRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); var operation = new SecurityCenterArmOperation(response); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); @@ -229,31 +221,35 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Use this method to update existing IoT Security solution tags or user defined resources. To update other fields use the CreateOrUpdate method. + /// Create a security assignment on the given scope. Will create/update the required standard assignment. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} /// /// /// Operation Id - /// IotSecuritySolution_Update + /// Assignments_CreateOrUpdate /// /// /// - /// The security solution data. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Custom standard assignment over a pre-defined scope. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(IotSecuritySolutionPatch patch, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, AssignmentData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionResource.Update"); + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentResource.Update"); scope.Start(); try { - var response = await _iotSecuritySolutionRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new IotSecuritySolutionResource(Client, response.Value), response.GetRawResponse()); + var response = await _assignmentRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new SecurityCenterArmOperation(Response.FromValue(new AssignmentResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; } catch (Exception e) { @@ -263,31 +259,35 @@ public virtual async Task> UpdateAsync(Iot } /// - /// Use this method to update existing IoT Security solution tags or user defined resources. To update other fields use the CreateOrUpdate method. + /// Create a security assignment on the given scope. Will create/update the required standard assignment. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} /// /// /// Operation Id - /// IotSecuritySolution_Update + /// Assignments_CreateOrUpdate /// /// /// - /// The security solution data. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Custom standard assignment over a pre-defined scope. /// The cancellation token to use. - /// is null. - public virtual Response Update(IotSecuritySolutionPatch patch, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, AssignmentData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionResource.Update"); + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentResource.Update"); scope.Start(); try { - var response = _iotSecuritySolutionRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - return Response.FromValue(new IotSecuritySolutionResource(Client, response.Value), response.GetRawResponse()); + var response = _assignmentRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken); + var operation = new SecurityCenterArmOperation(Response.FromValue(new AssignmentResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; } catch (Exception e) { @@ -301,11 +301,11 @@ public virtual Response Update(IotSecuritySolutionP /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} /// /// /// Operation Id - /// IotSecuritySolution_Get + /// Assignments_Get /// /// /// @@ -313,12 +313,12 @@ public virtual Response Update(IotSecuritySolutionP /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionResource.AddTag"); + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentResource.AddTag"); scope.Start(); try { @@ -327,20 +327,15 @@ public virtual async Task> AddTagAsync(str var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _iotSecuritySolutionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new IotSecuritySolutionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _assignmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AssignmentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new IotSecuritySolutionPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; + current.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -355,11 +350,11 @@ public virtual async Task> AddTagAsync(str /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} /// /// /// Operation Id - /// IotSecuritySolution_Get + /// Assignments_Get /// /// /// @@ -367,12 +362,12 @@ public virtual async Task> AddTagAsync(str /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionResource.AddTag"); + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentResource.AddTag"); scope.Start(); try { @@ -381,20 +376,15 @@ public virtual Response AddTag(string key, string v var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _iotSecuritySolutionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new IotSecuritySolutionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _assignmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new AssignmentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new IotSecuritySolutionPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(patch, cancellationToken: cancellationToken); - return result; + current.Tags[key] = value; + var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -409,22 +399,22 @@ public virtual Response AddTag(string key, string v /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} /// /// /// Operation Id - /// IotSecuritySolution_Get + /// Assignments_Get /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionResource.SetTags"); + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentResource.SetTags"); scope.Start(); try { @@ -434,16 +424,15 @@ public virtual async Task> SetTagsAsync(ID var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _iotSecuritySolutionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new IotSecuritySolutionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _assignmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AssignmentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new IotSecuritySolutionPatch(); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; + current.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -458,22 +447,22 @@ public virtual async Task> SetTagsAsync(ID /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} /// /// /// Operation Id - /// IotSecuritySolution_Get + /// Assignments_Get /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionResource.SetTags"); + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentResource.SetTags"); scope.Start(); try { @@ -483,16 +472,15 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} /// /// /// Operation Id - /// IotSecuritySolution_Get + /// Assignments_Get /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionResource.RemoveTag"); + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentResource.RemoveTag"); scope.Start(); try { @@ -531,20 +519,15 @@ public virtual async Task> RemoveTagAsync( var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _iotSecuritySolutionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new IotSecuritySolutionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _assignmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new AssignmentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new IotSecuritySolutionPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; + current.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) @@ -559,22 +542,22 @@ public virtual async Task> RemoveTagAsync( /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} /// /// /// Operation Id - /// IotSecuritySolution_Get + /// Assignments_Get /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionResource.RemoveTag"); + using var scope = _assignmentClientDiagnostics.CreateScope("AssignmentResource.RemoveTag"); scope.Start(); try { @@ -583,20 +566,15 @@ public virtual Response RemoveTag(string key, Cance var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _iotSecuritySolutionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new IotSecuritySolutionResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _assignmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new AssignmentResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new IotSecuritySolutionPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(patch, cancellationToken: cancellationToken); - return result; + current.Tags.Remove(key); + var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); } } catch (Exception e) diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AutoProvisioningSettingCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AutoProvisioningSettingCollection.cs deleted file mode 100644 index d56aa396b8b2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AutoProvisioningSettingCollection.cs +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get an instance call the GetAutoProvisioningSettings method from an instance of . - /// - public partial class AutoProvisioningSettingCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _autoProvisioningSettingClientDiagnostics; - private readonly AutoProvisioningSettingsRestOperations _autoProvisioningSettingRestClient; - - /// Initializes a new instance of the class for mocking. - protected AutoProvisioningSettingCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal AutoProvisioningSettingCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _autoProvisioningSettingClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", AutoProvisioningSettingResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(AutoProvisioningSettingResource.ResourceType, out string autoProvisioningSettingApiVersion); - _autoProvisioningSettingRestClient = new AutoProvisioningSettingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, autoProvisioningSettingApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SubscriptionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); - } - - /// - /// Details of a specific setting - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName} - /// - /// - /// Operation Id - /// AutoProvisioningSettings_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Auto provisioning setting key. - /// Auto provisioning setting key. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string settingName, AutoProvisioningSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(settingName, nameof(settingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _autoProvisioningSettingClientDiagnostics.CreateScope("AutoProvisioningSettingCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _autoProvisioningSettingRestClient.CreateAsync(Id.SubscriptionId, settingName, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new AutoProvisioningSettingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Details of a specific setting - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName} - /// - /// - /// Operation Id - /// AutoProvisioningSettings_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Auto provisioning setting key. - /// Auto provisioning setting key. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string settingName, AutoProvisioningSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(settingName, nameof(settingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _autoProvisioningSettingClientDiagnostics.CreateScope("AutoProvisioningSettingCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _autoProvisioningSettingRestClient.Create(Id.SubscriptionId, settingName, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new AutoProvisioningSettingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Details of a specific setting - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName} - /// - /// - /// Operation Id - /// AutoProvisioningSettings_Get - /// - /// - /// - /// Auto provisioning setting key. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string settingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(settingName, nameof(settingName)); - - using var scope = _autoProvisioningSettingClientDiagnostics.CreateScope("AutoProvisioningSettingCollection.Get"); - scope.Start(); - try - { - var response = await _autoProvisioningSettingRestClient.GetAsync(Id.SubscriptionId, settingName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AutoProvisioningSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Details of a specific setting - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName} - /// - /// - /// Operation Id - /// AutoProvisioningSettings_Get - /// - /// - /// - /// Auto provisioning setting key. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string settingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(settingName, nameof(settingName)); - - using var scope = _autoProvisioningSettingClientDiagnostics.CreateScope("AutoProvisioningSettingCollection.Get"); - scope.Start(); - try - { - var response = _autoProvisioningSettingRestClient.Get(Id.SubscriptionId, settingName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AutoProvisioningSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Exposes the auto provisioning settings of the subscriptions - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings - /// - /// - /// Operation Id - /// AutoProvisioningSettings_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _autoProvisioningSettingRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autoProvisioningSettingRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AutoProvisioningSettingResource(Client, AutoProvisioningSettingData.DeserializeAutoProvisioningSettingData(e)), _autoProvisioningSettingClientDiagnostics, Pipeline, "AutoProvisioningSettingCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Exposes the auto provisioning settings of the subscriptions - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings - /// - /// - /// Operation Id - /// AutoProvisioningSettings_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _autoProvisioningSettingRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autoProvisioningSettingRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AutoProvisioningSettingResource(Client, AutoProvisioningSettingData.DeserializeAutoProvisioningSettingData(e)), _autoProvisioningSettingClientDiagnostics, Pipeline, "AutoProvisioningSettingCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName} - /// - /// - /// Operation Id - /// AutoProvisioningSettings_Get - /// - /// - /// - /// Auto provisioning setting key. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string settingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(settingName, nameof(settingName)); - - using var scope = _autoProvisioningSettingClientDiagnostics.CreateScope("AutoProvisioningSettingCollection.Exists"); - scope.Start(); - try - { - var response = await _autoProvisioningSettingRestClient.GetAsync(Id.SubscriptionId, settingName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName} - /// - /// - /// Operation Id - /// AutoProvisioningSettings_Get - /// - /// - /// - /// Auto provisioning setting key. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string settingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(settingName, nameof(settingName)); - - using var scope = _autoProvisioningSettingClientDiagnostics.CreateScope("AutoProvisioningSettingCollection.Exists"); - scope.Start(); - try - { - var response = _autoProvisioningSettingRestClient.Get(Id.SubscriptionId, settingName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AutoProvisioningSettingData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AutoProvisioningSettingData.cs deleted file mode 100644 index 72cf72d41d20..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AutoProvisioningSettingData.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the AutoProvisioningSetting data model. - /// Auto provisioning setting - /// - public partial class AutoProvisioningSettingData : ResourceData - { - /// Initializes a new instance of AutoProvisioningSettingData. - public AutoProvisioningSettingData() - { - } - - /// Initializes a new instance of AutoProvisioningSettingData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Describes what kind of security agent provisioning action to take. - internal AutoProvisioningSettingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AutoProvisionState? autoProvision) : base(id, name, resourceType, systemData) - { - AutoProvision = autoProvision; - } - - /// Describes what kind of security agent provisioning action to take. - public AutoProvisionState? AutoProvision { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AutoProvisioningSettingResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AutoProvisioningSettingResource.cs deleted file mode 100644 index 78f72a039bdb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/AutoProvisioningSettingResource.cs +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing an AutoProvisioningSetting along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetAutoProvisioningSettingResource method. - /// Otherwise you can get one from its parent resource using the GetAutoProvisioningSetting method. - /// - public partial class AutoProvisioningSettingResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string settingName) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _autoProvisioningSettingClientDiagnostics; - private readonly AutoProvisioningSettingsRestOperations _autoProvisioningSettingRestClient; - private readonly AutoProvisioningSettingData _data; - - /// Initializes a new instance of the class for mocking. - protected AutoProvisioningSettingResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal AutoProvisioningSettingResource(ArmClient client, AutoProvisioningSettingData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal AutoProvisioningSettingResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _autoProvisioningSettingClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string autoProvisioningSettingApiVersion); - _autoProvisioningSettingRestClient = new AutoProvisioningSettingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, autoProvisioningSettingApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/autoProvisioningSettings"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual AutoProvisioningSettingData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Details of a specific setting - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName} - /// - /// - /// Operation Id - /// AutoProvisioningSettings_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _autoProvisioningSettingClientDiagnostics.CreateScope("AutoProvisioningSettingResource.Get"); - scope.Start(); - try - { - var response = await _autoProvisioningSettingRestClient.GetAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AutoProvisioningSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Details of a specific setting - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName} - /// - /// - /// Operation Id - /// AutoProvisioningSettings_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _autoProvisioningSettingClientDiagnostics.CreateScope("AutoProvisioningSettingResource.Get"); - scope.Start(); - try - { - var response = _autoProvisioningSettingRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new AutoProvisioningSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Details of a specific setting - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName} - /// - /// - /// Operation Id - /// AutoProvisioningSettings_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Auto provisioning setting key. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, AutoProvisioningSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _autoProvisioningSettingClientDiagnostics.CreateScope("AutoProvisioningSettingResource.Update"); - scope.Start(); - try - { - var response = await _autoProvisioningSettingRestClient.CreateAsync(Id.SubscriptionId, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new AutoProvisioningSettingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Details of a specific setting - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName} - /// - /// - /// Operation Id - /// AutoProvisioningSettings_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Auto provisioning setting key. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, AutoProvisioningSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _autoProvisioningSettingClientDiagnostics.CreateScope("AutoProvisioningSettingResource.Update"); - scope.Start(); - try - { - var response = _autoProvisioningSettingRestClient.Create(Id.SubscriptionId, Id.Name, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new AutoProvisioningSettingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ComplianceResultCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ComplianceResultCollection.cs deleted file mode 100644 index 33a494242888..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ComplianceResultCollection.cs +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetComplianceResults method from an instance of . - /// - public partial class ComplianceResultCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _complianceResultClientDiagnostics; - private readonly ComplianceResultsRestOperations _complianceResultRestClient; - - /// Initializes a new instance of the class for mocking. - protected ComplianceResultCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal ComplianceResultCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _complianceResultClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ComplianceResultResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ComplianceResultResource.ResourceType, out string complianceResultApiVersion); - _complianceResultRestClient = new ComplianceResultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, complianceResultApiVersion); - } - - /// - /// Security Compliance Result - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName} - /// - /// - /// Operation Id - /// ComplianceResults_Get - /// - /// - /// - /// name of the desired assessment compliance result. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string complianceResultName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(complianceResultName, nameof(complianceResultName)); - - using var scope = _complianceResultClientDiagnostics.CreateScope("ComplianceResultCollection.Get"); - scope.Start(); - try - { - var response = await _complianceResultRestClient.GetAsync(Id, complianceResultName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ComplianceResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Security Compliance Result - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName} - /// - /// - /// Operation Id - /// ComplianceResults_Get - /// - /// - /// - /// name of the desired assessment compliance result. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string complianceResultName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(complianceResultName, nameof(complianceResultName)); - - using var scope = _complianceResultClientDiagnostics.CreateScope("ComplianceResultCollection.Get"); - scope.Start(); - try - { - var response = _complianceResultRestClient.Get(Id, complianceResultName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ComplianceResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Security compliance results in the subscription - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/complianceResults - /// - /// - /// Operation Id - /// ComplianceResults_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _complianceResultRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _complianceResultRestClient.CreateListNextPageRequest(nextLink, Id); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ComplianceResultResource(Client, ComplianceResultData.DeserializeComplianceResultData(e)), _complianceResultClientDiagnostics, Pipeline, "ComplianceResultCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Security compliance results in the subscription - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/complianceResults - /// - /// - /// Operation Id - /// ComplianceResults_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _complianceResultRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _complianceResultRestClient.CreateListNextPageRequest(nextLink, Id); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ComplianceResultResource(Client, ComplianceResultData.DeserializeComplianceResultData(e)), _complianceResultClientDiagnostics, Pipeline, "ComplianceResultCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName} - /// - /// - /// Operation Id - /// ComplianceResults_Get - /// - /// - /// - /// name of the desired assessment compliance result. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string complianceResultName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(complianceResultName, nameof(complianceResultName)); - - using var scope = _complianceResultClientDiagnostics.CreateScope("ComplianceResultCollection.Exists"); - scope.Start(); - try - { - var response = await _complianceResultRestClient.GetAsync(Id, complianceResultName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName} - /// - /// - /// Operation Id - /// ComplianceResults_Get - /// - /// - /// - /// name of the desired assessment compliance result. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string complianceResultName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(complianceResultName, nameof(complianceResultName)); - - using var scope = _complianceResultClientDiagnostics.CreateScope("ComplianceResultCollection.Exists"); - scope.Start(); - try - { - var response = _complianceResultRestClient.Get(Id, complianceResultName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ComplianceResultData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ComplianceResultData.cs deleted file mode 100644 index 9ab24bc2712c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ComplianceResultData.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the ComplianceResult data model. - /// a compliance result - /// - public partial class ComplianceResultData : ResourceData - { - /// Initializes a new instance of ComplianceResultData. - public ComplianceResultData() - { - } - - /// Initializes a new instance of ComplianceResultData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The status of the resource regarding a single assessment. - internal ComplianceResultData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SecurityAssessmentResourceStatus? resourceStatus) : base(id, name, resourceType, systemData) - { - ResourceStatus = resourceStatus; - } - - /// The status of the resource regarding a single assessment. - public SecurityAssessmentResourceStatus? ResourceStatus { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ComplianceResultResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ComplianceResultResource.cs deleted file mode 100644 index f3dce225c94b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ComplianceResultResource.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a ComplianceResult along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetComplianceResultResource method. - /// Otherwise you can get one from its parent resource using the GetComplianceResult method. - /// - public partial class ComplianceResultResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string resourceId, string complianceResultName) - { - var resourceId0 = $"{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName}"; - return new ResourceIdentifier(resourceId0); - } - - private readonly ClientDiagnostics _complianceResultClientDiagnostics; - private readonly ComplianceResultsRestOperations _complianceResultRestClient; - private readonly ComplianceResultData _data; - - /// Initializes a new instance of the class for mocking. - protected ComplianceResultResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal ComplianceResultResource(ArmClient client, ComplianceResultData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal ComplianceResultResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _complianceResultClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string complianceResultApiVersion); - _complianceResultRestClient = new ComplianceResultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, complianceResultApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/complianceResults"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual ComplianceResultData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Security Compliance Result - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName} - /// - /// - /// Operation Id - /// ComplianceResults_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _complianceResultClientDiagnostics.CreateScope("ComplianceResultResource.Get"); - scope.Start(); - try - { - var response = await _complianceResultRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ComplianceResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Security Compliance Result - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName} - /// - /// - /// Operation Id - /// ComplianceResults_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _complianceResultClientDiagnostics.CreateScope("ComplianceResultResource.Get"); - scope.Start(); - try - { - var response = _complianceResultRestClient.Get(Id.Parent, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ComplianceResultResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomAssessmentAutomationCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomAssessmentAutomationCollection.cs deleted file mode 100644 index 2bdb165e98b5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomAssessmentAutomationCollection.cs +++ /dev/null @@ -1,342 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetCustomAssessmentAutomations method from an instance of . - /// - public partial class CustomAssessmentAutomationCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _customAssessmentAutomationClientDiagnostics; - private readonly CustomAssessmentAutomationsRestOperations _customAssessmentAutomationRestClient; - - /// Initializes a new instance of the class for mocking. - protected CustomAssessmentAutomationCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal CustomAssessmentAutomationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _customAssessmentAutomationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", CustomAssessmentAutomationResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CustomAssessmentAutomationResource.ResourceType, out string customAssessmentAutomationApiVersion); - _customAssessmentAutomationRestClient = new CustomAssessmentAutomationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, customAssessmentAutomationApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates a custom assessment automation for the provided subscription. Please note that providing an existing custom assessment automation will replace the existing record. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName} - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the Custom Assessment Automation. - /// Custom Assessment Automation body. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string customAssessmentAutomationName, CustomAssessmentAutomationCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(customAssessmentAutomationName, nameof(customAssessmentAutomationName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _customAssessmentAutomationClientDiagnostics.CreateScope("CustomAssessmentAutomationCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _customAssessmentAutomationRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, customAssessmentAutomationName, content, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new CustomAssessmentAutomationResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a custom assessment automation for the provided subscription. Please note that providing an existing custom assessment automation will replace the existing record. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName} - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the Custom Assessment Automation. - /// Custom Assessment Automation body. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string customAssessmentAutomationName, CustomAssessmentAutomationCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(customAssessmentAutomationName, nameof(customAssessmentAutomationName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _customAssessmentAutomationClientDiagnostics.CreateScope("CustomAssessmentAutomationCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _customAssessmentAutomationRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, customAssessmentAutomationName, content, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new CustomAssessmentAutomationResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a single custom assessment automation by name for the provided subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName} - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_Get - /// - /// - /// - /// Name of the Custom Assessment Automation. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string customAssessmentAutomationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(customAssessmentAutomationName, nameof(customAssessmentAutomationName)); - - using var scope = _customAssessmentAutomationClientDiagnostics.CreateScope("CustomAssessmentAutomationCollection.Get"); - scope.Start(); - try - { - var response = await _customAssessmentAutomationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, customAssessmentAutomationName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CustomAssessmentAutomationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a single custom assessment automation by name for the provided subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName} - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_Get - /// - /// - /// - /// Name of the Custom Assessment Automation. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string customAssessmentAutomationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(customAssessmentAutomationName, nameof(customAssessmentAutomationName)); - - using var scope = _customAssessmentAutomationClientDiagnostics.CreateScope("CustomAssessmentAutomationCollection.Get"); - scope.Start(); - try - { - var response = _customAssessmentAutomationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, customAssessmentAutomationName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CustomAssessmentAutomationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List custom assessment automations by provided subscription and resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _customAssessmentAutomationRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _customAssessmentAutomationRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CustomAssessmentAutomationResource(Client, CustomAssessmentAutomationData.DeserializeCustomAssessmentAutomationData(e)), _customAssessmentAutomationClientDiagnostics, Pipeline, "CustomAssessmentAutomationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List custom assessment automations by provided subscription and resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _customAssessmentAutomationRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _customAssessmentAutomationRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CustomAssessmentAutomationResource(Client, CustomAssessmentAutomationData.DeserializeCustomAssessmentAutomationData(e)), _customAssessmentAutomationClientDiagnostics, Pipeline, "CustomAssessmentAutomationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName} - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_Get - /// - /// - /// - /// Name of the Custom Assessment Automation. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string customAssessmentAutomationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(customAssessmentAutomationName, nameof(customAssessmentAutomationName)); - - using var scope = _customAssessmentAutomationClientDiagnostics.CreateScope("CustomAssessmentAutomationCollection.Exists"); - scope.Start(); - try - { - var response = await _customAssessmentAutomationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, customAssessmentAutomationName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName} - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_Get - /// - /// - /// - /// Name of the Custom Assessment Automation. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string customAssessmentAutomationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(customAssessmentAutomationName, nameof(customAssessmentAutomationName)); - - using var scope = _customAssessmentAutomationClientDiagnostics.CreateScope("CustomAssessmentAutomationCollection.Exists"); - scope.Start(); - try - { - var response = _customAssessmentAutomationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, customAssessmentAutomationName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomAssessmentAutomationData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomAssessmentAutomationData.cs deleted file mode 100644 index 8b4d17273645..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomAssessmentAutomationData.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the CustomAssessmentAutomation data model. - /// Custom Assessment Automation - /// - public partial class CustomAssessmentAutomationData : ResourceData - { - /// Initializes a new instance of CustomAssessmentAutomationData. - public CustomAssessmentAutomationData() - { - } - - /// Initializes a new instance of CustomAssessmentAutomationData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// GZip encoded KQL query representing the assessment automation results required. - /// Relevant cloud for the custom assessment automation. - /// The severity to relate to the assessments generated by this assessment automation. - /// The display name of the assessments generated by this assessment automation. - /// The description to relate to the assessments generated by this assessment automation. - /// The remediation description to relate to the assessments generated by this assessment automation. - /// The assessment metadata key used when an assessment is generated for this assessment automation. - internal CustomAssessmentAutomationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string compressedQuery, CustomAssessmentAutomationSupportedCloud? supportedCloud, CustomAssessmentSeverity? severity, string displayName, string description, string remediationDescription, string assessmentKey) : base(id, name, resourceType, systemData) - { - CompressedQuery = compressedQuery; - SupportedCloud = supportedCloud; - Severity = severity; - DisplayName = displayName; - Description = description; - RemediationDescription = remediationDescription; - AssessmentKey = assessmentKey; - } - - /// GZip encoded KQL query representing the assessment automation results required. - public string CompressedQuery { get; set; } - /// Relevant cloud for the custom assessment automation. - public CustomAssessmentAutomationSupportedCloud? SupportedCloud { get; set; } - /// The severity to relate to the assessments generated by this assessment automation. - public CustomAssessmentSeverity? Severity { get; set; } - /// The display name of the assessments generated by this assessment automation. - public string DisplayName { get; set; } - /// The description to relate to the assessments generated by this assessment automation. - public string Description { get; set; } - /// The remediation description to relate to the assessments generated by this assessment automation. - public string RemediationDescription { get; set; } - /// The assessment metadata key used when an assessment is generated for this assessment automation. - public string AssessmentKey { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomAssessmentAutomationResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomAssessmentAutomationResource.cs deleted file mode 100644 index 9ea0a12e24c8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomAssessmentAutomationResource.cs +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a CustomAssessmentAutomation along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCustomAssessmentAutomationResource method. - /// Otherwise you can get one from its parent resource using the GetCustomAssessmentAutomation method. - /// - public partial class CustomAssessmentAutomationResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string customAssessmentAutomationName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _customAssessmentAutomationClientDiagnostics; - private readonly CustomAssessmentAutomationsRestOperations _customAssessmentAutomationRestClient; - private readonly CustomAssessmentAutomationData _data; - - /// Initializes a new instance of the class for mocking. - protected CustomAssessmentAutomationResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal CustomAssessmentAutomationResource(ArmClient client, CustomAssessmentAutomationData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal CustomAssessmentAutomationResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _customAssessmentAutomationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string customAssessmentAutomationApiVersion); - _customAssessmentAutomationRestClient = new CustomAssessmentAutomationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, customAssessmentAutomationApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/customAssessmentAutomations"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual CustomAssessmentAutomationData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets a single custom assessment automation by name for the provided subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName} - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _customAssessmentAutomationClientDiagnostics.CreateScope("CustomAssessmentAutomationResource.Get"); - scope.Start(); - try - { - var response = await _customAssessmentAutomationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CustomAssessmentAutomationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a single custom assessment automation by name for the provided subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName} - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _customAssessmentAutomationClientDiagnostics.CreateScope("CustomAssessmentAutomationResource.Get"); - scope.Start(); - try - { - var response = _customAssessmentAutomationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CustomAssessmentAutomationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes a custom assessment automation by name for a provided subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName} - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _customAssessmentAutomationClientDiagnostics.CreateScope("CustomAssessmentAutomationResource.Delete"); - scope.Start(); - try - { - var response = await _customAssessmentAutomationRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes a custom assessment automation by name for a provided subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName} - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _customAssessmentAutomationClientDiagnostics.CreateScope("CustomAssessmentAutomationResource.Delete"); - scope.Start(); - try - { - var response = _customAssessmentAutomationRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a custom assessment automation for the provided subscription. Please note that providing an existing custom assessment automation will replace the existing record. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName} - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Custom Assessment Automation body. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, CustomAssessmentAutomationCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _customAssessmentAutomationClientDiagnostics.CreateScope("CustomAssessmentAutomationResource.Update"); - scope.Start(); - try - { - var response = await _customAssessmentAutomationRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new CustomAssessmentAutomationResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a custom assessment automation for the provided subscription. Please note that providing an existing custom assessment automation will replace the existing record. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName} - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Custom Assessment Automation body. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, CustomAssessmentAutomationCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _customAssessmentAutomationClientDiagnostics.CreateScope("CustomAssessmentAutomationResource.Update"); - scope.Start(); - try - { - var response = _customAssessmentAutomationRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new CustomAssessmentAutomationResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomEntityStoreAssignmentCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomEntityStoreAssignmentCollection.cs deleted file mode 100644 index 5ae178e921ac..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomEntityStoreAssignmentCollection.cs +++ /dev/null @@ -1,342 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetCustomEntityStoreAssignments method from an instance of . - /// - public partial class CustomEntityStoreAssignmentCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _customEntityStoreAssignmentClientDiagnostics; - private readonly CustomEntityStoreAssignmentsRestOperations _customEntityStoreAssignmentRestClient; - - /// Initializes a new instance of the class for mocking. - protected CustomEntityStoreAssignmentCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal CustomEntityStoreAssignmentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _customEntityStoreAssignmentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", CustomEntityStoreAssignmentResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(CustomEntityStoreAssignmentResource.ResourceType, out string customEntityStoreAssignmentApiVersion); - _customEntityStoreAssignmentRestClient = new CustomEntityStoreAssignmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, customEntityStoreAssignmentApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Creates a custom entity store assignment for the provided subscription, if not already exists. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName} - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the custom entity store assignment. Generated name is GUID. - /// Custom entity store assignment body. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string customEntityStoreAssignmentName, CustomEntityStoreAssignmentCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(customEntityStoreAssignmentName, nameof(customEntityStoreAssignmentName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _customEntityStoreAssignmentClientDiagnostics.CreateScope("CustomEntityStoreAssignmentCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _customEntityStoreAssignmentRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, customEntityStoreAssignmentName, content, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new CustomEntityStoreAssignmentResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a custom entity store assignment for the provided subscription, if not already exists. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName} - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the custom entity store assignment. Generated name is GUID. - /// Custom entity store assignment body. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string customEntityStoreAssignmentName, CustomEntityStoreAssignmentCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(customEntityStoreAssignmentName, nameof(customEntityStoreAssignmentName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _customEntityStoreAssignmentClientDiagnostics.CreateScope("CustomEntityStoreAssignmentCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _customEntityStoreAssignmentRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, customEntityStoreAssignmentName, content, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new CustomEntityStoreAssignmentResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a single custom entity store assignment by name for the provided subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName} - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_Get - /// - /// - /// - /// Name of the custom entity store assignment. Generated name is GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string customEntityStoreAssignmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(customEntityStoreAssignmentName, nameof(customEntityStoreAssignmentName)); - - using var scope = _customEntityStoreAssignmentClientDiagnostics.CreateScope("CustomEntityStoreAssignmentCollection.Get"); - scope.Start(); - try - { - var response = await _customEntityStoreAssignmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, customEntityStoreAssignmentName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CustomEntityStoreAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a single custom entity store assignment by name for the provided subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName} - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_Get - /// - /// - /// - /// Name of the custom entity store assignment. Generated name is GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string customEntityStoreAssignmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(customEntityStoreAssignmentName, nameof(customEntityStoreAssignmentName)); - - using var scope = _customEntityStoreAssignmentClientDiagnostics.CreateScope("CustomEntityStoreAssignmentCollection.Get"); - scope.Start(); - try - { - var response = _customEntityStoreAssignmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, customEntityStoreAssignmentName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CustomEntityStoreAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List custom entity store assignments by a provided subscription and resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _customEntityStoreAssignmentRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _customEntityStoreAssignmentRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CustomEntityStoreAssignmentResource(Client, CustomEntityStoreAssignmentData.DeserializeCustomEntityStoreAssignmentData(e)), _customEntityStoreAssignmentClientDiagnostics, Pipeline, "CustomEntityStoreAssignmentCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List custom entity store assignments by a provided subscription and resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _customEntityStoreAssignmentRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _customEntityStoreAssignmentRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CustomEntityStoreAssignmentResource(Client, CustomEntityStoreAssignmentData.DeserializeCustomEntityStoreAssignmentData(e)), _customEntityStoreAssignmentClientDiagnostics, Pipeline, "CustomEntityStoreAssignmentCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName} - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_Get - /// - /// - /// - /// Name of the custom entity store assignment. Generated name is GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string customEntityStoreAssignmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(customEntityStoreAssignmentName, nameof(customEntityStoreAssignmentName)); - - using var scope = _customEntityStoreAssignmentClientDiagnostics.CreateScope("CustomEntityStoreAssignmentCollection.Exists"); - scope.Start(); - try - { - var response = await _customEntityStoreAssignmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, customEntityStoreAssignmentName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName} - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_Get - /// - /// - /// - /// Name of the custom entity store assignment. Generated name is GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string customEntityStoreAssignmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(customEntityStoreAssignmentName, nameof(customEntityStoreAssignmentName)); - - using var scope = _customEntityStoreAssignmentClientDiagnostics.CreateScope("CustomEntityStoreAssignmentCollection.Exists"); - scope.Start(); - try - { - var response = _customEntityStoreAssignmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, customEntityStoreAssignmentName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomEntityStoreAssignmentData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomEntityStoreAssignmentData.cs deleted file mode 100644 index 2f52e9d40b87..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomEntityStoreAssignmentData.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the CustomEntityStoreAssignment data model. - /// Custom entity store assignment - /// - public partial class CustomEntityStoreAssignmentData : ResourceData - { - /// Initializes a new instance of CustomEntityStoreAssignmentData. - public CustomEntityStoreAssignmentData() - { - } - - /// Initializes a new instance of CustomEntityStoreAssignmentData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The principal assigned with entity store. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. - /// The link to entity store database. - internal CustomEntityStoreAssignmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string principal, string entityStoreDatabaseLink) : base(id, name, resourceType, systemData) - { - Principal = principal; - EntityStoreDatabaseLink = entityStoreDatabaseLink; - } - - /// The principal assigned with entity store. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. - public string Principal { get; set; } - /// The link to entity store database. - public string EntityStoreDatabaseLink { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomEntityStoreAssignmentResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomEntityStoreAssignmentResource.cs deleted file mode 100644 index 6574b1c45d13..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/CustomEntityStoreAssignmentResource.cs +++ /dev/null @@ -1,299 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a CustomEntityStoreAssignment along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetCustomEntityStoreAssignmentResource method. - /// Otherwise you can get one from its parent resource using the GetCustomEntityStoreAssignment method. - /// - public partial class CustomEntityStoreAssignmentResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string customEntityStoreAssignmentName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _customEntityStoreAssignmentClientDiagnostics; - private readonly CustomEntityStoreAssignmentsRestOperations _customEntityStoreAssignmentRestClient; - private readonly CustomEntityStoreAssignmentData _data; - - /// Initializes a new instance of the class for mocking. - protected CustomEntityStoreAssignmentResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal CustomEntityStoreAssignmentResource(ArmClient client, CustomEntityStoreAssignmentData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal CustomEntityStoreAssignmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _customEntityStoreAssignmentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string customEntityStoreAssignmentApiVersion); - _customEntityStoreAssignmentRestClient = new CustomEntityStoreAssignmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, customEntityStoreAssignmentApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/customEntityStoreAssignments"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual CustomEntityStoreAssignmentData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets a single custom entity store assignment by name for the provided subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName} - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _customEntityStoreAssignmentClientDiagnostics.CreateScope("CustomEntityStoreAssignmentResource.Get"); - scope.Start(); - try - { - var response = await _customEntityStoreAssignmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CustomEntityStoreAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a single custom entity store assignment by name for the provided subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName} - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _customEntityStoreAssignmentClientDiagnostics.CreateScope("CustomEntityStoreAssignmentResource.Get"); - scope.Start(); - try - { - var response = _customEntityStoreAssignmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new CustomEntityStoreAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a custom entity store assignment by name for a provided subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName} - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _customEntityStoreAssignmentClientDiagnostics.CreateScope("CustomEntityStoreAssignmentResource.Delete"); - scope.Start(); - try - { - var response = await _customEntityStoreAssignmentRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a custom entity store assignment by name for a provided subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName} - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _customEntityStoreAssignmentClientDiagnostics.CreateScope("CustomEntityStoreAssignmentResource.Delete"); - scope.Start(); - try - { - var response = _customEntityStoreAssignmentRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a custom entity store assignment for the provided subscription, if not already exists. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName} - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Custom entity store assignment body. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, CustomEntityStoreAssignmentCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _customEntityStoreAssignmentClientDiagnostics.CreateScope("CustomEntityStoreAssignmentResource.Update"); - scope.Start(); - try - { - var response = await _customEntityStoreAssignmentRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new CustomEntityStoreAssignmentResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a custom entity store assignment for the provided subscription, if not already exists. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName} - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Custom entity store assignment body. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, CustomEntityStoreAssignmentCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _customEntityStoreAssignmentClientDiagnostics.CreateScope("CustomEntityStoreAssignmentResource.Update"); - scope.Start(); - try - { - var response = _customEntityStoreAssignmentRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new CustomEntityStoreAssignmentResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/DeviceSecurityGroupCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/DeviceSecurityGroupCollection.cs deleted file mode 100644 index 434ad6eacc43..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/DeviceSecurityGroupCollection.cs +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetDeviceSecurityGroups method from an instance of . - /// - public partial class DeviceSecurityGroupCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _deviceSecurityGroupClientDiagnostics; - private readonly DeviceSecurityGroupsRestOperations _deviceSecurityGroupRestClient; - - /// Initializes a new instance of the class for mocking. - protected DeviceSecurityGroupCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal DeviceSecurityGroupCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _deviceSecurityGroupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", DeviceSecurityGroupResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(DeviceSecurityGroupResource.ResourceType, out string deviceSecurityGroupApiVersion); - _deviceSecurityGroupRestClient = new DeviceSecurityGroupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceSecurityGroupApiVersion); - } - - /// - /// Use this method to creates or updates the device security group on a specified IoT Hub resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} - /// - /// - /// Operation Id - /// DeviceSecurityGroups_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the device security group. Note that the name of the device security group is case insensitive. - /// Security group object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string deviceSecurityGroupName, DeviceSecurityGroupData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(deviceSecurityGroupName, nameof(deviceSecurityGroupName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceSecurityGroupClientDiagnostics.CreateScope("DeviceSecurityGroupCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _deviceSecurityGroupRestClient.CreateOrUpdateAsync(Id, deviceSecurityGroupName, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new DeviceSecurityGroupResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method to creates or updates the device security group on a specified IoT Hub resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} - /// - /// - /// Operation Id - /// DeviceSecurityGroups_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the device security group. Note that the name of the device security group is case insensitive. - /// Security group object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string deviceSecurityGroupName, DeviceSecurityGroupData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(deviceSecurityGroupName, nameof(deviceSecurityGroupName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceSecurityGroupClientDiagnostics.CreateScope("DeviceSecurityGroupCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _deviceSecurityGroupRestClient.CreateOrUpdate(Id, deviceSecurityGroupName, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new DeviceSecurityGroupResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method to get the device security group for the specified IoT Hub resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} - /// - /// - /// Operation Id - /// DeviceSecurityGroups_Get - /// - /// - /// - /// The name of the device security group. Note that the name of the device security group is case insensitive. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string deviceSecurityGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(deviceSecurityGroupName, nameof(deviceSecurityGroupName)); - - using var scope = _deviceSecurityGroupClientDiagnostics.CreateScope("DeviceSecurityGroupCollection.Get"); - scope.Start(); - try - { - var response = await _deviceSecurityGroupRestClient.GetAsync(Id, deviceSecurityGroupName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceSecurityGroupResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method to get the device security group for the specified IoT Hub resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} - /// - /// - /// Operation Id - /// DeviceSecurityGroups_Get - /// - /// - /// - /// The name of the device security group. Note that the name of the device security group is case insensitive. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string deviceSecurityGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(deviceSecurityGroupName, nameof(deviceSecurityGroupName)); - - using var scope = _deviceSecurityGroupClientDiagnostics.CreateScope("DeviceSecurityGroupCollection.Get"); - scope.Start(); - try - { - var response = _deviceSecurityGroupRestClient.Get(Id, deviceSecurityGroupName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceSecurityGroupResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method get the list of device security groups for the specified IoT Hub resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups - /// - /// - /// Operation Id - /// DeviceSecurityGroups_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceSecurityGroupRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceSecurityGroupRestClient.CreateListNextPageRequest(nextLink, Id); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DeviceSecurityGroupResource(Client, DeviceSecurityGroupData.DeserializeDeviceSecurityGroupData(e)), _deviceSecurityGroupClientDiagnostics, Pipeline, "DeviceSecurityGroupCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Use this method get the list of device security groups for the specified IoT Hub resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups - /// - /// - /// Operation Id - /// DeviceSecurityGroups_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _deviceSecurityGroupRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _deviceSecurityGroupRestClient.CreateListNextPageRequest(nextLink, Id); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DeviceSecurityGroupResource(Client, DeviceSecurityGroupData.DeserializeDeviceSecurityGroupData(e)), _deviceSecurityGroupClientDiagnostics, Pipeline, "DeviceSecurityGroupCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} - /// - /// - /// Operation Id - /// DeviceSecurityGroups_Get - /// - /// - /// - /// The name of the device security group. Note that the name of the device security group is case insensitive. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string deviceSecurityGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(deviceSecurityGroupName, nameof(deviceSecurityGroupName)); - - using var scope = _deviceSecurityGroupClientDiagnostics.CreateScope("DeviceSecurityGroupCollection.Exists"); - scope.Start(); - try - { - var response = await _deviceSecurityGroupRestClient.GetAsync(Id, deviceSecurityGroupName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} - /// - /// - /// Operation Id - /// DeviceSecurityGroups_Get - /// - /// - /// - /// The name of the device security group. Note that the name of the device security group is case insensitive. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string deviceSecurityGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(deviceSecurityGroupName, nameof(deviceSecurityGroupName)); - - using var scope = _deviceSecurityGroupClientDiagnostics.CreateScope("DeviceSecurityGroupCollection.Exists"); - scope.Start(); - try - { - var response = _deviceSecurityGroupRestClient.Get(Id, deviceSecurityGroupName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/DeviceSecurityGroupData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/DeviceSecurityGroupData.cs deleted file mode 100644 index ef91fca1441b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/DeviceSecurityGroupData.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the DeviceSecurityGroup data model. - /// The device security group resource - /// - public partial class DeviceSecurityGroupData : ResourceData - { - /// Initializes a new instance of DeviceSecurityGroupData. - public DeviceSecurityGroupData() - { - ThresholdRules = new ChangeTrackingList(); - TimeWindowRules = new ChangeTrackingList(); - AllowlistRules = new ChangeTrackingList(); - DenylistRules = new ChangeTrackingList(); - } - - /// Initializes a new instance of DeviceSecurityGroupData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// - /// The list of custom alert threshold rules. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , , , and . - /// - /// - /// The list of custom alert time-window rules. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , , and . - /// - /// - /// The allow-list custom alert rules. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . - /// - /// The deny-list custom alert rules. - internal DeviceSecurityGroupData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList thresholdRules, IList timeWindowRules, IList allowlistRules, IList denylistRules) : base(id, name, resourceType, systemData) - { - ThresholdRules = thresholdRules; - TimeWindowRules = timeWindowRules; - AllowlistRules = allowlistRules; - DenylistRules = denylistRules; - } - - /// - /// The list of custom alert threshold rules. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , , , and . - /// - public IList ThresholdRules { get; } - /// - /// The list of custom alert time-window rules. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , , and . - /// - public IList TimeWindowRules { get; } - /// - /// The allow-list custom alert rules. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . - /// - public IList AllowlistRules { get; } - /// The deny-list custom alert rules. - public IList DenylistRules { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/DeviceSecurityGroupResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/DeviceSecurityGroupResource.cs deleted file mode 100644 index 08344c29cb95..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/DeviceSecurityGroupResource.cs +++ /dev/null @@ -1,297 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a DeviceSecurityGroup along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetDeviceSecurityGroupResource method. - /// Otherwise you can get one from its parent resource using the GetDeviceSecurityGroup method. - /// - public partial class DeviceSecurityGroupResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string resourceId, string deviceSecurityGroupName) - { - var resourceId0 = $"{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}"; - return new ResourceIdentifier(resourceId0); - } - - private readonly ClientDiagnostics _deviceSecurityGroupClientDiagnostics; - private readonly DeviceSecurityGroupsRestOperations _deviceSecurityGroupRestClient; - private readonly DeviceSecurityGroupData _data; - - /// Initializes a new instance of the class for mocking. - protected DeviceSecurityGroupResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal DeviceSecurityGroupResource(ArmClient client, DeviceSecurityGroupData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal DeviceSecurityGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _deviceSecurityGroupClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string deviceSecurityGroupApiVersion); - _deviceSecurityGroupRestClient = new DeviceSecurityGroupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, deviceSecurityGroupApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/deviceSecurityGroups"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual DeviceSecurityGroupData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Use this method to get the device security group for the specified IoT Hub resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} - /// - /// - /// Operation Id - /// DeviceSecurityGroups_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _deviceSecurityGroupClientDiagnostics.CreateScope("DeviceSecurityGroupResource.Get"); - scope.Start(); - try - { - var response = await _deviceSecurityGroupRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceSecurityGroupResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method to get the device security group for the specified IoT Hub resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} - /// - /// - /// Operation Id - /// DeviceSecurityGroups_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _deviceSecurityGroupClientDiagnostics.CreateScope("DeviceSecurityGroupResource.Get"); - scope.Start(); - try - { - var response = _deviceSecurityGroupRestClient.Get(Id.Parent, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new DeviceSecurityGroupResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// User this method to deletes the device security group. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} - /// - /// - /// Operation Id - /// DeviceSecurityGroups_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _deviceSecurityGroupClientDiagnostics.CreateScope("DeviceSecurityGroupResource.Delete"); - scope.Start(); - try - { - var response = await _deviceSecurityGroupRestClient.DeleteAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// User this method to deletes the device security group. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} - /// - /// - /// Operation Id - /// DeviceSecurityGroups_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _deviceSecurityGroupClientDiagnostics.CreateScope("DeviceSecurityGroupResource.Delete"); - scope.Start(); - try - { - var response = _deviceSecurityGroupRestClient.Delete(Id.Parent, Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method to creates or updates the device security group on a specified IoT Hub resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} - /// - /// - /// Operation Id - /// DeviceSecurityGroups_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Security group object. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, DeviceSecurityGroupData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceSecurityGroupClientDiagnostics.CreateScope("DeviceSecurityGroupResource.Update"); - scope.Start(); - try - { - var response = await _deviceSecurityGroupRestClient.CreateOrUpdateAsync(Id.Parent, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new DeviceSecurityGroupResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method to creates or updates the device security group on a specified IoT Hub resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} - /// - /// - /// Operation Id - /// DeviceSecurityGroups_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Security group object. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, DeviceSecurityGroupData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _deviceSecurityGroupClientDiagnostics.CreateScope("DeviceSecurityGroupResource.Update"); - scope.Start(); - try - { - var response = _deviceSecurityGroupRestClient.CreateOrUpdate(Id.Parent, Id.Name, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new DeviceSecurityGroupResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/ArmResourceExtensionClient.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/ArmResourceExtensionClient.cs deleted file mode 100644 index 9c6f44cb01bf..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/ArmResourceExtensionClient.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// A class to add extension methods to ArmResource. - internal partial class ArmResourceExtensionClient : ArmResource - { - /// Initializes a new instance of the class for mocking. - protected ArmResourceExtensionClient() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal ArmResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of ComplianceResultResources in the ArmResource. - /// An object representing collection of ComplianceResultResources and their operations over a ComplianceResultResource. - public virtual ComplianceResultCollection GetComplianceResults() - { - return GetCachedClient(Client => new ComplianceResultCollection(Client, Id)); - } - - /// Gets an object representing a AdvancedThreatProtectionSettingResource along with the instance operations that can be performed on it in the ArmResource. - /// Returns a object. - public virtual AdvancedThreatProtectionSettingResource GetAdvancedThreatProtectionSetting() - { - return new AdvancedThreatProtectionSettingResource(Client, Id.AppendProviderResource("Microsoft.Security", "advancedThreatProtectionSettings", "current")); - } - - /// Gets a collection of DeviceSecurityGroupResources in the ArmResource. - /// An object representing collection of DeviceSecurityGroupResources and their operations over a DeviceSecurityGroupResource. - public virtual DeviceSecurityGroupCollection GetDeviceSecurityGroups() - { - return GetCachedClient(Client => new DeviceSecurityGroupCollection(Client, Id)); - } - - /// Gets a collection of SecurityComplianceResources in the ArmResource. - /// An object representing collection of SecurityComplianceResources and their operations over a SecurityComplianceResource. - public virtual SecurityComplianceCollection GetSecurityCompliances() - { - return GetCachedClient(Client => new SecurityComplianceCollection(Client, Id)); - } - - /// Gets a collection of SecurityAssessmentResources in the ArmResource. - /// An object representing collection of SecurityAssessmentResources and their operations over a SecurityAssessmentResource. - public virtual SecurityAssessmentCollection GetSecurityAssessments() - { - return GetCachedClient(Client => new SecurityAssessmentCollection(Client, Id)); - } - - /// Gets a collection of SqlVulnerabilityAssessmentScanResources in the ArmResource. - /// An object representing collection of SqlVulnerabilityAssessmentScanResources and their operations over a SqlVulnerabilityAssessmentScanResource. - public virtual SqlVulnerabilityAssessmentScanCollection GetSqlVulnerabilityAssessmentScans() - { - return GetCachedClient(Client => new SqlVulnerabilityAssessmentScanCollection(Client, Id)); - } - - /// Gets a collection of SqlVulnerabilityAssessmentBaselineRuleResources in the ArmResource. - /// An object representing collection of SqlVulnerabilityAssessmentBaselineRuleResources and their operations over a SqlVulnerabilityAssessmentBaselineRuleResource. - public virtual SqlVulnerabilityAssessmentBaselineRuleCollection GetSqlVulnerabilityAssessmentBaselineRules() - { - return GetCachedClient(Client => new SqlVulnerabilityAssessmentBaselineRuleCollection(Client, Id)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs index 27a3ecd03e2b..05124e46b1cc 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs @@ -5,35 +5,14 @@ #nullable disable -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; using Azure.Core; -using Azure.Core.Pipeline; using Azure.ResourceManager; -using Azure.ResourceManager.SecurityCenter.Models; namespace Azure.ResourceManager.SecurityCenter { /// A class to add extension methods to ResourceGroupResource. internal partial class ResourceGroupResourceExtensionClient : ArmResource { - private ClientDiagnostics _allowedConnectionsClientDiagnostics; - private AllowedConnectionsRestOperations _allowedConnectionsRestClient; - private ClientDiagnostics _topologyClientDiagnostics; - private TopologyRestOperations _topologyRestClient; - private ClientDiagnostics _jitNetworkAccessPolicyClientDiagnostics; - private JitNetworkAccessPoliciesRestOperations _jitNetworkAccessPolicyRestClient; - private ClientDiagnostics _discoveredSecuritySolutionsClientDiagnostics; - private DiscoveredSecuritySolutionsRestOperations _discoveredSecuritySolutionsRestClient; - private ClientDiagnostics _externalSecuritySolutionsClientDiagnostics; - private ExternalSecuritySolutionsRestOperations _externalSecuritySolutionsRestClient; - private ClientDiagnostics _securitySolutionsClientDiagnostics; - private SecuritySolutionsRestOperations _securitySolutionsRestClient; - private ClientDiagnostics _alertsClientDiagnostics; - private AlertsRestOperations _alertsRestClient; - /// Initializes a new instance of the class for mocking. protected ResourceGroupResourceExtensionClient() { @@ -46,522 +25,24 @@ internal ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifi { } - private ClientDiagnostics AllowedConnectionsClientDiagnostics => _allowedConnectionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private AllowedConnectionsRestOperations AllowedConnectionsRestClient => _allowedConnectionsRestClient ??= new AllowedConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics TopologyClientDiagnostics => _topologyClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private TopologyRestOperations TopologyRestClient => _topologyRestClient ??= new TopologyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics JitNetworkAccessPolicyClientDiagnostics => _jitNetworkAccessPolicyClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", JitNetworkAccessPolicyResource.ResourceType.Namespace, Diagnostics); - private JitNetworkAccessPoliciesRestOperations JitNetworkAccessPolicyRestClient => _jitNetworkAccessPolicyRestClient ??= new JitNetworkAccessPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(JitNetworkAccessPolicyResource.ResourceType)); - private ClientDiagnostics DiscoveredSecuritySolutionsClientDiagnostics => _discoveredSecuritySolutionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private DiscoveredSecuritySolutionsRestOperations DiscoveredSecuritySolutionsRestClient => _discoveredSecuritySolutionsRestClient ??= new DiscoveredSecuritySolutionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics ExternalSecuritySolutionsClientDiagnostics => _externalSecuritySolutionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private ExternalSecuritySolutionsRestOperations ExternalSecuritySolutionsRestClient => _externalSecuritySolutionsRestClient ??= new ExternalSecuritySolutionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics SecuritySolutionsClientDiagnostics => _securitySolutionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private SecuritySolutionsRestOperations SecuritySolutionsRestClient => _securitySolutionsRestClient ??= new SecuritySolutionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics AlertsClientDiagnostics => _alertsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private AlertsRestOperations AlertsRestClient => _alertsRestClient ??= new AlertsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private string GetApiVersionOrNull(ResourceType resourceType) { TryGetApiVersion(resourceType, out string apiVersion); return apiVersion; } - /// Gets a collection of CustomAssessmentAutomationResources in the ResourceGroupResource. - /// An object representing collection of CustomAssessmentAutomationResources and their operations over a CustomAssessmentAutomationResource. - public virtual CustomAssessmentAutomationCollection GetCustomAssessmentAutomations() - { - return GetCachedClient(Client => new CustomAssessmentAutomationCollection(Client, Id)); - } - - /// Gets a collection of CustomEntityStoreAssignmentResources in the ResourceGroupResource. - /// An object representing collection of CustomEntityStoreAssignmentResources and their operations over a CustomEntityStoreAssignmentResource. - public virtual CustomEntityStoreAssignmentCollection GetCustomEntityStoreAssignments() - { - return GetCachedClient(Client => new CustomEntityStoreAssignmentCollection(Client, Id)); - } - - /// Gets a collection of IotSecuritySolutionResources in the ResourceGroupResource. - /// An object representing collection of IotSecuritySolutionResources and their operations over a IotSecuritySolutionResource. - public virtual IotSecuritySolutionCollection GetIotSecuritySolutions() - { - return GetCachedClient(Client => new IotSecuritySolutionCollection(Client, Id)); - } - - /// Gets a collection of ResourceGroupSecurityTaskResources in the ResourceGroupResource. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// An object representing collection of ResourceGroupSecurityTaskResources and their operations over a ResourceGroupSecurityTaskResource. - public virtual ResourceGroupSecurityTaskCollection GetResourceGroupSecurityTasks(AzureLocation ascLocation) - { - return new ResourceGroupSecurityTaskCollection(Client, Id, ascLocation); - } - - /// Gets a collection of SecurityAutomationResources in the ResourceGroupResource. - /// An object representing collection of SecurityAutomationResources and their operations over a SecurityAutomationResource. - public virtual SecurityAutomationCollection GetSecurityAutomations() - { - return GetCachedClient(Client => new SecurityAutomationCollection(Client, Id)); - } - - /// Gets a collection of ServerVulnerabilityAssessmentResources in the ResourceGroupResource. - /// The Namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// An object representing collection of ServerVulnerabilityAssessmentResources and their operations over a ServerVulnerabilityAssessmentResource. - public virtual ServerVulnerabilityAssessmentCollection GetServerVulnerabilityAssessments(string resourceNamespace, string resourceType, string resourceName) - { - return new ServerVulnerabilityAssessmentCollection(Client, Id, resourceNamespace, resourceType, resourceName); - } - - /// Gets a collection of AdaptiveNetworkHardeningResources in the ResourceGroupResource. - /// The Namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// An object representing collection of AdaptiveNetworkHardeningResources and their operations over a AdaptiveNetworkHardeningResource. - public virtual AdaptiveNetworkHardeningCollection GetAdaptiveNetworkHardenings(string resourceNamespace, string resourceType, string resourceName) - { - return new AdaptiveNetworkHardeningCollection(Client, Id, resourceNamespace, resourceType, resourceName); - } - - /// Gets a collection of JitNetworkAccessPolicyResources in the ResourceGroupResource. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// An object representing collection of JitNetworkAccessPolicyResources and their operations over a JitNetworkAccessPolicyResource. - public virtual JitNetworkAccessPolicyCollection GetJitNetworkAccessPolicies(AzureLocation ascLocation) - { - return new JitNetworkAccessPolicyCollection(Client, Id, ascLocation); - } - - /// Gets a collection of ResourceGroupSecurityAlertResources in the ResourceGroupResource. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// An object representing collection of ResourceGroupSecurityAlertResources and their operations over a ResourceGroupSecurityAlertResource. - public virtual ResourceGroupSecurityAlertCollection GetResourceGroupSecurityAlerts(AzureLocation ascLocation) - { - return new ResourceGroupSecurityAlertCollection(Client, Id, ascLocation); - } - - /// Gets a collection of SoftwareInventoryResources in the ResourceGroupResource. - /// The namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// An object representing collection of SoftwareInventoryResources and their operations over a SoftwareInventoryResource. - public virtual SoftwareInventoryCollection GetSoftwareInventories(string resourceNamespace, string resourceType, string resourceName) - { - return new SoftwareInventoryCollection(Client, Id, resourceNamespace, resourceType, resourceName); - } - - /// Gets a collection of SecurityConnectorResources in the ResourceGroupResource. - /// An object representing collection of SecurityConnectorResources and their operations over a SecurityConnectorResource. - public virtual SecurityConnectorCollection GetSecurityConnectors() - { - return GetCachedClient(Client => new SecurityConnectorCollection(Client, Id)); - } - - /// - /// Gets the list of all possible traffic between resources for the subscription and location, based on connection type. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType} - /// - /// - /// Operation Id - /// AllowedConnections_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The type of allowed connections (Internal, External). - /// The cancellation token to use. - public virtual async Task> GetAllowedConnectionAsync(AzureLocation ascLocation, SecurityCenterConnectionType connectionType, CancellationToken cancellationToken = default) - { - using var scope = AllowedConnectionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetAllowedConnection"); - scope.Start(); - try - { - var response = await AllowedConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, connectionType, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the list of all possible traffic between resources for the subscription and location, based on connection type. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType} - /// - /// - /// Operation Id - /// AllowedConnections_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The type of allowed connections (Internal, External). - /// The cancellation token to use. - public virtual Response GetAllowedConnection(AzureLocation ascLocation, SecurityCenterConnectionType connectionType, CancellationToken cancellationToken = default) - { - using var scope = AllowedConnectionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetAllowedConnection"); - scope.Start(); - try - { - var response = AllowedConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, connectionType, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a specific topology component. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName} - /// - /// - /// Operation Id - /// Topology_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a topology resources collection. - /// The cancellation token to use. - public virtual async Task> GetTopologyAsync(AzureLocation ascLocation, string topologyResourceName, CancellationToken cancellationToken = default) - { - using var scope = TopologyClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetTopology"); - scope.Start(); - try - { - var response = await TopologyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, topologyResourceName, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a specific topology component. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName} - /// - /// - /// Operation Id - /// Topology_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a topology resources collection. - /// The cancellation token to use. - public virtual Response GetTopology(AzureLocation ascLocation, string topologyResourceName, CancellationToken cancellationToken = default) - { - using var scope = TopologyClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetTopology"); - scope.Start(); - try - { - var response = TopologyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, topologyResourceName, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Policies for protecting resources using Just-in-Time access control for the subscription, location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetJitNetworkAccessPoliciesAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => JitNetworkAccessPolicyRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => JitNetworkAccessPolicyRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new JitNetworkAccessPolicyResource(Client, JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(e)), JitNetworkAccessPolicyClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetJitNetworkAccessPolicies", "value", "nextLink", cancellationToken); - } - - /// - /// Policies for protecting resources using Just-in-Time access control for the subscription, location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetJitNetworkAccessPolicies(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => JitNetworkAccessPolicyRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => JitNetworkAccessPolicyRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new JitNetworkAccessPolicyResource(Client, JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(e)), JitNetworkAccessPolicyClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetJitNetworkAccessPolicies", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a specific discovered Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName} - /// - /// - /// Operation Id - /// DiscoveredSecuritySolutions_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a discovered security solution. - /// The cancellation token to use. - public virtual async Task> GetDiscoveredSecuritySolutionAsync(AzureLocation ascLocation, string discoveredSecuritySolutionName, CancellationToken cancellationToken = default) - { - using var scope = DiscoveredSecuritySolutionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetDiscoveredSecuritySolution"); - scope.Start(); - try - { - var response = await DiscoveredSecuritySolutionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, discoveredSecuritySolutionName, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a specific discovered Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName} - /// - /// - /// Operation Id - /// DiscoveredSecuritySolutions_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a discovered security solution. - /// The cancellation token to use. - public virtual Response GetDiscoveredSecuritySolution(AzureLocation ascLocation, string discoveredSecuritySolutionName, CancellationToken cancellationToken = default) - { - using var scope = DiscoveredSecuritySolutionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetDiscoveredSecuritySolution"); - scope.Start(); - try - { - var response = DiscoveredSecuritySolutionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, discoveredSecuritySolutionName, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a specific external Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName} - /// - /// - /// Operation Id - /// ExternalSecuritySolutions_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of an external security solution. - /// The cancellation token to use. - public virtual async Task> GetExternalSecuritySolutionAsync(AzureLocation ascLocation, string externalSecuritySolutionsName, CancellationToken cancellationToken = default) - { - using var scope = ExternalSecuritySolutionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetExternalSecuritySolution"); - scope.Start(); - try - { - var response = await ExternalSecuritySolutionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, externalSecuritySolutionsName, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a specific external Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName} - /// - /// - /// Operation Id - /// ExternalSecuritySolutions_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of an external security solution. - /// The cancellation token to use. - public virtual Response GetExternalSecuritySolution(AzureLocation ascLocation, string externalSecuritySolutionsName, CancellationToken cancellationToken = default) - { - using var scope = ExternalSecuritySolutionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetExternalSecuritySolution"); - scope.Start(); - try - { - var response = ExternalSecuritySolutionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, externalSecuritySolutionsName, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a specific Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutions/{securitySolutionName} - /// - /// - /// Operation Id - /// SecuritySolutions_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of security solution. - /// The cancellation token to use. - public virtual async Task> GetSecuritySolutionAsync(AzureLocation ascLocation, string securitySolutionName, CancellationToken cancellationToken = default) - { - using var scope = SecuritySolutionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetSecuritySolution"); - scope.Start(); - try - { - var response = await SecuritySolutionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, securitySolutionName, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a specific Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutions/{securitySolutionName} - /// - /// - /// Operation Id - /// SecuritySolutions_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of security solution. - /// The cancellation token to use. - public virtual Response GetSecuritySolution(AzureLocation ascLocation, string securitySolutionName, CancellationToken cancellationToken = default) - { - using var scope = SecuritySolutionsClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetSecuritySolution"); - scope.Start(); - try - { - var response = SecuritySolutionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, ascLocation, securitySolutionName, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List all the alerts that are associated with the resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts - /// - /// - /// Operation Id - /// Alerts_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAlertsByResourceGroupAsync(CancellationToken cancellationToken = default) + /// Gets a collection of StandardResources in the ResourceGroupResource. + /// An object representing collection of StandardResources and their operations over a StandardResource. + public virtual StandardCollection GetStandards() { - HttpMessage FirstPageRequest(int? pageSizeHint) => AlertsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AlertsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecurityAlertData.DeserializeSecurityAlertData, AlertsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAlertsByResourceGroup", "value", "nextLink", cancellationToken); + return GetCachedClient(Client => new StandardCollection(Client, Id)); } - /// - /// List all the alerts that are associated with the resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts - /// - /// - /// Operation Id - /// Alerts_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAlertsByResourceGroup(CancellationToken cancellationToken = default) + /// Gets a collection of AssignmentResources in the ResourceGroupResource. + /// An object representing collection of AssignmentResources and their operations over a AssignmentResource. + public virtual AssignmentCollection GetAssignments() { - HttpMessage FirstPageRequest(int? pageSizeHint) => AlertsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AlertsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecurityAlertData.DeserializeSecurityAlertData, AlertsClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetAlertsByResourceGroup", "value", "nextLink", cancellationToken); + return GetCachedClient(Client => new AssignmentCollection(Client, Id)); } } } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterExtensions.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterExtensions.cs index b4228b0ac3aa..dca283f03c3e 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterExtensions.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SecurityCenterExtensions.cs @@ -12,120 +12,12 @@ using Azure.Core; using Azure.ResourceManager; using Azure.ResourceManager.Resources; -using Azure.ResourceManager.SecurityCenter.Models; namespace Azure.ResourceManager.SecurityCenter { /// A class to add extension methods to Azure.ResourceManager.SecurityCenter. public static partial class SecurityCenterExtensions { - private static TenantResourceExtensionClient GetExtensionClient(TenantResource tenantResource) - { - return tenantResource.GetCachedClient((client) => - { - return new TenantResourceExtensionClient(client, tenantResource.Id); - } - ); - } - - /// Gets a collection of TenantAssessmentMetadataResources in the TenantResource. - /// The instance the method will execute against. - /// An object representing collection of TenantAssessmentMetadataResources and their operations over a TenantAssessmentMetadataResource. - public static TenantAssessmentMetadataCollection GetAllTenantAssessmentMetadata(this TenantResource tenantResource) - { - return GetExtensionClient(tenantResource).GetAllTenantAssessmentMetadata(); - } - - /// - /// Get metadata information on an assessment type - /// - /// - /// Request Path - /// /providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_Get - /// - /// - /// - /// The instance the method will execute against. - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetTenantAssessmentMetadataAsync(this TenantResource tenantResource, string assessmentMetadataName, CancellationToken cancellationToken = default) - { - return await tenantResource.GetAllTenantAssessmentMetadata().GetAsync(assessmentMetadataName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get metadata information on an assessment type - /// - /// - /// Request Path - /// /providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_Get - /// - /// - /// - /// The instance the method will execute against. - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetTenantAssessmentMetadata(this TenantResource tenantResource, string assessmentMetadataName, CancellationToken cancellationToken = default) - { - return tenantResource.GetAllTenantAssessmentMetadata().Get(assessmentMetadataName, cancellationToken); - } - - /// - /// List the available security controls, their assessments, and the max score - /// - /// - /// Request Path - /// /providers/Microsoft.Security/secureScoreControlDefinitions - /// - /// - /// Operation Id - /// SecureScoreControlDefinitions_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetSecureScoreControlDefinitionsAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(tenantResource).GetSecureScoreControlDefinitionsAsync(cancellationToken); - } - - /// - /// List the available security controls, their assessments, and the max score - /// - /// - /// Request Path - /// /providers/Microsoft.Security/secureScoreControlDefinitions - /// - /// - /// Operation Id - /// SecureScoreControlDefinitions_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetSecureScoreControlDefinitions(this TenantResource tenantResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(tenantResource).GetSecureScoreControlDefinitions(cancellationToken); - } - private static SubscriptionResourceExtensionClient GetExtensionClient(SubscriptionResource subscriptionResource) { return subscriptionResource.GetCachedClient((client) => @@ -135,3880 +27,244 @@ private static SubscriptionResourceExtensionClient GetExtensionClient(Subscripti ); } - /// Gets a collection of SecurityCenterPricingResources in the SubscriptionResource. - /// The instance the method will execute against. - /// An object representing collection of SecurityCenterPricingResources and their operations over a SecurityCenterPricingResource. - public static SecurityCenterPricingCollection GetSecurityCenterPricings(this SubscriptionResource subscriptionResource) - { - return GetExtensionClient(subscriptionResource).GetSecurityCenterPricings(); - } - - /// - /// Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName} - /// - /// - /// Operation Id - /// Pricings_Get - /// - /// - /// - /// The instance the method will execute against. - /// name of the pricing configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetSecurityCenterPricingAsync(this SubscriptionResource subscriptionResource, string pricingName, CancellationToken cancellationToken = default) - { - return await subscriptionResource.GetSecurityCenterPricings().GetAsync(pricingName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName} - /// - /// - /// Operation Id - /// Pricings_Get - /// - /// - /// - /// The instance the method will execute against. - /// name of the pricing configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetSecurityCenterPricing(this SubscriptionResource subscriptionResource, string pricingName, CancellationToken cancellationToken = default) - { - return subscriptionResource.GetSecurityCenterPricings().Get(pricingName, cancellationToken); - } - - /// Gets a collection of SecurityCenterLocationResources in the SubscriptionResource. - /// The instance the method will execute against. - /// An object representing collection of SecurityCenterLocationResources and their operations over a SecurityCenterLocationResource. - public static SecurityCenterLocationCollection GetSecurityCenterLocations(this SubscriptionResource subscriptionResource) - { - return GetExtensionClient(subscriptionResource).GetSecurityCenterLocations(); - } - - /// - /// Details of a specific location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation} - /// - /// - /// Operation Id - /// Locations_Get - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - [ForwardsClientCalls] - public static async Task> GetSecurityCenterLocationAsync(this SubscriptionResource subscriptionResource, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - return await subscriptionResource.GetSecurityCenterLocations().GetAsync(ascLocation, cancellationToken).ConfigureAwait(false); - } - - /// - /// Details of a specific location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation} - /// - /// - /// Operation Id - /// Locations_Get - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - [ForwardsClientCalls] - public static Response GetSecurityCenterLocation(this SubscriptionResource subscriptionResource, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - return subscriptionResource.GetSecurityCenterLocations().Get(ascLocation, cancellationToken); - } - - /// Gets a collection of AutoProvisioningSettingResources in the SubscriptionResource. - /// The instance the method will execute against. - /// An object representing collection of AutoProvisioningSettingResources and their operations over a AutoProvisioningSettingResource. - public static AutoProvisioningSettingCollection GetAutoProvisioningSettings(this SubscriptionResource subscriptionResource) - { - return GetExtensionClient(subscriptionResource).GetAutoProvisioningSettings(); - } - - /// - /// Details of a specific setting - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName} - /// - /// - /// Operation Id - /// AutoProvisioningSettings_Get - /// - /// - /// - /// The instance the method will execute against. - /// Auto provisioning setting key. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetAutoProvisioningSettingAsync(this SubscriptionResource subscriptionResource, string settingName, CancellationToken cancellationToken = default) - { - return await subscriptionResource.GetAutoProvisioningSettings().GetAsync(settingName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Details of a specific setting - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName} - /// - /// - /// Operation Id - /// AutoProvisioningSettings_Get - /// - /// - /// - /// The instance the method will execute against. - /// Auto provisioning setting key. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetAutoProvisioningSetting(this SubscriptionResource subscriptionResource, string settingName, CancellationToken cancellationToken = default) - { - return subscriptionResource.GetAutoProvisioningSettings().Get(settingName, cancellationToken); - } - - /// Gets a collection of SecurityContactResources in the SubscriptionResource. - /// The instance the method will execute against. - /// An object representing collection of SecurityContactResources and their operations over a SecurityContactResource. - public static SecurityContactCollection GetSecurityContacts(this SubscriptionResource subscriptionResource) - { - return GetExtensionClient(subscriptionResource).GetSecurityContacts(); - } - - /// - /// Get Default Security contact configurations for the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName} - /// - /// - /// Operation Id - /// SecurityContacts_Get - /// - /// - /// - /// The instance the method will execute against. - /// Name of the security contact object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetSecurityContactAsync(this SubscriptionResource subscriptionResource, string securityContactName, CancellationToken cancellationToken = default) - { - return await subscriptionResource.GetSecurityContacts().GetAsync(securityContactName, cancellationToken).ConfigureAwait(false); - } - /// - /// Get Default Security contact configurations for the subscription + /// Get a list of all relevant security standards over a subscription level scope. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/standards /// /// /// Operation Id - /// SecurityContacts_Get + /// Standards_ListBySubscription /// /// /// /// The instance the method will execute against. - /// Name of the security contact object. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetSecurityContact(this SubscriptionResource subscriptionResource, string securityContactName, CancellationToken cancellationToken = default) - { - return subscriptionResource.GetSecurityContacts().Get(securityContactName, cancellationToken); - } - - /// Gets a collection of SecurityWorkspaceSettingResources in the SubscriptionResource. - /// The instance the method will execute against. - /// An object representing collection of SecurityWorkspaceSettingResources and their operations over a SecurityWorkspaceSettingResource. - public static SecurityWorkspaceSettingCollection GetSecurityWorkspaceSettings(this SubscriptionResource subscriptionResource) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetStandardsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetExtensionClient(subscriptionResource).GetSecurityWorkspaceSettings(); + return GetExtensionClient(subscriptionResource).GetStandardsAsync(cancellationToken); } /// - /// Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set + /// Get a list of all relevant security standards over a subscription level scope. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/standards /// /// /// Operation Id - /// WorkspaceSettings_Get + /// Standards_ListBySubscription /// /// /// /// The instance the method will execute against. - /// Name of the security setting. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetSecurityWorkspaceSettingAsync(this SubscriptionResource subscriptionResource, string workspaceSettingName, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetStandards(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSecurityWorkspaceSettings().GetAsync(workspaceSettingName, cancellationToken).ConfigureAwait(false); + return GetExtensionClient(subscriptionResource).GetStandards(cancellationToken); } /// - /// Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set + /// Get a list of all relevant standardAssignments over a subscription level scope /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assignments /// /// /// Operation Id - /// WorkspaceSettings_Get + /// Assignments_ListBySubscription /// /// /// /// The instance the method will execute against. - /// Name of the security setting. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetSecurityWorkspaceSetting(this SubscriptionResource subscriptionResource, string workspaceSettingName, CancellationToken cancellationToken = default) - { - return subscriptionResource.GetSecurityWorkspaceSettings().Get(workspaceSettingName, cancellationToken); - } - - /// Gets a collection of RegulatoryComplianceStandardResources in the SubscriptionResource. - /// The instance the method will execute against. - /// An object representing collection of RegulatoryComplianceStandardResources and their operations over a RegulatoryComplianceStandardResource. - public static RegulatoryComplianceStandardCollection GetRegulatoryComplianceStandards(this SubscriptionResource subscriptionResource) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetAssignmentsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return GetExtensionClient(subscriptionResource).GetRegulatoryComplianceStandards(); + return GetExtensionClient(subscriptionResource).GetAssignmentsAsync(cancellationToken); } /// - /// Supported regulatory compliance details state for selected standard + /// Get a list of all relevant standardAssignments over a subscription level scope /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assignments /// /// /// Operation Id - /// RegulatoryComplianceStandards_Get + /// Assignments_ListBySubscription /// /// /// /// The instance the method will execute against. - /// Name of the regulatory compliance standard object. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetRegulatoryComplianceStandardAsync(this SubscriptionResource subscriptionResource, string regulatoryComplianceStandardName, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetAssignments(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetRegulatoryComplianceStandards().GetAsync(regulatoryComplianceStandardName, cancellationToken).ConfigureAwait(false); + return GetExtensionClient(subscriptionResource).GetAssignments(cancellationToken); } - /// - /// Supported regulatory compliance details state for selected standard - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName} - /// - /// - /// Operation Id - /// RegulatoryComplianceStandards_Get - /// - /// - /// - /// The instance the method will execute against. - /// Name of the regulatory compliance standard object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetRegulatoryComplianceStandard(this SubscriptionResource subscriptionResource, string regulatoryComplianceStandardName, CancellationToken cancellationToken = default) + private static ResourceGroupResourceExtensionClient GetExtensionClient(ResourceGroupResource resourceGroupResource) { - return subscriptionResource.GetRegulatoryComplianceStandards().Get(regulatoryComplianceStandardName, cancellationToken); + return resourceGroupResource.GetCachedClient((client) => + { + return new ResourceGroupResourceExtensionClient(client, resourceGroupResource.Id); + } + ); } - /// Gets a collection of SecurityAlertsSuppressionRuleResources in the SubscriptionResource. - /// The instance the method will execute against. - /// An object representing collection of SecurityAlertsSuppressionRuleResources and their operations over a SecurityAlertsSuppressionRuleResource. - public static SecurityAlertsSuppressionRuleCollection GetSecurityAlertsSuppressionRules(this SubscriptionResource subscriptionResource) + /// Gets a collection of StandardResources in the ResourceGroupResource. + /// The instance the method will execute against. + /// An object representing collection of StandardResources and their operations over a StandardResource. + public static StandardCollection GetStandards(this ResourceGroupResource resourceGroupResource) { - return GetExtensionClient(subscriptionResource).GetSecurityAlertsSuppressionRules(); + return GetExtensionClient(resourceGroupResource).GetStandards(); } /// - /// Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription + /// Get a specific security standard for the requested scope /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} /// /// /// Operation Id - /// AlertsSuppressionRules_Get + /// Standards_Get /// /// /// - /// The instance the method will execute against. - /// The unique name of the suppression alert rule. + /// The instance the method will execute against. + /// The Security Standard key - unique key for the standard type. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. + /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] - public static async Task> GetSecurityAlertsSuppressionRuleAsync(this SubscriptionResource subscriptionResource, string alertsSuppressionRuleName, CancellationToken cancellationToken = default) + public static async Task> GetStandardAsync(this ResourceGroupResource resourceGroupResource, string standardId, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetSecurityAlertsSuppressionRules().GetAsync(alertsSuppressionRuleName, cancellationToken).ConfigureAwait(false); + return await resourceGroupResource.GetStandards().GetAsync(standardId, cancellationToken).ConfigureAwait(false); } /// - /// Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription + /// Get a specific security standard for the requested scope /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} /// /// /// Operation Id - /// AlertsSuppressionRules_Get + /// Standards_Get /// /// /// - /// The instance the method will execute against. - /// The unique name of the suppression alert rule. + /// The instance the method will execute against. + /// The Security Standard key - unique key for the standard type. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. + /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] - public static Response GetSecurityAlertsSuppressionRule(this SubscriptionResource subscriptionResource, string alertsSuppressionRuleName, CancellationToken cancellationToken = default) + public static Response GetStandard(this ResourceGroupResource resourceGroupResource, string standardId, CancellationToken cancellationToken = default) { - return subscriptionResource.GetSecurityAlertsSuppressionRules().Get(alertsSuppressionRuleName, cancellationToken); + return resourceGroupResource.GetStandards().Get(standardId, cancellationToken); } - /// Gets a collection of SubscriptionAssessmentMetadataResources in the SubscriptionResource. - /// The instance the method will execute against. - /// An object representing collection of SubscriptionAssessmentMetadataResources and their operations over a SubscriptionAssessmentMetadataResource. - public static SubscriptionAssessmentMetadataCollection GetAllSubscriptionAssessmentMetadata(this SubscriptionResource subscriptionResource) + /// Gets a collection of AssignmentResources in the ResourceGroupResource. + /// The instance the method will execute against. + /// An object representing collection of AssignmentResources and their operations over a AssignmentResource. + public static AssignmentCollection GetAssignments(this ResourceGroupResource resourceGroupResource) { - return GetExtensionClient(subscriptionResource).GetAllSubscriptionAssessmentMetadata(); + return GetExtensionClient(resourceGroupResource).GetAssignments(); } /// - /// Get metadata information on an assessment type in a specific subscription + /// Get a specific standard assignment for the requested scope by resourceId /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} /// /// /// Operation Id - /// AssessmentsMetadata_GetInSubscription + /// Assignments_Get /// /// /// - /// The instance the method will execute against. - /// The Assessment Key - Unique key for the assessment type. + /// The instance the method will execute against. + /// The security assignment key - unique key for the standard assignment. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. + /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] - public static async Task> GetSubscriptionAssessmentMetadataAsync(this SubscriptionResource subscriptionResource, string assessmentMetadataName, CancellationToken cancellationToken = default) + public static async Task> GetAssignmentAsync(this ResourceGroupResource resourceGroupResource, string assignmentId, CancellationToken cancellationToken = default) { - return await subscriptionResource.GetAllSubscriptionAssessmentMetadata().GetAsync(assessmentMetadataName, cancellationToken).ConfigureAwait(false); + return await resourceGroupResource.GetAssignments().GetAsync(assignmentId, cancellationToken).ConfigureAwait(false); } /// - /// Get metadata information on an assessment type in a specific subscription + /// Get a specific standard assignment for the requested scope by resourceId /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/assignments/{assignmentId} /// /// /// Operation Id - /// AssessmentsMetadata_GetInSubscription + /// Assignments_Get /// /// /// - /// The instance the method will execute against. - /// The Assessment Key - Unique key for the assessment type. + /// The instance the method will execute against. + /// The security assignment key - unique key for the standard assignment. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. + /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] - public static Response GetSubscriptionAssessmentMetadata(this SubscriptionResource subscriptionResource, string assessmentMetadataName, CancellationToken cancellationToken = default) - { - return subscriptionResource.GetAllSubscriptionAssessmentMetadata().Get(assessmentMetadataName, cancellationToken); - } - - /// Gets a collection of SecureScoreResources in the SubscriptionResource. - /// The instance the method will execute against. - /// An object representing collection of SecureScoreResources and their operations over a SecureScoreResource. - public static SecureScoreCollection GetSecureScores(this SubscriptionResource subscriptionResource) + public static Response GetAssignment(this ResourceGroupResource resourceGroupResource, string assignmentId, CancellationToken cancellationToken = default) { - return GetExtensionClient(subscriptionResource).GetSecureScores(); + return resourceGroupResource.GetAssignments().Get(assignmentId, cancellationToken); } + #region StandardResource /// - /// Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC Default initiative, use 'ascScore'. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName} - /// - /// - /// Operation Id - /// SecureScores_Get - /// - /// - /// - /// The instance the method will execute against. - /// The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetSecureScoreAsync(this SubscriptionResource subscriptionResource, string secureScoreName, CancellationToken cancellationToken = default) - { - return await subscriptionResource.GetSecureScores().GetAsync(secureScoreName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC Default initiative, use 'ascScore'. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName} - /// - /// - /// Operation Id - /// SecureScores_Get - /// - /// - /// - /// The instance the method will execute against. - /// The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetSecureScore(this SubscriptionResource subscriptionResource, string secureScoreName, CancellationToken cancellationToken = default) - { - return subscriptionResource.GetSecureScores().Get(secureScoreName, cancellationToken); - } - - /// Gets a collection of SecurityCloudConnectorResources in the SubscriptionResource. - /// The instance the method will execute against. - /// An object representing collection of SecurityCloudConnectorResources and their operations over a SecurityCloudConnectorResource. - public static SecurityCloudConnectorCollection GetSecurityCloudConnectors(this SubscriptionResource subscriptionResource) - { - return GetExtensionClient(subscriptionResource).GetSecurityCloudConnectors(); - } - - /// - /// Details of a specific cloud account connector - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName} - /// - /// - /// Operation Id - /// Connectors_Get - /// - /// - /// - /// The instance the method will execute against. - /// Name of the cloud account connector. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetSecurityCloudConnectorAsync(this SubscriptionResource subscriptionResource, string connectorName, CancellationToken cancellationToken = default) - { - return await subscriptionResource.GetSecurityCloudConnectors().GetAsync(connectorName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Details of a specific cloud account connector - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName} - /// - /// - /// Operation Id - /// Connectors_Get - /// - /// - /// - /// The instance the method will execute against. - /// Name of the cloud account connector. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetSecurityCloudConnector(this SubscriptionResource subscriptionResource, string connectorName, CancellationToken cancellationToken = default) - { - return subscriptionResource.GetSecurityCloudConnectors().Get(connectorName, cancellationToken); - } - - /// Gets a collection of SecuritySettingResources in the SubscriptionResource. - /// The instance the method will execute against. - /// An object representing collection of SecuritySettingResources and their operations over a SecuritySettingResource. - public static SecuritySettingCollection GetSecuritySettings(this SubscriptionResource subscriptionResource) - { - return GetExtensionClient(subscriptionResource).GetSecuritySettings(); - } - - /// - /// Settings of different configurations in Microsoft Defender for Cloud - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName} - /// - /// - /// Operation Id - /// Settings_Get - /// - /// - /// - /// The instance the method will execute against. - /// The name of the setting. - /// The cancellation token to use. - [ForwardsClientCalls] - public static async Task> GetSecuritySettingAsync(this SubscriptionResource subscriptionResource, SecuritySettingName settingName, CancellationToken cancellationToken = default) - { - return await subscriptionResource.GetSecuritySettings().GetAsync(settingName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Settings of different configurations in Microsoft Defender for Cloud - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName} - /// - /// - /// Operation Id - /// Settings_Get - /// - /// - /// - /// The instance the method will execute against. - /// The name of the setting. - /// The cancellation token to use. - [ForwardsClientCalls] - public static Response GetSecuritySetting(this SubscriptionResource subscriptionResource, SecuritySettingName settingName, CancellationToken cancellationToken = default) - { - return subscriptionResource.GetSecuritySettings().Get(settingName, cancellationToken); - } - - /// Gets a collection of IngestionSettingResources in the SubscriptionResource. - /// The instance the method will execute against. - /// An object representing collection of IngestionSettingResources and their operations over a IngestionSettingResource. - public static IngestionSettingCollection GetIngestionSettings(this SubscriptionResource subscriptionResource) - { - return GetExtensionClient(subscriptionResource).GetIngestionSettings(); - } - - /// - /// Settings for ingesting security data and logs to correlate with resources associated with the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName} - /// - /// - /// Operation Id - /// IngestionSettings_Get - /// - /// - /// - /// The instance the method will execute against. - /// Name of the ingestion setting. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetIngestionSettingAsync(this SubscriptionResource subscriptionResource, string ingestionSettingName, CancellationToken cancellationToken = default) - { - return await subscriptionResource.GetIngestionSettings().GetAsync(ingestionSettingName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Settings for ingesting security data and logs to correlate with resources associated with the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName} - /// - /// - /// Operation Id - /// IngestionSettings_Get - /// - /// - /// - /// The instance the method will execute against. - /// Name of the ingestion setting. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetIngestionSetting(this SubscriptionResource subscriptionResource, string ingestionSettingName, CancellationToken cancellationToken = default) - { - return subscriptionResource.GetIngestionSettings().Get(ingestionSettingName, cancellationToken); - } - - /// Gets a collection of SubscriptionGovernanceRuleResources in the SubscriptionResource. - /// The instance the method will execute against. - /// An object representing collection of SubscriptionGovernanceRuleResources and their operations over a SubscriptionGovernanceRuleResource. - public static SubscriptionGovernanceRuleCollection GetSubscriptionGovernanceRules(this SubscriptionResource subscriptionResource) - { - return GetExtensionClient(subscriptionResource).GetSubscriptionGovernanceRules(); - } - - /// - /// Get a specific governanceRule for the requested scope by ruleId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// GovernanceRules_Get - /// - /// - /// - /// The instance the method will execute against. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetSubscriptionGovernanceRuleAsync(this SubscriptionResource subscriptionResource, string ruleId, CancellationToken cancellationToken = default) - { - return await subscriptionResource.GetSubscriptionGovernanceRules().GetAsync(ruleId, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a specific governanceRule for the requested scope by ruleId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// GovernanceRules_Get - /// - /// - /// - /// The instance the method will execute against. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetSubscriptionGovernanceRule(this SubscriptionResource subscriptionResource, string ruleId, CancellationToken cancellationToken = default) - { - return subscriptionResource.GetSubscriptionGovernanceRules().Get(ruleId, cancellationToken); - } - - /// Gets a collection of SubscriptionSecurityApplicationResources in the SubscriptionResource. - /// The instance the method will execute against. - /// An object representing collection of SubscriptionSecurityApplicationResources and their operations over a SubscriptionSecurityApplicationResource. - public static SubscriptionSecurityApplicationCollection GetSubscriptionSecurityApplications(this SubscriptionResource subscriptionResource) - { - return GetExtensionClient(subscriptionResource).GetSubscriptionSecurityApplications(); - } - - /// - /// Get a specific application for the requested scope by applicationId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// Application_Get - /// - /// - /// - /// The instance the method will execute against. - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetSubscriptionSecurityApplicationAsync(this SubscriptionResource subscriptionResource, string applicationId, CancellationToken cancellationToken = default) - { - return await subscriptionResource.GetSubscriptionSecurityApplications().GetAsync(applicationId, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a specific application for the requested scope by applicationId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// Application_Get - /// - /// - /// - /// The instance the method will execute against. - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetSubscriptionSecurityApplication(this SubscriptionResource subscriptionResource, string applicationId, CancellationToken cancellationToken = default) - { - return subscriptionResource.GetSubscriptionSecurityApplications().Get(applicationId, cancellationToken); - } - - /// - /// The configuration or data needed to onboard the machine to MDE - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings - /// - /// - /// Operation Id - /// MdeOnboardings_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetMdeOnboardingsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetMdeOnboardingsAsync(cancellationToken); - } - - /// - /// The configuration or data needed to onboard the machine to MDE - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings - /// - /// - /// Operation Id - /// MdeOnboardings_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetMdeOnboardings(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetMdeOnboardings(cancellationToken); - } - - /// - /// The default configuration or data needed to onboard the machine to MDE - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings/default - /// - /// - /// Operation Id - /// MdeOnboardings_Get - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - public static async Task> GetMdeOnboardingAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return await GetExtensionClient(subscriptionResource).GetMdeOnboardingAsync(cancellationToken).ConfigureAwait(false); - } - - /// - /// The default configuration or data needed to onboard the machine to MDE - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings/default - /// - /// - /// Operation Id - /// MdeOnboardings_Get - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - public static Response GetMdeOnboarding(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetMdeOnboarding(cancellationToken); - } - - /// - /// List custom assessment automations by provided subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/customAssessmentAutomations - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_ListBySubscription - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetCustomAssessmentAutomationsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetCustomAssessmentAutomationsAsync(cancellationToken); - } - - /// - /// List custom assessment automations by provided subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/customAssessmentAutomations - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_ListBySubscription - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetCustomAssessmentAutomations(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetCustomAssessmentAutomations(cancellationToken); - } - - /// - /// List custom entity store assignments by provided subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/customEntityStoreAssignments - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_ListBySubscription - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetCustomEntityStoreAssignmentsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetCustomEntityStoreAssignmentsAsync(cancellationToken); - } - - /// - /// List custom entity store assignments by provided subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/customEntityStoreAssignments - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_ListBySubscription - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetCustomEntityStoreAssignments(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetCustomEntityStoreAssignments(cancellationToken); - } - - /// - /// Use this method to get the list of IoT Security solutions by subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions - /// - /// - /// Operation Id - /// IotSecuritySolution_ListBySubscription - /// - /// - /// - /// The instance the method will execute against. - /// Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetIotSecuritySolutionsAsync(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetIotSecuritySolutionsAsync(filter, cancellationToken); - } - - /// - /// Use this method to get the list of IoT Security solutions by subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions - /// - /// - /// Operation Id - /// IotSecuritySolution_ListBySubscription - /// - /// - /// - /// The instance the method will execute against. - /// Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetIotSecuritySolutions(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetIotSecuritySolutions(filter, cancellationToken); - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/tasks - /// - /// - /// Operation Id - /// Tasks_List - /// - /// - /// - /// The instance the method will execute against. - /// OData filter. Optional. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetTasksAsync(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetTasksAsync(filter, cancellationToken); - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/tasks - /// - /// - /// Operation Id - /// Tasks_List - /// - /// - /// - /// The instance the method will execute against. - /// OData filter. Optional. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetTasks(this SubscriptionResource subscriptionResource, string filter = null, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetTasks(filter, cancellationToken); - } - - /// - /// Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to get the next page of security automations for the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/automations - /// - /// - /// Operation Id - /// Automations_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetSecurityAutomationsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetSecurityAutomationsAsync(cancellationToken); - } - - /// - /// Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to get the next page of security automations for the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/automations - /// - /// - /// Operation Id - /// Automations_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetSecurityAutomations(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetSecurityAutomations(cancellationToken); - } - - /// - /// Gets a list of application control machine groups for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applicationWhitelistings - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_List - /// - /// - /// - /// The instance the method will execute against. - /// Include the policy rules. - /// Return output in a summarized form. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetAdaptiveApplicationControlGroupsAsync(this SubscriptionResource subscriptionResource, bool? includePathRecommendations = null, bool? summary = null, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetAdaptiveApplicationControlGroupsAsync(includePathRecommendations, summary, cancellationToken); - } - - /// - /// Gets a list of application control machine groups for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applicationWhitelistings - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_List - /// - /// - /// - /// The instance the method will execute against. - /// Include the policy rules. - /// Return output in a summarized form. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetAdaptiveApplicationControlGroups(this SubscriptionResource subscriptionResource, bool? includePathRecommendations = null, bool? summary = null, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetAdaptiveApplicationControlGroups(includePathRecommendations, summary, cancellationToken); - } - - /// - /// Gets the list of all possible traffic between resources for the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/allowedConnections - /// - /// - /// Operation Id - /// AllowedConnections_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetAllowedConnectionsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetAllowedConnectionsAsync(cancellationToken); - } - - /// - /// Gets the list of all possible traffic between resources for the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/allowedConnections - /// - /// - /// Operation Id - /// AllowedConnections_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetAllowedConnections(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetAllowedConnections(cancellationToken); - } - - /// - /// Gets a list that allows to build a topology view of a subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/topologies - /// - /// - /// Operation Id - /// Topology_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetTopologiesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetTopologiesAsync(cancellationToken); - } - - /// - /// Gets a list that allows to build a topology view of a subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/topologies - /// - /// - /// Operation Id - /// Topology_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetTopologies(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetTopologies(cancellationToken); - } - - /// - /// Policies for protecting resources using Just-in-Time access control. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/jitNetworkAccessPolicies - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetJitNetworkAccessPoliciesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetJitNetworkAccessPoliciesAsync(cancellationToken); - } - - /// - /// Policies for protecting resources using Just-in-Time access control. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/jitNetworkAccessPolicies - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetJitNetworkAccessPolicies(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetJitNetworkAccessPolicies(cancellationToken); - } - - /// - /// Gets a list of discovered Security Solutions for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/discoveredSecuritySolutions - /// - /// - /// Operation Id - /// DiscoveredSecuritySolutions_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetDiscoveredSecuritySolutionsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetDiscoveredSecuritySolutionsAsync(cancellationToken); - } - - /// - /// Gets a list of discovered Security Solutions for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/discoveredSecuritySolutions - /// - /// - /// Operation Id - /// DiscoveredSecuritySolutions_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetDiscoveredSecuritySolutions(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetDiscoveredSecuritySolutions(cancellationToken); - } - - /// - /// Gets a list of all supported Security Solutions for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutionsReferenceData - /// - /// - /// Operation Id - /// securitySolutionsReferenceData_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetAllSecuritySolutionsReferenceDataAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetAllSecuritySolutionsReferenceDataAsync(cancellationToken); - } - - /// - /// Gets a list of all supported Security Solutions for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutionsReferenceData - /// - /// - /// Operation Id - /// securitySolutionsReferenceData_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetAllSecuritySolutionsReferenceData(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetAllSecuritySolutionsReferenceData(cancellationToken); - } - - /// - /// Gets a list of external security solutions for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/externalSecuritySolutions - /// - /// - /// Operation Id - /// ExternalSecuritySolutions_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetExternalSecuritySolutionsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetExternalSecuritySolutionsAsync(cancellationToken); - } - - /// - /// Gets a list of external security solutions for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/externalSecuritySolutions - /// - /// - /// Operation Id - /// ExternalSecuritySolutions_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetExternalSecuritySolutions(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetExternalSecuritySolutions(cancellationToken); - } - - /// - /// Get all security controls within a scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControls - /// - /// - /// Operation Id - /// SecureScoreControls_List - /// - /// - /// - /// The instance the method will execute against. - /// OData expand. Optional. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetSecureScoreControlsAsync(this SubscriptionResource subscriptionResource, SecurityScoreODataExpand? expand = null, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetSecureScoreControlsAsync(expand, cancellationToken); - } - - /// - /// Get all security controls within a scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControls - /// - /// - /// Operation Id - /// SecureScoreControls_List - /// - /// - /// - /// The instance the method will execute against. - /// OData expand. Optional. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetSecureScoreControls(this SubscriptionResource subscriptionResource, SecurityScoreODataExpand? expand = null, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetSecureScoreControls(expand, cancellationToken); - } - - /// - /// For a specified subscription, list the available security controls, their assessments, and the max score - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControlDefinitions - /// - /// - /// Operation Id - /// SecureScoreControlDefinitions_ListBySubscription - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetSecureScoreControlDefinitionsBySubscriptionAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetSecureScoreControlDefinitionsBySubscriptionAsync(cancellationToken); - } - - /// - /// For a specified subscription, list the available security controls, their assessments, and the max score - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControlDefinitions - /// - /// - /// Operation Id - /// SecureScoreControlDefinitions_ListBySubscription - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetSecureScoreControlDefinitionsBySubscription(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetSecureScoreControlDefinitionsBySubscription(cancellationToken); - } - - /// - /// Gets a list of Security Solutions for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutions - /// - /// - /// Operation Id - /// SecuritySolutions_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetSecuritySolutionsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetSecuritySolutionsAsync(cancellationToken); - } - - /// - /// Gets a list of Security Solutions for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutions - /// - /// - /// Operation Id - /// SecuritySolutions_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetSecuritySolutions(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetSecuritySolutions(cancellationToken); - } - - /// - /// List all the alerts that are associated with the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts - /// - /// - /// Operation Id - /// Alerts_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetAlertsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetAlertsAsync(cancellationToken); - } - - /// - /// List all the alerts that are associated with the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts - /// - /// - /// Operation Id - /// Alerts_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetAlerts(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetAlerts(cancellationToken); - } - - /// - /// Gets the software inventory of all virtual machines in the subscriptions. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories - /// - /// - /// Operation Id - /// SoftwareInventories_ListBySubscription - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetSoftwareInventoriesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetSoftwareInventoriesAsync(cancellationToken); - } - - /// - /// Gets the software inventory of all virtual machines in the subscriptions. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories - /// - /// - /// Operation Id - /// SoftwareInventories_ListBySubscription - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetSoftwareInventories(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetSoftwareInventories(cancellationToken); - } - - /// - /// Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to get the next page of security connectors for the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors - /// - /// - /// Operation Id - /// SecurityConnectors_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetSecurityConnectorsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetSecurityConnectorsAsync(cancellationToken); - } - - /// - /// Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to get the next page of security connectors for the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors - /// - /// - /// Operation Id - /// SecurityConnectors_List - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetSecurityConnectors(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(subscriptionResource).GetSecurityConnectors(cancellationToken); - } - - private static ResourceGroupResourceExtensionClient GetExtensionClient(ResourceGroupResource resourceGroupResource) - { - return resourceGroupResource.GetCachedClient((client) => - { - return new ResourceGroupResourceExtensionClient(client, resourceGroupResource.Id); - } - ); - } - - /// Gets a collection of CustomAssessmentAutomationResources in the ResourceGroupResource. - /// The instance the method will execute against. - /// An object representing collection of CustomAssessmentAutomationResources and their operations over a CustomAssessmentAutomationResource. - public static CustomAssessmentAutomationCollection GetCustomAssessmentAutomations(this ResourceGroupResource resourceGroupResource) - { - return GetExtensionClient(resourceGroupResource).GetCustomAssessmentAutomations(); - } - - /// - /// Gets a single custom assessment automation by name for the provided subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName} - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_Get - /// - /// - /// - /// The instance the method will execute against. - /// Name of the Custom Assessment Automation. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetCustomAssessmentAutomationAsync(this ResourceGroupResource resourceGroupResource, string customAssessmentAutomationName, CancellationToken cancellationToken = default) - { - return await resourceGroupResource.GetCustomAssessmentAutomations().GetAsync(customAssessmentAutomationName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a single custom assessment automation by name for the provided subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName} - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_Get - /// - /// - /// - /// The instance the method will execute against. - /// Name of the Custom Assessment Automation. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetCustomAssessmentAutomation(this ResourceGroupResource resourceGroupResource, string customAssessmentAutomationName, CancellationToken cancellationToken = default) - { - return resourceGroupResource.GetCustomAssessmentAutomations().Get(customAssessmentAutomationName, cancellationToken); - } - - /// Gets a collection of CustomEntityStoreAssignmentResources in the ResourceGroupResource. - /// The instance the method will execute against. - /// An object representing collection of CustomEntityStoreAssignmentResources and their operations over a CustomEntityStoreAssignmentResource. - public static CustomEntityStoreAssignmentCollection GetCustomEntityStoreAssignments(this ResourceGroupResource resourceGroupResource) - { - return GetExtensionClient(resourceGroupResource).GetCustomEntityStoreAssignments(); - } - - /// - /// Gets a single custom entity store assignment by name for the provided subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName} - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_Get - /// - /// - /// - /// The instance the method will execute against. - /// Name of the custom entity store assignment. Generated name is GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetCustomEntityStoreAssignmentAsync(this ResourceGroupResource resourceGroupResource, string customEntityStoreAssignmentName, CancellationToken cancellationToken = default) - { - return await resourceGroupResource.GetCustomEntityStoreAssignments().GetAsync(customEntityStoreAssignmentName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a single custom entity store assignment by name for the provided subscription and resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName} - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_Get - /// - /// - /// - /// The instance the method will execute against. - /// Name of the custom entity store assignment. Generated name is GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetCustomEntityStoreAssignment(this ResourceGroupResource resourceGroupResource, string customEntityStoreAssignmentName, CancellationToken cancellationToken = default) - { - return resourceGroupResource.GetCustomEntityStoreAssignments().Get(customEntityStoreAssignmentName, cancellationToken); - } - - /// Gets a collection of IotSecuritySolutionResources in the ResourceGroupResource. - /// The instance the method will execute against. - /// An object representing collection of IotSecuritySolutionResources and their operations over a IotSecuritySolutionResource. - public static IotSecuritySolutionCollection GetIotSecuritySolutions(this ResourceGroupResource resourceGroupResource) - { - return GetExtensionClient(resourceGroupResource).GetIotSecuritySolutions(); - } - - /// - /// User this method to get details of a specific IoT Security solution based on solution name - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} - /// - /// - /// Operation Id - /// IotSecuritySolution_Get - /// - /// - /// - /// The instance the method will execute against. - /// The name of the IoT Security solution. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetIotSecuritySolutionAsync(this ResourceGroupResource resourceGroupResource, string solutionName, CancellationToken cancellationToken = default) - { - return await resourceGroupResource.GetIotSecuritySolutions().GetAsync(solutionName, cancellationToken).ConfigureAwait(false); - } - - /// - /// User this method to get details of a specific IoT Security solution based on solution name - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} - /// - /// - /// Operation Id - /// IotSecuritySolution_Get - /// - /// - /// - /// The instance the method will execute against. - /// The name of the IoT Security solution. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetIotSecuritySolution(this ResourceGroupResource resourceGroupResource, string solutionName, CancellationToken cancellationToken = default) - { - return resourceGroupResource.GetIotSecuritySolutions().Get(solutionName, cancellationToken); - } - - /// Gets a collection of ResourceGroupSecurityTaskResources in the ResourceGroupResource. - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// An object representing collection of ResourceGroupSecurityTaskResources and their operations over a ResourceGroupSecurityTaskResource. - public static ResourceGroupSecurityTaskCollection GetResourceGroupSecurityTasks(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation) - { - return GetExtensionClient(resourceGroupResource).GetResourceGroupSecurityTasks(ascLocation); - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} - /// - /// - /// Operation Id - /// Tasks_GetResourceGroupLevelTask - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the task object, will be a GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetResourceGroupSecurityTaskAsync(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string taskName, CancellationToken cancellationToken = default) - { - return await resourceGroupResource.GetResourceGroupSecurityTasks(ascLocation).GetAsync(taskName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} - /// - /// - /// Operation Id - /// Tasks_GetResourceGroupLevelTask - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the task object, will be a GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetResourceGroupSecurityTask(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string taskName, CancellationToken cancellationToken = default) - { - return resourceGroupResource.GetResourceGroupSecurityTasks(ascLocation).Get(taskName, cancellationToken); - } - - /// Gets a collection of SecurityAutomationResources in the ResourceGroupResource. - /// The instance the method will execute against. - /// An object representing collection of SecurityAutomationResources and their operations over a SecurityAutomationResource. - public static SecurityAutomationCollection GetSecurityAutomations(this ResourceGroupResource resourceGroupResource) - { - return GetExtensionClient(resourceGroupResource).GetSecurityAutomations(); - } - - /// - /// Retrieves information about the model of a security automation. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} - /// - /// - /// Operation Id - /// Automations_Get - /// - /// - /// - /// The instance the method will execute against. - /// The security automation name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetSecurityAutomationAsync(this ResourceGroupResource resourceGroupResource, string automationName, CancellationToken cancellationToken = default) - { - return await resourceGroupResource.GetSecurityAutomations().GetAsync(automationName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves information about the model of a security automation. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} - /// - /// - /// Operation Id - /// Automations_Get - /// - /// - /// - /// The instance the method will execute against. - /// The security automation name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetSecurityAutomation(this ResourceGroupResource resourceGroupResource, string automationName, CancellationToken cancellationToken = default) - { - return resourceGroupResource.GetSecurityAutomations().Get(automationName, cancellationToken); - } - - /// Gets a collection of ServerVulnerabilityAssessmentResources in the ResourceGroupResource. - /// The instance the method will execute against. - /// The Namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// , or is an empty string, and was expected to be non-empty. - /// , or is null. - /// An object representing collection of ServerVulnerabilityAssessmentResources and their operations over a ServerVulnerabilityAssessmentResource. - public static ServerVulnerabilityAssessmentCollection GetServerVulnerabilityAssessments(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName) - { - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetExtensionClient(resourceGroupResource).GetServerVulnerabilityAssessments(resourceNamespace, resourceType, resourceName); - } - - /// - /// Gets a server vulnerability assessment onboarding statuses on a given resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment} - /// - /// - /// Operation Id - /// ServerVulnerabilityAssessment_Get - /// - /// - /// - /// The instance the method will execute against. - /// The Namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. - /// , or is null. - [ForwardsClientCalls] - public static async Task> GetServerVulnerabilityAssessmentAsync(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - return await resourceGroupResource.GetServerVulnerabilityAssessments(resourceNamespace, resourceType, resourceName).GetAsync(cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a server vulnerability assessment onboarding statuses on a given resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment} - /// - /// - /// Operation Id - /// ServerVulnerabilityAssessment_Get - /// - /// - /// - /// The instance the method will execute against. - /// The Namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// The cancellation token to use. - /// , or is an empty string, and was expected to be non-empty. - /// , or is null. - [ForwardsClientCalls] - public static Response GetServerVulnerabilityAssessment(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - return resourceGroupResource.GetServerVulnerabilityAssessments(resourceNamespace, resourceType, resourceName).Get(cancellationToken); - } - - /// Gets a collection of AdaptiveNetworkHardeningResources in the ResourceGroupResource. - /// The instance the method will execute against. - /// The Namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// , or is an empty string, and was expected to be non-empty. - /// , or is null. - /// An object representing collection of AdaptiveNetworkHardeningResources and their operations over a AdaptiveNetworkHardeningResource. - public static AdaptiveNetworkHardeningCollection GetAdaptiveNetworkHardenings(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName) - { - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetExtensionClient(resourceGroupResource).GetAdaptiveNetworkHardenings(resourceNamespace, resourceType, resourceName); - } - - /// - /// Gets a single Adaptive Network Hardening resource - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName} - /// - /// - /// Operation Id - /// AdaptiveNetworkHardenings_Get - /// - /// - /// - /// The instance the method will execute against. - /// 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 to use. - /// , , or is an empty string, and was expected to be non-empty. - /// , , or is null. - [ForwardsClientCalls] - public static async Task> GetAdaptiveNetworkHardeningAsync(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, CancellationToken cancellationToken = default) - { - return await resourceGroupResource.GetAdaptiveNetworkHardenings(resourceNamespace, resourceType, resourceName).GetAsync(adaptiveNetworkHardeningResourceName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a single Adaptive Network Hardening resource - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName} - /// - /// - /// Operation Id - /// AdaptiveNetworkHardenings_Get - /// - /// - /// - /// The instance the method will execute against. - /// 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 to use. - /// , , or is an empty string, and was expected to be non-empty. - /// , , or is null. - [ForwardsClientCalls] - public static Response GetAdaptiveNetworkHardening(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, CancellationToken cancellationToken = default) - { - return resourceGroupResource.GetAdaptiveNetworkHardenings(resourceNamespace, resourceType, resourceName).Get(adaptiveNetworkHardeningResourceName, cancellationToken); - } - - /// Gets a collection of JitNetworkAccessPolicyResources in the ResourceGroupResource. - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// An object representing collection of JitNetworkAccessPolicyResources and their operations over a JitNetworkAccessPolicyResource. - public static JitNetworkAccessPolicyCollection GetJitNetworkAccessPolicies(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation) - { - return GetExtensionClient(resourceGroupResource).GetJitNetworkAccessPolicies(ascLocation); - } - - /// - /// Policies for protecting resources using Just-in-Time access control for the subscription, location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName} - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_Get - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a Just-in-Time access configuration policy. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetJitNetworkAccessPolicyAsync(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string jitNetworkAccessPolicyName, CancellationToken cancellationToken = default) - { - return await resourceGroupResource.GetJitNetworkAccessPolicies(ascLocation).GetAsync(jitNetworkAccessPolicyName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Policies for protecting resources using Just-in-Time access control for the subscription, location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName} - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_Get - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a Just-in-Time access configuration policy. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetJitNetworkAccessPolicy(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string jitNetworkAccessPolicyName, CancellationToken cancellationToken = default) - { - return resourceGroupResource.GetJitNetworkAccessPolicies(ascLocation).Get(jitNetworkAccessPolicyName, cancellationToken); - } - - /// Gets a collection of ResourceGroupSecurityAlertResources in the ResourceGroupResource. - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// An object representing collection of ResourceGroupSecurityAlertResources and their operations over a ResourceGroupSecurityAlertResource. - public static ResourceGroupSecurityAlertCollection GetResourceGroupSecurityAlerts(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation) - { - return GetExtensionClient(resourceGroupResource).GetResourceGroupSecurityAlerts(ascLocation); - } - - /// - /// Get an alert that is associated a resource group or a resource in a resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} - /// - /// - /// Operation Id - /// Alerts_GetResourceGroupLevel - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetResourceGroupSecurityAlertAsync(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - return await resourceGroupResource.GetResourceGroupSecurityAlerts(ascLocation).GetAsync(alertName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get an alert that is associated a resource group or a resource in a resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} - /// - /// - /// Operation Id - /// Alerts_GetResourceGroupLevel - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetResourceGroupSecurityAlert(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - return resourceGroupResource.GetResourceGroupSecurityAlerts(ascLocation).Get(alertName, cancellationToken); - } - - /// Gets a collection of SoftwareInventoryResources in the ResourceGroupResource. - /// The instance the method will execute against. - /// The namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// , or is an empty string, and was expected to be non-empty. - /// , or is null. - /// An object representing collection of SoftwareInventoryResources and their operations over a SoftwareInventoryResource. - public static SoftwareInventoryCollection GetSoftwareInventories(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName) - { - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - return GetExtensionClient(resourceGroupResource).GetSoftwareInventories(resourceNamespace, resourceType, resourceName); - } - - /// - /// Gets a single software data of the virtual machine. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName} - /// - /// - /// Operation Id - /// SoftwareInventories_Get - /// - /// - /// - /// The instance the method will execute against. - /// The namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// Name of the installed software. - /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. - /// , , or is null. - [ForwardsClientCalls] - public static async Task> GetSoftwareInventoryAsync(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName, string softwareName, CancellationToken cancellationToken = default) - { - return await resourceGroupResource.GetSoftwareInventories(resourceNamespace, resourceType, resourceName).GetAsync(softwareName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a single software data of the virtual machine. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName} - /// - /// - /// Operation Id - /// SoftwareInventories_Get - /// - /// - /// - /// The instance the method will execute against. - /// The namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// Name of the installed software. - /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. - /// , , or is null. - [ForwardsClientCalls] - public static Response GetSoftwareInventory(this ResourceGroupResource resourceGroupResource, string resourceNamespace, string resourceType, string resourceName, string softwareName, CancellationToken cancellationToken = default) - { - return resourceGroupResource.GetSoftwareInventories(resourceNamespace, resourceType, resourceName).Get(softwareName, cancellationToken); - } - - /// Gets a collection of SecurityConnectorResources in the ResourceGroupResource. - /// The instance the method will execute against. - /// An object representing collection of SecurityConnectorResources and their operations over a SecurityConnectorResource. - public static SecurityConnectorCollection GetSecurityConnectors(this ResourceGroupResource resourceGroupResource) - { - return GetExtensionClient(resourceGroupResource).GetSecurityConnectors(); - } - - /// - /// Retrieves details of a specific security connector - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Get - /// - /// - /// - /// The instance the method will execute against. - /// The security connector name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetSecurityConnectorAsync(this ResourceGroupResource resourceGroupResource, string securityConnectorName, CancellationToken cancellationToken = default) - { - return await resourceGroupResource.GetSecurityConnectors().GetAsync(securityConnectorName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves details of a specific security connector - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Get - /// - /// - /// - /// The instance the method will execute against. - /// The security connector name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetSecurityConnector(this ResourceGroupResource resourceGroupResource, string securityConnectorName, CancellationToken cancellationToken = default) - { - return resourceGroupResource.GetSecurityConnectors().Get(securityConnectorName, cancellationToken); - } - - /// - /// Gets the list of all possible traffic between resources for the subscription and location, based on connection type. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType} - /// - /// - /// Operation Id - /// AllowedConnections_Get - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The type of allowed connections (Internal, External). - /// The cancellation token to use. - public static async Task> GetAllowedConnectionAsync(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, SecurityCenterConnectionType connectionType, CancellationToken cancellationToken = default) - { - return await GetExtensionClient(resourceGroupResource).GetAllowedConnectionAsync(ascLocation, connectionType, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the list of all possible traffic between resources for the subscription and location, based on connection type. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType} - /// - /// - /// Operation Id - /// AllowedConnections_Get - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The type of allowed connections (Internal, External). - /// The cancellation token to use. - public static Response GetAllowedConnection(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, SecurityCenterConnectionType connectionType, CancellationToken cancellationToken = default) - { - return GetExtensionClient(resourceGroupResource).GetAllowedConnection(ascLocation, connectionType, cancellationToken); - } - - /// - /// Gets a specific topology component. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName} - /// - /// - /// Operation Id - /// Topology_Get - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a topology resources collection. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public static async Task> GetTopologyAsync(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string topologyResourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(topologyResourceName, nameof(topologyResourceName)); - - return await GetExtensionClient(resourceGroupResource).GetTopologyAsync(ascLocation, topologyResourceName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a specific topology component. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName} - /// - /// - /// Operation Id - /// Topology_Get - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a topology resources collection. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public static Response GetTopology(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string topologyResourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(topologyResourceName, nameof(topologyResourceName)); - - return GetExtensionClient(resourceGroupResource).GetTopology(ascLocation, topologyResourceName, cancellationToken); - } - - /// - /// Policies for protecting resources using Just-in-Time access control for the subscription, location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_ListByResourceGroup - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetJitNetworkAccessPoliciesAsync(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(resourceGroupResource).GetJitNetworkAccessPoliciesAsync(cancellationToken); - } - - /// - /// Policies for protecting resources using Just-in-Time access control for the subscription, location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_ListByResourceGroup - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetJitNetworkAccessPolicies(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(resourceGroupResource).GetJitNetworkAccessPolicies(cancellationToken); - } - - /// - /// Gets a specific discovered Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName} - /// - /// - /// Operation Id - /// DiscoveredSecuritySolutions_Get - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a discovered security solution. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public static async Task> GetDiscoveredSecuritySolutionAsync(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string discoveredSecuritySolutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(discoveredSecuritySolutionName, nameof(discoveredSecuritySolutionName)); - - return await GetExtensionClient(resourceGroupResource).GetDiscoveredSecuritySolutionAsync(ascLocation, discoveredSecuritySolutionName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a specific discovered Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName} - /// - /// - /// Operation Id - /// DiscoveredSecuritySolutions_Get - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a discovered security solution. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public static Response GetDiscoveredSecuritySolution(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string discoveredSecuritySolutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(discoveredSecuritySolutionName, nameof(discoveredSecuritySolutionName)); - - return GetExtensionClient(resourceGroupResource).GetDiscoveredSecuritySolution(ascLocation, discoveredSecuritySolutionName, cancellationToken); - } - - /// - /// Gets a specific external Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName} - /// - /// - /// Operation Id - /// ExternalSecuritySolutions_Get - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of an external security solution. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public static async Task> GetExternalSecuritySolutionAsync(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string externalSecuritySolutionsName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(externalSecuritySolutionsName, nameof(externalSecuritySolutionsName)); - - return await GetExtensionClient(resourceGroupResource).GetExternalSecuritySolutionAsync(ascLocation, externalSecuritySolutionsName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a specific external Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName} - /// - /// - /// Operation Id - /// ExternalSecuritySolutions_Get - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of an external security solution. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public static Response GetExternalSecuritySolution(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string externalSecuritySolutionsName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(externalSecuritySolutionsName, nameof(externalSecuritySolutionsName)); - - return GetExtensionClient(resourceGroupResource).GetExternalSecuritySolution(ascLocation, externalSecuritySolutionsName, cancellationToken); - } - - /// - /// Gets a specific Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutions/{securitySolutionName} - /// - /// - /// Operation Id - /// SecuritySolutions_Get - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of security solution. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public static async Task> GetSecuritySolutionAsync(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string securitySolutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(securitySolutionName, nameof(securitySolutionName)); - - return await GetExtensionClient(resourceGroupResource).GetSecuritySolutionAsync(ascLocation, securitySolutionName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets a specific Security Solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutions/{securitySolutionName} - /// - /// - /// Operation Id - /// SecuritySolutions_Get - /// - /// - /// - /// The instance the method will execute against. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of security solution. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public static Response GetSecuritySolution(this ResourceGroupResource resourceGroupResource, AzureLocation ascLocation, string securitySolutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(securitySolutionName, nameof(securitySolutionName)); - - return GetExtensionClient(resourceGroupResource).GetSecuritySolution(ascLocation, securitySolutionName, cancellationToken); - } - - /// - /// List all the alerts that are associated with the resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts - /// - /// - /// Operation Id - /// Alerts_ListByResourceGroup - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetAlertsByResourceGroupAsync(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(resourceGroupResource).GetAlertsByResourceGroupAsync(cancellationToken); - } - - /// - /// List all the alerts that are associated with the resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts - /// - /// - /// Operation Id - /// Alerts_ListByResourceGroup - /// - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetAlertsByResourceGroup(this ResourceGroupResource resourceGroupResource, CancellationToken cancellationToken = default) - { - return GetExtensionClient(resourceGroupResource).GetAlertsByResourceGroup(cancellationToken); - } - - private static ArmResourceExtensionClient GetExtensionClient(ArmClient client, ResourceIdentifier scope) - { - return client.GetResourceClient(() => - { - return new ArmResourceExtensionClient(client, scope); - } - ); - } - - private static ArmResourceExtensionClient GetExtensionClient(ArmResource armResource) - { - return armResource.GetCachedClient((client) => - { - return new ArmResourceExtensionClient(client, armResource.Id); - } - ); - } - - /// Gets a collection of ComplianceResultResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of ComplianceResultResources and their operations over a ComplianceResultResource. - public static ComplianceResultCollection GetComplianceResults(this ArmClient client, ResourceIdentifier scope) - { - return GetExtensionClient(client, scope).GetComplianceResults(); - } - - /// - /// Security Compliance Result - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName} - /// - /// - /// Operation Id - /// ComplianceResults_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// name of the desired assessment compliance result. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetComplianceResultAsync(this ArmClient client, ResourceIdentifier scope, string complianceResultName, CancellationToken cancellationToken = default) - { - return await client.GetComplianceResults(scope).GetAsync(complianceResultName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Security Compliance Result - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName} - /// - /// - /// Operation Id - /// ComplianceResults_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// name of the desired assessment compliance result. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetComplianceResult(this ArmClient client, ResourceIdentifier scope, string complianceResultName, CancellationToken cancellationToken = default) - { - return client.GetComplianceResults(scope).Get(complianceResultName, cancellationToken); - } - - /// Gets an object representing a AdvancedThreatProtectionSettingResource along with the instance operations that can be performed on it in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// Returns a object. - public static AdvancedThreatProtectionSettingResource GetAdvancedThreatProtectionSetting(this ArmClient client, ResourceIdentifier scope) - { - return GetExtensionClient(client, scope).GetAdvancedThreatProtectionSetting(); - } - - /// Gets a collection of DeviceSecurityGroupResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of DeviceSecurityGroupResources and their operations over a DeviceSecurityGroupResource. - public static DeviceSecurityGroupCollection GetDeviceSecurityGroups(this ArmClient client, ResourceIdentifier scope) - { - return GetExtensionClient(client, scope).GetDeviceSecurityGroups(); - } - - /// - /// Use this method to get the device security group for the specified IoT Hub resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} - /// - /// - /// Operation Id - /// DeviceSecurityGroups_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The name of the device security group. Note that the name of the device security group is case insensitive. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetDeviceSecurityGroupAsync(this ArmClient client, ResourceIdentifier scope, string deviceSecurityGroupName, CancellationToken cancellationToken = default) - { - return await client.GetDeviceSecurityGroups(scope).GetAsync(deviceSecurityGroupName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Use this method to get the device security group for the specified IoT Hub resource. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName} - /// - /// - /// Operation Id - /// DeviceSecurityGroups_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The name of the device security group. Note that the name of the device security group is case insensitive. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetDeviceSecurityGroup(this ArmClient client, ResourceIdentifier scope, string deviceSecurityGroupName, CancellationToken cancellationToken = default) - { - return client.GetDeviceSecurityGroups(scope).Get(deviceSecurityGroupName, cancellationToken); - } - - /// Gets a collection of SecurityComplianceResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of SecurityComplianceResources and their operations over a SecurityComplianceResource. - public static SecurityComplianceCollection GetSecurityCompliances(this ArmClient client, ResourceIdentifier scope) - { - return GetExtensionClient(client, scope).GetSecurityCompliances(); - } - - /// - /// Details of a specific Compliance. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/compliances/{complianceName} - /// - /// - /// Operation Id - /// Compliances_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// name of the Compliance. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetSecurityComplianceAsync(this ArmClient client, ResourceIdentifier scope, string complianceName, CancellationToken cancellationToken = default) - { - return await client.GetSecurityCompliances(scope).GetAsync(complianceName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Details of a specific Compliance. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/compliances/{complianceName} - /// - /// - /// Operation Id - /// Compliances_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// name of the Compliance. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetSecurityCompliance(this ArmClient client, ResourceIdentifier scope, string complianceName, CancellationToken cancellationToken = default) - { - return client.GetSecurityCompliances(scope).Get(complianceName, cancellationToken); - } - - /// Gets a collection of SecurityAssessmentResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of SecurityAssessmentResources and their operations over a SecurityAssessmentResource. - public static SecurityAssessmentCollection GetSecurityAssessments(this ArmClient client, ResourceIdentifier scope) - { - return GetExtensionClient(client, scope).GetSecurityAssessments(); - } - - /// - /// Get a security assessment on your scanned resource - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} - /// - /// - /// Operation Id - /// Assessments_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The Assessment Key - Unique key for the assessment type. - /// OData expand. Optional. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetSecurityAssessmentAsync(this ArmClient client, ResourceIdentifier scope, string assessmentName, SecurityAssessmentODataExpand? expand = null, CancellationToken cancellationToken = default) - { - return await client.GetSecurityAssessments(scope).GetAsync(assessmentName, expand, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a security assessment on your scanned resource - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} - /// - /// - /// Operation Id - /// Assessments_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The Assessment Key - Unique key for the assessment type. - /// OData expand. Optional. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetSecurityAssessment(this ArmClient client, ResourceIdentifier scope, string assessmentName, SecurityAssessmentODataExpand? expand = null, CancellationToken cancellationToken = default) - { - return client.GetSecurityAssessments(scope).Get(assessmentName, expand, cancellationToken); - } - - /// Gets a collection of SqlVulnerabilityAssessmentScanResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of SqlVulnerabilityAssessmentScanResources and their operations over a SqlVulnerabilityAssessmentScanResource. - public static SqlVulnerabilityAssessmentScanCollection GetSqlVulnerabilityAssessmentScans(this ArmClient client, ResourceIdentifier scope) - { - return GetExtensionClient(client, scope).GetSqlVulnerabilityAssessmentScans(); - } - - /// - /// Gets the scan details of a single scan record. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentScans_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The scan Id. Type 'latest' to get the scan record for the latest scan. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetSqlVulnerabilityAssessmentScanAsync(this ArmClient client, ResourceIdentifier scope, string scanId, Guid workspaceId, CancellationToken cancellationToken = default) - { - return await client.GetSqlVulnerabilityAssessmentScans(scope).GetAsync(scanId, workspaceId, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the scan details of a single scan record. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentScans_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The scan Id. Type 'latest' to get the scan record for the latest scan. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetSqlVulnerabilityAssessmentScan(this ArmClient client, ResourceIdentifier scope, string scanId, Guid workspaceId, CancellationToken cancellationToken = default) - { - return client.GetSqlVulnerabilityAssessmentScans(scope).Get(scanId, workspaceId, cancellationToken); - } - - /// Gets a collection of SqlVulnerabilityAssessmentBaselineRuleResources in the ArmResource. - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// An object representing collection of SqlVulnerabilityAssessmentBaselineRuleResources and their operations over a SqlVulnerabilityAssessmentBaselineRuleResource. - public static SqlVulnerabilityAssessmentBaselineRuleCollection GetSqlVulnerabilityAssessmentBaselineRules(this ArmClient client, ResourceIdentifier scope) - { - return GetExtensionClient(client, scope).GetSqlVulnerabilityAssessmentBaselineRules(); - } - - /// - /// Gets the results for a given rule in the Baseline. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The rule Id. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static async Task> GetSqlVulnerabilityAssessmentBaselineRuleAsync(this ArmClient client, ResourceIdentifier scope, string ruleId, Guid workspaceId, CancellationToken cancellationToken = default) - { - return await client.GetSqlVulnerabilityAssessmentBaselineRules(scope).GetAsync(ruleId, workspaceId, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets the results for a given rule in the Baseline. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_Get - /// - /// - /// - /// The instance the method will execute against. - /// The scope that the resource will apply against. - /// The rule Id. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public static Response GetSqlVulnerabilityAssessmentBaselineRule(this ArmClient client, ResourceIdentifier scope, string ruleId, Guid workspaceId, CancellationToken cancellationToken = default) - { - return client.GetSqlVulnerabilityAssessmentBaselineRules(scope).Get(ruleId, workspaceId, cancellationToken); - } - - #region CustomAssessmentAutomationResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static CustomAssessmentAutomationResource GetCustomAssessmentAutomationResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - CustomAssessmentAutomationResource.ValidateResourceId(id); - return new CustomAssessmentAutomationResource(client, id); - } - ); - } - #endregion - - #region CustomEntityStoreAssignmentResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static CustomEntityStoreAssignmentResource GetCustomEntityStoreAssignmentResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - CustomEntityStoreAssignmentResource.ValidateResourceId(id); - return new CustomEntityStoreAssignmentResource(client, id); - } - ); - } - #endregion - - #region ComplianceResultResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ComplianceResultResource GetComplianceResultResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ComplianceResultResource.ValidateResourceId(id); - return new ComplianceResultResource(client, id); - } - ); - } - #endregion - - #region SecurityCenterPricingResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityCenterPricingResource GetSecurityCenterPricingResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SecurityCenterPricingResource.ValidateResourceId(id); - return new SecurityCenterPricingResource(client, id); - } - ); - } - #endregion - - #region AdvancedThreatProtectionSettingResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AdvancedThreatProtectionSettingResource GetAdvancedThreatProtectionSettingResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AdvancedThreatProtectionSettingResource.ValidateResourceId(id); - return new AdvancedThreatProtectionSettingResource(client, id); - } - ); - } - #endregion - - #region DeviceSecurityGroupResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static DeviceSecurityGroupResource GetDeviceSecurityGroupResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - DeviceSecurityGroupResource.ValidateResourceId(id); - return new DeviceSecurityGroupResource(client, id); - } - ); - } - #endregion - - #region IotSecuritySolutionResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static IotSecuritySolutionResource GetIotSecuritySolutionResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - IotSecuritySolutionResource.ValidateResourceId(id); - return new IotSecuritySolutionResource(client, id); - } - ); - } - #endregion - - #region IotSecuritySolutionAnalyticsModelResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static IotSecuritySolutionAnalyticsModelResource GetIotSecuritySolutionAnalyticsModelResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - IotSecuritySolutionAnalyticsModelResource.ValidateResourceId(id); - return new IotSecuritySolutionAnalyticsModelResource(client, id); - } - ); - } - #endregion - - #region IotSecurityAggregatedAlertResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static IotSecurityAggregatedAlertResource GetIotSecurityAggregatedAlertResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - IotSecurityAggregatedAlertResource.ValidateResourceId(id); - return new IotSecurityAggregatedAlertResource(client, id); - } - ); - } - #endregion - - #region IotSecurityAggregatedRecommendationResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static IotSecurityAggregatedRecommendationResource GetIotSecurityAggregatedRecommendationResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - IotSecurityAggregatedRecommendationResource.ValidateResourceId(id); - return new IotSecurityAggregatedRecommendationResource(client, id); - } - ); - } - #endregion - - #region SecurityCenterLocationResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityCenterLocationResource GetSecurityCenterLocationResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SecurityCenterLocationResource.ValidateResourceId(id); - return new SecurityCenterLocationResource(client, id); - } - ); - } - #endregion - - #region SubscriptionSecurityTaskResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SubscriptionSecurityTaskResource GetSubscriptionSecurityTaskResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SubscriptionSecurityTaskResource.ValidateResourceId(id); - return new SubscriptionSecurityTaskResource(client, id); - } - ); - } - #endregion - - #region ResourceGroupSecurityTaskResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ResourceGroupSecurityTaskResource GetResourceGroupSecurityTaskResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ResourceGroupSecurityTaskResource.ValidateResourceId(id); - return new ResourceGroupSecurityTaskResource(client, id); - } - ); - } - #endregion - - #region AutoProvisioningSettingResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AutoProvisioningSettingResource GetAutoProvisioningSettingResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AutoProvisioningSettingResource.ValidateResourceId(id); - return new AutoProvisioningSettingResource(client, id); - } - ); - } - #endregion - - #region SecurityComplianceResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityComplianceResource GetSecurityComplianceResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SecurityComplianceResource.ValidateResourceId(id); - return new SecurityComplianceResource(client, id); - } - ); - } - #endregion - - #region SecurityContactResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityContactResource GetSecurityContactResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SecurityContactResource.ValidateResourceId(id); - return new SecurityContactResource(client, id); - } - ); - } - #endregion - - #region SecurityWorkspaceSettingResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityWorkspaceSettingResource GetSecurityWorkspaceSettingResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SecurityWorkspaceSettingResource.ValidateResourceId(id); - return new SecurityWorkspaceSettingResource(client, id); - } - ); - } - #endregion - - #region RegulatoryComplianceStandardResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static RegulatoryComplianceStandardResource GetRegulatoryComplianceStandardResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - RegulatoryComplianceStandardResource.ValidateResourceId(id); - return new RegulatoryComplianceStandardResource(client, id); - } - ); - } - #endregion - - #region RegulatoryComplianceControlResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static RegulatoryComplianceControlResource GetRegulatoryComplianceControlResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - RegulatoryComplianceControlResource.ValidateResourceId(id); - return new RegulatoryComplianceControlResource(client, id); - } - ); - } - #endregion - - #region RegulatoryComplianceAssessmentResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static RegulatoryComplianceAssessmentResource GetRegulatoryComplianceAssessmentResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - RegulatoryComplianceAssessmentResource.ValidateResourceId(id); - return new RegulatoryComplianceAssessmentResource(client, id); - } - ); - } - #endregion - - #region SecuritySubAssessmentResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecuritySubAssessmentResource GetSecuritySubAssessmentResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SecuritySubAssessmentResource.ValidateResourceId(id); - return new SecuritySubAssessmentResource(client, id); - } - ); - } - #endregion - - #region SecurityAutomationResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityAutomationResource GetSecurityAutomationResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SecurityAutomationResource.ValidateResourceId(id); - return new SecurityAutomationResource(client, id); - } - ); - } - #endregion - - #region SecurityAlertsSuppressionRuleResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityAlertsSuppressionRuleResource GetSecurityAlertsSuppressionRuleResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SecurityAlertsSuppressionRuleResource.ValidateResourceId(id); - return new SecurityAlertsSuppressionRuleResource(client, id); - } - ); - } - #endregion - - #region ServerVulnerabilityAssessmentResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ServerVulnerabilityAssessmentResource GetServerVulnerabilityAssessmentResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ServerVulnerabilityAssessmentResource.ValidateResourceId(id); - return new ServerVulnerabilityAssessmentResource(client, id); - } - ); - } - #endregion - - #region TenantAssessmentMetadataResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static TenantAssessmentMetadataResource GetTenantAssessmentMetadataResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - TenantAssessmentMetadataResource.ValidateResourceId(id); - return new TenantAssessmentMetadataResource(client, id); - } - ); - } - #endregion - - #region SubscriptionAssessmentMetadataResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SubscriptionAssessmentMetadataResource GetSubscriptionAssessmentMetadataResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SubscriptionAssessmentMetadataResource.ValidateResourceId(id); - return new SubscriptionAssessmentMetadataResource(client, id); - } - ); - } - #endregion - - #region SecurityAssessmentResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityAssessmentResource GetSecurityAssessmentResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SecurityAssessmentResource.ValidateResourceId(id); - return new SecurityAssessmentResource(client, id); - } - ); - } - #endregion - - #region AdaptiveApplicationControlGroupResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AdaptiveApplicationControlGroupResource GetAdaptiveApplicationControlGroupResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AdaptiveApplicationControlGroupResource.ValidateResourceId(id); - return new AdaptiveApplicationControlGroupResource(client, id); - } - ); - } - #endregion - - #region AdaptiveNetworkHardeningResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static AdaptiveNetworkHardeningResource GetAdaptiveNetworkHardeningResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - AdaptiveNetworkHardeningResource.ValidateResourceId(id); - return new AdaptiveNetworkHardeningResource(client, id); - } - ); - } - #endregion - - #region JitNetworkAccessPolicyResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static JitNetworkAccessPolicyResource GetJitNetworkAccessPolicyResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - JitNetworkAccessPolicyResource.ValidateResourceId(id); - return new JitNetworkAccessPolicyResource(client, id); - } - ); - } - #endregion - - #region SecureScoreResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecureScoreResource GetSecureScoreResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SecureScoreResource.ValidateResourceId(id); - return new SecureScoreResource(client, id); - } - ); - } - #endregion - - #region SecurityCloudConnectorResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityCloudConnectorResource GetSecurityCloudConnectorResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SecurityCloudConnectorResource.ValidateResourceId(id); - return new SecurityCloudConnectorResource(client, id); - } - ); - } - #endregion - - #region SqlVulnerabilityAssessmentScanResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SqlVulnerabilityAssessmentScanResource GetSqlVulnerabilityAssessmentScanResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SqlVulnerabilityAssessmentScanResource.ValidateResourceId(id); - return new SqlVulnerabilityAssessmentScanResource(client, id); - } - ); - } - #endregion - - #region SqlVulnerabilityAssessmentBaselineRuleResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SqlVulnerabilityAssessmentBaselineRuleResource GetSqlVulnerabilityAssessmentBaselineRuleResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SqlVulnerabilityAssessmentBaselineRuleResource.ValidateResourceId(id); - return new SqlVulnerabilityAssessmentBaselineRuleResource(client, id); - } - ); - } - #endregion - - #region SubscriptionSecurityAlertResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SubscriptionSecurityAlertResource GetSubscriptionSecurityAlertResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SubscriptionSecurityAlertResource.ValidateResourceId(id); - return new SubscriptionSecurityAlertResource(client, id); - } - ); - } - #endregion - - #region ResourceGroupSecurityAlertResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static ResourceGroupSecurityAlertResource GetResourceGroupSecurityAlertResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - ResourceGroupSecurityAlertResource.ValidateResourceId(id); - return new ResourceGroupSecurityAlertResource(client, id); - } - ); - } - #endregion - - #region SecuritySettingResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecuritySettingResource GetSecuritySettingResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SecuritySettingResource.ValidateResourceId(id); - return new SecuritySettingResource(client, id); - } - ); - } - #endregion - - #region IngestionSettingResource - /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static IngestionSettingResource GetIngestionSettingResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - IngestionSettingResource.ValidateResourceId(id); - return new IngestionSettingResource(client, id); - } - ); - } - #endregion - - #region SoftwareInventoryResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SoftwareInventoryResource GetSoftwareInventoryResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SoftwareInventoryResource.ValidateResourceId(id); - return new SoftwareInventoryResource(client, id); - } - ); - } - #endregion - - #region SecurityConnectorResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityConnectorResource GetSecurityConnectorResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SecurityConnectorResource.ValidateResourceId(id); - return new SecurityConnectorResource(client, id); - } - ); - } - #endregion - - #region SubscriptionGovernanceRuleResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SubscriptionGovernanceRuleResource GetSubscriptionGovernanceRuleResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SubscriptionGovernanceRuleResource.ValidateResourceId(id); - return new SubscriptionGovernanceRuleResource(client, id); - } - ); - } - #endregion - - #region SecurityConnectorGovernanceRuleResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityConnectorGovernanceRuleResource GetSecurityConnectorGovernanceRuleResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - SecurityConnectorGovernanceRuleResource.ValidateResourceId(id); - return new SecurityConnectorGovernanceRuleResource(client, id); - } - ); - } - #endregion - - #region GovernanceAssignmentResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// Returns a object. - public static GovernanceAssignmentResource GetGovernanceAssignmentResource(this ArmClient client, ResourceIdentifier id) - { - return client.GetResourceClient(() => - { - GovernanceAssignmentResource.ValidateResourceId(id); - return new GovernanceAssignmentResource(client, id); - } - ); - } - #endregion - - #region SubscriptionSecurityApplicationResource - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static SubscriptionSecurityApplicationResource GetSubscriptionSecurityApplicationResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static StandardResource GetStandardResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - SubscriptionSecurityApplicationResource.ValidateResourceId(id); - return new SubscriptionSecurityApplicationResource(client, id); + StandardResource.ValidateResourceId(id); + return new StandardResource(client, id); } ); } #endregion - #region SecurityConnectorApplicationResource + #region AssignmentResource /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static SecurityConnectorApplicationResource GetSecurityConnectorApplicationResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static AssignmentResource GetAssignmentResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - SecurityConnectorApplicationResource.ValidateResourceId(id); - return new SecurityConnectorApplicationResource(client, id); + AssignmentResource.ValidateResourceId(id); + return new AssignmentResource(client, id); } ); } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs index b0e0b6aafd90..b14d48a184ce 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs @@ -5,58 +5,21 @@ #nullable disable -using System; using System.Threading; -using System.Threading.Tasks; using Azure; using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; -using Azure.ResourceManager.SecurityCenter.Models; namespace Azure.ResourceManager.SecurityCenter { /// A class to add extension methods to SubscriptionResource. internal partial class SubscriptionResourceExtensionClient : ArmResource { - private ClientDiagnostics _mdeOnboardingsClientDiagnostics; - private MdeOnboardingsRestOperations _mdeOnboardingsRestClient; - private ClientDiagnostics _customAssessmentAutomationClientDiagnostics; - private CustomAssessmentAutomationsRestOperations _customAssessmentAutomationRestClient; - private ClientDiagnostics _customEntityStoreAssignmentClientDiagnostics; - private CustomEntityStoreAssignmentsRestOperations _customEntityStoreAssignmentRestClient; - private ClientDiagnostics _iotSecuritySolutionClientDiagnostics; - private IotSecuritySolutionRestOperations _iotSecuritySolutionRestClient; - private ClientDiagnostics _tasksClientDiagnostics; - private TasksRestOperations _tasksRestClient; - private ClientDiagnostics _securityAutomationAutomationsClientDiagnostics; - private AutomationsRestOperations _securityAutomationAutomationsRestClient; - private ClientDiagnostics _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics; - private AdaptiveApplicationControlsRestOperations _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient; - private ClientDiagnostics _allowedConnectionsClientDiagnostics; - private AllowedConnectionsRestOperations _allowedConnectionsRestClient; - private ClientDiagnostics _topologyClientDiagnostics; - private TopologyRestOperations _topologyRestClient; - private ClientDiagnostics _jitNetworkAccessPolicyClientDiagnostics; - private JitNetworkAccessPoliciesRestOperations _jitNetworkAccessPolicyRestClient; - private ClientDiagnostics _discoveredSecuritySolutionsClientDiagnostics; - private DiscoveredSecuritySolutionsRestOperations _discoveredSecuritySolutionsRestClient; - private ClientDiagnostics _securitySolutionsReferenceDataClientDiagnostics; - private SecuritySolutionsReferenceDataRestOperations _securitySolutionsReferenceDataRestClient; - private ClientDiagnostics _externalSecuritySolutionsClientDiagnostics; - private ExternalSecuritySolutionsRestOperations _externalSecuritySolutionsRestClient; - private ClientDiagnostics _secureScoreControlsClientDiagnostics; - private SecureScoreControlsRestOperations _secureScoreControlsRestClient; - private ClientDiagnostics _secureScoreControlDefinitionsClientDiagnostics; - private SecureScoreControlDefinitionsRestOperations _secureScoreControlDefinitionsRestClient; - private ClientDiagnostics _securitySolutionsClientDiagnostics; - private SecuritySolutionsRestOperations _securitySolutionsRestClient; - private ClientDiagnostics _alertsClientDiagnostics; - private AlertsRestOperations _alertsRestClient; - private ClientDiagnostics _softwareInventoryClientDiagnostics; - private SoftwareInventoriesRestOperations _softwareInventoryRestClient; - private ClientDiagnostics _securityConnectorClientDiagnostics; - private SecurityConnectorsRestOperations _securityConnectorRestClient; + private ClientDiagnostics _standardClientDiagnostics; + private StandardsRestOperations _standardRestClient; + private ClientDiagnostics _assignmentClientDiagnostics; + private AssignmentsRestOperations _assignmentRestClient; /// Initializes a new instance of the class for mocking. protected SubscriptionResourceExtensionClient() @@ -70,44 +33,10 @@ internal SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifie { } - private ClientDiagnostics MdeOnboardingsClientDiagnostics => _mdeOnboardingsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private MdeOnboardingsRestOperations MdeOnboardingsRestClient => _mdeOnboardingsRestClient ??= new MdeOnboardingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics CustomAssessmentAutomationClientDiagnostics => _customAssessmentAutomationClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", CustomAssessmentAutomationResource.ResourceType.Namespace, Diagnostics); - private CustomAssessmentAutomationsRestOperations CustomAssessmentAutomationRestClient => _customAssessmentAutomationRestClient ??= new CustomAssessmentAutomationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(CustomAssessmentAutomationResource.ResourceType)); - private ClientDiagnostics CustomEntityStoreAssignmentClientDiagnostics => _customEntityStoreAssignmentClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", CustomEntityStoreAssignmentResource.ResourceType.Namespace, Diagnostics); - private CustomEntityStoreAssignmentsRestOperations CustomEntityStoreAssignmentRestClient => _customEntityStoreAssignmentRestClient ??= new CustomEntityStoreAssignmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(CustomEntityStoreAssignmentResource.ResourceType)); - private ClientDiagnostics IotSecuritySolutionClientDiagnostics => _iotSecuritySolutionClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", IotSecuritySolutionResource.ResourceType.Namespace, Diagnostics); - private IotSecuritySolutionRestOperations IotSecuritySolutionRestClient => _iotSecuritySolutionRestClient ??= new IotSecuritySolutionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(IotSecuritySolutionResource.ResourceType)); - private ClientDiagnostics TasksClientDiagnostics => _tasksClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private TasksRestOperations TasksRestClient => _tasksRestClient ??= new TasksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics SecurityAutomationAutomationsClientDiagnostics => _securityAutomationAutomationsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecurityAutomationResource.ResourceType.Namespace, Diagnostics); - private AutomationsRestOperations SecurityAutomationAutomationsRestClient => _securityAutomationAutomationsRestClient ??= new AutomationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(SecurityAutomationResource.ResourceType)); - private ClientDiagnostics AdaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics => _adaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", AdaptiveApplicationControlGroupResource.ResourceType.Namespace, Diagnostics); - private AdaptiveApplicationControlsRestOperations AdaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient => _adaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient ??= new AdaptiveApplicationControlsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(AdaptiveApplicationControlGroupResource.ResourceType)); - private ClientDiagnostics AllowedConnectionsClientDiagnostics => _allowedConnectionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private AllowedConnectionsRestOperations AllowedConnectionsRestClient => _allowedConnectionsRestClient ??= new AllowedConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics TopologyClientDiagnostics => _topologyClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private TopologyRestOperations TopologyRestClient => _topologyRestClient ??= new TopologyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics JitNetworkAccessPolicyClientDiagnostics => _jitNetworkAccessPolicyClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", JitNetworkAccessPolicyResource.ResourceType.Namespace, Diagnostics); - private JitNetworkAccessPoliciesRestOperations JitNetworkAccessPolicyRestClient => _jitNetworkAccessPolicyRestClient ??= new JitNetworkAccessPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(JitNetworkAccessPolicyResource.ResourceType)); - private ClientDiagnostics DiscoveredSecuritySolutionsClientDiagnostics => _discoveredSecuritySolutionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private DiscoveredSecuritySolutionsRestOperations DiscoveredSecuritySolutionsRestClient => _discoveredSecuritySolutionsRestClient ??= new DiscoveredSecuritySolutionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics securitySolutionsReferenceDataClientDiagnostics => _securitySolutionsReferenceDataClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private SecuritySolutionsReferenceDataRestOperations securitySolutionsReferenceDataRestClient => _securitySolutionsReferenceDataRestClient ??= new SecuritySolutionsReferenceDataRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics ExternalSecuritySolutionsClientDiagnostics => _externalSecuritySolutionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private ExternalSecuritySolutionsRestOperations ExternalSecuritySolutionsRestClient => _externalSecuritySolutionsRestClient ??= new ExternalSecuritySolutionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics SecureScoreControlsClientDiagnostics => _secureScoreControlsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private SecureScoreControlsRestOperations SecureScoreControlsRestClient => _secureScoreControlsRestClient ??= new SecureScoreControlsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics SecureScoreControlDefinitionsClientDiagnostics => _secureScoreControlDefinitionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private SecureScoreControlDefinitionsRestOperations SecureScoreControlDefinitionsRestClient => _secureScoreControlDefinitionsRestClient ??= new SecureScoreControlDefinitionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics SecuritySolutionsClientDiagnostics => _securitySolutionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private SecuritySolutionsRestOperations SecuritySolutionsRestClient => _securitySolutionsRestClient ??= new SecuritySolutionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics AlertsClientDiagnostics => _alertsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private AlertsRestOperations AlertsRestClient => _alertsRestClient ??= new AlertsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics SoftwareInventoryClientDiagnostics => _softwareInventoryClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SoftwareInventoryResource.ResourceType.Namespace, Diagnostics); - private SoftwareInventoriesRestOperations SoftwareInventoryRestClient => _softwareInventoryRestClient ??= new SoftwareInventoriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(SoftwareInventoryResource.ResourceType)); - private ClientDiagnostics SecurityConnectorClientDiagnostics => _securityConnectorClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecurityConnectorResource.ResourceType.Namespace, Diagnostics); - private SecurityConnectorsRestOperations SecurityConnectorRestClient => _securityConnectorRestClient ??= new SecurityConnectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(SecurityConnectorResource.ResourceType)); + private ClientDiagnostics StandardClientDiagnostics => _standardClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", StandardResource.ResourceType.Namespace, Diagnostics); + private StandardsRestOperations StandardRestClient => _standardRestClient ??= new StandardsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(StandardResource.ResourceType)); + private ClientDiagnostics AssignmentClientDiagnostics => _assignmentClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", AssignmentResource.ResourceType.Namespace, Diagnostics); + private AssignmentsRestOperations AssignmentRestClient => _assignmentRestClient ??= new AssignmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(AssignmentResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -115,1002 +44,92 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// Gets a collection of SecurityCenterPricingResources in the SubscriptionResource. - /// An object representing collection of SecurityCenterPricingResources and their operations over a SecurityCenterPricingResource. - public virtual SecurityCenterPricingCollection GetSecurityCenterPricings() - { - return GetCachedClient(Client => new SecurityCenterPricingCollection(Client, Id)); - } - - /// Gets a collection of SecurityCenterLocationResources in the SubscriptionResource. - /// An object representing collection of SecurityCenterLocationResources and their operations over a SecurityCenterLocationResource. - public virtual SecurityCenterLocationCollection GetSecurityCenterLocations() - { - return GetCachedClient(Client => new SecurityCenterLocationCollection(Client, Id)); - } - - /// Gets a collection of AutoProvisioningSettingResources in the SubscriptionResource. - /// An object representing collection of AutoProvisioningSettingResources and their operations over a AutoProvisioningSettingResource. - public virtual AutoProvisioningSettingCollection GetAutoProvisioningSettings() - { - return GetCachedClient(Client => new AutoProvisioningSettingCollection(Client, Id)); - } - - /// Gets a collection of SecurityContactResources in the SubscriptionResource. - /// An object representing collection of SecurityContactResources and their operations over a SecurityContactResource. - public virtual SecurityContactCollection GetSecurityContacts() - { - return GetCachedClient(Client => new SecurityContactCollection(Client, Id)); - } - - /// Gets a collection of SecurityWorkspaceSettingResources in the SubscriptionResource. - /// An object representing collection of SecurityWorkspaceSettingResources and their operations over a SecurityWorkspaceSettingResource. - public virtual SecurityWorkspaceSettingCollection GetSecurityWorkspaceSettings() - { - return GetCachedClient(Client => new SecurityWorkspaceSettingCollection(Client, Id)); - } - - /// Gets a collection of RegulatoryComplianceStandardResources in the SubscriptionResource. - /// An object representing collection of RegulatoryComplianceStandardResources and their operations over a RegulatoryComplianceStandardResource. - public virtual RegulatoryComplianceStandardCollection GetRegulatoryComplianceStandards() - { - return GetCachedClient(Client => new RegulatoryComplianceStandardCollection(Client, Id)); - } - - /// Gets a collection of SecurityAlertsSuppressionRuleResources in the SubscriptionResource. - /// An object representing collection of SecurityAlertsSuppressionRuleResources and their operations over a SecurityAlertsSuppressionRuleResource. - public virtual SecurityAlertsSuppressionRuleCollection GetSecurityAlertsSuppressionRules() - { - return GetCachedClient(Client => new SecurityAlertsSuppressionRuleCollection(Client, Id)); - } - - /// Gets a collection of SubscriptionAssessmentMetadataResources in the SubscriptionResource. - /// An object representing collection of SubscriptionAssessmentMetadataResources and their operations over a SubscriptionAssessmentMetadataResource. - public virtual SubscriptionAssessmentMetadataCollection GetAllSubscriptionAssessmentMetadata() - { - return GetCachedClient(Client => new SubscriptionAssessmentMetadataCollection(Client, Id)); - } - - /// Gets a collection of SecureScoreResources in the SubscriptionResource. - /// An object representing collection of SecureScoreResources and their operations over a SecureScoreResource. - public virtual SecureScoreCollection GetSecureScores() - { - return GetCachedClient(Client => new SecureScoreCollection(Client, Id)); - } - - /// Gets a collection of SecurityCloudConnectorResources in the SubscriptionResource. - /// An object representing collection of SecurityCloudConnectorResources and their operations over a SecurityCloudConnectorResource. - public virtual SecurityCloudConnectorCollection GetSecurityCloudConnectors() - { - return GetCachedClient(Client => new SecurityCloudConnectorCollection(Client, Id)); - } - - /// Gets a collection of SecuritySettingResources in the SubscriptionResource. - /// An object representing collection of SecuritySettingResources and their operations over a SecuritySettingResource. - public virtual SecuritySettingCollection GetSecuritySettings() - { - return GetCachedClient(Client => new SecuritySettingCollection(Client, Id)); - } - - /// Gets a collection of IngestionSettingResources in the SubscriptionResource. - /// An object representing collection of IngestionSettingResources and their operations over a IngestionSettingResource. - public virtual IngestionSettingCollection GetIngestionSettings() - { - return GetCachedClient(Client => new IngestionSettingCollection(Client, Id)); - } - - /// Gets a collection of SubscriptionGovernanceRuleResources in the SubscriptionResource. - /// An object representing collection of SubscriptionGovernanceRuleResources and their operations over a SubscriptionGovernanceRuleResource. - public virtual SubscriptionGovernanceRuleCollection GetSubscriptionGovernanceRules() - { - return GetCachedClient(Client => new SubscriptionGovernanceRuleCollection(Client, Id)); - } - - /// Gets a collection of SubscriptionSecurityApplicationResources in the SubscriptionResource. - /// An object representing collection of SubscriptionSecurityApplicationResources and their operations over a SubscriptionSecurityApplicationResource. - public virtual SubscriptionSecurityApplicationCollection GetSubscriptionSecurityApplications() - { - return GetCachedClient(Client => new SubscriptionSecurityApplicationCollection(Client, Id)); - } - - /// - /// The configuration or data needed to onboard the machine to MDE - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings - /// - /// - /// Operation Id - /// MdeOnboardings_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetMdeOnboardingsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => MdeOnboardingsRestClient.CreateListRequest(Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, MdeOnboarding.DeserializeMdeOnboarding, MdeOnboardingsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMdeOnboardings", "value", null, cancellationToken); - } - - /// - /// The configuration or data needed to onboard the machine to MDE - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings - /// - /// - /// Operation Id - /// MdeOnboardings_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetMdeOnboardings(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => MdeOnboardingsRestClient.CreateListRequest(Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, null, MdeOnboarding.DeserializeMdeOnboarding, MdeOnboardingsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMdeOnboardings", "value", null, cancellationToken); - } - - /// - /// The default configuration or data needed to onboard the machine to MDE - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings/default - /// - /// - /// Operation Id - /// MdeOnboardings_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetMdeOnboardingAsync(CancellationToken cancellationToken = default) - { - using var scope = MdeOnboardingsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetMdeOnboarding"); - scope.Start(); - try - { - var response = await MdeOnboardingsRestClient.GetAsync(Id.SubscriptionId, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// The default configuration or data needed to onboard the machine to MDE - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings/default - /// - /// - /// Operation Id - /// MdeOnboardings_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response GetMdeOnboarding(CancellationToken cancellationToken = default) - { - using var scope = MdeOnboardingsClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetMdeOnboarding"); - scope.Start(); - try - { - var response = MdeOnboardingsRestClient.Get(Id.SubscriptionId, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List custom assessment automations by provided subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/customAssessmentAutomations - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_ListBySubscription - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetCustomAssessmentAutomationsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CustomAssessmentAutomationRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CustomAssessmentAutomationRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CustomAssessmentAutomationResource(Client, CustomAssessmentAutomationData.DeserializeCustomAssessmentAutomationData(e)), CustomAssessmentAutomationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCustomAssessmentAutomations", "value", "nextLink", cancellationToken); - } - - /// - /// List custom assessment automations by provided subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/customAssessmentAutomations - /// - /// - /// Operation Id - /// CustomAssessmentAutomations_ListBySubscription - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetCustomAssessmentAutomations(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CustomAssessmentAutomationRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CustomAssessmentAutomationRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CustomAssessmentAutomationResource(Client, CustomAssessmentAutomationData.DeserializeCustomAssessmentAutomationData(e)), CustomAssessmentAutomationClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCustomAssessmentAutomations", "value", "nextLink", cancellationToken); - } - - /// - /// List custom entity store assignments by provided subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/customEntityStoreAssignments - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_ListBySubscription - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetCustomEntityStoreAssignmentsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CustomEntityStoreAssignmentRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CustomEntityStoreAssignmentRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CustomEntityStoreAssignmentResource(Client, CustomEntityStoreAssignmentData.DeserializeCustomEntityStoreAssignmentData(e)), CustomEntityStoreAssignmentClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCustomEntityStoreAssignments", "value", "nextLink", cancellationToken); - } - - /// - /// List custom entity store assignments by provided subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/customEntityStoreAssignments - /// - /// - /// Operation Id - /// CustomEntityStoreAssignments_ListBySubscription - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetCustomEntityStoreAssignments(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => CustomEntityStoreAssignmentRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => CustomEntityStoreAssignmentRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CustomEntityStoreAssignmentResource(Client, CustomEntityStoreAssignmentData.DeserializeCustomEntityStoreAssignmentData(e)), CustomEntityStoreAssignmentClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCustomEntityStoreAssignments", "value", "nextLink", cancellationToken); - } - - /// - /// Use this method to get the list of IoT Security solutions by subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions - /// - /// - /// Operation Id - /// IotSecuritySolution_ListBySubscription - /// - /// - /// - /// Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetIotSecuritySolutionsAsync(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => IotSecuritySolutionRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IotSecuritySolutionRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotSecuritySolutionResource(Client, IotSecuritySolutionData.DeserializeIotSecuritySolutionData(e)), IotSecuritySolutionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIotSecuritySolutions", "value", "nextLink", cancellationToken); - } - - /// - /// Use this method to get the list of IoT Security solutions by subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/iotSecuritySolutions - /// - /// - /// Operation Id - /// IotSecuritySolution_ListBySubscription - /// - /// - /// - /// Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetIotSecuritySolutions(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => IotSecuritySolutionRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => IotSecuritySolutionRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotSecuritySolutionResource(Client, IotSecuritySolutionData.DeserializeIotSecuritySolutionData(e)), IotSecuritySolutionClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetIotSecuritySolutions", "value", "nextLink", cancellationToken); - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/tasks - /// - /// - /// Operation Id - /// Tasks_List - /// - /// - /// - /// OData filter. Optional. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetTasksAsync(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => TasksRestClient.CreateListRequest(Id.SubscriptionId, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TasksRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, filter); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecurityTaskData.DeserializeSecurityTaskData, TasksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTasks", "value", "nextLink", cancellationToken); - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/tasks - /// - /// - /// Operation Id - /// Tasks_List - /// - /// - /// - /// OData filter. Optional. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetTasks(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => TasksRestClient.CreateListRequest(Id.SubscriptionId, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TasksRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, filter); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecurityTaskData.DeserializeSecurityTaskData, TasksClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTasks", "value", "nextLink", cancellationToken); - } - - /// - /// Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to get the next page of security automations for the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/automations - /// - /// - /// Operation Id - /// Automations_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetSecurityAutomationsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => SecurityAutomationAutomationsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecurityAutomationAutomationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityAutomationResource(Client, SecurityAutomationData.DeserializeSecurityAutomationData(e)), SecurityAutomationAutomationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecurityAutomations", "value", "nextLink", cancellationToken); - } - - /// - /// Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to get the next page of security automations for the specified subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/automations - /// - /// - /// Operation Id - /// Automations_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetSecurityAutomations(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => SecurityAutomationAutomationsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecurityAutomationAutomationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityAutomationResource(Client, SecurityAutomationData.DeserializeSecurityAutomationData(e)), SecurityAutomationAutomationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecurityAutomations", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of application control machine groups for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applicationWhitelistings - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_List - /// - /// - /// - /// Include the policy rules. - /// Return output in a summarized form. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAdaptiveApplicationControlGroupsAsync(bool? includePathRecommendations = null, bool? summary = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AdaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient.CreateListRequest(Id.SubscriptionId, includePathRecommendations, summary); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new AdaptiveApplicationControlGroupResource(Client, AdaptiveApplicationControlGroupData.DeserializeAdaptiveApplicationControlGroupData(e)), AdaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAdaptiveApplicationControlGroups", "value", null, cancellationToken); - } - - /// - /// Gets a list of application control machine groups for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applicationWhitelistings - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_List - /// - /// - /// - /// Include the policy rules. - /// Return output in a summarized form. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAdaptiveApplicationControlGroups(bool? includePathRecommendations = null, bool? summary = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AdaptiveApplicationControlGroupAdaptiveApplicationControlsRestClient.CreateListRequest(Id.SubscriptionId, includePathRecommendations, summary); - return PageableHelpers.CreatePageable(FirstPageRequest, null, e => new AdaptiveApplicationControlGroupResource(Client, AdaptiveApplicationControlGroupData.DeserializeAdaptiveApplicationControlGroupData(e)), AdaptiveApplicationControlGroupAdaptiveApplicationControlsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAdaptiveApplicationControlGroups", "value", null, cancellationToken); - } - - /// - /// Gets the list of all possible traffic between resources for the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/allowedConnections - /// - /// - /// Operation Id - /// AllowedConnections_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllowedConnectionsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AllowedConnectionsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AllowedConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecurityCenterAllowedConnection.DeserializeSecurityCenterAllowedConnection, AllowedConnectionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAllowedConnections", "value", "nextLink", cancellationToken); - } - - /// - /// Gets the list of all possible traffic between resources for the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/allowedConnections - /// - /// - /// Operation Id - /// AllowedConnections_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAllowedConnections(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AllowedConnectionsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AllowedConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecurityCenterAllowedConnection.DeserializeSecurityCenterAllowedConnection, AllowedConnectionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAllowedConnections", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list that allows to build a topology view of a subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/topologies - /// - /// - /// Operation Id - /// Topology_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetTopologiesAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => TopologyRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TopologyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecurityTopologyResource.DeserializeSecurityTopologyResource, TopologyClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTopologies", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list that allows to build a topology view of a subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/topologies - /// - /// - /// Operation Id - /// Topology_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetTopologies(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => TopologyRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => TopologyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecurityTopologyResource.DeserializeSecurityTopologyResource, TopologyClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetTopologies", "value", "nextLink", cancellationToken); - } - - /// - /// Policies for protecting resources using Just-in-Time access control. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/jitNetworkAccessPolicies - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetJitNetworkAccessPoliciesAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => JitNetworkAccessPolicyRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => JitNetworkAccessPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new JitNetworkAccessPolicyResource(Client, JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(e)), JitNetworkAccessPolicyClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetJitNetworkAccessPolicies", "value", "nextLink", cancellationToken); - } - - /// - /// Policies for protecting resources using Just-in-Time access control. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/jitNetworkAccessPolicies - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetJitNetworkAccessPolicies(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => JitNetworkAccessPolicyRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => JitNetworkAccessPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new JitNetworkAccessPolicyResource(Client, JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(e)), JitNetworkAccessPolicyClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetJitNetworkAccessPolicies", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of discovered Security Solutions for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/discoveredSecuritySolutions - /// - /// - /// Operation Id - /// DiscoveredSecuritySolutions_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetDiscoveredSecuritySolutionsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => DiscoveredSecuritySolutionsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiscoveredSecuritySolutionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DiscoveredSecuritySolution.DeserializeDiscoveredSecuritySolution, DiscoveredSecuritySolutionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDiscoveredSecuritySolutions", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of discovered Security Solutions for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/discoveredSecuritySolutions - /// - /// - /// Operation Id - /// DiscoveredSecuritySolutions_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetDiscoveredSecuritySolutions(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => DiscoveredSecuritySolutionsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DiscoveredSecuritySolutionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DiscoveredSecuritySolution.DeserializeDiscoveredSecuritySolution, DiscoveredSecuritySolutionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetDiscoveredSecuritySolutions", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of all supported Security Solutions for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutionsReferenceData - /// - /// - /// Operation Id - /// securitySolutionsReferenceData_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllSecuritySolutionsReferenceDataAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => securitySolutionsReferenceDataRestClient.CreateListRequest(Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, SecuritySolutionsReferenceData.DeserializeSecuritySolutionsReferenceData, securitySolutionsReferenceDataClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAllSecuritySolutionsReferenceData", "value", null, cancellationToken); - } - - /// - /// Gets a list of all supported Security Solutions for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutionsReferenceData - /// - /// - /// Operation Id - /// securitySolutionsReferenceData_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAllSecuritySolutionsReferenceData(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => securitySolutionsReferenceDataRestClient.CreateListRequest(Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, null, SecuritySolutionsReferenceData.DeserializeSecuritySolutionsReferenceData, securitySolutionsReferenceDataClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAllSecuritySolutionsReferenceData", "value", null, cancellationToken); - } - - /// - /// Gets a list of external security solutions for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/externalSecuritySolutions - /// - /// - /// Operation Id - /// ExternalSecuritySolutions_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetExternalSecuritySolutionsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => ExternalSecuritySolutionsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExternalSecuritySolutionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ExternalSecuritySolution.DeserializeExternalSecuritySolution, ExternalSecuritySolutionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetExternalSecuritySolutions", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of external security solutions for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/externalSecuritySolutions - /// - /// - /// Operation Id - /// ExternalSecuritySolutions_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetExternalSecuritySolutions(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => ExternalSecuritySolutionsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ExternalSecuritySolutionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ExternalSecuritySolution.DeserializeExternalSecuritySolution, ExternalSecuritySolutionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetExternalSecuritySolutions", "value", "nextLink", cancellationToken); - } - - /// - /// Get all security controls within a scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControls - /// - /// - /// Operation Id - /// SecureScoreControls_List - /// - /// - /// - /// OData expand. Optional. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetSecureScoreControlsAsync(SecurityScoreODataExpand? expand = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => SecureScoreControlsRestClient.CreateListRequest(Id.SubscriptionId, expand); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecureScoreControlsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, expand); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecureScoreControlDetails.DeserializeSecureScoreControlDetails, SecureScoreControlsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecureScoreControls", "value", "nextLink", cancellationToken); - } - - /// - /// Get all security controls within a scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControls - /// - /// - /// Operation Id - /// SecureScoreControls_List - /// - /// - /// - /// OData expand. Optional. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetSecureScoreControls(SecurityScoreODataExpand? expand = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => SecureScoreControlsRestClient.CreateListRequest(Id.SubscriptionId, expand); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecureScoreControlsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, expand); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecureScoreControlDetails.DeserializeSecureScoreControlDetails, SecureScoreControlsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecureScoreControls", "value", "nextLink", cancellationToken); - } - - /// - /// For a specified subscription, list the available security controls, their assessments, and the max score - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControlDefinitions - /// - /// - /// Operation Id - /// SecureScoreControlDefinitions_ListBySubscription - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetSecureScoreControlDefinitionsBySubscriptionAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => SecureScoreControlDefinitionsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecureScoreControlDefinitionsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecureScoreControlDefinitionItem.DeserializeSecureScoreControlDefinitionItem, SecureScoreControlDefinitionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecureScoreControlDefinitionsBySubscription", "value", "nextLink", cancellationToken); - } - - /// - /// For a specified subscription, list the available security controls, their assessments, and the max score - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControlDefinitions - /// - /// - /// Operation Id - /// SecureScoreControlDefinitions_ListBySubscription - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetSecureScoreControlDefinitionsBySubscription(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => SecureScoreControlDefinitionsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecureScoreControlDefinitionsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecureScoreControlDefinitionItem.DeserializeSecureScoreControlDefinitionItem, SecureScoreControlDefinitionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecureScoreControlDefinitionsBySubscription", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of Security Solutions for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutions - /// - /// - /// Operation Id - /// SecuritySolutions_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetSecuritySolutionsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => SecuritySolutionsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecuritySolutionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecuritySolution.DeserializeSecuritySolution, SecuritySolutionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecuritySolutions", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of Security Solutions for the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutions - /// - /// - /// Operation Id - /// SecuritySolutions_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetSecuritySolutions(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => SecuritySolutionsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecuritySolutionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecuritySolution.DeserializeSecuritySolution, SecuritySolutionsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecuritySolutions", "value", "nextLink", cancellationToken); - } - - /// - /// List all the alerts that are associated with the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts - /// - /// - /// Operation Id - /// Alerts_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAlertsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AlertsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AlertsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecurityAlertData.DeserializeSecurityAlertData, AlertsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAlerts", "value", "nextLink", cancellationToken); - } - - /// - /// List all the alerts that are associated with the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts - /// - /// - /// Operation Id - /// Alerts_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAlerts(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => AlertsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AlertsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecurityAlertData.DeserializeSecurityAlertData, AlertsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAlerts", "value", "nextLink", cancellationToken); - } - /// - /// Gets the software inventory of all virtual machines in the subscriptions. + /// Get a list of all relevant security standards over a subscription level scope. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/standards /// /// /// Operation Id - /// SoftwareInventories_ListBySubscription + /// Standards_ListBySubscription /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetSoftwareInventoriesAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetStandardsAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => SoftwareInventoryRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SoftwareInventoryRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SoftwareInventoryResource(Client, SoftwareInventoryData.DeserializeSoftwareInventoryData(e)), SoftwareInventoryClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSoftwareInventories", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => StandardRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StandardRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StandardResource(Client, StandardData.DeserializeStandardData(e)), StandardClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStandards", "value", "nextLink", cancellationToken); } /// - /// Gets the software inventory of all virtual machines in the subscriptions. + /// Get a list of all relevant security standards over a subscription level scope. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/standards /// /// /// Operation Id - /// SoftwareInventories_ListBySubscription + /// Standards_ListBySubscription /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetSoftwareInventories(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetStandards(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => SoftwareInventoryRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SoftwareInventoryRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SoftwareInventoryResource(Client, SoftwareInventoryData.DeserializeSoftwareInventoryData(e)), SoftwareInventoryClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSoftwareInventories", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => StandardRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => StandardRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StandardResource(Client, StandardData.DeserializeStandardData(e)), StandardClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetStandards", "value", "nextLink", cancellationToken); } /// - /// Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to get the next page of security connectors for the specified subscription. + /// Get a list of all relevant standardAssignments over a subscription level scope /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assignments /// /// /// Operation Id - /// SecurityConnectors_List + /// Assignments_ListBySubscription /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetSecurityConnectorsAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAssignmentsAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => SecurityConnectorRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecurityConnectorRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityConnectorResource(Client, SecurityConnectorData.DeserializeSecurityConnectorData(e)), SecurityConnectorClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecurityConnectors", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => AssignmentRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AssignmentRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AssignmentResource(Client, AssignmentData.DeserializeAssignmentData(e)), AssignmentClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAssignments", "value", "nextLink", cancellationToken); } /// - /// Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to get the next page of security connectors for the specified subscription. + /// Get a list of all relevant standardAssignments over a subscription level scope /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors + /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assignments /// /// /// Operation Id - /// SecurityConnectors_List + /// Assignments_ListBySubscription /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetSecurityConnectors(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAssignments(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => SecurityConnectorRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecurityConnectorRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityConnectorResource(Client, SecurityConnectorData.DeserializeSecurityConnectorData(e)), SecurityConnectorClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetSecurityConnectors", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => AssignmentRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => AssignmentRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AssignmentResource(Client, AssignmentData.DeserializeAssignmentData(e)), AssignmentClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetAssignments", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/TenantResourceExtensionClient.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/TenantResourceExtensionClient.cs deleted file mode 100644 index ec8e576698ce..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Extensions/TenantResourceExtensionClient.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Threading; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// A class to add extension methods to TenantResource. - internal partial class TenantResourceExtensionClient : ArmResource - { - private ClientDiagnostics _secureScoreControlDefinitionsClientDiagnostics; - private SecureScoreControlDefinitionsRestOperations _secureScoreControlDefinitionsRestClient; - - /// Initializes a new instance of the class for mocking. - protected TenantResourceExtensionClient() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal TenantResourceExtensionClient(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics SecureScoreControlDefinitionsClientDiagnostics => _secureScoreControlDefinitionsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private SecureScoreControlDefinitionsRestOperations SecureScoreControlDefinitionsRestClient => _secureScoreControlDefinitionsRestClient ??= new SecureScoreControlDefinitionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// Gets a collection of TenantAssessmentMetadataResources in the TenantResource. - /// An object representing collection of TenantAssessmentMetadataResources and their operations over a TenantAssessmentMetadataResource. - public virtual TenantAssessmentMetadataCollection GetAllTenantAssessmentMetadata() - { - return GetCachedClient(Client => new TenantAssessmentMetadataCollection(Client, Id)); - } - - /// - /// List the available security controls, their assessments, and the max score - /// - /// - /// Request Path - /// /providers/Microsoft.Security/secureScoreControlDefinitions - /// - /// - /// Operation Id - /// SecureScoreControlDefinitions_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetSecureScoreControlDefinitionsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => SecureScoreControlDefinitionsRestClient.CreateListRequest(); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecureScoreControlDefinitionsRestClient.CreateListNextPageRequest(nextLink); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecureScoreControlDefinitionItem.DeserializeSecureScoreControlDefinitionItem, SecureScoreControlDefinitionsClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetSecureScoreControlDefinitions", "value", "nextLink", cancellationToken); - } - - /// - /// List the available security controls, their assessments, and the max score - /// - /// - /// Request Path - /// /providers/Microsoft.Security/secureScoreControlDefinitions - /// - /// - /// Operation Id - /// SecureScoreControlDefinitions_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetSecureScoreControlDefinitions(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => SecureScoreControlDefinitionsRestClient.CreateListRequest(); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SecureScoreControlDefinitionsRestClient.CreateListNextPageRequest(nextLink); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecureScoreControlDefinitionItem.DeserializeSecureScoreControlDefinitionItem, SecureScoreControlDefinitionsClientDiagnostics, Pipeline, "TenantResourceExtensionClient.GetSecureScoreControlDefinitions", "value", "nextLink", cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/GovernanceAssignmentCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/GovernanceAssignmentCollection.cs deleted file mode 100644 index 66120e54e5d4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/GovernanceAssignmentCollection.cs +++ /dev/null @@ -1,340 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetGovernanceAssignments method from an instance of . - /// - public partial class GovernanceAssignmentCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _governanceAssignmentClientDiagnostics; - private readonly GovernanceAssignmentsRestOperations _governanceAssignmentRestClient; - - /// Initializes a new instance of the class for mocking. - protected GovernanceAssignmentCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal GovernanceAssignmentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _governanceAssignmentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", GovernanceAssignmentResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(GovernanceAssignmentResource.ResourceType, out string governanceAssignmentApiVersion); - _governanceAssignmentRestClient = new GovernanceAssignmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, governanceAssignmentApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SecurityAssessmentResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SecurityAssessmentResource.ResourceType), nameof(id)); - } - - /// - /// Creates or update a security GovernanceAssignment on the given subscription. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey} - /// - /// - /// Operation Id - /// GovernanceAssignments_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security governance assignment key - the assessment key of the required governance assignment. - /// GovernanceAssignment over a subscription scope. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string assignmentKey, GovernanceAssignmentData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assignmentKey, nameof(assignmentKey)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _governanceAssignmentClientDiagnostics.CreateScope("GovernanceAssignmentCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _governanceAssignmentRestClient.CreateOrUpdateAsync(Id.Parent, Id.Name, assignmentKey, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new GovernanceAssignmentResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or update a security GovernanceAssignment on the given subscription. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey} - /// - /// - /// Operation Id - /// GovernanceAssignments_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security governance assignment key - the assessment key of the required governance assignment. - /// GovernanceAssignment over a subscription scope. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string assignmentKey, GovernanceAssignmentData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assignmentKey, nameof(assignmentKey)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _governanceAssignmentClientDiagnostics.CreateScope("GovernanceAssignmentCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _governanceAssignmentRestClient.CreateOrUpdate(Id.Parent, Id.Name, assignmentKey, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new GovernanceAssignmentResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific governanceAssignment for the requested scope by AssignmentKey - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey} - /// - /// - /// Operation Id - /// GovernanceAssignments_Get - /// - /// - /// - /// The security governance assignment key - the assessment key of the required governance assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string assignmentKey, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assignmentKey, nameof(assignmentKey)); - - using var scope = _governanceAssignmentClientDiagnostics.CreateScope("GovernanceAssignmentCollection.Get"); - scope.Start(); - try - { - var response = await _governanceAssignmentRestClient.GetAsync(Id.Parent, Id.Name, assignmentKey, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GovernanceAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific governanceAssignment for the requested scope by AssignmentKey - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey} - /// - /// - /// Operation Id - /// GovernanceAssignments_Get - /// - /// - /// - /// The security governance assignment key - the assessment key of the required governance assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string assignmentKey, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assignmentKey, nameof(assignmentKey)); - - using var scope = _governanceAssignmentClientDiagnostics.CreateScope("GovernanceAssignmentCollection.Get"); - scope.Start(); - try - { - var response = _governanceAssignmentRestClient.Get(Id.Parent, Id.Name, assignmentKey, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GovernanceAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get security governanceAssignments on all your resources inside a scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments - /// - /// - /// Operation Id - /// GovernanceAssignments_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _governanceAssignmentRestClient.CreateListRequest(Id.Parent, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _governanceAssignmentRestClient.CreateListNextPageRequest(nextLink, Id.Parent, Id.Name); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GovernanceAssignmentResource(Client, GovernanceAssignmentData.DeserializeGovernanceAssignmentData(e)), _governanceAssignmentClientDiagnostics, Pipeline, "GovernanceAssignmentCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Get security governanceAssignments on all your resources inside a scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments - /// - /// - /// Operation Id - /// GovernanceAssignments_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _governanceAssignmentRestClient.CreateListRequest(Id.Parent, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _governanceAssignmentRestClient.CreateListNextPageRequest(nextLink, Id.Parent, Id.Name); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GovernanceAssignmentResource(Client, GovernanceAssignmentData.DeserializeGovernanceAssignmentData(e)), _governanceAssignmentClientDiagnostics, Pipeline, "GovernanceAssignmentCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey} - /// - /// - /// Operation Id - /// GovernanceAssignments_Get - /// - /// - /// - /// The security governance assignment key - the assessment key of the required governance assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string assignmentKey, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assignmentKey, nameof(assignmentKey)); - - using var scope = _governanceAssignmentClientDiagnostics.CreateScope("GovernanceAssignmentCollection.Exists"); - scope.Start(); - try - { - var response = await _governanceAssignmentRestClient.GetAsync(Id.Parent, Id.Name, assignmentKey, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey} - /// - /// - /// Operation Id - /// GovernanceAssignments_Get - /// - /// - /// - /// The security governance assignment key - the assessment key of the required governance assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string assignmentKey, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assignmentKey, nameof(assignmentKey)); - - using var scope = _governanceAssignmentClientDiagnostics.CreateScope("GovernanceAssignmentCollection.Exists"); - scope.Start(); - try - { - var response = _governanceAssignmentRestClient.Get(Id.Parent, Id.Name, assignmentKey, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/GovernanceAssignmentData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/GovernanceAssignmentData.cs deleted file mode 100644 index efd5a5a0f74f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/GovernanceAssignmentData.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the GovernanceAssignment data model. - /// Security GovernanceAssignment over a given scope - /// - public partial class GovernanceAssignmentData : ResourceData - { - /// Initializes a new instance of GovernanceAssignmentData. - public GovernanceAssignmentData() - { - } - - /// Initializes a new instance of GovernanceAssignmentData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The Owner for the governance assignment - e.g. user@contoso.com - see example. - /// The remediation due-date - after this date Secure Score will be affected (in case of active grace-period). - /// The ETA (estimated time of arrival) for remediation (optional), see example. - /// Defines whether there is a grace period on the governance assignment. - /// The email notifications settings for the governance rule, states whether to disable notifications for mangers and owners. - /// The additional data for the governance assignment - e.g. links to ticket (optional), see example. - internal GovernanceAssignmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string owner, DateTimeOffset? remediationDueOn, RemediationEta remediationEta, bool? isGracePeriod, GovernanceEmailNotification governanceEmailNotification, GovernanceAssignmentAdditionalInfo additionalData) : base(id, name, resourceType, systemData) - { - Owner = owner; - RemediationDueOn = remediationDueOn; - RemediationEta = remediationEta; - IsGracePeriod = isGracePeriod; - GovernanceEmailNotification = governanceEmailNotification; - AdditionalData = additionalData; - } - - /// The Owner for the governance assignment - e.g. user@contoso.com - see example. - public string Owner { get; set; } - /// The remediation due-date - after this date Secure Score will be affected (in case of active grace-period). - public DateTimeOffset? RemediationDueOn { get; set; } - /// The ETA (estimated time of arrival) for remediation (optional), see example. - public RemediationEta RemediationEta { get; set; } - /// Defines whether there is a grace period on the governance assignment. - public bool? IsGracePeriod { get; set; } - /// The email notifications settings for the governance rule, states whether to disable notifications for mangers and owners. - public GovernanceEmailNotification GovernanceEmailNotification { get; set; } - /// The additional data for the governance assignment - e.g. links to ticket (optional), see example. - public GovernanceAssignmentAdditionalInfo AdditionalData { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/GovernanceAssignmentResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/GovernanceAssignmentResource.cs deleted file mode 100644 index 9a56832b0294..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/GovernanceAssignmentResource.cs +++ /dev/null @@ -1,297 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a GovernanceAssignment along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetGovernanceAssignmentResource method. - /// Otherwise you can get one from its parent resource using the GetGovernanceAssignment method. - /// - public partial class GovernanceAssignmentResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string scope, string assessmentName, string assignmentKey) - { - var resourceId = $"{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _governanceAssignmentClientDiagnostics; - private readonly GovernanceAssignmentsRestOperations _governanceAssignmentRestClient; - private readonly GovernanceAssignmentData _data; - - /// Initializes a new instance of the class for mocking. - protected GovernanceAssignmentResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal GovernanceAssignmentResource(ArmClient client, GovernanceAssignmentData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal GovernanceAssignmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _governanceAssignmentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string governanceAssignmentApiVersion); - _governanceAssignmentRestClient = new GovernanceAssignmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, governanceAssignmentApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/assessments/governanceAssignments"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual GovernanceAssignmentData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get a specific governanceAssignment for the requested scope by AssignmentKey - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey} - /// - /// - /// Operation Id - /// GovernanceAssignments_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _governanceAssignmentClientDiagnostics.CreateScope("GovernanceAssignmentResource.Get"); - scope.Start(); - try - { - var response = await _governanceAssignmentRestClient.GetAsync(Id.Parent.Parent, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GovernanceAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific governanceAssignment for the requested scope by AssignmentKey - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey} - /// - /// - /// Operation Id - /// GovernanceAssignments_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _governanceAssignmentClientDiagnostics.CreateScope("GovernanceAssignmentResource.Get"); - scope.Start(); - try - { - var response = _governanceAssignmentRestClient.Get(Id.Parent.Parent, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GovernanceAssignmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a GovernanceAssignment over a given scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey} - /// - /// - /// Operation Id - /// GovernanceAssignments_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _governanceAssignmentClientDiagnostics.CreateScope("GovernanceAssignmentResource.Delete"); - scope.Start(); - try - { - var response = await _governanceAssignmentRestClient.DeleteAsync(Id.Parent.Parent, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a GovernanceAssignment over a given scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey} - /// - /// - /// Operation Id - /// GovernanceAssignments_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _governanceAssignmentClientDiagnostics.CreateScope("GovernanceAssignmentResource.Delete"); - scope.Start(); - try - { - var response = _governanceAssignmentRestClient.Delete(Id.Parent.Parent, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or update a security GovernanceAssignment on the given subscription. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey} - /// - /// - /// Operation Id - /// GovernanceAssignments_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// GovernanceAssignment over a subscription scope. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, GovernanceAssignmentData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _governanceAssignmentClientDiagnostics.CreateScope("GovernanceAssignmentResource.Update"); - scope.Start(); - try - { - var response = await _governanceAssignmentRestClient.CreateOrUpdateAsync(Id.Parent.Parent, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new GovernanceAssignmentResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or update a security GovernanceAssignment on the given subscription. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey} - /// - /// - /// Operation Id - /// GovernanceAssignments_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// GovernanceAssignment over a subscription scope. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, GovernanceAssignmentData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _governanceAssignmentClientDiagnostics.CreateScope("GovernanceAssignmentResource.Update"); - scope.Start(); - try - { - var response = _governanceAssignmentRestClient.CreateOrUpdate(Id.Parent.Parent, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new GovernanceAssignmentResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/GovernanceRuleData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/GovernanceRuleData.cs deleted file mode 100644 index 72888a47ae09..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/GovernanceRuleData.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the GovernanceRule data model. - /// Security GovernanceRule over a given scope - /// - public partial class GovernanceRuleData : ResourceData - { - /// Initializes a new instance of GovernanceRuleData. - public GovernanceRuleData() - { - ConditionSets = new ChangeTrackingList(); - } - - /// Initializes a new instance of GovernanceRuleData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// display name of the governanceRule. - /// description of the governanceRule. - /// Governance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. 7.00:00:00 - means 7 days. - /// Defines whether there is a grace period on the governance rule. - /// The governance rule priority, priority to the lower number. Rules with the same priority on the same subscription will not be allowed. - /// Defines whether the rule is active/inactive. - /// The rule type of the governance rule, defines the source of the rule e.g. Integrated. - /// The governance rule source, what the rule affects, e.g. Assessments. - /// The governance rule conditionSets - see examples. - /// The Owner source for the governance rule - e.g. Manually by user@contoso.com - see example. - /// The email notifications settings for the governance rule, states whether to disable notifications for mangers and owners. - internal GovernanceRuleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string displayName, string description, string remediationTimeframe, bool? isGracePeriod, int? rulePriority, bool? isDisabled, GovernanceRuleType? ruleType, GovernanceRuleSourceResourceType? sourceResourceType, IList conditionSets, GovernanceRuleOwnerSource ownerSource, GovernanceRuleEmailNotification governanceEmailNotification) : base(id, name, resourceType, systemData) - { - DisplayName = displayName; - Description = description; - RemediationTimeframe = remediationTimeframe; - IsGracePeriod = isGracePeriod; - RulePriority = rulePriority; - IsDisabled = isDisabled; - RuleType = ruleType; - SourceResourceType = sourceResourceType; - ConditionSets = conditionSets; - OwnerSource = ownerSource; - GovernanceEmailNotification = governanceEmailNotification; - } - - /// display name of the governanceRule. - public string DisplayName { get; set; } - /// description of the governanceRule. - public string Description { get; set; } - /// Governance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. 7.00:00:00 - means 7 days. - public string RemediationTimeframe { get; set; } - /// Defines whether there is a grace period on the governance rule. - public bool? IsGracePeriod { get; set; } - /// The governance rule priority, priority to the lower number. Rules with the same priority on the same subscription will not be allowed. - public int? RulePriority { get; set; } - /// Defines whether the rule is active/inactive. - public bool? IsDisabled { get; set; } - /// The rule type of the governance rule, defines the source of the rule e.g. Integrated. - public GovernanceRuleType? RuleType { get; set; } - /// The governance rule source, what the rule affects, e.g. Assessments. - public GovernanceRuleSourceResourceType? SourceResourceType { get; set; } - /// - /// The governance rule conditionSets - see examples - /// - /// To assign an object to the element of this property use . - /// - /// - /// To assign an already formated json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public IList ConditionSets { get; } - /// The Owner source for the governance rule - e.g. Manually by user@contoso.com - see example. - public GovernanceRuleOwnerSource OwnerSource { get; set; } - /// The email notifications settings for the governance rule, states whether to disable notifications for mangers and owners. - public GovernanceRuleEmailNotification GovernanceEmailNotification { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IngestionSettingCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IngestionSettingCollection.cs deleted file mode 100644 index f84787116434..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IngestionSettingCollection.cs +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get an instance call the GetIngestionSettings method from an instance of . - /// - public partial class IngestionSettingCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _ingestionSettingClientDiagnostics; - private readonly IngestionSettingsRestOperations _ingestionSettingRestClient; - - /// Initializes a new instance of the class for mocking. - protected IngestionSettingCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal IngestionSettingCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _ingestionSettingClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", IngestionSettingResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(IngestionSettingResource.ResourceType, out string ingestionSettingApiVersion); - _ingestionSettingRestClient = new IngestionSettingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, ingestionSettingApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SubscriptionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); - } - - /// - /// Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName} - /// - /// - /// Operation Id - /// IngestionSettings_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the ingestion setting. - /// Ingestion setting object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string ingestionSettingName, IngestionSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ingestionSettingName, nameof(ingestionSettingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _ingestionSettingClientDiagnostics.CreateScope("IngestionSettingCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _ingestionSettingRestClient.CreateAsync(Id.SubscriptionId, ingestionSettingName, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new IngestionSettingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName} - /// - /// - /// Operation Id - /// IngestionSettings_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the ingestion setting. - /// Ingestion setting object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string ingestionSettingName, IngestionSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ingestionSettingName, nameof(ingestionSettingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _ingestionSettingClientDiagnostics.CreateScope("IngestionSettingCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _ingestionSettingRestClient.Create(Id.SubscriptionId, ingestionSettingName, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new IngestionSettingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Settings for ingesting security data and logs to correlate with resources associated with the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName} - /// - /// - /// Operation Id - /// IngestionSettings_Get - /// - /// - /// - /// Name of the ingestion setting. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string ingestionSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ingestionSettingName, nameof(ingestionSettingName)); - - using var scope = _ingestionSettingClientDiagnostics.CreateScope("IngestionSettingCollection.Get"); - scope.Start(); - try - { - var response = await _ingestionSettingRestClient.GetAsync(Id.SubscriptionId, ingestionSettingName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IngestionSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Settings for ingesting security data and logs to correlate with resources associated with the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName} - /// - /// - /// Operation Id - /// IngestionSettings_Get - /// - /// - /// - /// Name of the ingestion setting. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string ingestionSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ingestionSettingName, nameof(ingestionSettingName)); - - using var scope = _ingestionSettingClientDiagnostics.CreateScope("IngestionSettingCollection.Get"); - scope.Start(); - try - { - var response = _ingestionSettingRestClient.Get(Id.SubscriptionId, ingestionSettingName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IngestionSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Settings for ingesting security data and logs to correlate with resources associated with the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings - /// - /// - /// Operation Id - /// IngestionSettings_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _ingestionSettingRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _ingestionSettingRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IngestionSettingResource(Client, IngestionSettingData.DeserializeIngestionSettingData(e)), _ingestionSettingClientDiagnostics, Pipeline, "IngestionSettingCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Settings for ingesting security data and logs to correlate with resources associated with the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings - /// - /// - /// Operation Id - /// IngestionSettings_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _ingestionSettingRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _ingestionSettingRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IngestionSettingResource(Client, IngestionSettingData.DeserializeIngestionSettingData(e)), _ingestionSettingClientDiagnostics, Pipeline, "IngestionSettingCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName} - /// - /// - /// Operation Id - /// IngestionSettings_Get - /// - /// - /// - /// Name of the ingestion setting. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string ingestionSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ingestionSettingName, nameof(ingestionSettingName)); - - using var scope = _ingestionSettingClientDiagnostics.CreateScope("IngestionSettingCollection.Exists"); - scope.Start(); - try - { - var response = await _ingestionSettingRestClient.GetAsync(Id.SubscriptionId, ingestionSettingName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName} - /// - /// - /// Operation Id - /// IngestionSettings_Get - /// - /// - /// - /// Name of the ingestion setting. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string ingestionSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ingestionSettingName, nameof(ingestionSettingName)); - - using var scope = _ingestionSettingClientDiagnostics.CreateScope("IngestionSettingCollection.Exists"); - scope.Start(); - try - { - var response = _ingestionSettingRestClient.Get(Id.SubscriptionId, ingestionSettingName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IngestionSettingData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IngestionSettingData.cs deleted file mode 100644 index 42cc54c38ecd..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IngestionSettingData.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the IngestionSetting data model. - /// Configures how to correlate scan data and logs with resources associated with the subscription. - /// - public partial class IngestionSettingData : ResourceData - { - /// Initializes a new instance of IngestionSettingData. - public IngestionSettingData() - { - } - - /// Initializes a new instance of IngestionSettingData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Ingestion setting data. - internal IngestionSettingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, BinaryData properties) : base(id, name, resourceType, systemData) - { - Properties = properties; - } - - /// - /// Ingestion setting data - /// - /// To assign an object to this property use . - /// - /// - /// To assign an already formated json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public BinaryData Properties { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IngestionSettingResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IngestionSettingResource.cs deleted file mode 100644 index 6d2bda175fc6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IngestionSettingResource.cs +++ /dev/null @@ -1,401 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing an IngestionSetting along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetIngestionSettingResource method. - /// Otherwise you can get one from its parent resource using the GetIngestionSetting method. - /// - public partial class IngestionSettingResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string ingestionSettingName) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _ingestionSettingClientDiagnostics; - private readonly IngestionSettingsRestOperations _ingestionSettingRestClient; - private readonly IngestionSettingData _data; - - /// Initializes a new instance of the class for mocking. - protected IngestionSettingResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal IngestionSettingResource(ArmClient client, IngestionSettingData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal IngestionSettingResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _ingestionSettingClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string ingestionSettingApiVersion); - _ingestionSettingRestClient = new IngestionSettingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, ingestionSettingApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/ingestionSettings"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual IngestionSettingData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Settings for ingesting security data and logs to correlate with resources associated with the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName} - /// - /// - /// Operation Id - /// IngestionSettings_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _ingestionSettingClientDiagnostics.CreateScope("IngestionSettingResource.Get"); - scope.Start(); - try - { - var response = await _ingestionSettingRestClient.GetAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IngestionSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Settings for ingesting security data and logs to correlate with resources associated with the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName} - /// - /// - /// Operation Id - /// IngestionSettings_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _ingestionSettingClientDiagnostics.CreateScope("IngestionSettingResource.Get"); - scope.Start(); - try - { - var response = _ingestionSettingRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IngestionSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes the ingestion settings for this subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName} - /// - /// - /// Operation Id - /// IngestionSettings_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _ingestionSettingClientDiagnostics.CreateScope("IngestionSettingResource.Delete"); - scope.Start(); - try - { - var response = await _ingestionSettingRestClient.DeleteAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes the ingestion settings for this subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName} - /// - /// - /// Operation Id - /// IngestionSettings_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _ingestionSettingClientDiagnostics.CreateScope("IngestionSettingResource.Delete"); - scope.Start(); - try - { - var response = _ingestionSettingRestClient.Delete(Id.SubscriptionId, Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName} - /// - /// - /// Operation Id - /// IngestionSettings_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Ingestion setting object. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, IngestionSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _ingestionSettingClientDiagnostics.CreateScope("IngestionSettingResource.Update"); - scope.Start(); - try - { - var response = await _ingestionSettingRestClient.CreateAsync(Id.SubscriptionId, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new IngestionSettingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName} - /// - /// - /// Operation Id - /// IngestionSettings_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Ingestion setting object. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, IngestionSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _ingestionSettingClientDiagnostics.CreateScope("IngestionSettingResource.Update"); - scope.Start(); - try - { - var response = _ingestionSettingRestClient.Create(Id.SubscriptionId, Id.Name, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new IngestionSettingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listTokens - /// - /// - /// Operation Id - /// IngestionSettings_ListTokens - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetTokensAsync(CancellationToken cancellationToken = default) - { - using var scope = _ingestionSettingClientDiagnostics.CreateScope("IngestionSettingResource.GetTokens"); - scope.Start(); - try - { - var response = await _ingestionSettingRestClient.ListTokensAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listTokens - /// - /// - /// Operation Id - /// IngestionSettings_ListTokens - /// - /// - /// - /// The cancellation token to use. - public virtual Response GetTokens(CancellationToken cancellationToken = default) - { - using var scope = _ingestionSettingClientDiagnostics.CreateScope("IngestionSettingResource.GetTokens"); - scope.Start(); - try - { - var response = _ingestionSettingRestClient.ListTokens(Id.SubscriptionId, Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Connection strings for ingesting security scan logs and data. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listConnectionStrings - /// - /// - /// Operation Id - /// IngestionSettings_ListConnectionStrings - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetConnectionStringsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _ingestionSettingRestClient.CreateListConnectionStringsRequest(Id.SubscriptionId, Id.Name); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, IngestionConnectionString.DeserializeIngestionConnectionString, _ingestionSettingClientDiagnostics, Pipeline, "IngestionSettingResource.GetConnectionStrings", "value", null, cancellationToken); - } - - /// - /// Connection strings for ingesting security scan logs and data. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listConnectionStrings - /// - /// - /// Operation Id - /// IngestionSettings_ListConnectionStrings - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetConnectionStrings(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _ingestionSettingRestClient.CreateListConnectionStringsRequest(Id.SubscriptionId, Id.Name); - return PageableHelpers.CreatePageable(FirstPageRequest, null, IngestionConnectionString.DeserializeIngestionConnectionString, _ingestionSettingClientDiagnostics, Pipeline, "IngestionSettingResource.GetConnectionStrings", "value", null, cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedAlertCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedAlertCollection.cs deleted file mode 100644 index 9e54a118c375..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedAlertCollection.cs +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get an instance call the GetIotSecurityAggregatedAlerts method from an instance of . - /// - public partial class IotSecurityAggregatedAlertCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertClientDiagnostics; - private readonly IotSecuritySolutionsAnalyticsAggregatedAlertRestOperations _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertRestClient; - - /// Initializes a new instance of the class for mocking. - protected IotSecurityAggregatedAlertCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal IotSecurityAggregatedAlertCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", IotSecurityAggregatedAlertResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(IotSecurityAggregatedAlertResource.ResourceType, out string iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertApiVersion); - _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertRestClient = new IotSecuritySolutionsAnalyticsAggregatedAlertRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != IotSecuritySolutionAnalyticsModelResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, IotSecuritySolutionAnalyticsModelResource.ResourceType), nameof(id)); - } - - /// - /// Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is performed by alert name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName} - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsAggregatedAlert_Get - /// - /// - /// - /// Identifier of the aggregated alert. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string aggregatedAlertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(aggregatedAlertName, nameof(aggregatedAlertName)); - - using var scope = _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertClientDiagnostics.CreateScope("IotSecurityAggregatedAlertCollection.Get"); - scope.Start(); - try - { - var response = await _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, aggregatedAlertName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IotSecurityAggregatedAlertResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is performed by alert name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName} - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsAggregatedAlert_Get - /// - /// - /// - /// Identifier of the aggregated alert. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string aggregatedAlertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(aggregatedAlertName, nameof(aggregatedAlertName)); - - using var scope = _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertClientDiagnostics.CreateScope("IotSecurityAggregatedAlertCollection.Get"); - scope.Start(); - try - { - var response = _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, aggregatedAlertName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IotSecurityAggregatedAlertResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method to get the aggregated alert list of yours IoT Security solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsAggregatedAlert_List - /// - /// - /// - /// Number of results to retrieve. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(int? top = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, top); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, top); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotSecurityAggregatedAlertResource(Client, IotSecurityAggregatedAlertData.DeserializeIotSecurityAggregatedAlertData(e)), _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertClientDiagnostics, Pipeline, "IotSecurityAggregatedAlertCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Use this method to get the aggregated alert list of yours IoT Security solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsAggregatedAlert_List - /// - /// - /// - /// Number of results to retrieve. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(int? top = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, top); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, top); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotSecurityAggregatedAlertResource(Client, IotSecurityAggregatedAlertData.DeserializeIotSecurityAggregatedAlertData(e)), _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertClientDiagnostics, Pipeline, "IotSecurityAggregatedAlertCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName} - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsAggregatedAlert_Get - /// - /// - /// - /// Identifier of the aggregated alert. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string aggregatedAlertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(aggregatedAlertName, nameof(aggregatedAlertName)); - - using var scope = _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertClientDiagnostics.CreateScope("IotSecurityAggregatedAlertCollection.Exists"); - scope.Start(); - try - { - var response = await _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, aggregatedAlertName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName} - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsAggregatedAlert_Get - /// - /// - /// - /// Identifier of the aggregated alert. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string aggregatedAlertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(aggregatedAlertName, nameof(aggregatedAlertName)); - - using var scope = _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertClientDiagnostics.CreateScope("IotSecurityAggregatedAlertCollection.Exists"); - scope.Start(); - try - { - var response = _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, aggregatedAlertName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedAlertData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedAlertData.cs deleted file mode 100644 index 420e07ae7214..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedAlertData.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the IotSecurityAggregatedAlert data model. - /// Security Solution Aggregated Alert information - /// - public partial class IotSecurityAggregatedAlertData : ResourceData - { - /// Initializes a new instance of IotSecurityAggregatedAlertData. - public IotSecurityAggregatedAlertData() - { - TopDevicesList = new ChangeTrackingList(); - Tags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of IotSecurityAggregatedAlertData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Name of the alert type. - /// Display name of the alert type. - /// Date of detection. - /// Name of the organization that raised the alert. - /// Assessed alert severity. - /// Recommended steps for remediation. - /// Description of the suspected vulnerability and meaning. - /// Number of alerts occurrences within the aggregated time window. - /// Azure resource ID of the resource that received the alerts. - /// The type of the alerted resource (Azure, Non-Azure). - /// IoT Security solution alert response. - /// Log analytics query for getting the list of affected devices/alerts. - /// 10 devices with the highest number of occurrences of this alert type, on this day. - /// Resource tags. - internal IotSecurityAggregatedAlertData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string alertType, string alertDisplayName, DateTimeOffset? aggregatedOn, string vendorName, ReportedSeverity? reportedSeverity, string remediationSteps, string description, long? count, string effectedResourceType, string systemSource, string actionTaken, string logAnalyticsQuery, IReadOnlyList topDevicesList, IDictionary tags) : base(id, name, resourceType, systemData) - { - AlertType = alertType; - AlertDisplayName = alertDisplayName; - AggregatedOn = aggregatedOn; - VendorName = vendorName; - ReportedSeverity = reportedSeverity; - RemediationSteps = remediationSteps; - Description = description; - Count = count; - EffectedResourceType = effectedResourceType; - SystemSource = systemSource; - ActionTaken = actionTaken; - LogAnalyticsQuery = logAnalyticsQuery; - TopDevicesList = topDevicesList; - Tags = tags; - } - - /// Name of the alert type. - public string AlertType { get; } - /// Display name of the alert type. - public string AlertDisplayName { get; } - /// Date of detection. - public DateTimeOffset? AggregatedOn { get; } - /// Name of the organization that raised the alert. - public string VendorName { get; } - /// Assessed alert severity. - public ReportedSeverity? ReportedSeverity { get; } - /// Recommended steps for remediation. - public string RemediationSteps { get; } - /// Description of the suspected vulnerability and meaning. - public string Description { get; } - /// Number of alerts occurrences within the aggregated time window. - public long? Count { get; } - /// Azure resource ID of the resource that received the alerts. - public string EffectedResourceType { get; } - /// The type of the alerted resource (Azure, Non-Azure). - public string SystemSource { get; } - /// IoT Security solution alert response. - public string ActionTaken { get; } - /// Log analytics query for getting the list of affected devices/alerts. - public string LogAnalyticsQuery { get; } - /// 10 devices with the highest number of occurrences of this alert type, on this day. - public IReadOnlyList TopDevicesList { get; } - /// Resource tags. - public IDictionary Tags { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedAlertResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedAlertResource.cs deleted file mode 100644 index 2ffb2d0fb7e2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedAlertResource.cs +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing an IotSecurityAggregatedAlert along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetIotSecurityAggregatedAlertResource method. - /// Otherwise you can get one from its parent resource using the GetIotSecurityAggregatedAlert method. - /// - public partial class IotSecurityAggregatedAlertResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string solutionName, string aggregatedAlertName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertClientDiagnostics; - private readonly IotSecuritySolutionsAnalyticsAggregatedAlertRestOperations _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertRestClient; - private readonly IotSecurityAggregatedAlertData _data; - - /// Initializes a new instance of the class for mocking. - protected IotSecurityAggregatedAlertResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal IotSecurityAggregatedAlertResource(ArmClient client, IotSecurityAggregatedAlertData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal IotSecurityAggregatedAlertResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertApiVersion); - _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertRestClient = new IotSecuritySolutionsAnalyticsAggregatedAlertRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/iotSecuritySolutions/analyticsModels/aggregatedAlerts"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual IotSecurityAggregatedAlertData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is performed by alert name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName} - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsAggregatedAlert_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertClientDiagnostics.CreateScope("IotSecurityAggregatedAlertResource.Get"); - scope.Start(); - try - { - var response = await _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IotSecurityAggregatedAlertResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is performed by alert name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName} - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsAggregatedAlert_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertClientDiagnostics.CreateScope("IotSecurityAggregatedAlertResource.Get"); - scope.Start(); - try - { - var response = _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IotSecurityAggregatedAlertResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method to dismiss an aggregated IoT Security Solution Alert. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}/dismiss - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsAggregatedAlert_Dismiss - /// - /// - /// - /// The cancellation token to use. - public virtual async Task DismissAsync(CancellationToken cancellationToken = default) - { - using var scope = _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertClientDiagnostics.CreateScope("IotSecurityAggregatedAlertResource.Dismiss"); - scope.Start(); - try - { - var response = await _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertRestClient.DismissAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method to dismiss an aggregated IoT Security Solution Alert. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}/dismiss - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsAggregatedAlert_Dismiss - /// - /// - /// - /// The cancellation token to use. - public virtual Response Dismiss(CancellationToken cancellationToken = default) - { - using var scope = _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertClientDiagnostics.CreateScope("IotSecurityAggregatedAlertResource.Dismiss"); - scope.Start(); - try - { - var response = _iotSecurityAggregatedAlertIotSecuritySolutionsAnalyticsAggregatedAlertRestClient.Dismiss(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedRecommendationCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedRecommendationCollection.cs deleted file mode 100644 index 1c2871a5a40c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedRecommendationCollection.cs +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get an instance call the GetIotSecurityAggregatedRecommendations method from an instance of . - /// - public partial class IotSecurityAggregatedRecommendationCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationClientDiagnostics; - private readonly IotSecuritySolutionsAnalyticsRecommendationRestOperations _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationRestClient; - - /// Initializes a new instance of the class for mocking. - protected IotSecurityAggregatedRecommendationCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal IotSecurityAggregatedRecommendationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", IotSecurityAggregatedRecommendationResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(IotSecurityAggregatedRecommendationResource.ResourceType, out string iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationApiVersion); - _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationRestClient = new IotSecuritySolutionsAnalyticsRecommendationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != IotSecuritySolutionAnalyticsModelResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, IotSecuritySolutionAnalyticsModelResource.ResourceType), nameof(id)); - } - - /// - /// Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This aggregation is performed by recommendation name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName} - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsRecommendation_Get - /// - /// - /// - /// Name of the recommendation aggregated for this query. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string aggregatedRecommendationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(aggregatedRecommendationName, nameof(aggregatedRecommendationName)); - - using var scope = _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationClientDiagnostics.CreateScope("IotSecurityAggregatedRecommendationCollection.Get"); - scope.Start(); - try - { - var response = await _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, aggregatedRecommendationName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IotSecurityAggregatedRecommendationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This aggregation is performed by recommendation name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName} - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsRecommendation_Get - /// - /// - /// - /// Name of the recommendation aggregated for this query. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string aggregatedRecommendationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(aggregatedRecommendationName, nameof(aggregatedRecommendationName)); - - using var scope = _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationClientDiagnostics.CreateScope("IotSecurityAggregatedRecommendationCollection.Get"); - scope.Start(); - try - { - var response = _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, aggregatedRecommendationName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IotSecurityAggregatedRecommendationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsRecommendation_List - /// - /// - /// - /// Number of results to retrieve. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(int? top = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, top); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, top); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotSecurityAggregatedRecommendationResource(Client, IotSecurityAggregatedRecommendationData.DeserializeIotSecurityAggregatedRecommendationData(e)), _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationClientDiagnostics, Pipeline, "IotSecurityAggregatedRecommendationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsRecommendation_List - /// - /// - /// - /// Number of results to retrieve. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(int? top = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, top); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, top); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotSecurityAggregatedRecommendationResource(Client, IotSecurityAggregatedRecommendationData.DeserializeIotSecurityAggregatedRecommendationData(e)), _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationClientDiagnostics, Pipeline, "IotSecurityAggregatedRecommendationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName} - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsRecommendation_Get - /// - /// - /// - /// Name of the recommendation aggregated for this query. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string aggregatedRecommendationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(aggregatedRecommendationName, nameof(aggregatedRecommendationName)); - - using var scope = _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationClientDiagnostics.CreateScope("IotSecurityAggregatedRecommendationCollection.Exists"); - scope.Start(); - try - { - var response = await _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, aggregatedRecommendationName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName} - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsRecommendation_Get - /// - /// - /// - /// Name of the recommendation aggregated for this query. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string aggregatedRecommendationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(aggregatedRecommendationName, nameof(aggregatedRecommendationName)); - - using var scope = _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationClientDiagnostics.CreateScope("IotSecurityAggregatedRecommendationCollection.Exists"); - scope.Start(); - try - { - var response = _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, aggregatedRecommendationName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedRecommendationData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedRecommendationData.cs deleted file mode 100644 index 2e3fddde0d44..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedRecommendationData.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the IotSecurityAggregatedRecommendation data model. - /// IoT Security solution recommendation information. - /// - public partial class IotSecurityAggregatedRecommendationData : ResourceData - { - /// Initializes a new instance of IotSecurityAggregatedRecommendationData. - public IotSecurityAggregatedRecommendationData() - { - Tags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of IotSecurityAggregatedRecommendationData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Name of the recommendation. - /// Display name of the recommendation type. - /// Description of the suspected vulnerability and meaning. - /// Recommendation-type GUID. - /// Name of the organization that made the recommendation. - /// Recommended steps for remediation. - /// Assessed recommendation severity. - /// Number of healthy devices within the IoT Security solution. - /// Number of unhealthy devices within the IoT Security solution. - /// Log analytics query for getting the list of affected devices/alerts. - /// Resource tags. - internal IotSecurityAggregatedRecommendationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string recommendationName, string recommendationDisplayName, string description, string recommendationTypeId, string detectedBy, string remediationSteps, ReportedSeverity? reportedSeverity, long? healthyDevices, long? unhealthyDeviceCount, string logAnalyticsQuery, IDictionary tags) : base(id, name, resourceType, systemData) - { - RecommendationName = recommendationName; - RecommendationDisplayName = recommendationDisplayName; - Description = description; - RecommendationTypeId = recommendationTypeId; - DetectedBy = detectedBy; - RemediationSteps = remediationSteps; - ReportedSeverity = reportedSeverity; - HealthyDevices = healthyDevices; - UnhealthyDeviceCount = unhealthyDeviceCount; - LogAnalyticsQuery = logAnalyticsQuery; - Tags = tags; - } - - /// Name of the recommendation. - public string RecommendationName { get; set; } - /// Display name of the recommendation type. - public string RecommendationDisplayName { get; } - /// Description of the suspected vulnerability and meaning. - public string Description { get; } - /// Recommendation-type GUID. - public string RecommendationTypeId { get; } - /// Name of the organization that made the recommendation. - public string DetectedBy { get; } - /// Recommended steps for remediation. - public string RemediationSteps { get; } - /// Assessed recommendation severity. - public ReportedSeverity? ReportedSeverity { get; } - /// Number of healthy devices within the IoT Security solution. - public long? HealthyDevices { get; } - /// Number of unhealthy devices within the IoT Security solution. - public long? UnhealthyDeviceCount { get; } - /// Log analytics query for getting the list of affected devices/alerts. - public string LogAnalyticsQuery { get; } - /// Resource tags. - public IDictionary Tags { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedRecommendationResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedRecommendationResource.cs deleted file mode 100644 index cc189889a870..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecurityAggregatedRecommendationResource.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing an IotSecurityAggregatedRecommendation along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetIotSecurityAggregatedRecommendationResource method. - /// Otherwise you can get one from its parent resource using the GetIotSecurityAggregatedRecommendation method. - /// - public partial class IotSecurityAggregatedRecommendationResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string solutionName, string aggregatedRecommendationName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationClientDiagnostics; - private readonly IotSecuritySolutionsAnalyticsRecommendationRestOperations _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationRestClient; - private readonly IotSecurityAggregatedRecommendationData _data; - - /// Initializes a new instance of the class for mocking. - protected IotSecurityAggregatedRecommendationResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal IotSecurityAggregatedRecommendationResource(ArmClient client, IotSecurityAggregatedRecommendationData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal IotSecurityAggregatedRecommendationResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationApiVersion); - _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationRestClient = new IotSecuritySolutionsAnalyticsRecommendationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/iotSecuritySolutions/analyticsModels/aggregatedRecommendations"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual IotSecurityAggregatedRecommendationData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This aggregation is performed by recommendation name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName} - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsRecommendation_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationClientDiagnostics.CreateScope("IotSecurityAggregatedRecommendationResource.Get"); - scope.Start(); - try - { - var response = await _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IotSecurityAggregatedRecommendationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This aggregation is performed by recommendation name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName} - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsRecommendation_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationClientDiagnostics.CreateScope("IotSecurityAggregatedRecommendationResource.Get"); - scope.Start(); - try - { - var response = _iotSecurityAggregatedRecommendationIotSecuritySolutionsAnalyticsRecommendationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IotSecurityAggregatedRecommendationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionAnalyticsModelData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionAnalyticsModelData.cs deleted file mode 100644 index 9dfb2df13f2a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionAnalyticsModelData.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the IotSecuritySolutionAnalyticsModel data model. - /// Security analytics of your IoT Security solution - /// - public partial class IotSecuritySolutionAnalyticsModelData : ResourceData - { - /// Initializes a new instance of IotSecuritySolutionAnalyticsModelData. - public IotSecuritySolutionAnalyticsModelData() - { - DevicesMetrics = new ChangeTrackingList(); - TopAlertedDevices = new ChangeTrackingList(); - MostPrevalentDeviceAlerts = new ChangeTrackingList(); - MostPrevalentDeviceRecommendations = new ChangeTrackingList(); - } - - /// Initializes a new instance of IotSecuritySolutionAnalyticsModelData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Security analytics of your IoT Security solution. - /// Number of unhealthy devices within your IoT Security solution. - /// List of device metrics by the aggregation date. - /// List of the 3 devices with the most alerts. - /// List of the 3 most prevalent device alerts. - /// List of the 3 most prevalent device recommendations. - internal IotSecuritySolutionAnalyticsModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IotSeverityMetrics metrics, long? unhealthyDeviceCount, IReadOnlyList devicesMetrics, IList topAlertedDevices, IList mostPrevalentDeviceAlerts, IList mostPrevalentDeviceRecommendations) : base(id, name, resourceType, systemData) - { - Metrics = metrics; - UnhealthyDeviceCount = unhealthyDeviceCount; - DevicesMetrics = devicesMetrics; - TopAlertedDevices = topAlertedDevices; - MostPrevalentDeviceAlerts = mostPrevalentDeviceAlerts; - MostPrevalentDeviceRecommendations = mostPrevalentDeviceRecommendations; - } - - /// Security analytics of your IoT Security solution. - public IotSeverityMetrics Metrics { get; } - /// Number of unhealthy devices within your IoT Security solution. - public long? UnhealthyDeviceCount { get; } - /// List of device metrics by the aggregation date. - public IReadOnlyList DevicesMetrics { get; } - /// List of the 3 devices with the most alerts. - public IList TopAlertedDevices { get; } - /// List of the 3 most prevalent device alerts. - public IList MostPrevalentDeviceAlerts { get; } - /// List of the 3 most prevalent device recommendations. - public IList MostPrevalentDeviceRecommendations { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionAnalyticsModelResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionAnalyticsModelResource.cs deleted file mode 100644 index 68a56801c3fa..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionAnalyticsModelResource.cs +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing an IotSecuritySolutionAnalyticsModel along with the instance operations that can be performed on it. - /// If you have a you can construct an - /// from an instance of using the GetIotSecuritySolutionAnalyticsModelResource method. - /// Otherwise you can get one from its parent resource using the GetIotSecuritySolutionAnalyticsModel method. - /// - public partial class IotSecuritySolutionAnalyticsModelResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string solutionName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _iotSecuritySolutionAnalyticsModelIotSecuritySolutionAnalyticsClientDiagnostics; - private readonly IotSecuritySolutionAnalyticsRestOperations _iotSecuritySolutionAnalyticsModelIotSecuritySolutionAnalyticsRestClient; - private readonly IotSecuritySolutionAnalyticsModelData _data; - - /// Initializes a new instance of the class for mocking. - protected IotSecuritySolutionAnalyticsModelResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal IotSecuritySolutionAnalyticsModelResource(ArmClient client, IotSecuritySolutionAnalyticsModelData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal IotSecuritySolutionAnalyticsModelResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _iotSecuritySolutionAnalyticsModelIotSecuritySolutionAnalyticsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string iotSecuritySolutionAnalyticsModelIotSecuritySolutionAnalyticsApiVersion); - _iotSecuritySolutionAnalyticsModelIotSecuritySolutionAnalyticsRestClient = new IotSecuritySolutionAnalyticsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotSecuritySolutionAnalyticsModelIotSecuritySolutionAnalyticsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/iotSecuritySolutions/analyticsModels"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual IotSecuritySolutionAnalyticsModelData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets a collection of IotSecurityAggregatedAlertResources in the IotSecuritySolutionAnalyticsModel. - /// An object representing collection of IotSecurityAggregatedAlertResources and their operations over a IotSecurityAggregatedAlertResource. - public virtual IotSecurityAggregatedAlertCollection GetIotSecurityAggregatedAlerts() - { - return GetCachedClient(Client => new IotSecurityAggregatedAlertCollection(Client, Id)); - } - - /// - /// Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is performed by alert name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName} - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsAggregatedAlert_Get - /// - /// - /// - /// Identifier of the aggregated alert. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetIotSecurityAggregatedAlertAsync(string aggregatedAlertName, CancellationToken cancellationToken = default) - { - return await GetIotSecurityAggregatedAlerts().GetAsync(aggregatedAlertName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is performed by alert name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName} - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsAggregatedAlert_Get - /// - /// - /// - /// Identifier of the aggregated alert. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetIotSecurityAggregatedAlert(string aggregatedAlertName, CancellationToken cancellationToken = default) - { - return GetIotSecurityAggregatedAlerts().Get(aggregatedAlertName, cancellationToken); - } - - /// Gets a collection of IotSecurityAggregatedRecommendationResources in the IotSecuritySolutionAnalyticsModel. - /// An object representing collection of IotSecurityAggregatedRecommendationResources and their operations over a IotSecurityAggregatedRecommendationResource. - public virtual IotSecurityAggregatedRecommendationCollection GetIotSecurityAggregatedRecommendations() - { - return GetCachedClient(Client => new IotSecurityAggregatedRecommendationCollection(Client, Id)); - } - - /// - /// Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This aggregation is performed by recommendation name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName} - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsRecommendation_Get - /// - /// - /// - /// Name of the recommendation aggregated for this query. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetIotSecurityAggregatedRecommendationAsync(string aggregatedRecommendationName, CancellationToken cancellationToken = default) - { - return await GetIotSecurityAggregatedRecommendations().GetAsync(aggregatedRecommendationName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This aggregation is performed by recommendation name. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName} - /// - /// - /// Operation Id - /// IotSecuritySolutionsAnalyticsRecommendation_Get - /// - /// - /// - /// Name of the recommendation aggregated for this query. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetIotSecurityAggregatedRecommendation(string aggregatedRecommendationName, CancellationToken cancellationToken = default) - { - return GetIotSecurityAggregatedRecommendations().Get(aggregatedRecommendationName, cancellationToken); - } - - /// - /// Use this method to get IoT Security Analytics metrics. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default - /// - /// - /// Operation Id - /// IotSecuritySolutionAnalytics_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _iotSecuritySolutionAnalyticsModelIotSecuritySolutionAnalyticsClientDiagnostics.CreateScope("IotSecuritySolutionAnalyticsModelResource.Get"); - scope.Start(); - try - { - var response = await _iotSecuritySolutionAnalyticsModelIotSecuritySolutionAnalyticsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IotSecuritySolutionAnalyticsModelResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method to get IoT Security Analytics metrics. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default - /// - /// - /// Operation Id - /// IotSecuritySolutionAnalytics_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _iotSecuritySolutionAnalyticsModelIotSecuritySolutionAnalyticsClientDiagnostics.CreateScope("IotSecuritySolutionAnalyticsModelResource.Get"); - scope.Start(); - try - { - var response = _iotSecuritySolutionAnalyticsModelIotSecuritySolutionAnalyticsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IotSecuritySolutionAnalyticsModelResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionCollection.cs deleted file mode 100644 index c377541b43d3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionCollection.cs +++ /dev/null @@ -1,343 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get an instance call the GetIotSecuritySolutions method from an instance of . - /// - public partial class IotSecuritySolutionCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _iotSecuritySolutionClientDiagnostics; - private readonly IotSecuritySolutionRestOperations _iotSecuritySolutionRestClient; - - /// Initializes a new instance of the class for mocking. - protected IotSecuritySolutionCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal IotSecuritySolutionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _iotSecuritySolutionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", IotSecuritySolutionResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(IotSecuritySolutionResource.ResourceType, out string iotSecuritySolutionApiVersion); - _iotSecuritySolutionRestClient = new IotSecuritySolutionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, iotSecuritySolutionApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Use this method to create or update yours IoT Security solution - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} - /// - /// - /// Operation Id - /// IotSecuritySolution_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the IoT Security solution. - /// The security solution data. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string solutionName, IotSecuritySolutionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _iotSecuritySolutionRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, solutionName, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new IotSecuritySolutionResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method to create or update yours IoT Security solution - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} - /// - /// - /// Operation Id - /// IotSecuritySolution_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the IoT Security solution. - /// The security solution data. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string solutionName, IotSecuritySolutionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _iotSecuritySolutionRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, solutionName, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new IotSecuritySolutionResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// User this method to get details of a specific IoT Security solution based on solution name - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} - /// - /// - /// Operation Id - /// IotSecuritySolution_Get - /// - /// - /// - /// The name of the IoT Security solution. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string solutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionCollection.Get"); - scope.Start(); - try - { - var response = await _iotSecuritySolutionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, solutionName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IotSecuritySolutionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// User this method to get details of a specific IoT Security solution based on solution name - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} - /// - /// - /// Operation Id - /// IotSecuritySolution_Get - /// - /// - /// - /// The name of the IoT Security solution. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string solutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionCollection.Get"); - scope.Start(); - try - { - var response = _iotSecuritySolutionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, solutionName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new IotSecuritySolutionResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Use this method to get the list IoT Security solutions organized by resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions - /// - /// - /// Operation Id - /// IotSecuritySolution_ListByResourceGroup - /// - /// - /// - /// Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _iotSecuritySolutionRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotSecuritySolutionRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, filter); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new IotSecuritySolutionResource(Client, IotSecuritySolutionData.DeserializeIotSecuritySolutionData(e)), _iotSecuritySolutionClientDiagnostics, Pipeline, "IotSecuritySolutionCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Use this method to get the list IoT Security solutions organized by resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions - /// - /// - /// Operation Id - /// IotSecuritySolution_ListByResourceGroup - /// - /// - /// - /// Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _iotSecuritySolutionRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _iotSecuritySolutionRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, filter); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new IotSecuritySolutionResource(Client, IotSecuritySolutionData.DeserializeIotSecuritySolutionData(e)), _iotSecuritySolutionClientDiagnostics, Pipeline, "IotSecuritySolutionCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} - /// - /// - /// Operation Id - /// IotSecuritySolution_Get - /// - /// - /// - /// The name of the IoT Security solution. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string solutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionCollection.Exists"); - scope.Start(); - try - { - var response = await _iotSecuritySolutionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, solutionName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName} - /// - /// - /// Operation Id - /// IotSecuritySolution_Get - /// - /// - /// - /// The name of the IoT Security solution. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string solutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var scope = _iotSecuritySolutionClientDiagnostics.CreateScope("IotSecuritySolutionCollection.Exists"); - scope.Start(); - try - { - var response = _iotSecuritySolutionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, solutionName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionData.cs deleted file mode 100644 index a29539a65f10..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/IotSecuritySolutionData.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the IotSecuritySolution data model. - /// IoT Security solution configuration and resource information. - /// - public partial class IotSecuritySolutionData : TrackedResourceData - { - /// Initializes a new instance of IotSecuritySolutionData. - /// The location. - public IotSecuritySolutionData(AzureLocation location) : base(location) - { - Export = new ChangeTrackingList(); - DisabledDataSources = new ChangeTrackingList(); - IotHubs = new ChangeTrackingList(); - AutoDiscoveredResources = new ChangeTrackingList(); - RecommendationsConfiguration = new ChangeTrackingList(); - AdditionalWorkspaces = new ChangeTrackingList(); - } - - /// Initializes a new instance of IotSecuritySolutionData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// Workspace resource ID. - /// Resource display name. - /// Status of the IoT Security solution. - /// List of additional options for exporting to workspace data. - /// Disabled data sources. Disabling these data sources compromises the system. - /// IoT Hub resource IDs. - /// Properties of the IoT Security solution's user defined resources. - /// List of resources that were automatically discovered as relevant to the security solution. - /// List of the configuration status for each recommendation type. - /// Unmasked IP address logging status. - /// List of additional workspaces. - internal IotSecuritySolutionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string workspace, string displayName, SecuritySolutionStatus? status, IList export, IList disabledDataSources, IList iotHubs, UserDefinedResourcesProperties userDefinedResources, IReadOnlyList autoDiscoveredResources, IList recommendationsConfiguration, UnmaskedIPLoggingStatus? unmaskedIPLoggingStatus, IList additionalWorkspaces) : base(id, name, resourceType, systemData, tags, location) - { - Workspace = workspace; - DisplayName = displayName; - Status = status; - Export = export; - DisabledDataSources = disabledDataSources; - IotHubs = iotHubs; - UserDefinedResources = userDefinedResources; - AutoDiscoveredResources = autoDiscoveredResources; - RecommendationsConfiguration = recommendationsConfiguration; - UnmaskedIPLoggingStatus = unmaskedIPLoggingStatus; - AdditionalWorkspaces = additionalWorkspaces; - } - - /// Workspace resource ID. - public string Workspace { get; set; } - /// Resource display name. - public string DisplayName { get; set; } - /// Status of the IoT Security solution. - public SecuritySolutionStatus? Status { get; set; } - /// List of additional options for exporting to workspace data. - public IList Export { get; } - /// Disabled data sources. Disabling these data sources compromises the system. - public IList DisabledDataSources { get; } - /// IoT Hub resource IDs. - public IList IotHubs { get; } - /// Properties of the IoT Security solution's user defined resources. - public UserDefinedResourcesProperties UserDefinedResources { get; set; } - /// List of resources that were automatically discovered as relevant to the security solution. - public IReadOnlyList AutoDiscoveredResources { get; } - /// List of the configuration status for each recommendation type. - public IList RecommendationsConfiguration { get; } - /// Unmasked IP address logging status. - public UnmaskedIPLoggingStatus? UnmaskedIPLoggingStatus { get; set; } - /// List of additional workspaces. - public IList AdditionalWorkspaces { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/JitNetworkAccessPolicyCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/JitNetworkAccessPolicyCollection.cs deleted file mode 100644 index 586e871f7f37..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/JitNetworkAccessPolicyCollection.cs +++ /dev/null @@ -1,344 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetJitNetworkAccessPolicies method from an instance of . - /// - public partial class JitNetworkAccessPolicyCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _jitNetworkAccessPolicyClientDiagnostics; - private readonly JitNetworkAccessPoliciesRestOperations _jitNetworkAccessPolicyRestClient; - private readonly AzureLocation _ascLocation; - - /// Initializes a new instance of the class for mocking. - protected JitNetworkAccessPolicyCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - internal JitNetworkAccessPolicyCollection(ArmClient client, ResourceIdentifier id, AzureLocation ascLocation) : base(client, id) - { - _ascLocation = ascLocation; - _jitNetworkAccessPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", JitNetworkAccessPolicyResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(JitNetworkAccessPolicyResource.ResourceType, out string jitNetworkAccessPolicyApiVersion); - _jitNetworkAccessPolicyRestClient = new JitNetworkAccessPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, jitNetworkAccessPolicyApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Create a policy for protecting resources using Just-in-Time access control - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName} - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of a Just-in-Time access configuration policy. - /// The JitNetworkAccessPolicy to use. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string jitNetworkAccessPolicyName, JitNetworkAccessPolicyData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jitNetworkAccessPolicyName, nameof(jitNetworkAccessPolicyName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _jitNetworkAccessPolicyClientDiagnostics.CreateScope("JitNetworkAccessPolicyCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _jitNetworkAccessPolicyRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), jitNetworkAccessPolicyName, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new JitNetworkAccessPolicyResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a policy for protecting resources using Just-in-Time access control - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName} - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of a Just-in-Time access configuration policy. - /// The JitNetworkAccessPolicy to use. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string jitNetworkAccessPolicyName, JitNetworkAccessPolicyData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jitNetworkAccessPolicyName, nameof(jitNetworkAccessPolicyName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _jitNetworkAccessPolicyClientDiagnostics.CreateScope("JitNetworkAccessPolicyCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _jitNetworkAccessPolicyRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), jitNetworkAccessPolicyName, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new JitNetworkAccessPolicyResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Policies for protecting resources using Just-in-Time access control for the subscription, location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName} - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_Get - /// - /// - /// - /// Name of a Just-in-Time access configuration policy. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string jitNetworkAccessPolicyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jitNetworkAccessPolicyName, nameof(jitNetworkAccessPolicyName)); - - using var scope = _jitNetworkAccessPolicyClientDiagnostics.CreateScope("JitNetworkAccessPolicyCollection.Get"); - scope.Start(); - try - { - var response = await _jitNetworkAccessPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), jitNetworkAccessPolicyName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new JitNetworkAccessPolicyResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Policies for protecting resources using Just-in-Time access control for the subscription, location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName} - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_Get - /// - /// - /// - /// Name of a Just-in-Time access configuration policy. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string jitNetworkAccessPolicyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jitNetworkAccessPolicyName, nameof(jitNetworkAccessPolicyName)); - - using var scope = _jitNetworkAccessPolicyClientDiagnostics.CreateScope("JitNetworkAccessPolicyCollection.Get"); - scope.Start(); - try - { - var response = _jitNetworkAccessPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), jitNetworkAccessPolicyName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new JitNetworkAccessPolicyResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Policies for protecting resources using Just-in-Time access control for the subscription, location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_ListByResourceGroupAndRegion - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _jitNetworkAccessPolicyRestClient.CreateListByResourceGroupAndRegionRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _jitNetworkAccessPolicyRestClient.CreateListByResourceGroupAndRegionNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation)); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new JitNetworkAccessPolicyResource(Client, JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(e)), _jitNetworkAccessPolicyClientDiagnostics, Pipeline, "JitNetworkAccessPolicyCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Policies for protecting resources using Just-in-Time access control for the subscription, location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_ListByResourceGroupAndRegion - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _jitNetworkAccessPolicyRestClient.CreateListByResourceGroupAndRegionRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _jitNetworkAccessPolicyRestClient.CreateListByResourceGroupAndRegionNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation)); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new JitNetworkAccessPolicyResource(Client, JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(e)), _jitNetworkAccessPolicyClientDiagnostics, Pipeline, "JitNetworkAccessPolicyCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName} - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_Get - /// - /// - /// - /// Name of a Just-in-Time access configuration policy. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string jitNetworkAccessPolicyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jitNetworkAccessPolicyName, nameof(jitNetworkAccessPolicyName)); - - using var scope = _jitNetworkAccessPolicyClientDiagnostics.CreateScope("JitNetworkAccessPolicyCollection.Exists"); - scope.Start(); - try - { - var response = await _jitNetworkAccessPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), jitNetworkAccessPolicyName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName} - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_Get - /// - /// - /// - /// Name of a Just-in-Time access configuration policy. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string jitNetworkAccessPolicyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(jitNetworkAccessPolicyName, nameof(jitNetworkAccessPolicyName)); - - using var scope = _jitNetworkAccessPolicyClientDiagnostics.CreateScope("JitNetworkAccessPolicyCollection.Exists"); - scope.Start(); - try - { - var response = _jitNetworkAccessPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), jitNetworkAccessPolicyName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/JitNetworkAccessPolicyData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/JitNetworkAccessPolicyData.cs deleted file mode 100644 index a3cbac5bc420..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/JitNetworkAccessPolicyData.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// A class representing the JitNetworkAccessPolicy data model. - public partial class JitNetworkAccessPolicyData : ResourceData - { - /// Initializes a new instance of JitNetworkAccessPolicyData. - /// Configurations for Microsoft.Compute/virtualMachines resource type. - /// is null. - public JitNetworkAccessPolicyData(IEnumerable virtualMachines) - { - Argument.AssertNotNull(virtualMachines, nameof(virtualMachines)); - - VirtualMachines = virtualMachines.ToList(); - Requests = new ChangeTrackingList(); - } - - /// Initializes a new instance of JitNetworkAccessPolicyData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Configurations for Microsoft.Compute/virtualMachines resource type. - /// - /// Gets the provisioning state of the Just-in-Time policy. - /// Kind of the resource. - /// Location where the resource is stored. - internal JitNetworkAccessPolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList virtualMachines, IList requests, string provisioningState, string kind, AzureLocation? location) : base(id, name, resourceType, systemData) - { - VirtualMachines = virtualMachines; - Requests = requests; - ProvisioningState = provisioningState; - Kind = kind; - Location = location; - } - - /// Configurations for Microsoft.Compute/virtualMachines resource type. - public IList VirtualMachines { get; } - /// Gets the requests. - public IList Requests { get; } - /// Gets the provisioning state of the Just-in-Time policy. - public string ProvisioningState { get; } - /// Kind of the resource. - public string Kind { get; set; } - /// Location where the resource is stored. - public AzureLocation? Location { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/JitNetworkAccessPolicyResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/JitNetworkAccessPolicyResource.cs deleted file mode 100644 index 6c885e495975..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/JitNetworkAccessPolicyResource.cs +++ /dev/null @@ -1,367 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a JitNetworkAccessPolicy along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetJitNetworkAccessPolicyResource method. - /// Otherwise you can get one from its parent resource using the GetJitNetworkAccessPolicy method. - /// - public partial class JitNetworkAccessPolicyResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string jitNetworkAccessPolicyName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _jitNetworkAccessPolicyClientDiagnostics; - private readonly JitNetworkAccessPoliciesRestOperations _jitNetworkAccessPolicyRestClient; - private readonly JitNetworkAccessPolicyData _data; - - /// Initializes a new instance of the class for mocking. - protected JitNetworkAccessPolicyResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal JitNetworkAccessPolicyResource(ArmClient client, JitNetworkAccessPolicyData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal JitNetworkAccessPolicyResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _jitNetworkAccessPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string jitNetworkAccessPolicyApiVersion); - _jitNetworkAccessPolicyRestClient = new JitNetworkAccessPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, jitNetworkAccessPolicyApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/locations/jitNetworkAccessPolicies"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual JitNetworkAccessPolicyData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Policies for protecting resources using Just-in-Time access control for the subscription, location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName} - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _jitNetworkAccessPolicyClientDiagnostics.CreateScope("JitNetworkAccessPolicyResource.Get"); - scope.Start(); - try - { - var response = await _jitNetworkAccessPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new JitNetworkAccessPolicyResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Policies for protecting resources using Just-in-Time access control for the subscription, location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName} - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _jitNetworkAccessPolicyClientDiagnostics.CreateScope("JitNetworkAccessPolicyResource.Get"); - scope.Start(); - try - { - var response = _jitNetworkAccessPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new JitNetworkAccessPolicyResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a Just-in-Time access control policy. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName} - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _jitNetworkAccessPolicyClientDiagnostics.CreateScope("JitNetworkAccessPolicyResource.Delete"); - scope.Start(); - try - { - var response = await _jitNetworkAccessPolicyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a Just-in-Time access control policy. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName} - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _jitNetworkAccessPolicyClientDiagnostics.CreateScope("JitNetworkAccessPolicyResource.Delete"); - scope.Start(); - try - { - var response = _jitNetworkAccessPolicyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a policy for protecting resources using Just-in-Time access control - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName} - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The JitNetworkAccessPolicy to use. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, JitNetworkAccessPolicyData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _jitNetworkAccessPolicyClientDiagnostics.CreateScope("JitNetworkAccessPolicyResource.Update"); - scope.Start(); - try - { - var response = await _jitNetworkAccessPolicyRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new JitNetworkAccessPolicyResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a policy for protecting resources using Just-in-Time access control - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName} - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The JitNetworkAccessPolicy to use. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, JitNetworkAccessPolicyData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _jitNetworkAccessPolicyClientDiagnostics.CreateScope("JitNetworkAccessPolicyResource.Update"); - scope.Start(); - try - { - var response = _jitNetworkAccessPolicyRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new JitNetworkAccessPolicyResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Initiate a JIT access from a specific Just-in-Time policy configuration. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}/{jitNetworkAccessPolicyInitiateType} - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_Initiate - /// - /// - /// - /// The JitNetworkAccessPolicyInitiateContent to use. - /// The cancellation token to use. - /// is null. - public virtual async Task> InitiateAsync(JitNetworkAccessPolicyInitiateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _jitNetworkAccessPolicyClientDiagnostics.CreateScope("JitNetworkAccessPolicyResource.Initiate"); - scope.Start(); - try - { - var response = await _jitNetworkAccessPolicyRestClient.InitiateAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, content, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Initiate a JIT access from a specific Just-in-Time policy configuration. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}/{jitNetworkAccessPolicyInitiateType} - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_Initiate - /// - /// - /// - /// The JitNetworkAccessPolicyInitiateContent to use. - /// The cancellation token to use. - /// is null. - public virtual Response Initiate(JitNetworkAccessPolicyInitiateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _jitNetworkAccessPolicyClientDiagnostics.CreateScope("JitNetworkAccessPolicyResource.Initiate"); - scope.Start(); - try - { - var response = _jitNetworkAccessPolicyRestClient.Initiate(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, content, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/LongRunningOperation/ExecuteRuleStatusOperationSource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/LongRunningOperation/ExecuteRuleStatusOperationSource.cs deleted file mode 100644 index 4ce25d93d83d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/LongRunningOperation/ExecuteRuleStatusOperationSource.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal class ExecuteRuleStatusOperationSource : IOperationSource - { - ExecuteRuleStatus IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return ExecuteRuleStatus.DeserializeExecuteRuleStatus(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return ExecuteRuleStatus.DeserializeExecuteRuleStatus(document.RootElement); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AadConnectivityStateType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AadConnectivityStateType.cs deleted file mode 100644 index 75ffcf7a6fe7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AadConnectivityStateType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The connectivity state of the external AAD solution. - public readonly partial struct AadConnectivityStateType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AadConnectivityStateType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DiscoveredValue = "Discovered"; - private const string NotLicensedValue = "NotLicensed"; - private const string ConnectedValue = "Connected"; - - /// Discovered. - public static AadConnectivityStateType Discovered { get; } = new AadConnectivityStateType(DiscoveredValue); - /// NotLicensed. - public static AadConnectivityStateType NotLicensed { get; } = new AadConnectivityStateType(NotLicensedValue); - /// Connected. - public static AadConnectivityStateType Connected { get; } = new AadConnectivityStateType(ConnectedValue); - /// Determines if two values are the same. - public static bool operator ==(AadConnectivityStateType left, AadConnectivityStateType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AadConnectivityStateType left, AadConnectivityStateType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AadConnectivityStateType(string value) => new AadConnectivityStateType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AadConnectivityStateType other && Equals(other); - /// - public bool Equals(AadConnectivityStateType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AadExternalSecuritySolution.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AadExternalSecuritySolution.Serialization.cs deleted file mode 100644 index 4bf0c0789fd2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AadExternalSecuritySolution.Serialization.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AadExternalSecuritySolution : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties); - } - if (Kind != null) - { - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.Value.ToString()); - } - else - { - writer.WriteNull("kind"); - } - writer.WriteEndObject(); - } - - internal static AadExternalSecuritySolution DeserializeAadExternalSecuritySolution(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional properties = default; - ExternalSecuritySolutionKind? kind = default; - Optional location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - properties = AadSolutionProperties.DeserializeAadSolutionProperties(property.Value); - continue; - } - if (property.NameEquals("kind"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - kind = null; - continue; - } - kind = new ExternalSecuritySolutionKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - } - return new AadExternalSecuritySolution(id, name, type, systemData.Value, kind, Optional.ToNullable(location), properties.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AadExternalSecuritySolution.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AadExternalSecuritySolution.cs deleted file mode 100644 index 351ad2a91922..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AadExternalSecuritySolution.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Represents an AAD identity protection solution which sends logs to an OMS workspace. - public partial class AadExternalSecuritySolution : ExternalSecuritySolution - { - /// Initializes a new instance of AadExternalSecuritySolution. - public AadExternalSecuritySolution() - { - Kind = ExternalSecuritySolutionKind.Aad; - } - - /// Initializes a new instance of AadExternalSecuritySolution. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The kind of the external solution. - /// Location where the resource is stored. - /// The external security solution properties for AAD solutions. - internal AadExternalSecuritySolution(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ExternalSecuritySolutionKind? kind, AzureLocation? location, AadSolutionProperties properties) : base(id, name, resourceType, systemData, kind, location) - { - Properties = properties; - Kind = kind; - } - - /// The external security solution properties for AAD solutions. - public AadSolutionProperties Properties { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AadSolutionProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AadSolutionProperties.Serialization.cs deleted file mode 100644 index 23db4ec02e8c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AadSolutionProperties.Serialization.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AadSolutionProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ConnectivityState)) - { - writer.WritePropertyName("connectivityState"u8); - writer.WriteStringValue(ConnectivityState.Value.ToString()); - } - if (Optional.IsDefined(DeviceVendor)) - { - writer.WritePropertyName("deviceVendor"u8); - writer.WriteStringValue(DeviceVendor); - } - if (Optional.IsDefined(DeviceType)) - { - writer.WritePropertyName("deviceType"u8); - writer.WriteStringValue(DeviceType); - } - if (Optional.IsDefined(Workspace)) - { - writer.WritePropertyName("workspace"u8); - JsonSerializer.Serialize(writer, Workspace); - } - foreach (var item in AdditionalProperties) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - - internal static AadSolutionProperties DeserializeAadSolutionProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional connectivityState = default; - Optional deviceVendor = default; - Optional deviceType = default; - Optional workspace = default; - IDictionary additionalProperties = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("connectivityState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - connectivityState = new AadConnectivityStateType(property.Value.GetString()); - continue; - } - if (property.NameEquals("deviceVendor"u8)) - { - deviceVendor = property.Value.GetString(); - continue; - } - if (property.NameEquals("deviceType"u8)) - { - deviceType = property.Value.GetString(); - continue; - } - if (property.NameEquals("workspace"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - workspace = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - additionalProperties = additionalPropertiesDictionary; - return new AadSolutionProperties(deviceVendor.Value, deviceType.Value, workspace, additionalProperties, Optional.ToNullable(connectivityState)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AadSolutionProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AadSolutionProperties.cs deleted file mode 100644 index 1aeaaa056910..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AadSolutionProperties.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The external security solution properties for AAD solutions. - public partial class AadSolutionProperties : ExternalSecuritySolutionProperties - { - /// Initializes a new instance of AadSolutionProperties. - public AadSolutionProperties() - { - } - - /// Initializes a new instance of AadSolutionProperties. - /// - /// - /// Represents an OMS workspace to which the solution is connected. - /// Additional Properties. - /// The connectivity state of the external AAD solution. - internal AadSolutionProperties(string deviceVendor, string deviceType, WritableSubResource workspace, IDictionary additionalProperties, AadConnectivityStateType? connectivityState) : base(deviceVendor, deviceType, workspace, additionalProperties) - { - ConnectivityState = connectivityState; - } - - /// The connectivity state of the external AAD solution. - public AadConnectivityStateType? ConnectivityState { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ActionType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ActionType.cs deleted file mode 100644 index dd3eeea12e20..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ActionType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The type of the action that will be triggered by the Automation. - internal readonly partial struct ActionType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ActionType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string LogicAppValue = "LogicApp"; - private const string EventHubValue = "EventHub"; - private const string WorkspaceValue = "Workspace"; - - /// LogicApp. - public static ActionType LogicApp { get; } = new ActionType(LogicAppValue); - /// EventHub. - public static ActionType EventHub { get; } = new ActionType(EventHubValue); - /// Workspace. - public static ActionType Workspace { get; } = new ActionType(WorkspaceValue); - /// Determines if two values are the same. - public static bool operator ==(ActionType left, ActionType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ActionType left, ActionType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ActionType(string value) => new ActionType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ActionType other && Equals(other); - /// - public bool Equals(ActionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ActiveConnectionsNotInAllowedRange.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ActiveConnectionsNotInAllowedRange.Serialization.cs deleted file mode 100644 index 2727cb8eebba..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ActiveConnectionsNotInAllowedRange.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class ActiveConnectionsNotInAllowedRange : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("timeWindowSize"u8); - writer.WriteStringValue(TimeWindowSize, "P"); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static ActiveConnectionsNotInAllowedRange DeserializeActiveConnectionsNotInAllowedRange(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - TimeSpan timeWindowSize = default; - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeWindowSize"u8)) - { - timeWindowSize = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new ActiveConnectionsNotInAllowedRange(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ActiveConnectionsNotInAllowedRange.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ActiveConnectionsNotInAllowedRange.cs deleted file mode 100644 index 8334553cac86..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ActiveConnectionsNotInAllowedRange.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Number of active connections is not in allowed range. - public partial class ActiveConnectionsNotInAllowedRange : TimeWindowCustomAlertRule - { - /// Initializes a new instance of ActiveConnectionsNotInAllowedRange. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - public ActiveConnectionsNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(isEnabled, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = "ActiveConnectionsNotInAllowedRange"; - } - - /// Initializes a new instance of ActiveConnectionsNotInAllowedRange. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - internal ActiveConnectionsNotInAllowedRange(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(displayName, description, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = ruleType ?? "ActiveConnectionsNotInAllowedRange"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlEnforcementMode.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlEnforcementMode.cs deleted file mode 100644 index fd9c07dca796..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlEnforcementMode.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The application control policy enforcement/protection mode of the machine group. - public readonly partial struct AdaptiveApplicationControlEnforcementMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AdaptiveApplicationControlEnforcementMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AuditValue = "Audit"; - private const string EnforceValue = "Enforce"; - private const string NoneValue = "None"; - - /// Audit. - public static AdaptiveApplicationControlEnforcementMode Audit { get; } = new AdaptiveApplicationControlEnforcementMode(AuditValue); - /// Enforce. - public static AdaptiveApplicationControlEnforcementMode Enforce { get; } = new AdaptiveApplicationControlEnforcementMode(EnforceValue); - /// None. - public static AdaptiveApplicationControlEnforcementMode None { get; } = new AdaptiveApplicationControlEnforcementMode(NoneValue); - /// Determines if two values are the same. - public static bool operator ==(AdaptiveApplicationControlEnforcementMode left, AdaptiveApplicationControlEnforcementMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AdaptiveApplicationControlEnforcementMode left, AdaptiveApplicationControlEnforcementMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AdaptiveApplicationControlEnforcementMode(string value) => new AdaptiveApplicationControlEnforcementMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AdaptiveApplicationControlEnforcementMode other && Equals(other); - /// - public bool Equals(AdaptiveApplicationControlEnforcementMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlGroupData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlGroupData.Serialization.cs deleted file mode 100644 index e4eba4355feb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlGroupData.Serialization.cs +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class AdaptiveApplicationControlGroupData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(EnforcementMode)) - { - writer.WritePropertyName("enforcementMode"u8); - writer.WriteStringValue(EnforcementMode.Value.ToString()); - } - if (Optional.IsDefined(ProtectionMode)) - { - writer.WritePropertyName("protectionMode"u8); - writer.WriteObjectValue(ProtectionMode); - } - if (Optional.IsCollectionDefined(VmRecommendations)) - { - writer.WritePropertyName("vmRecommendations"u8); - writer.WriteStartArray(); - foreach (var item in VmRecommendations) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(PathRecommendations)) - { - writer.WritePropertyName("pathRecommendations"u8); - writer.WriteStartArray(); - foreach (var item in PathRecommendations) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AdaptiveApplicationControlGroupData DeserializeAdaptiveApplicationControlGroupData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional enforcementMode = default; - Optional protectionMode = default; - Optional configurationStatus = default; - Optional recommendationStatus = default; - Optional> issues = default; - Optional sourceSystem = default; - Optional> vmRecommendations = default; - Optional> pathRecommendations = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("enforcementMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enforcementMode = new AdaptiveApplicationControlEnforcementMode(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("protectionMode"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - protectionMode = SecurityCenterFileProtectionMode.DeserializeSecurityCenterFileProtectionMode(property0.Value); - continue; - } - if (property0.NameEquals("configurationStatus"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - configurationStatus = new SecurityCenterConfigurationStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("recommendationStatus"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - recommendationStatus = new RecommendationStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("issues"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(AdaptiveApplicationControlIssueSummary.DeserializeAdaptiveApplicationControlIssueSummary(item)); - } - issues = array; - continue; - } - if (property0.NameEquals("sourceSystem"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - sourceSystem = new AdaptiveApplicationControlGroupSourceSystem(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("vmRecommendations"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(VmRecommendation.DeserializeVmRecommendation(item)); - } - vmRecommendations = array; - continue; - } - if (property0.NameEquals("pathRecommendations"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(PathRecommendation.DeserializePathRecommendation(item)); - } - pathRecommendations = array; - continue; - } - } - continue; - } - } - return new AdaptiveApplicationControlGroupData(id, name, type, systemData.Value, Optional.ToNullable(enforcementMode), protectionMode.Value, Optional.ToNullable(configurationStatus), Optional.ToNullable(recommendationStatus), Optional.ToList(issues), Optional.ToNullable(sourceSystem), Optional.ToList(vmRecommendations), Optional.ToList(pathRecommendations), Optional.ToNullable(location)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlGroupSourceSystem.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlGroupSourceSystem.cs deleted file mode 100644 index dc1c894a1ca4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlGroupSourceSystem.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The source type of the machine group. - public readonly partial struct AdaptiveApplicationControlGroupSourceSystem : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AdaptiveApplicationControlGroupSourceSystem(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureAppLockerValue = "Azure_AppLocker"; - private const string AzureAuditDValue = "Azure_AuditD"; - private const string NonAzureAppLockerValue = "NonAzure_AppLocker"; - private const string NonAzureAuditDValue = "NonAzure_AuditD"; - private const string NoneValue = "None"; - - /// Azure_AppLocker. - public static AdaptiveApplicationControlGroupSourceSystem AzureAppLocker { get; } = new AdaptiveApplicationControlGroupSourceSystem(AzureAppLockerValue); - /// Azure_AuditD. - public static AdaptiveApplicationControlGroupSourceSystem AzureAuditD { get; } = new AdaptiveApplicationControlGroupSourceSystem(AzureAuditDValue); - /// NonAzure_AppLocker. - public static AdaptiveApplicationControlGroupSourceSystem NonAzureAppLocker { get; } = new AdaptiveApplicationControlGroupSourceSystem(NonAzureAppLockerValue); - /// NonAzure_AuditD. - public static AdaptiveApplicationControlGroupSourceSystem NonAzureAuditD { get; } = new AdaptiveApplicationControlGroupSourceSystem(NonAzureAuditDValue); - /// None. - public static AdaptiveApplicationControlGroupSourceSystem None { get; } = new AdaptiveApplicationControlGroupSourceSystem(NoneValue); - /// Determines if two values are the same. - public static bool operator ==(AdaptiveApplicationControlGroupSourceSystem left, AdaptiveApplicationControlGroupSourceSystem right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AdaptiveApplicationControlGroupSourceSystem left, AdaptiveApplicationControlGroupSourceSystem right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AdaptiveApplicationControlGroupSourceSystem(string value) => new AdaptiveApplicationControlGroupSourceSystem(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AdaptiveApplicationControlGroupSourceSystem other && Equals(other); - /// - public bool Equals(AdaptiveApplicationControlGroupSourceSystem other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlGroups.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlGroups.Serialization.cs deleted file mode 100644 index e6b7072a8bc1..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlGroups.Serialization.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class AdaptiveApplicationControlGroups - { - internal static AdaptiveApplicationControlGroups DeserializeAdaptiveApplicationControlGroups(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AdaptiveApplicationControlGroupData.DeserializeAdaptiveApplicationControlGroupData(item)); - } - value = array; - continue; - } - } - return new AdaptiveApplicationControlGroups(Optional.ToList(value)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlGroups.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlGroups.cs deleted file mode 100644 index 2d8a4c65f269..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlGroups.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Represents a list of VM/server groups and set of rules that are Recommended by Microsoft Defender for Cloud to be allowed. - internal partial class AdaptiveApplicationControlGroups - { - /// Initializes a new instance of AdaptiveApplicationControlGroups. - internal AdaptiveApplicationControlGroups() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of AdaptiveApplicationControlGroups. - /// - internal AdaptiveApplicationControlGroups(IReadOnlyList value) - { - Value = value; - } - - /// Gets the value. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlIssue.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlIssue.cs deleted file mode 100644 index d598b1e6aba8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlIssue.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// An alert that machines within a group can have. - public readonly partial struct AdaptiveApplicationControlIssue : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AdaptiveApplicationControlIssue(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ViolationsAuditedValue = "ViolationsAudited"; - private const string ViolationsBlockedValue = "ViolationsBlocked"; - private const string MsiAndScriptViolationsAuditedValue = "MsiAndScriptViolationsAudited"; - private const string MsiAndScriptViolationsBlockedValue = "MsiAndScriptViolationsBlocked"; - private const string ExecutableViolationsAuditedValue = "ExecutableViolationsAudited"; - private const string RulesViolatedManuallyValue = "RulesViolatedManually"; - - /// ViolationsAudited. - public static AdaptiveApplicationControlIssue ViolationsAudited { get; } = new AdaptiveApplicationControlIssue(ViolationsAuditedValue); - /// ViolationsBlocked. - public static AdaptiveApplicationControlIssue ViolationsBlocked { get; } = new AdaptiveApplicationControlIssue(ViolationsBlockedValue); - /// MsiAndScriptViolationsAudited. - public static AdaptiveApplicationControlIssue MsiAndScriptViolationsAudited { get; } = new AdaptiveApplicationControlIssue(MsiAndScriptViolationsAuditedValue); - /// MsiAndScriptViolationsBlocked. - public static AdaptiveApplicationControlIssue MsiAndScriptViolationsBlocked { get; } = new AdaptiveApplicationControlIssue(MsiAndScriptViolationsBlockedValue); - /// ExecutableViolationsAudited. - public static AdaptiveApplicationControlIssue ExecutableViolationsAudited { get; } = new AdaptiveApplicationControlIssue(ExecutableViolationsAuditedValue); - /// RulesViolatedManually. - public static AdaptiveApplicationControlIssue RulesViolatedManually { get; } = new AdaptiveApplicationControlIssue(RulesViolatedManuallyValue); - /// Determines if two values are the same. - public static bool operator ==(AdaptiveApplicationControlIssue left, AdaptiveApplicationControlIssue right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AdaptiveApplicationControlIssue left, AdaptiveApplicationControlIssue right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AdaptiveApplicationControlIssue(string value) => new AdaptiveApplicationControlIssue(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AdaptiveApplicationControlIssue other && Equals(other); - /// - public bool Equals(AdaptiveApplicationControlIssue other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlIssueSummary.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlIssueSummary.Serialization.cs deleted file mode 100644 index e592a0697985..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlIssueSummary.Serialization.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AdaptiveApplicationControlIssueSummary - { - internal static AdaptiveApplicationControlIssueSummary DeserializeAdaptiveApplicationControlIssueSummary(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional issue = default; - Optional numberOfVms = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("issue"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - issue = new AdaptiveApplicationControlIssue(property.Value.GetString()); - continue; - } - if (property.NameEquals("numberOfVms"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - numberOfVms = property.Value.GetSingle(); - continue; - } - } - return new AdaptiveApplicationControlIssueSummary(Optional.ToNullable(issue), Optional.ToNullable(numberOfVms)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlIssueSummary.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlIssueSummary.cs deleted file mode 100644 index f06fbb91f923..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveApplicationControlIssueSummary.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Represents a summary of the alerts of the machine group. - public partial class AdaptiveApplicationControlIssueSummary - { - /// Initializes a new instance of AdaptiveApplicationControlIssueSummary. - internal AdaptiveApplicationControlIssueSummary() - { - } - - /// Initializes a new instance of AdaptiveApplicationControlIssueSummary. - /// An alert that machines within a group can have. - /// The number of machines in the group that have this alert. - internal AdaptiveApplicationControlIssueSummary(AdaptiveApplicationControlIssue? issue, float? numberOfVms) - { - Issue = issue; - NumberOfVms = numberOfVms; - } - - /// An alert that machines within a group can have. - public AdaptiveApplicationControlIssue? Issue { get; } - /// The number of machines in the group that have this alert. - public float? NumberOfVms { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningData.Serialization.cs deleted file mode 100644 index 567576db1051..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningData.Serialization.cs +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class AdaptiveNetworkHardeningData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Rules)) - { - writer.WritePropertyName("rules"u8); - writer.WriteStartArray(); - foreach (var item in Rules) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(RulesCalculatedOn)) - { - writer.WritePropertyName("rulesCalculationTime"u8); - writer.WriteStringValue(RulesCalculatedOn.Value, "O"); - } - if (Optional.IsCollectionDefined(EffectiveNetworkSecurityGroups)) - { - writer.WritePropertyName("effectiveNetworkSecurityGroups"u8); - writer.WriteStartArray(); - foreach (var item in EffectiveNetworkSecurityGroups) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AdaptiveNetworkHardeningData DeserializeAdaptiveNetworkHardeningData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional> rules = default; - Optional rulesCalculationTime = default; - Optional> effectiveNetworkSecurityGroups = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("rules"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(RecommendedSecurityRule.DeserializeRecommendedSecurityRule(item)); - } - rules = array; - continue; - } - if (property0.NameEquals("rulesCalculationTime"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - rulesCalculationTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("effectiveNetworkSecurityGroups"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(Models.EffectiveNetworkSecurityGroups.DeserializeEffectiveNetworkSecurityGroups(item)); - } - effectiveNetworkSecurityGroups = array; - continue; - } - } - continue; - } - } - return new AdaptiveNetworkHardeningData(id, name, type, systemData.Value, Optional.ToList(rules), Optional.ToNullable(rulesCalculationTime), Optional.ToList(effectiveNetworkSecurityGroups)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningEnforceContent.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningEnforceContent.Serialization.cs deleted file mode 100644 index c8a522f839e0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningEnforceContent.Serialization.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AdaptiveNetworkHardeningEnforceContent : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("rules"u8); - writer.WriteStartArray(); - foreach (var item in Rules) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - writer.WritePropertyName("networkSecurityGroups"u8); - writer.WriteStartArray(); - foreach (var item in NetworkSecurityGroups) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - writer.WriteEndObject(); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningEnforceContent.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningEnforceContent.cs deleted file mode 100644 index 693b0bef93a6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningEnforceContent.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The AdaptiveNetworkHardeningEnforceContent. - public partial class AdaptiveNetworkHardeningEnforceContent - { - /// Initializes a new instance of AdaptiveNetworkHardeningEnforceContent. - /// 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. - /// or is null. - public AdaptiveNetworkHardeningEnforceContent(IEnumerable rules, IEnumerable networkSecurityGroups) - { - Argument.AssertNotNull(rules, nameof(rules)); - Argument.AssertNotNull(networkSecurityGroups, nameof(networkSecurityGroups)); - - Rules = rules.ToList(); - NetworkSecurityGroups = networkSecurityGroups.ToList(); - } - - /// The rules to enforce. - public IList Rules { get; } - /// 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 IList NetworkSecurityGroups { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningsList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningsList.Serialization.cs deleted file mode 100644 index e99a7e475df4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningsList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class AdaptiveNetworkHardeningsList - { - internal static AdaptiveNetworkHardeningsList DeserializeAdaptiveNetworkHardeningsList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AdaptiveNetworkHardeningData.DeserializeAdaptiveNetworkHardeningData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new AdaptiveNetworkHardeningsList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningsList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningsList.cs deleted file mode 100644 index 9ae0b2f3248a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdaptiveNetworkHardeningsList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Response for ListAdaptiveNetworkHardenings API service call. - internal partial class AdaptiveNetworkHardeningsList - { - /// Initializes a new instance of AdaptiveNetworkHardeningsList. - internal AdaptiveNetworkHardeningsList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of AdaptiveNetworkHardeningsList. - /// A list of Adaptive Network Hardenings resources. - /// The URL to get the next set of results. - internal AdaptiveNetworkHardeningsList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// A list of Adaptive Network Hardenings resources. - public IReadOnlyList Value { get; } - /// The URL to get the next set of results. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdditionalWorkspaceDataType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdditionalWorkspaceDataType.cs deleted file mode 100644 index 6958e041520e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdditionalWorkspaceDataType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Data types sent to workspace. - public readonly partial struct AdditionalWorkspaceDataType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AdditionalWorkspaceDataType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AlertsValue = "Alerts"; - private const string RawEventsValue = "RawEvents"; - - /// Alerts. - public static AdditionalWorkspaceDataType Alerts { get; } = new AdditionalWorkspaceDataType(AlertsValue); - /// RawEvents. - public static AdditionalWorkspaceDataType RawEvents { get; } = new AdditionalWorkspaceDataType(RawEventsValue); - /// Determines if two values are the same. - public static bool operator ==(AdditionalWorkspaceDataType left, AdditionalWorkspaceDataType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AdditionalWorkspaceDataType left, AdditionalWorkspaceDataType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AdditionalWorkspaceDataType(string value) => new AdditionalWorkspaceDataType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AdditionalWorkspaceDataType other && Equals(other); - /// - public bool Equals(AdditionalWorkspaceDataType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdditionalWorkspaceType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdditionalWorkspaceType.cs deleted file mode 100644 index f6ef6c25a42a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdditionalWorkspaceType.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Workspace type. - public readonly partial struct AdditionalWorkspaceType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AdditionalWorkspaceType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SentinelValue = "Sentinel"; - - /// Sentinel. - public static AdditionalWorkspaceType Sentinel { get; } = new AdditionalWorkspaceType(SentinelValue); - /// Determines if two values are the same. - public static bool operator ==(AdditionalWorkspaceType left, AdditionalWorkspaceType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AdditionalWorkspaceType left, AdditionalWorkspaceType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AdditionalWorkspaceType(string value) => new AdditionalWorkspaceType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AdditionalWorkspaceType other && Equals(other); - /// - public bool Equals(AdditionalWorkspaceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdditionalWorkspacesProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdditionalWorkspacesProperties.Serialization.cs deleted file mode 100644 index 32d5e1b0d0c7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdditionalWorkspacesProperties.Serialization.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AdditionalWorkspacesProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Workspace)) - { - writer.WritePropertyName("workspace"u8); - writer.WriteStringValue(Workspace); - } - if (Optional.IsDefined(WorkspaceType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(WorkspaceType.Value.ToString()); - } - if (Optional.IsCollectionDefined(DataTypes)) - { - writer.WritePropertyName("dataTypes"u8); - writer.WriteStartArray(); - foreach (var item in DataTypes) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static AdditionalWorkspacesProperties DeserializeAdditionalWorkspacesProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional workspace = default; - Optional type = default; - Optional> dataTypes = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("workspace"u8)) - { - workspace = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = new AdditionalWorkspaceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("dataTypes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(new AdditionalWorkspaceDataType(item.GetString())); - } - dataTypes = array; - continue; - } - } - return new AdditionalWorkspacesProperties(workspace.Value, Optional.ToNullable(type), Optional.ToList(dataTypes)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdditionalWorkspacesProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdditionalWorkspacesProperties.cs deleted file mode 100644 index 222ac62f159a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdditionalWorkspacesProperties.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Properties of the additional workspaces. - public partial class AdditionalWorkspacesProperties - { - /// Initializes a new instance of AdditionalWorkspacesProperties. - public AdditionalWorkspacesProperties() - { - DataTypes = new ChangeTrackingList(); - } - - /// Initializes a new instance of AdditionalWorkspacesProperties. - /// Workspace resource id. - /// Workspace type. - /// List of data types sent to workspace. - internal AdditionalWorkspacesProperties(string workspace, AdditionalWorkspaceType? workspaceType, IList dataTypes) - { - Workspace = workspace; - WorkspaceType = workspaceType; - DataTypes = dataTypes; - } - - /// Workspace resource id. - public string Workspace { get; set; } - /// Workspace type. - public AdditionalWorkspaceType? WorkspaceType { get; set; } - /// List of data types sent to workspace. - public IList DataTypes { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdvancedThreatProtectionSettingData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdvancedThreatProtectionSettingData.Serialization.cs deleted file mode 100644 index 1813eba3971e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AdvancedThreatProtectionSettingData.Serialization.cs +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class AdvancedThreatProtectionSettingData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AdvancedThreatProtectionSettingData DeserializeAdvancedThreatProtectionSettingData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional isEnabled = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("isEnabled"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isEnabled = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new AdvancedThreatProtectionSettingData(id, name, type, systemData.Value, Optional.ToNullable(isEnabled)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AlertList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AlertList.Serialization.cs deleted file mode 100644 index dbbc8a09aab5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AlertList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class AlertList - { - internal static AlertList DeserializeAlertList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityAlertData.DeserializeSecurityAlertData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new AlertList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AlertList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AlertList.cs deleted file mode 100644 index de36fbddf15a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AlertList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of security alerts. - internal partial class AlertList - { - /// Initializes a new instance of AlertList. - internal AlertList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of AlertList. - /// describes security alert properties. - /// The URI to fetch the next page. - internal AlertList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// describes security alert properties. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AlertsSuppressionRulesList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AlertsSuppressionRulesList.Serialization.cs deleted file mode 100644 index 6c9cb42cdb15..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AlertsSuppressionRulesList.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class AlertsSuppressionRulesList - { - internal static AlertsSuppressionRulesList DeserializeAlertsSuppressionRulesList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityAlertsSuppressionRuleData.DeserializeSecurityAlertsSuppressionRuleData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new AlertsSuppressionRulesList(value, nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AlertsSuppressionRulesList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AlertsSuppressionRulesList.cs deleted file mode 100644 index 4271743ed55b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AlertsSuppressionRulesList.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Suppression rules list for subscription. - internal partial class AlertsSuppressionRulesList - { - /// Initializes a new instance of AlertsSuppressionRulesList. - /// - /// is null. - internal AlertsSuppressionRulesList(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of AlertsSuppressionRulesList. - /// - /// URI to fetch the next page. - internal AlertsSuppressionRulesList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Gets the value. - public IReadOnlyList Value { get; } - /// URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AllowedConnectionsList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AllowedConnectionsList.Serialization.cs deleted file mode 100644 index 28b5912da15f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AllowedConnectionsList.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class AllowedConnectionsList - { - internal static AllowedConnectionsList DeserializeAllowedConnectionsList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityCenterAllowedConnection.DeserializeSecurityCenterAllowedConnection(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new AllowedConnectionsList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AllowedConnectionsList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AllowedConnectionsList.cs deleted file mode 100644 index 38b0bd6c81d5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AllowedConnectionsList.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of all possible traffic between Azure resources. - internal partial class AllowedConnectionsList - { - /// Initializes a new instance of AllowedConnectionsList. - internal AllowedConnectionsList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of AllowedConnectionsList. - /// - /// The URI to fetch the next page. - internal AllowedConnectionsList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Gets the value. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AllowlistCustomAlertRule.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AllowlistCustomAlertRule.Serialization.cs deleted file mode 100644 index 40427c888e51..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AllowlistCustomAlertRule.Serialization.cs +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AllowlistCustomAlertRule : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("allowlistValues"u8); - writer.WriteStartArray(); - foreach (var item in AllowlistValues) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static AllowlistCustomAlertRule DeserializeAllowlistCustomAlertRule(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("ruleType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "ConnectionFromIpNotAllowed": return ConnectionFromIPNotAllowed.DeserializeConnectionFromIPNotAllowed(element); - case "ConnectionToIpNotAllowed": return ConnectionToIPNotAllowed.DeserializeConnectionToIPNotAllowed(element); - case "LocalUserNotAllowed": return LocalUserNotAllowed.DeserializeLocalUserNotAllowed(element); - case "ProcessNotAllowed": return ProcessNotAllowed.DeserializeProcessNotAllowed(element); - } - } - IList allowlistValues = default; - Optional valueType = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = "AllowlistCustomAlertRule"; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("allowlistValues"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowlistValues = array; - continue; - } - if (property.NameEquals("valueType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - valueType = new SecurityValueType(property.Value.GetString()); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new AllowlistCustomAlertRule(displayName.Value, description.Value, isEnabled, ruleType, Optional.ToNullable(valueType), allowlistValues); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AllowlistCustomAlertRule.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AllowlistCustomAlertRule.cs deleted file mode 100644 index 9ceef2765811..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AllowlistCustomAlertRule.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// - /// A custom alert rule that checks if a value (depends on the custom alert type) is allowed. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . - /// - public partial class AllowlistCustomAlertRule : ListCustomAlertRule - { - /// Initializes a new instance of AllowlistCustomAlertRule. - /// Status of the custom alert. - /// The values to allow. The format of the values depends on the rule type. - /// is null. - public AllowlistCustomAlertRule(bool isEnabled, IEnumerable allowlistValues) : base(isEnabled) - { - Argument.AssertNotNull(allowlistValues, nameof(allowlistValues)); - - AllowlistValues = allowlistValues.ToList(); - RuleType = "AllowlistCustomAlertRule"; - } - - /// Initializes a new instance of AllowlistCustomAlertRule. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The value type of the items in the list. - /// The values to allow. The format of the values depends on the rule type. - internal AllowlistCustomAlertRule(string displayName, string description, bool isEnabled, string ruleType, SecurityValueType? valueType, IList allowlistValues) : base(displayName, description, isEnabled, ruleType, valueType) - { - AllowlistValues = allowlistValues; - RuleType = ruleType ?? "AllowlistCustomAlertRule"; - } - - /// The values to allow. The format of the values depends on the rule type. - public IList AllowlistValues { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpC2DMessagesNotInAllowedRange.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpC2DMessagesNotInAllowedRange.Serialization.cs deleted file mode 100644 index a73f5eeb6af3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpC2DMessagesNotInAllowedRange.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AmqpC2DMessagesNotInAllowedRange : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("timeWindowSize"u8); - writer.WriteStringValue(TimeWindowSize, "P"); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static AmqpC2DMessagesNotInAllowedRange DeserializeAmqpC2DMessagesNotInAllowedRange(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - TimeSpan timeWindowSize = default; - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeWindowSize"u8)) - { - timeWindowSize = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new AmqpC2DMessagesNotInAllowedRange(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpC2DMessagesNotInAllowedRange.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpC2DMessagesNotInAllowedRange.cs deleted file mode 100644 index 38af4e809244..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpC2DMessagesNotInAllowedRange.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Number of cloud to device messages (AMQP protocol) is not in allowed range. - public partial class AmqpC2DMessagesNotInAllowedRange : TimeWindowCustomAlertRule - { - /// Initializes a new instance of AmqpC2DMessagesNotInAllowedRange. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - public AmqpC2DMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(isEnabled, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = "AmqpC2DMessagesNotInAllowedRange"; - } - - /// Initializes a new instance of AmqpC2DMessagesNotInAllowedRange. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - internal AmqpC2DMessagesNotInAllowedRange(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(displayName, description, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = ruleType ?? "AmqpC2DMessagesNotInAllowedRange"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpC2DRejectedMessagesNotInAllowedRange.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpC2DRejectedMessagesNotInAllowedRange.Serialization.cs deleted file mode 100644 index d89283f85fd8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpC2DRejectedMessagesNotInAllowedRange.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AmqpC2DRejectedMessagesNotInAllowedRange : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("timeWindowSize"u8); - writer.WriteStringValue(TimeWindowSize, "P"); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static AmqpC2DRejectedMessagesNotInAllowedRange DeserializeAmqpC2DRejectedMessagesNotInAllowedRange(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - TimeSpan timeWindowSize = default; - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeWindowSize"u8)) - { - timeWindowSize = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new AmqpC2DRejectedMessagesNotInAllowedRange(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpC2DRejectedMessagesNotInAllowedRange.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpC2DRejectedMessagesNotInAllowedRange.cs deleted file mode 100644 index f99b5511fcb9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpC2DRejectedMessagesNotInAllowedRange.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Number of rejected cloud to device messages (AMQP protocol) is not in allowed range. - public partial class AmqpC2DRejectedMessagesNotInAllowedRange : TimeWindowCustomAlertRule - { - /// Initializes a new instance of AmqpC2DRejectedMessagesNotInAllowedRange. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - public AmqpC2DRejectedMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(isEnabled, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = "AmqpC2DRejectedMessagesNotInAllowedRange"; - } - - /// Initializes a new instance of AmqpC2DRejectedMessagesNotInAllowedRange. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - internal AmqpC2DRejectedMessagesNotInAllowedRange(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(displayName, description, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = ruleType ?? "AmqpC2DRejectedMessagesNotInAllowedRange"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpD2CMessagesNotInAllowedRange.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpD2CMessagesNotInAllowedRange.Serialization.cs deleted file mode 100644 index 6ebf87a6a2c0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpD2CMessagesNotInAllowedRange.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AmqpD2CMessagesNotInAllowedRange : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("timeWindowSize"u8); - writer.WriteStringValue(TimeWindowSize, "P"); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static AmqpD2CMessagesNotInAllowedRange DeserializeAmqpD2CMessagesNotInAllowedRange(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - TimeSpan timeWindowSize = default; - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeWindowSize"u8)) - { - timeWindowSize = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new AmqpD2CMessagesNotInAllowedRange(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpD2CMessagesNotInAllowedRange.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpD2CMessagesNotInAllowedRange.cs deleted file mode 100644 index ebccd2b94a98..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AmqpD2CMessagesNotInAllowedRange.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Number of device to cloud messages (AMQP protocol) is not in allowed range. - public partial class AmqpD2CMessagesNotInAllowedRange : TimeWindowCustomAlertRule - { - /// Initializes a new instance of AmqpD2CMessagesNotInAllowedRange. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - public AmqpD2CMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(isEnabled, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = "AmqpD2CMessagesNotInAllowedRange"; - } - - /// Initializes a new instance of AmqpD2CMessagesNotInAllowedRange. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - internal AmqpD2CMessagesNotInAllowedRange(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(displayName, description, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = ruleType ?? "AmqpD2CMessagesNotInAllowedRange"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ApplicationSourceResourceType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ApplicationSourceResourceType.cs deleted file mode 100644 index 22b3b224e181..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ApplicationSourceResourceType.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The application source, what it affects, e.g. Assessments. - public readonly partial struct ApplicationSourceResourceType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ApplicationSourceResourceType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AssessmentsValue = "Assessments"; - - /// The source of the application is assessments. - public static ApplicationSourceResourceType Assessments { get; } = new ApplicationSourceResourceType(AssessmentsValue); - /// Determines if two values are the same. - public static bool operator ==(ApplicationSourceResourceType left, ApplicationSourceResourceType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ApplicationSourceResourceType left, ApplicationSourceResourceType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ApplicationSourceResourceType(string value) => new ApplicationSourceResourceType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ApplicationSourceResourceType other && Equals(other); - /// - public bool Equals(ApplicationSourceResourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ApplicationsList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ApplicationsList.Serialization.cs deleted file mode 100644 index 1096f0d35c8d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ApplicationsList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class ApplicationsList - { - internal static ApplicationsList DeserializeApplicationsList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityApplicationData.DeserializeSecurityApplicationData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new ApplicationsList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ApplicationsList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ApplicationsList.cs deleted file mode 100644 index 57e3370da3d9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ApplicationsList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Page of a security applications list. - internal partial class ApplicationsList - { - /// Initializes a new instance of ApplicationsList. - internal ApplicationsList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of ApplicationsList. - /// Collection of applications in this page. - /// The URI to fetch the next page. - internal ApplicationsList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of applications in this page. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AscLocationList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AscLocationList.Serialization.cs deleted file mode 100644 index 728a1a61a4c7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AscLocationList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class AscLocationList - { - internal static AscLocationList DeserializeAscLocationList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityCenterLocationData.DeserializeSecurityCenterLocationData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new AscLocationList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AscLocationList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AscLocationList.cs deleted file mode 100644 index e7c36a07fdac..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AscLocationList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of locations where ASC saves your data. - internal partial class AscLocationList - { - /// Initializes a new instance of AscLocationList. - internal AscLocationList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of AscLocationList. - /// - /// The URI to fetch the next page. - internal AscLocationList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Gets the value. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssessedResourceType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssessedResourceType.cs deleted file mode 100644 index ef0d1f2b2614..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssessedResourceType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Sub-assessment resource type. - internal readonly partial struct AssessedResourceType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AssessedResourceType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SqlServerVulnerabilityValue = "SqlServerVulnerability"; - private const string ContainerRegistryVulnerabilityValue = "ContainerRegistryVulnerability"; - private const string ServerVulnerabilityValue = "ServerVulnerability"; - - /// SqlServerVulnerability. - public static AssessedResourceType SqlServerVulnerability { get; } = new AssessedResourceType(SqlServerVulnerabilityValue); - /// ContainerRegistryVulnerability. - public static AssessedResourceType ContainerRegistryVulnerability { get; } = new AssessedResourceType(ContainerRegistryVulnerabilityValue); - /// ServerVulnerability. - public static AssessedResourceType ServerVulnerability { get; } = new AssessedResourceType(ServerVulnerabilityValue); - /// Determines if two values are the same. - public static bool operator ==(AssessedResourceType left, AssessedResourceType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AssessedResourceType left, AssessedResourceType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AssessedResourceType(string value) => new AssessedResourceType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AssessedResourceType other && Equals(other); - /// - public bool Equals(AssessedResourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssessmentLinks.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssessmentLinks.Serialization.cs deleted file mode 100644 index 192ce58708f3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssessmentLinks.Serialization.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class AssessmentLinks - { - internal static AssessmentLinks DeserializeAssessmentLinks(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional azurePortalUri = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("azurePortalUri"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - azurePortalUri = null; - continue; - } - azurePortalUri = new Uri(property.Value.GetString()); - continue; - } - } - return new AssessmentLinks(azurePortalUri.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssessmentLinks.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssessmentLinks.cs deleted file mode 100644 index fcbb5a39b5a4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssessmentLinks.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Links relevant to the assessment. - internal partial class AssessmentLinks - { - /// Initializes a new instance of AssessmentLinks. - internal AssessmentLinks() - { - } - - /// Initializes a new instance of AssessmentLinks. - /// Link to assessment in Azure Portal. - internal AssessmentLinks(Uri azurePortalUri) - { - AzurePortalUri = azurePortalUri; - } - - /// Link to assessment in Azure Portal. - public Uri AzurePortalUri { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownResourceDetails.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignedComponentItem.Serialization.cs similarity index 56% rename from sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownResourceDetails.Serialization.cs rename to sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignedComponentItem.Serialization.cs index b3537efb4ae1..efb9791dfc62 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownResourceDetails.Serialization.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignedComponentItem.Serialization.cs @@ -10,32 +10,35 @@ namespace Azure.ResourceManager.SecurityCenter.Models { - internal partial class UnknownResourceDetails : IUtf8JsonSerializable + internal partial class AssignedComponentItem : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - writer.WritePropertyName("source"u8); - writer.WriteStringValue(Source.ToString()); + if (Optional.IsDefined(Key)) + { + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); + } writer.WriteEndObject(); } - internal static UnknownResourceDetails DeserializeUnknownResourceDetails(JsonElement element) + internal static AssignedComponentItem DeserializeAssignedComponentItem(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { return null; } - Source source = "Unknown"; + Optional key = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("source"u8)) + if (property.NameEquals("key"u8)) { - source = new Source(property.Value.GetString()); + key = property.Value.GetString(); continue; } } - return new UnknownResourceDetails(source); + return new AssignedComponentItem(key.Value); } } } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignedComponentItem.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignedComponentItem.cs new file mode 100644 index 000000000000..3cafb726c1ce --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignedComponentItem.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.SecurityCenter.Models +{ + /// describe the properties of a security assessment object reference (by key). + internal partial class AssignedComponentItem + { + /// Initializes a new instance of AssignedComponentItem. + public AssignedComponentItem() + { + } + + /// Initializes a new instance of AssignedComponentItem. + /// unique key to a security assessment object. + internal AssignedComponentItem(string key) + { + Key = key; + } + + /// unique key to a security assessment object. + public string Key { get; set; } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityConnectorData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignmentData.Serialization.cs similarity index 58% rename from sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityConnectorData.Serialization.cs rename to sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignmentData.Serialization.cs index 3c183f4e8de8..56a8036b3411 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityConnectorData.Serialization.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignmentData.Serialization.cs @@ -11,11 +11,12 @@ using Azure; using Azure.Core; using Azure.ResourceManager.Models; +using Azure.ResourceManager.Resources.Models; using Azure.ResourceManager.SecurityCenter.Models; namespace Azure.ResourceManager.SecurityCenter { - public partial class SecurityConnectorData : IUtf8JsonSerializable + public partial class AssignmentData : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -45,36 +46,60 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(Location); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); - if (Optional.IsDefined(HierarchyIdentifier)) + if (Optional.IsDefined(DisplayName)) { - writer.WritePropertyName("hierarchyIdentifier"u8); - writer.WriteStringValue(HierarchyIdentifier); + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); } - if (Optional.IsDefined(EnvironmentName)) + if (Optional.IsDefined(Description)) { - writer.WritePropertyName("environmentName"u8); - writer.WriteStringValue(EnvironmentName.Value.ToString()); + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); } - if (Optional.IsCollectionDefined(Offerings)) + if (Optional.IsDefined(AssignedStandard)) { - writer.WritePropertyName("offerings"u8); - writer.WriteStartArray(); - foreach (var item in Offerings) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); + writer.WritePropertyName("assignedStandard"u8); + JsonSerializer.Serialize(writer, AssignedStandard); + } + if (Optional.IsDefined(AssignedComponent)) + { + writer.WritePropertyName("assignedComponent"u8); + writer.WriteObjectValue(AssignedComponent); + } + if (Optional.IsDefined(Scope)) + { + writer.WritePropertyName("scope"u8); + writer.WriteStringValue(Scope); + } + if (Optional.IsDefined(Effect)) + { + writer.WritePropertyName("effect"u8); + writer.WriteStringValue(Effect); + } + if (Optional.IsDefined(ExpiresOn)) + { + writer.WritePropertyName("expiresOn"u8); + writer.WriteStringValue(ExpiresOn.Value, "O"); } - if (Optional.IsDefined(EnvironmentData)) + if (Optional.IsDefined(AdditionalData)) { - writer.WritePropertyName("environmentData"u8); - writer.WriteObjectValue(EnvironmentData); + writer.WritePropertyName("additionalData"u8); + writer.WriteObjectValue(AdditionalData); + } + if (Optional.IsDefined(Metadata)) + { + writer.WritePropertyName("metadata"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Metadata); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(Metadata.ToString()).RootElement); +#endif } writer.WriteEndObject(); writer.WriteEndObject(); } - internal static SecurityConnectorData DeserializeSecurityConnectorData(JsonElement element) + internal static AssignmentData DeserializeAssignmentData(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { @@ -88,11 +113,15 @@ internal static SecurityConnectorData DeserializeSecurityConnectorData(JsonEleme string name = default; ResourceType type = default; Optional systemData = default; - Optional hierarchyIdentifier = default; - Optional hierarchyIdentifierTrialEndDate = default; - Optional environmentName = default; - Optional> offerings = default; - Optional environmentData = default; + Optional displayName = default; + Optional description = default; + Optional assignedStandard = default; + Optional assignedComponent = default; + Optional scope = default; + Optional effect = default; + Optional expiresOn = default; + Optional additionalData = default; + Optional metadata = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("kind"u8)) @@ -164,61 +193,81 @@ internal static SecurityConnectorData DeserializeSecurityConnectorData(JsonEleme } foreach (var property0 in property.Value.EnumerateObject()) { - if (property0.NameEquals("hierarchyIdentifier"u8)) + if (property0.NameEquals("displayName"u8)) { - hierarchyIdentifier = property0.Value.GetString(); + displayName = property0.Value.GetString(); continue; } - if (property0.NameEquals("hierarchyIdentifierTrialEndDate"u8)) + if (property0.NameEquals("description"u8)) + { + description = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("assignedStandard"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } - hierarchyIdentifierTrialEndDate = property0.Value.GetDateTimeOffset("O"); + assignedStandard = JsonSerializer.Deserialize(property0.Value.GetRawText()); continue; } - if (property0.NameEquals("environmentName"u8)) + if (property0.NameEquals("assignedComponent"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } - environmentName = new SecurityCenterCloudName(property0.Value.GetString()); + assignedComponent = AssignedComponentItem.DeserializeAssignedComponentItem(property0.Value); + continue; + } + if (property0.NameEquals("scope"u8)) + { + scope = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("effect"u8)) + { + effect = property0.Value.GetString(); continue; } - if (property0.NameEquals("offerings"u8)) + if (property0.NameEquals("expiresOn"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) + expiresOn = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("additionalData"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) { - array.Add(SecurityCenterCloudOffering.DeserializeSecurityCenterCloudOffering(item)); + property0.ThrowNonNullablePropertyIsNull(); + continue; } - offerings = array; + additionalData = AssignmentPropertiesAdditionalData.DeserializeAssignmentPropertiesAdditionalData(property0.Value); continue; } - if (property0.NameEquals("environmentData"u8)) + if (property0.NameEquals("metadata"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } - environmentData = SecurityConnectorEnvironment.DeserializeSecurityConnectorEnvironment(property0.Value); + metadata = BinaryData.FromString(property0.Value.GetRawText()); continue; } } continue; } } - return new SecurityConnectorData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, hierarchyIdentifier.Value, Optional.ToNullable(hierarchyIdentifierTrialEndDate), Optional.ToNullable(environmentName), Optional.ToList(offerings), environmentData.Value, kind.Value, Optional.ToNullable(etag)); + return new AssignmentData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, displayName.Value, description.Value, assignedStandard, assignedComponent.Value, scope.Value, effect.Value, Optional.ToNullable(expiresOn), additionalData.Value, metadata.Value, kind.Value, Optional.ToNullable(etag)); } } } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignmentList.Serialization.cs similarity index 74% rename from sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceList.Serialization.cs rename to sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignmentList.Serialization.cs index 164e6ee5e7b4..9e39974e56f5 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceList.Serialization.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignmentList.Serialization.cs @@ -12,15 +12,15 @@ namespace Azure.ResourceManager.SecurityCenter.Models { - internal partial class ComplianceList + internal partial class AssignmentList { - internal static ComplianceList DeserializeComplianceList(JsonElement element) + internal static AssignmentList DeserializeAssignmentList(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { return null; } - Optional> value = default; + Optional> value = default; Optional nextLink = default; foreach (var property in element.EnumerateObject()) { @@ -31,10 +31,10 @@ internal static ComplianceList DeserializeComplianceList(JsonElement element) property.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(SecurityComplianceData.DeserializeSecurityComplianceData(item)); + array.Add(AssignmentData.DeserializeAssignmentData(item)); } value = array; continue; @@ -45,7 +45,7 @@ internal static ComplianceList DeserializeComplianceList(JsonElement element) continue; } } - return new ComplianceList(Optional.ToList(value), nextLink.Value); + return new AssignmentList(Optional.ToList(value), nextLink.Value); } } } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignmentList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignmentList.cs new file mode 100644 index 000000000000..b1fe46b2e316 --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignmentList.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.SecurityCenter; + +namespace Azure.ResourceManager.SecurityCenter.Models +{ + /// Page of a standard assignment list. + internal partial class AssignmentList + { + /// Initializes a new instance of AssignmentList. + internal AssignmentList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of AssignmentList. + /// Collection of standardAssignments in this page. + /// The URI to fetch the next page. + internal AssignmentList(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of standardAssignments in this page. + public IReadOnlyList Value { get; } + /// The URI to fetch the next page. + public string NextLink { get; } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsInformationProtection.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignmentPropertiesAdditionalData.Serialization.cs similarity index 52% rename from sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsInformationProtection.Serialization.cs rename to sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignmentPropertiesAdditionalData.Serialization.cs index 8c8172c5dd10..2004f9cd85f4 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsInformationProtection.Serialization.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignmentPropertiesAdditionalData.Serialization.cs @@ -10,35 +10,35 @@ namespace Azure.ResourceManager.SecurityCenter.Models { - internal partial class AwsInformationProtection : IUtf8JsonSerializable + internal partial class AssignmentPropertiesAdditionalData : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Optional.IsDefined(CloudRoleArn)) + if (Optional.IsDefined(ExemptionCategory)) { - writer.WritePropertyName("cloudRoleArn"u8); - writer.WriteStringValue(CloudRoleArn); + writer.WritePropertyName("exemptionCategory"u8); + writer.WriteStringValue(ExemptionCategory); } writer.WriteEndObject(); } - internal static AwsInformationProtection DeserializeAwsInformationProtection(JsonElement element) + internal static AssignmentPropertiesAdditionalData DeserializeAssignmentPropertiesAdditionalData(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { return null; } - Optional cloudRoleArn = default; + Optional exemptionCategory = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("cloudRoleArn"u8)) + if (property.NameEquals("exemptionCategory"u8)) { - cloudRoleArn = property.Value.GetString(); + exemptionCategory = property.Value.GetString(); continue; } } - return new AwsInformationProtection(cloudRoleArn.Value); + return new AssignmentPropertiesAdditionalData(exemptionCategory.Value); } } } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignmentPropertiesAdditionalData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignmentPropertiesAdditionalData.cs new file mode 100644 index 000000000000..f1b1c930605d --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AssignmentPropertiesAdditionalData.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.SecurityCenter.Models +{ + /// Additional data about the assignment. + internal partial class AssignmentPropertiesAdditionalData + { + /// Initializes a new instance of AssignmentPropertiesAdditionalData. + public AssignmentPropertiesAdditionalData() + { + } + + /// Initializes a new instance of AssignmentPropertiesAdditionalData. + /// Exemption category of this assignment. + internal AssignmentPropertiesAdditionalData(string exemptionCategory) + { + ExemptionCategory = exemptionCategory; + } + + /// Exemption category of this assignment. + public string ExemptionCategory { get; set; } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AtaExternalSecuritySolution.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AtaExternalSecuritySolution.Serialization.cs deleted file mode 100644 index 0a909fdc658e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AtaExternalSecuritySolution.Serialization.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AtaExternalSecuritySolution : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties); - } - if (Kind != null) - { - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.Value.ToString()); - } - else - { - writer.WriteNull("kind"); - } - writer.WriteEndObject(); - } - - internal static AtaExternalSecuritySolution DeserializeAtaExternalSecuritySolution(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional properties = default; - ExternalSecuritySolutionKind? kind = default; - Optional location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - properties = AtaSolutionProperties.DeserializeAtaSolutionProperties(property.Value); - continue; - } - if (property.NameEquals("kind"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - kind = null; - continue; - } - kind = new ExternalSecuritySolutionKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - } - return new AtaExternalSecuritySolution(id, name, type, systemData.Value, kind, Optional.ToNullable(location), properties.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AtaExternalSecuritySolution.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AtaExternalSecuritySolution.cs deleted file mode 100644 index fd1d6a679e85..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AtaExternalSecuritySolution.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Represents an ATA security solution which sends logs to an OMS workspace. - public partial class AtaExternalSecuritySolution : ExternalSecuritySolution - { - /// Initializes a new instance of AtaExternalSecuritySolution. - public AtaExternalSecuritySolution() - { - Kind = ExternalSecuritySolutionKind.Ata; - } - - /// Initializes a new instance of AtaExternalSecuritySolution. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The kind of the external solution. - /// Location where the resource is stored. - /// The external security solution properties for ATA solutions. - internal AtaExternalSecuritySolution(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ExternalSecuritySolutionKind? kind, AzureLocation? location, AtaSolutionProperties properties) : base(id, name, resourceType, systemData, kind, location) - { - Properties = properties; - Kind = kind; - } - - /// The external security solution properties for ATA solutions. - public AtaSolutionProperties Properties { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AtaSolutionProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AtaSolutionProperties.Serialization.cs deleted file mode 100644 index dd50850602c8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AtaSolutionProperties.Serialization.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AtaSolutionProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(LastEventReceived)) - { - writer.WritePropertyName("lastEventReceived"u8); - writer.WriteStringValue(LastEventReceived); - } - if (Optional.IsDefined(DeviceVendor)) - { - writer.WritePropertyName("deviceVendor"u8); - writer.WriteStringValue(DeviceVendor); - } - if (Optional.IsDefined(DeviceType)) - { - writer.WritePropertyName("deviceType"u8); - writer.WriteStringValue(DeviceType); - } - if (Optional.IsDefined(Workspace)) - { - writer.WritePropertyName("workspace"u8); - JsonSerializer.Serialize(writer, Workspace); - } - foreach (var item in AdditionalProperties) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - - internal static AtaSolutionProperties DeserializeAtaSolutionProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional lastEventReceived = default; - Optional deviceVendor = default; - Optional deviceType = default; - Optional workspace = default; - IDictionary additionalProperties = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("lastEventReceived"u8)) - { - lastEventReceived = property.Value.GetString(); - continue; - } - if (property.NameEquals("deviceVendor"u8)) - { - deviceVendor = property.Value.GetString(); - continue; - } - if (property.NameEquals("deviceType"u8)) - { - deviceType = property.Value.GetString(); - continue; - } - if (property.NameEquals("workspace"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - workspace = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - additionalProperties = additionalPropertiesDictionary; - return new AtaSolutionProperties(deviceVendor.Value, deviceType.Value, workspace, additionalProperties, lastEventReceived.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AtaSolutionProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AtaSolutionProperties.cs deleted file mode 100644 index 49b876e651a3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AtaSolutionProperties.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The external security solution properties for ATA solutions. - public partial class AtaSolutionProperties : ExternalSecuritySolutionProperties - { - /// Initializes a new instance of AtaSolutionProperties. - public AtaSolutionProperties() - { - } - - /// Initializes a new instance of AtaSolutionProperties. - /// - /// - /// Represents an OMS workspace to which the solution is connected. - /// Additional Properties. - /// - internal AtaSolutionProperties(string deviceVendor, string deviceType, WritableSubResource workspace, IDictionary additionalProperties, string lastEventReceived) : base(deviceVendor, deviceType, workspace, additionalProperties) - { - LastEventReceived = lastEventReceived; - } - - /// Gets or sets the last event received. - public string LastEventReceived { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AuthenticationDetailsProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AuthenticationDetailsProperties.Serialization.cs deleted file mode 100644 index 2e8ae4b547b6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AuthenticationDetailsProperties.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AuthenticationDetailsProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("authenticationType"u8); - writer.WriteStringValue(AuthenticationType.ToString()); - writer.WriteEndObject(); - } - - internal static AuthenticationDetailsProperties DeserializeAuthenticationDetailsProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("authenticationType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "awsAssumeRole": return AwsAssumeRoleAuthenticationDetailsProperties.DeserializeAwsAssumeRoleAuthenticationDetailsProperties(element); - case "awsCreds": return AwsCredsAuthenticationDetailsProperties.DeserializeAwsCredsAuthenticationDetailsProperties(element); - case "gcpCredentials": return GcpCredentialsDetailsProperties.DeserializeGcpCredentialsDetailsProperties(element); - } - } - return UnknownAuthenticationDetailsProperties.DeserializeUnknownAuthenticationDetailsProperties(element); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AuthenticationDetailsProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AuthenticationDetailsProperties.cs deleted file mode 100644 index a80ec6e60600..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AuthenticationDetailsProperties.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// - /// Settings for cloud authentication management - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public abstract partial class AuthenticationDetailsProperties - { - /// Initializes a new instance of AuthenticationDetailsProperties. - protected AuthenticationDetailsProperties() - { - GrantedPermissions = new ChangeTrackingList(); - } - - /// Initializes a new instance of AuthenticationDetailsProperties. - /// State of the multi-cloud connector. - /// The permissions detected in the cloud account. - /// Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use account organization credentials. - internal AuthenticationDetailsProperties(AuthenticationProvisioningState? authenticationProvisioningState, IReadOnlyList grantedPermissions, AuthenticationType authenticationType) - { - AuthenticationProvisioningState = authenticationProvisioningState; - GrantedPermissions = grantedPermissions; - AuthenticationType = authenticationType; - } - - /// State of the multi-cloud connector. - public AuthenticationProvisioningState? AuthenticationProvisioningState { get; } - /// The permissions detected in the cloud account. - public IReadOnlyList GrantedPermissions { get; } - /// Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use account organization credentials. - internal AuthenticationType AuthenticationType { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AuthenticationProvisioningState.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AuthenticationProvisioningState.cs deleted file mode 100644 index 50f94dd071df..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AuthenticationProvisioningState.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// State of the multi-cloud connector. - public readonly partial struct AuthenticationProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AuthenticationProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ValidValue = "Valid"; - private const string InvalidValue = "Invalid"; - private const string ExpiredValue = "Expired"; - private const string IncorrectPolicyValue = "IncorrectPolicy"; - - /// Valid connector. - public static AuthenticationProvisioningState Valid { get; } = new AuthenticationProvisioningState(ValidValue); - /// Invalid connector. - public static AuthenticationProvisioningState Invalid { get; } = new AuthenticationProvisioningState(InvalidValue); - /// the connection has expired. - public static AuthenticationProvisioningState Expired { get; } = new AuthenticationProvisioningState(ExpiredValue); - /// Incorrect policy of the connector. - public static AuthenticationProvisioningState IncorrectPolicy { get; } = new AuthenticationProvisioningState(IncorrectPolicyValue); - /// Determines if two values are the same. - public static bool operator ==(AuthenticationProvisioningState left, AuthenticationProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AuthenticationProvisioningState left, AuthenticationProvisioningState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AuthenticationProvisioningState(string value) => new AuthenticationProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AuthenticationProvisioningState other && Equals(other); - /// - public bool Equals(AuthenticationProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AuthenticationType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AuthenticationType.cs deleted file mode 100644 index d2f52cc95d23..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AuthenticationType.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use account organization credentials. - internal readonly partial struct AuthenticationType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AuthenticationType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AwsCredsValue = "awsCreds"; - private const string AwsAssumeRoleValue = "awsAssumeRole"; - private const string GcpCredentialsValue = "gcpCredentials"; - - /// AWS cloud account connector user credentials authentication. - public static AuthenticationType AwsCreds { get; } = new AuthenticationType(AwsCredsValue); - /// AWS account connector assume role authentication. - public static AuthenticationType AwsAssumeRole { get; } = new AuthenticationType(AwsAssumeRoleValue); - /// GCP account connector service to service authentication. - public static AuthenticationType GcpCredentials { get; } = new AuthenticationType(GcpCredentialsValue); - /// Determines if two values are the same. - public static bool operator ==(AuthenticationType left, AuthenticationType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AuthenticationType left, AuthenticationType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AuthenticationType(string value) => new AuthenticationType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AuthenticationType other && Equals(other); - /// - public bool Equals(AuthenticationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutoProvisionState.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutoProvisionState.cs deleted file mode 100644 index a48b4d19a5eb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutoProvisionState.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Describes what kind of security agent provisioning action to take. - public readonly partial struct AutoProvisionState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AutoProvisionState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string OnValue = "On"; - private const string OffValue = "Off"; - - /// Install missing security agent on VMs automatically. - public static AutoProvisionState On { get; } = new AutoProvisionState(OnValue); - /// Do not install security agent on the VMs automatically. - public static AutoProvisionState Off { get; } = new AutoProvisionState(OffValue); - /// Determines if two values are the same. - public static bool operator ==(AutoProvisionState left, AutoProvisionState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AutoProvisionState left, AutoProvisionState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AutoProvisionState(string value) => new AutoProvisionState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AutoProvisionState other && Equals(other); - /// - public bool Equals(AutoProvisionState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutoProvisioningSettingData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutoProvisioningSettingData.Serialization.cs deleted file mode 100644 index e9ce442b2beb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutoProvisioningSettingData.Serialization.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class AutoProvisioningSettingData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(AutoProvision)) - { - writer.WritePropertyName("autoProvision"u8); - writer.WriteStringValue(AutoProvision.Value.ToString()); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static AutoProvisioningSettingData DeserializeAutoProvisioningSettingData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional autoProvision = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("autoProvision"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - autoProvision = new AutoProvisionState(property0.Value.GetString()); - continue; - } - } - continue; - } - } - return new AutoProvisioningSettingData(id, name, type, systemData.Value, Optional.ToNullable(autoProvision)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutoProvisioningSettingList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutoProvisioningSettingList.Serialization.cs deleted file mode 100644 index 11d14672c270..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutoProvisioningSettingList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class AutoProvisioningSettingList - { - internal static AutoProvisioningSettingList DeserializeAutoProvisioningSettingList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(AutoProvisioningSettingData.DeserializeAutoProvisioningSettingData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new AutoProvisioningSettingList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutoProvisioningSettingList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutoProvisioningSettingList.cs deleted file mode 100644 index 816330adc074..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutoProvisioningSettingList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of all the auto provisioning settings response. - internal partial class AutoProvisioningSettingList - { - /// Initializes a new instance of AutoProvisioningSettingList. - internal AutoProvisioningSettingList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of AutoProvisioningSettingList. - /// List of all the auto provisioning settings. - /// The URI to fetch the next page. - internal AutoProvisioningSettingList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of all the auto provisioning settings. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutomationList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutomationList.Serialization.cs deleted file mode 100644 index f7a116df9259..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutomationList.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class AutomationList - { - internal static AutomationList DeserializeAutomationList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityAutomationData.DeserializeSecurityAutomationData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new AutomationList(value, nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutomationList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutomationList.cs deleted file mode 100644 index b49118d3da49..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutomationList.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of security automations response. - internal partial class AutomationList - { - /// Initializes a new instance of AutomationList. - /// The list of security automations under the given scope. - /// is null. - internal AutomationList(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of AutomationList. - /// The list of security automations under the given scope. - /// The URI to fetch the next page. - internal AutomationList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// The list of security automations under the given scope. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutomationTriggeringRuleOperator.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutomationTriggeringRuleOperator.cs deleted file mode 100644 index ad19074f0a29..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutomationTriggeringRuleOperator.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType. - public readonly partial struct AutomationTriggeringRuleOperator : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AutomationTriggeringRuleOperator(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EqualsValueValue = "Equals"; - private const string GreaterThanValue = "GreaterThan"; - private const string GreaterThanOrEqualToValue = "GreaterThanOrEqualTo"; - private const string LesserThanValue = "LesserThan"; - private const string LesserThanOrEqualToValue = "LesserThanOrEqualTo"; - private const string NotEqualsValue = "NotEquals"; - private const string ContainsValue = "Contains"; - private const string StartsWithValue = "StartsWith"; - private const string EndsWithValue = "EndsWith"; - - /// Applies for decimal and non-decimal operands. - public static AutomationTriggeringRuleOperator EqualsValue { get; } = new AutomationTriggeringRuleOperator(EqualsValueValue); - /// Applies only for decimal operands. - public static AutomationTriggeringRuleOperator GreaterThan { get; } = new AutomationTriggeringRuleOperator(GreaterThanValue); - /// Applies only for decimal operands. - public static AutomationTriggeringRuleOperator GreaterThanOrEqualTo { get; } = new AutomationTriggeringRuleOperator(GreaterThanOrEqualToValue); - /// Applies only for decimal operands. - public static AutomationTriggeringRuleOperator LesserThan { get; } = new AutomationTriggeringRuleOperator(LesserThanValue); - /// Applies only for decimal operands. - public static AutomationTriggeringRuleOperator LesserThanOrEqualTo { get; } = new AutomationTriggeringRuleOperator(LesserThanOrEqualToValue); - /// Applies for decimal and non-decimal operands. - public static AutomationTriggeringRuleOperator NotEquals { get; } = new AutomationTriggeringRuleOperator(NotEqualsValue); - /// Applies only for non-decimal operands. - public static AutomationTriggeringRuleOperator Contains { get; } = new AutomationTriggeringRuleOperator(ContainsValue); - /// Applies only for non-decimal operands. - public static AutomationTriggeringRuleOperator StartsWith { get; } = new AutomationTriggeringRuleOperator(StartsWithValue); - /// Applies only for non-decimal operands. - public static AutomationTriggeringRuleOperator EndsWith { get; } = new AutomationTriggeringRuleOperator(EndsWithValue); - /// Determines if two values are the same. - public static bool operator ==(AutomationTriggeringRuleOperator left, AutomationTriggeringRuleOperator right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AutomationTriggeringRuleOperator left, AutomationTriggeringRuleOperator right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AutomationTriggeringRuleOperator(string value) => new AutomationTriggeringRuleOperator(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AutomationTriggeringRuleOperator other && Equals(other); - /// - public bool Equals(AutomationTriggeringRuleOperator other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutomationTriggeringRulePropertyType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutomationTriggeringRulePropertyType.cs deleted file mode 100644 index 11a659d79331..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AutomationTriggeringRulePropertyType.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The data type of the compared operands (string, integer, floating point number or a boolean [true/false]]. - public readonly partial struct AutomationTriggeringRulePropertyType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AutomationTriggeringRulePropertyType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string StringValue = "String"; - private const string IntegerValue = "Integer"; - private const string NumberValue = "Number"; - private const string BooleanValue = "Boolean"; - - /// String. - public static AutomationTriggeringRulePropertyType String { get; } = new AutomationTriggeringRulePropertyType(StringValue); - /// Integer. - public static AutomationTriggeringRulePropertyType Integer { get; } = new AutomationTriggeringRulePropertyType(IntegerValue); - /// Number. - public static AutomationTriggeringRulePropertyType Number { get; } = new AutomationTriggeringRulePropertyType(NumberValue); - /// Boolean. - public static AutomationTriggeringRulePropertyType Boolean { get; } = new AutomationTriggeringRulePropertyType(BooleanValue); - /// Determines if two values are the same. - public static bool operator ==(AutomationTriggeringRulePropertyType left, AutomationTriggeringRulePropertyType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AutomationTriggeringRulePropertyType left, AutomationTriggeringRulePropertyType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AutomationTriggeringRulePropertyType(string value) => new AutomationTriggeringRulePropertyType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AutomationTriggeringRulePropertyType other && Equals(other); - /// - public bool Equals(AutomationTriggeringRulePropertyType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AvailableSubPlanType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AvailableSubPlanType.cs deleted file mode 100644 index 655a6b340d67..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AvailableSubPlanType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The available sub plans. - public readonly partial struct AvailableSubPlanType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public AvailableSubPlanType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string P1Value = "P1"; - private const string P2Value = "P2"; - - /// P1. - public static AvailableSubPlanType P1 { get; } = new AvailableSubPlanType(P1Value); - /// P2. - public static AvailableSubPlanType P2 { get; } = new AvailableSubPlanType(P2Value); - /// Determines if two values are the same. - public static bool operator ==(AvailableSubPlanType left, AvailableSubPlanType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(AvailableSubPlanType left, AvailableSubPlanType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator AvailableSubPlanType(string value) => new AvailableSubPlanType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is AvailableSubPlanType other && Equals(other); - /// - public bool Equals(AvailableSubPlanType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsAssumeRoleAuthenticationDetailsProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsAssumeRoleAuthenticationDetailsProperties.Serialization.cs deleted file mode 100644 index 6b70eed1365f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsAssumeRoleAuthenticationDetailsProperties.Serialization.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AwsAssumeRoleAuthenticationDetailsProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("awsAssumeRoleArn"u8); - writer.WriteStringValue(AwsAssumeRoleArn); - writer.WritePropertyName("awsExternalId"u8); - writer.WriteStringValue(AwsExternalId); - writer.WritePropertyName("authenticationType"u8); - writer.WriteStringValue(AuthenticationType.ToString()); - writer.WriteEndObject(); - } - - internal static AwsAssumeRoleAuthenticationDetailsProperties DeserializeAwsAssumeRoleAuthenticationDetailsProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional accountId = default; - string awsAssumeRoleArn = default; - Guid awsExternalId = default; - Optional authenticationProvisioningState = default; - Optional> grantedPermissions = default; - AuthenticationType authenticationType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("accountId"u8)) - { - accountId = property.Value.GetString(); - continue; - } - if (property.NameEquals("awsAssumeRoleArn"u8)) - { - awsAssumeRoleArn = property.Value.GetString(); - continue; - } - if (property.NameEquals("awsExternalId"u8)) - { - awsExternalId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("authenticationProvisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - authenticationProvisioningState = new AuthenticationProvisioningState(property.Value.GetString()); - continue; - } - if (property.NameEquals("grantedPermissions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(new SecurityCenterCloudPermission(item.GetString())); - } - grantedPermissions = array; - continue; - } - if (property.NameEquals("authenticationType"u8)) - { - authenticationType = new AuthenticationType(property.Value.GetString()); - continue; - } - } - return new AwsAssumeRoleAuthenticationDetailsProperties(Optional.ToNullable(authenticationProvisioningState), Optional.ToList(grantedPermissions), authenticationType, accountId.Value, awsAssumeRoleArn, awsExternalId); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsAssumeRoleAuthenticationDetailsProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsAssumeRoleAuthenticationDetailsProperties.cs deleted file mode 100644 index 56236b2a5f3b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsAssumeRoleAuthenticationDetailsProperties.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// AWS cloud account connector based assume role, the role enables delegating access to your AWS resources. The role is composed of role Amazon Resource Name (ARN) and external ID. For more details, refer to <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html">Creating a Role to Delegate Permissions to an IAM User (write only)</a>. - public partial class AwsAssumeRoleAuthenticationDetailsProperties : AuthenticationDetailsProperties - { - /// Initializes a new instance of AwsAssumeRoleAuthenticationDetailsProperties. - /// Assumed role ID is an identifier that you can use to create temporary security credentials. - /// A unique identifier that is required when you assume a role in another account. - /// is null. - public AwsAssumeRoleAuthenticationDetailsProperties(string awsAssumeRoleArn, Guid awsExternalId) - { - Argument.AssertNotNull(awsAssumeRoleArn, nameof(awsAssumeRoleArn)); - - AwsAssumeRoleArn = awsAssumeRoleArn; - AwsExternalId = awsExternalId; - AuthenticationType = AuthenticationType.AwsAssumeRole; - } - - /// Initializes a new instance of AwsAssumeRoleAuthenticationDetailsProperties. - /// State of the multi-cloud connector. - /// The permissions detected in the cloud account. - /// Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use account organization credentials. - /// The ID of the cloud account. - /// Assumed role ID is an identifier that you can use to create temporary security credentials. - /// A unique identifier that is required when you assume a role in another account. - internal AwsAssumeRoleAuthenticationDetailsProperties(AuthenticationProvisioningState? authenticationProvisioningState, IReadOnlyList grantedPermissions, AuthenticationType authenticationType, string accountId, string awsAssumeRoleArn, Guid awsExternalId) : base(authenticationProvisioningState, grantedPermissions, authenticationType) - { - AccountId = accountId; - AwsAssumeRoleArn = awsAssumeRoleArn; - AwsExternalId = awsExternalId; - AuthenticationType = authenticationType; - } - - /// The ID of the cloud account. - public string AccountId { get; } - /// Assumed role ID is an identifier that you can use to create temporary security credentials. - public string AwsAssumeRoleArn { get; set; } - /// A unique identifier that is required when you assume a role in another account. - public Guid AwsExternalId { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsCredsAuthenticationDetailsProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsCredsAuthenticationDetailsProperties.Serialization.cs deleted file mode 100644 index d7e97196226c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsCredsAuthenticationDetailsProperties.Serialization.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AwsCredsAuthenticationDetailsProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("awsAccessKeyId"u8); - writer.WriteStringValue(AwsAccessKeyId); - writer.WritePropertyName("awsSecretAccessKey"u8); - writer.WriteStringValue(AwsSecretAccessKey); - writer.WritePropertyName("authenticationType"u8); - writer.WriteStringValue(AuthenticationType.ToString()); - writer.WriteEndObject(); - } - - internal static AwsCredsAuthenticationDetailsProperties DeserializeAwsCredsAuthenticationDetailsProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional accountId = default; - string awsAccessKeyId = default; - string awsSecretAccessKey = default; - Optional authenticationProvisioningState = default; - Optional> grantedPermissions = default; - AuthenticationType authenticationType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("accountId"u8)) - { - accountId = property.Value.GetString(); - continue; - } - if (property.NameEquals("awsAccessKeyId"u8)) - { - awsAccessKeyId = property.Value.GetString(); - continue; - } - if (property.NameEquals("awsSecretAccessKey"u8)) - { - awsSecretAccessKey = property.Value.GetString(); - continue; - } - if (property.NameEquals("authenticationProvisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - authenticationProvisioningState = new AuthenticationProvisioningState(property.Value.GetString()); - continue; - } - if (property.NameEquals("grantedPermissions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(new SecurityCenterCloudPermission(item.GetString())); - } - grantedPermissions = array; - continue; - } - if (property.NameEquals("authenticationType"u8)) - { - authenticationType = new AuthenticationType(property.Value.GetString()); - continue; - } - } - return new AwsCredsAuthenticationDetailsProperties(Optional.ToNullable(authenticationProvisioningState), Optional.ToList(grantedPermissions), authenticationType, accountId.Value, awsAccessKeyId, awsSecretAccessKey); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsCredsAuthenticationDetailsProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsCredsAuthenticationDetailsProperties.cs deleted file mode 100644 index 664d6bdd930a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsCredsAuthenticationDetailsProperties.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// AWS cloud account connector based credentials, the credentials is composed of access key ID and secret key, for more details, refer to <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html">Creating an IAM User in Your AWS Account (write only)</a>. - public partial class AwsCredsAuthenticationDetailsProperties : AuthenticationDetailsProperties - { - /// Initializes a new instance of AwsCredsAuthenticationDetailsProperties. - /// Public key element of the AWS credential object (write only). - /// Secret key element of the AWS credential object (write only). - /// or is null. - public AwsCredsAuthenticationDetailsProperties(string awsAccessKeyId, string awsSecretAccessKey) - { - Argument.AssertNotNull(awsAccessKeyId, nameof(awsAccessKeyId)); - Argument.AssertNotNull(awsSecretAccessKey, nameof(awsSecretAccessKey)); - - AwsAccessKeyId = awsAccessKeyId; - AwsSecretAccessKey = awsSecretAccessKey; - AuthenticationType = AuthenticationType.AwsCreds; - } - - /// Initializes a new instance of AwsCredsAuthenticationDetailsProperties. - /// State of the multi-cloud connector. - /// The permissions detected in the cloud account. - /// Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use account organization credentials. - /// The ID of the cloud account. - /// Public key element of the AWS credential object (write only). - /// Secret key element of the AWS credential object (write only). - internal AwsCredsAuthenticationDetailsProperties(AuthenticationProvisioningState? authenticationProvisioningState, IReadOnlyList grantedPermissions, AuthenticationType authenticationType, string accountId, string awsAccessKeyId, string awsSecretAccessKey) : base(authenticationProvisioningState, grantedPermissions, authenticationType) - { - AccountId = accountId; - AwsAccessKeyId = awsAccessKeyId; - AwsSecretAccessKey = awsSecretAccessKey; - AuthenticationType = authenticationType; - } - - /// The ID of the cloud account. - public string AccountId { get; } - /// Public key element of the AWS credential object (write only). - public string AwsAccessKeyId { get; set; } - /// Secret key element of the AWS credential object (write only). - public string AwsSecretAccessKey { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsDefenderForServersInfo.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsDefenderForServersInfo.cs deleted file mode 100644 index 97b87b440512..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsDefenderForServersInfo.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The Defender for servers connection configuration. - internal partial class AwsDefenderForServersInfo - { - /// Initializes a new instance of AwsDefenderForServersInfo. - public AwsDefenderForServersInfo() - { - } - - /// Initializes a new instance of AwsDefenderForServersInfo. - /// The cloud role ARN in AWS for this feature. - internal AwsDefenderForServersInfo(string cloudRoleArn) - { - CloudRoleArn = cloudRoleArn; - } - - /// The cloud role ARN in AWS for this feature. - public string CloudRoleArn { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsEnvironment.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsEnvironment.Serialization.cs deleted file mode 100644 index ade33aa6e79c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsEnvironment.Serialization.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AwsEnvironment : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(OrganizationalData)) - { - writer.WritePropertyName("organizationalData"u8); - writer.WriteObjectValue(OrganizationalData); - } - writer.WritePropertyName("environmentType"u8); - writer.WriteStringValue(EnvironmentType.ToString()); - writer.WriteEndObject(); - } - - internal static AwsEnvironment DeserializeAwsEnvironment(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional organizationalData = default; - EnvironmentType environmentType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("organizationalData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - organizationalData = AwsOrganizationalInfo.DeserializeAwsOrganizationalInfo(property.Value); - continue; - } - if (property.NameEquals("environmentType"u8)) - { - environmentType = new EnvironmentType(property.Value.GetString()); - continue; - } - } - return new AwsEnvironment(environmentType, organizationalData.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsEnvironment.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsEnvironment.cs deleted file mode 100644 index 3c5c6c025fa4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsEnvironment.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The aws connector environment data. - public partial class AwsEnvironment : SecurityConnectorEnvironment - { - /// Initializes a new instance of AwsEnvironment. - public AwsEnvironment() - { - EnvironmentType = EnvironmentType.AwsAccount; - } - - /// Initializes a new instance of AwsEnvironment. - /// The type of the environment data. - /// - /// The AWS account's organizational data - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - internal AwsEnvironment(EnvironmentType environmentType, AwsOrganizationalInfo organizationalData) : base(environmentType) - { - OrganizationalData = organizationalData; - EnvironmentType = environmentType; - } - - /// - /// The AWS account's organizational data - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public AwsOrganizationalInfo OrganizationalData { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsInformationProtection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsInformationProtection.cs deleted file mode 100644 index 55aa06efaae8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsInformationProtection.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The native cloud connection configuration. - internal partial class AwsInformationProtection - { - /// Initializes a new instance of AwsInformationProtection. - public AwsInformationProtection() - { - } - - /// Initializes a new instance of AwsInformationProtection. - /// The cloud role ARN in AWS for this feature. - internal AwsInformationProtection(string cloudRoleArn) - { - CloudRoleArn = cloudRoleArn; - } - - /// The cloud role ARN in AWS for this feature. - public string CloudRoleArn { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalDataMaster.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalDataMaster.Serialization.cs deleted file mode 100644 index e9ca185b78d2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalDataMaster.Serialization.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AwsOrganizationalDataMaster : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(StacksetName)) - { - writer.WritePropertyName("stacksetName"u8); - writer.WriteStringValue(StacksetName); - } - if (Optional.IsCollectionDefined(ExcludedAccountIds)) - { - writer.WritePropertyName("excludedAccountIds"u8); - writer.WriteStartArray(); - foreach (var item in ExcludedAccountIds) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WritePropertyName("organizationMembershipType"u8); - writer.WriteStringValue(OrganizationMembershipType.ToString()); - writer.WriteEndObject(); - } - - internal static AwsOrganizationalDataMaster DeserializeAwsOrganizationalDataMaster(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional stacksetName = default; - Optional> excludedAccountIds = default; - OrganizationMembershipType organizationMembershipType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("stacksetName"u8)) - { - stacksetName = property.Value.GetString(); - continue; - } - if (property.NameEquals("excludedAccountIds"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - excludedAccountIds = array; - continue; - } - if (property.NameEquals("organizationMembershipType"u8)) - { - organizationMembershipType = new OrganizationMembershipType(property.Value.GetString()); - continue; - } - } - return new AwsOrganizationalDataMaster(organizationMembershipType, stacksetName.Value, Optional.ToList(excludedAccountIds)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalDataMaster.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalDataMaster.cs deleted file mode 100644 index 669c577eb787..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalDataMaster.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The awsOrganization data for the master account. - public partial class AwsOrganizationalDataMaster : AwsOrganizationalInfo - { - /// Initializes a new instance of AwsOrganizationalDataMaster. - public AwsOrganizationalDataMaster() - { - ExcludedAccountIds = new ChangeTrackingList(); - OrganizationMembershipType = OrganizationMembershipType.Organization; - } - - /// Initializes a new instance of AwsOrganizationalDataMaster. - /// The multi cloud account's membership type in the organization. - /// If the multi cloud account is of membership type organization, this will be the name of the onboarding stackset. - /// If the multi cloud account is of membership type organization, list of accounts excluded from offering. - internal AwsOrganizationalDataMaster(OrganizationMembershipType organizationMembershipType, string stacksetName, IList excludedAccountIds) : base(organizationMembershipType) - { - StacksetName = stacksetName; - ExcludedAccountIds = excludedAccountIds; - OrganizationMembershipType = organizationMembershipType; - } - - /// If the multi cloud account is of membership type organization, this will be the name of the onboarding stackset. - public string StacksetName { get; set; } - /// If the multi cloud account is of membership type organization, list of accounts excluded from offering. - public IList ExcludedAccountIds { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalDataMember.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalDataMember.Serialization.cs deleted file mode 100644 index d0d248ba1e89..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalDataMember.Serialization.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AwsOrganizationalDataMember : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ParentHierarchyId)) - { - writer.WritePropertyName("parentHierarchyId"u8); - writer.WriteStringValue(ParentHierarchyId); - } - writer.WritePropertyName("organizationMembershipType"u8); - writer.WriteStringValue(OrganizationMembershipType.ToString()); - writer.WriteEndObject(); - } - - internal static AwsOrganizationalDataMember DeserializeAwsOrganizationalDataMember(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional parentHierarchyId = default; - OrganizationMembershipType organizationMembershipType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("parentHierarchyId"u8)) - { - parentHierarchyId = property.Value.GetString(); - continue; - } - if (property.NameEquals("organizationMembershipType"u8)) - { - organizationMembershipType = new OrganizationMembershipType(property.Value.GetString()); - continue; - } - } - return new AwsOrganizationalDataMember(organizationMembershipType, parentHierarchyId.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalDataMember.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalDataMember.cs deleted file mode 100644 index 6f991c2e2ce5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalDataMember.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The awsOrganization data for the member account. - public partial class AwsOrganizationalDataMember : AwsOrganizationalInfo - { - /// Initializes a new instance of AwsOrganizationalDataMember. - public AwsOrganizationalDataMember() - { - OrganizationMembershipType = OrganizationMembershipType.Member; - } - - /// Initializes a new instance of AwsOrganizationalDataMember. - /// The multi cloud account's membership type in the organization. - /// If the multi cloud account is not of membership type organization, this will be the ID of the account's parent. - internal AwsOrganizationalDataMember(OrganizationMembershipType organizationMembershipType, string parentHierarchyId) : base(organizationMembershipType) - { - ParentHierarchyId = parentHierarchyId; - OrganizationMembershipType = organizationMembershipType; - } - - /// If the multi cloud account is not of membership type organization, this will be the ID of the account's parent. - public string ParentHierarchyId { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalInfo.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalInfo.Serialization.cs deleted file mode 100644 index 6938c310c9f5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalInfo.Serialization.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AwsOrganizationalInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("organizationMembershipType"u8); - writer.WriteStringValue(OrganizationMembershipType.ToString()); - writer.WriteEndObject(); - } - - internal static AwsOrganizationalInfo DeserializeAwsOrganizationalInfo(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("organizationMembershipType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "Member": return AwsOrganizationalDataMember.DeserializeAwsOrganizationalDataMember(element); - case "Organization": return AwsOrganizationalDataMaster.DeserializeAwsOrganizationalDataMaster(element); - } - } - return UnknownAwsOrganizationalData.DeserializeUnknownAwsOrganizationalData(element); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalInfo.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalInfo.cs deleted file mode 100644 index 8ce09f843a44..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsOrganizationalInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// - /// The awsOrganization data - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public abstract partial class AwsOrganizationalInfo - { - /// Initializes a new instance of AwsOrganizationalInfo. - protected AwsOrganizationalInfo() - { - } - - /// Initializes a new instance of AwsOrganizationalInfo. - /// The multi cloud account's membership type in the organization. - internal AwsOrganizationalInfo(OrganizationMembershipType organizationMembershipType) - { - OrganizationMembershipType = organizationMembershipType; - } - - /// The multi cloud account's membership type in the organization. - internal OrganizationMembershipType OrganizationMembershipType { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureDevOpsScopeEnvironment.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureDevOpsScopeEnvironment.Serialization.cs deleted file mode 100644 index 05232acb30e9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureDevOpsScopeEnvironment.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AzureDevOpsScopeEnvironment : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("environmentType"u8); - writer.WriteStringValue(EnvironmentType.ToString()); - writer.WriteEndObject(); - } - - internal static AzureDevOpsScopeEnvironment DeserializeAzureDevOpsScopeEnvironment(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - EnvironmentType environmentType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("environmentType"u8)) - { - environmentType = new EnvironmentType(property.Value.GetString()); - continue; - } - } - return new AzureDevOpsScopeEnvironment(environmentType); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureDevOpsScopeEnvironment.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureDevOpsScopeEnvironment.cs deleted file mode 100644 index 9e427b4ee456..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureDevOpsScopeEnvironment.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The AzureDevOps scope connector's environment data. - public partial class AzureDevOpsScopeEnvironment : SecurityConnectorEnvironment - { - /// Initializes a new instance of AzureDevOpsScopeEnvironment. - public AzureDevOpsScopeEnvironment() - { - EnvironmentType = EnvironmentType.AzureDevOpsScope; - } - - /// Initializes a new instance of AzureDevOpsScopeEnvironment. - /// The type of the environment data. - internal AzureDevOpsScopeEnvironment(EnvironmentType environmentType) : base(environmentType) - { - EnvironmentType = environmentType; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureResourceDetails.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureResourceDetails.Serialization.cs deleted file mode 100644 index 5ee954b7c0dd..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureResourceDetails.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AzureResourceDetails : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("source"u8); - writer.WriteStringValue(Source.ToString()); - writer.WriteEndObject(); - } - - internal static AzureResourceDetails DeserializeAzureResourceDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional id = default; - Source source = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("source"u8)) - { - source = new Source(property.Value.GetString()); - continue; - } - } - return new AzureResourceDetails(source, id.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureResourceDetails.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureResourceDetails.cs deleted file mode 100644 index ed4539282ddf..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureResourceDetails.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Details of the Azure resource that was assessed. - public partial class AzureResourceDetails : SecurityCenterResourceDetails - { - /// Initializes a new instance of AzureResourceDetails. - public AzureResourceDetails() - { - Source = Source.Azure; - } - - /// Initializes a new instance of AzureResourceDetails. - /// The platform where the assessed resource resides. - /// Azure resource Id of the assessed resource. - internal AzureResourceDetails(Source source, string id) : base(source) - { - Id = id; - Source = source; - } - - /// Azure resource Id of the assessed resource. - public string Id { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureResourceIdentifier.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureResourceIdentifier.Serialization.cs deleted file mode 100644 index deaf1c421a6f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureResourceIdentifier.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class AzureResourceIdentifier - { - internal static AzureResourceIdentifier DeserializeAzureResourceIdentifier(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional azureResourceId = default; - ResourceIdentifierType type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("azureResourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - azureResourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceIdentifierType(property.Value.GetString()); - continue; - } - } - return new AzureResourceIdentifier(type, azureResourceId.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureResourceIdentifier.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureResourceIdentifier.cs deleted file mode 100644 index 4af11978688c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AzureResourceIdentifier.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Azure resource identifier. - public partial class AzureResourceIdentifier : SecurityAlertResourceIdentifier - { - /// Initializes a new instance of AzureResourceIdentifier. - internal AzureResourceIdentifier() - { - ResourceIdentifierType = ResourceIdentifierType.AzureResource; - } - - /// Initializes a new instance of AzureResourceIdentifier. - /// There can be multiple identifiers of different type per alert, this field specify the identifier type. - /// ARM resource identifier for the cloud resource being alerted on. - internal AzureResourceIdentifier(ResourceIdentifierType resourceIdentifierType, ResourceIdentifier azureResourceId) : base(resourceIdentifierType) - { - AzureResourceId = azureResourceId; - ResourceIdentifierType = resourceIdentifierType; - } - - /// ARM resource identifier for the cloud resource being alerted on. - public ResourceIdentifier AzureResourceId { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/BaselineAdjustedResult.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/BaselineAdjustedResult.Serialization.cs deleted file mode 100644 index e2d512455ece..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/BaselineAdjustedResult.Serialization.cs +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class BaselineAdjustedResult : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Baseline)) - { - writer.WritePropertyName("baseline"u8); - writer.WriteObjectValue(Baseline); - } - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } - if (Optional.IsCollectionDefined(ResultsNotInBaseline)) - { - writer.WritePropertyName("resultsNotInBaseline"u8); - writer.WriteStartArray(); - foreach (var item in ResultsNotInBaseline) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStartArray(); - foreach (var item0 in item) - { - writer.WriteStringValue(item0); - } - writer.WriteEndArray(); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(ResultsOnlyInBaseline)) - { - writer.WritePropertyName("resultsOnlyInBaseline"u8); - writer.WriteStartArray(); - foreach (var item in ResultsOnlyInBaseline) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStartArray(); - foreach (var item0 in item) - { - writer.WriteStringValue(item0); - } - writer.WriteEndArray(); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static BaselineAdjustedResult DeserializeBaselineAdjustedResult(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional baseline = default; - Optional status = default; - Optional>> resultsNotInBaseline = default; - Optional>> resultsOnlyInBaseline = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("baseline"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - baseline = SqlVulnerabilityAssessmentBaseline.DeserializeSqlVulnerabilityAssessmentBaseline(property.Value); - continue; - } - if (property.NameEquals("status"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - status = new SqlVulnerabilityAssessmentScanResultRuleStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("resultsNotInBaseline"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List> array = new List>(); - foreach (var item in property.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - List array0 = new List(); - foreach (var item0 in item.EnumerateArray()) - { - array0.Add(item0.GetString()); - } - array.Add(array0); - } - } - resultsNotInBaseline = array; - continue; - } - if (property.NameEquals("resultsOnlyInBaseline"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List> array = new List>(); - foreach (var item in property.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - List array0 = new List(); - foreach (var item0 in item.EnumerateArray()) - { - array0.Add(item0.GetString()); - } - array.Add(array0); - } - } - resultsOnlyInBaseline = array; - continue; - } - } - return new BaselineAdjustedResult(baseline.Value, Optional.ToNullable(status), Optional.ToList(resultsNotInBaseline), Optional.ToList(resultsOnlyInBaseline)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/BaselineAdjustedResult.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/BaselineAdjustedResult.cs deleted file mode 100644 index a6a6afc3db65..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/BaselineAdjustedResult.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The rule result adjusted with baseline. - public partial class BaselineAdjustedResult - { - /// Initializes a new instance of BaselineAdjustedResult. - public BaselineAdjustedResult() - { - ResultsNotInBaseline = new ChangeTrackingList>(); - ResultsOnlyInBaseline = new ChangeTrackingList>(); - } - - /// Initializes a new instance of BaselineAdjustedResult. - /// Baseline details. - /// The rule result status. - /// Results the are not in baseline. - /// Results the are in baseline. - internal BaselineAdjustedResult(SqlVulnerabilityAssessmentBaseline baseline, SqlVulnerabilityAssessmentScanResultRuleStatus? status, IList> resultsNotInBaseline, IList> resultsOnlyInBaseline) - { - Baseline = baseline; - Status = status; - ResultsNotInBaseline = resultsNotInBaseline; - ResultsOnlyInBaseline = resultsOnlyInBaseline; - } - - /// Baseline details. - public SqlVulnerabilityAssessmentBaseline Baseline { get; set; } - /// The rule result status. - public SqlVulnerabilityAssessmentScanResultRuleStatus? Status { get; set; } - /// Results the are not in baseline. - public IList> ResultsNotInBaseline { get; } - /// Results the are in baseline. - public IList> ResultsOnlyInBaseline { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/BenchmarkReference.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/BenchmarkReference.Serialization.cs deleted file mode 100644 index 49e63cf4dfd6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/BenchmarkReference.Serialization.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class BenchmarkReference : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Benchmark)) - { - writer.WritePropertyName("benchmark"u8); - writer.WriteStringValue(Benchmark); - } - if (Optional.IsDefined(Reference)) - { - writer.WritePropertyName("reference"u8); - writer.WriteStringValue(Reference); - } - writer.WriteEndObject(); - } - - internal static BenchmarkReference DeserializeBenchmarkReference(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional benchmark = default; - Optional reference = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("benchmark"u8)) - { - benchmark = property.Value.GetString(); - continue; - } - if (property.NameEquals("reference"u8)) - { - reference = property.Value.GetString(); - continue; - } - } - return new BenchmarkReference(benchmark.Value, reference.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/BenchmarkReference.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/BenchmarkReference.cs deleted file mode 100644 index b8f236946a4f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/BenchmarkReference.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The benchmark references. - public partial class BenchmarkReference - { - /// Initializes a new instance of BenchmarkReference. - public BenchmarkReference() - { - } - - /// Initializes a new instance of BenchmarkReference. - /// The benchmark name. - /// The benchmark reference. - internal BenchmarkReference(string benchmark, string reference) - { - Benchmark = benchmark; - Reference = reference; - } - - /// The benchmark name. - public string Benchmark { get; set; } - /// The benchmark reference. - public string Reference { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CefExternalSecuritySolution.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CefExternalSecuritySolution.Serialization.cs deleted file mode 100644 index ad8bd073f604..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CefExternalSecuritySolution.Serialization.cs +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class CefExternalSecuritySolution : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties); - } - if (Kind != null) - { - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.Value.ToString()); - } - else - { - writer.WriteNull("kind"); - } - writer.WriteEndObject(); - } - - internal static CefExternalSecuritySolution DeserializeCefExternalSecuritySolution(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional properties = default; - ExternalSecuritySolutionKind? kind = default; - Optional location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - properties = CefSolutionProperties.DeserializeCefSolutionProperties(property.Value); - continue; - } - if (property.NameEquals("kind"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - kind = null; - continue; - } - kind = new ExternalSecuritySolutionKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - } - return new CefExternalSecuritySolution(id, name, type, systemData.Value, kind, Optional.ToNullable(location), properties.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CefExternalSecuritySolution.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CefExternalSecuritySolution.cs deleted file mode 100644 index d04b41cdd92a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CefExternalSecuritySolution.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Represents a security solution which sends CEF logs to an OMS workspace. - public partial class CefExternalSecuritySolution : ExternalSecuritySolution - { - /// Initializes a new instance of CefExternalSecuritySolution. - public CefExternalSecuritySolution() - { - Kind = ExternalSecuritySolutionKind.Cef; - } - - /// Initializes a new instance of CefExternalSecuritySolution. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The kind of the external solution. - /// Location where the resource is stored. - /// The external security solution properties for CEF solutions. - internal CefExternalSecuritySolution(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ExternalSecuritySolutionKind? kind, AzureLocation? location, CefSolutionProperties properties) : base(id, name, resourceType, systemData, kind, location) - { - Properties = properties; - Kind = kind; - } - - /// The external security solution properties for CEF solutions. - public CefSolutionProperties Properties { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CefSolutionProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CefSolutionProperties.Serialization.cs deleted file mode 100644 index 97cd580203c0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CefSolutionProperties.Serialization.cs +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class CefSolutionProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Hostname)) - { - writer.WritePropertyName("hostname"u8); - writer.WriteStringValue(Hostname); - } - if (Optional.IsDefined(Agent)) - { - writer.WritePropertyName("agent"u8); - writer.WriteStringValue(Agent); - } - if (Optional.IsDefined(LastEventReceived)) - { - writer.WritePropertyName("lastEventReceived"u8); - writer.WriteStringValue(LastEventReceived); - } - if (Optional.IsDefined(DeviceVendor)) - { - writer.WritePropertyName("deviceVendor"u8); - writer.WriteStringValue(DeviceVendor); - } - if (Optional.IsDefined(DeviceType)) - { - writer.WritePropertyName("deviceType"u8); - writer.WriteStringValue(DeviceType); - } - if (Optional.IsDefined(Workspace)) - { - writer.WritePropertyName("workspace"u8); - JsonSerializer.Serialize(writer, Workspace); - } - foreach (var item in AdditionalProperties) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - - internal static CefSolutionProperties DeserializeCefSolutionProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional hostname = default; - Optional agent = default; - Optional lastEventReceived = default; - Optional deviceVendor = default; - Optional deviceType = default; - Optional workspace = default; - IDictionary additionalProperties = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("hostname"u8)) - { - hostname = property.Value.GetString(); - continue; - } - if (property.NameEquals("agent"u8)) - { - agent = property.Value.GetString(); - continue; - } - if (property.NameEquals("lastEventReceived"u8)) - { - lastEventReceived = property.Value.GetString(); - continue; - } - if (property.NameEquals("deviceVendor"u8)) - { - deviceVendor = property.Value.GetString(); - continue; - } - if (property.NameEquals("deviceType"u8)) - { - deviceType = property.Value.GetString(); - continue; - } - if (property.NameEquals("workspace"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - workspace = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - additionalProperties = additionalPropertiesDictionary; - return new CefSolutionProperties(deviceVendor.Value, deviceType.Value, workspace, additionalProperties, hostname.Value, agent.Value, lastEventReceived.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CefSolutionProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CefSolutionProperties.cs deleted file mode 100644 index 7fea0e77557d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CefSolutionProperties.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The external security solution properties for CEF solutions. - public partial class CefSolutionProperties : ExternalSecuritySolutionProperties - { - /// Initializes a new instance of CefSolutionProperties. - public CefSolutionProperties() - { - } - - /// Initializes a new instance of CefSolutionProperties. - /// - /// - /// Represents an OMS workspace to which the solution is connected. - /// Additional Properties. - /// - /// - /// - internal CefSolutionProperties(string deviceVendor, string deviceType, WritableSubResource workspace, IDictionary additionalProperties, string hostname, string agent, string lastEventReceived) : base(deviceVendor, deviceType, workspace, additionalProperties) - { - Hostname = hostname; - Agent = agent; - LastEventReceived = lastEventReceived; - } - - /// Gets or sets the hostname. - public string Hostname { get; set; } - /// Gets or sets the agent. - public string Agent { get; set; } - /// Gets or sets the last event received. - public string LastEventReceived { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceList.cs deleted file mode 100644 index 3fab0d32891d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of Compliance objects response. - internal partial class ComplianceList - { - /// Initializes a new instance of ComplianceList. - internal ComplianceList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of ComplianceList. - /// List of Compliance objects. - /// The URI to fetch the next page. - internal ComplianceList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of Compliance objects. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceResultData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceResultData.Serialization.cs deleted file mode 100644 index eb14f61ecf38..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceResultData.Serialization.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class ComplianceResultData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static ComplianceResultData DeserializeComplianceResultData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional resourceStatus = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resourceStatus"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - resourceStatus = new SecurityAssessmentResourceStatus(property0.Value.GetString()); - continue; - } - } - continue; - } - } - return new ComplianceResultData(id, name, type, systemData.Value, Optional.ToNullable(resourceStatus)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceResultList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceResultList.Serialization.cs deleted file mode 100644 index c7f071108849..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceResultList.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class ComplianceResultList - { - internal static ComplianceResultList DeserializeComplianceResultList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ComplianceResultData.DeserializeComplianceResultData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new ComplianceResultList(value, nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceResultList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceResultList.cs deleted file mode 100644 index 7e3d91b7ab90..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceResultList.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of compliance results response. - internal partial class ComplianceResultList - { - /// Initializes a new instance of ComplianceResultList. - /// List of compliance results. - /// is null. - internal ComplianceResultList(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of ComplianceResultList. - /// List of compliance results. - /// The URI to fetch the next page. - internal ComplianceResultList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of compliance results. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceSegment.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceSegment.Serialization.cs deleted file mode 100644 index 7280d6540706..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceSegment.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class ComplianceSegment - { - internal static ComplianceSegment DeserializeComplianceSegment(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional segmentType = default; - Optional percentage = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("segmentType"u8)) - { - segmentType = property.Value.GetString(); - continue; - } - if (property.NameEquals("percentage"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - percentage = property.Value.GetDouble(); - continue; - } - } - return new ComplianceSegment(segmentType.Value, Optional.ToNullable(percentage)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceSegment.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceSegment.cs deleted file mode 100644 index b85d8b188a76..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ComplianceSegment.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A segment of a compliance assessment. - public partial class ComplianceSegment - { - /// Initializes a new instance of ComplianceSegment. - internal ComplianceSegment() - { - } - - /// Initializes a new instance of ComplianceSegment. - /// The segment type, e.g. compliant, non-compliance, insufficient coverage, N/A, etc. - /// The size (%) of the segment. - internal ComplianceSegment(string segmentType, double? percentage) - { - SegmentType = segmentType; - Percentage = percentage; - } - - /// The segment type, e.g. compliant, non-compliance, insufficient coverage, N/A, etc. - public string SegmentType { get; } - /// The size (%) of the segment. - public double? Percentage { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectableResourceInfo.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectableResourceInfo.Serialization.cs deleted file mode 100644 index 419c7166d11d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectableResourceInfo.Serialization.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class ConnectableResourceInfo - { - internal static ConnectableResourceInfo DeserializeConnectableResourceInfo(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional id = default; - Optional> inboundConnectedResources = default; - Optional> outboundConnectedResources = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("inboundConnectedResources"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ConnectedResourceInfo.DeserializeConnectedResourceInfo(item)); - } - inboundConnectedResources = array; - continue; - } - if (property.NameEquals("outboundConnectedResources"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ConnectedResourceInfo.DeserializeConnectedResourceInfo(item)); - } - outboundConnectedResources = array; - continue; - } - } - return new ConnectableResourceInfo(id.Value, Optional.ToList(inboundConnectedResources), Optional.ToList(outboundConnectedResources)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectableResourceInfo.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectableResourceInfo.cs deleted file mode 100644 index 13d568c121ce..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectableResourceInfo.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Describes the allowed inbound and outbound traffic of an Azure resource. - public partial class ConnectableResourceInfo - { - /// Initializes a new instance of ConnectableResourceInfo. - internal ConnectableResourceInfo() - { - InboundConnectedResources = new ChangeTrackingList(); - OutboundConnectedResources = new ChangeTrackingList(); - } - - /// Initializes a new instance of ConnectableResourceInfo. - /// The Azure resource id. - /// The list of Azure resources that the resource has inbound allowed connection from. - /// The list of Azure resources that the resource has outbound allowed connection to. - internal ConnectableResourceInfo(ResourceIdentifier id, IReadOnlyList inboundConnectedResources, IReadOnlyList outboundConnectedResources) - { - Id = id; - InboundConnectedResources = inboundConnectedResources; - OutboundConnectedResources = outboundConnectedResources; - } - - /// The Azure resource id. - public ResourceIdentifier Id { get; } - /// The list of Azure resources that the resource has inbound allowed connection from. - public IReadOnlyList InboundConnectedResources { get; } - /// The list of Azure resources that the resource has outbound allowed connection to. - public IReadOnlyList OutboundConnectedResources { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectedResourceInfo.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectedResourceInfo.Serialization.cs deleted file mode 100644 index d24a1e0db7d1..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectedResourceInfo.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class ConnectedResourceInfo - { - internal static ConnectedResourceInfo DeserializeConnectedResourceInfo(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional connectedResourceId = default; - Optional tcpPorts = default; - Optional udpPorts = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("connectedResourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - connectedResourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("tcpPorts"u8)) - { - tcpPorts = property.Value.GetString(); - continue; - } - if (property.NameEquals("udpPorts"u8)) - { - udpPorts = property.Value.GetString(); - continue; - } - } - return new ConnectedResourceInfo(connectedResourceId.Value, tcpPorts.Value, udpPorts.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectedResourceInfo.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectedResourceInfo.cs deleted file mode 100644 index 535eb5b55ac8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectedResourceInfo.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Describes properties of a connected resource. - public partial class ConnectedResourceInfo - { - /// Initializes a new instance of ConnectedResourceInfo. - internal ConnectedResourceInfo() - { - } - - /// Initializes a new instance of ConnectedResourceInfo. - /// The Azure resource id of the connected resource. - /// The allowed tcp ports. - /// The allowed udp ports. - internal ConnectedResourceInfo(ResourceIdentifier connectedResourceId, string tcpPorts, string udpPorts) - { - ConnectedResourceId = connectedResourceId; - TcpPorts = tcpPorts; - UdpPorts = udpPorts; - } - - /// The Azure resource id of the connected resource. - public ResourceIdentifier ConnectedResourceId { get; } - /// The allowed tcp ports. - public string TcpPorts { get; } - /// The allowed udp ports. - public string UdpPorts { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionFromIPNotAllowed.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionFromIPNotAllowed.Serialization.cs deleted file mode 100644 index 8751f288cf61..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionFromIPNotAllowed.Serialization.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class ConnectionFromIPNotAllowed : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("allowlistValues"u8); - writer.WriteStartArray(); - foreach (var item in AllowlistValues) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static ConnectionFromIPNotAllowed DeserializeConnectionFromIPNotAllowed(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList allowlistValues = default; - Optional valueType = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("allowlistValues"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowlistValues = array; - continue; - } - if (property.NameEquals("valueType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - valueType = new SecurityValueType(property.Value.GetString()); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new ConnectionFromIPNotAllowed(displayName.Value, description.Value, isEnabled, ruleType, Optional.ToNullable(valueType), allowlistValues); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionFromIPNotAllowed.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionFromIPNotAllowed.cs deleted file mode 100644 index ff1b2264693f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionFromIPNotAllowed.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Inbound connection from an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. - public partial class ConnectionFromIPNotAllowed : AllowlistCustomAlertRule - { - /// Initializes a new instance of ConnectionFromIPNotAllowed. - /// Status of the custom alert. - /// The values to allow. The format of the values depends on the rule type. - /// is null. - public ConnectionFromIPNotAllowed(bool isEnabled, IEnumerable allowlistValues) : base(isEnabled, allowlistValues) - { - Argument.AssertNotNull(allowlistValues, nameof(allowlistValues)); - - RuleType = "ConnectionFromIpNotAllowed"; - } - - /// Initializes a new instance of ConnectionFromIPNotAllowed. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The value type of the items in the list. - /// The values to allow. The format of the values depends on the rule type. - internal ConnectionFromIPNotAllowed(string displayName, string description, bool isEnabled, string ruleType, SecurityValueType? valueType, IList allowlistValues) : base(displayName, description, isEnabled, ruleType, valueType, allowlistValues) - { - RuleType = ruleType ?? "ConnectionFromIpNotAllowed"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionStrings.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionStrings.Serialization.cs deleted file mode 100644 index 2a056551f220..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionStrings.Serialization.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class ConnectionStrings - { - internal static ConnectionStrings DeserializeConnectionStrings(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(IngestionConnectionString.DeserializeIngestionConnectionString(item)); - } - value = array; - continue; - } - } - return new ConnectionStrings(value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionStrings.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionStrings.cs deleted file mode 100644 index 2f358e6fe9af..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionStrings.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Connection string for ingesting security data and logs. - internal partial class ConnectionStrings - { - /// Initializes a new instance of ConnectionStrings. - /// Connection strings. - /// is null. - internal ConnectionStrings(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of ConnectionStrings. - /// Connection strings. - internal ConnectionStrings(IReadOnlyList value) - { - Value = value; - } - - /// Connection strings. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionToIPNotAllowed.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionToIPNotAllowed.Serialization.cs deleted file mode 100644 index 118cc54bbdef..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionToIPNotAllowed.Serialization.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class ConnectionToIPNotAllowed : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("allowlistValues"u8); - writer.WriteStartArray(); - foreach (var item in AllowlistValues) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static ConnectionToIPNotAllowed DeserializeConnectionToIPNotAllowed(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList allowlistValues = default; - Optional valueType = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("allowlistValues"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowlistValues = array; - continue; - } - if (property.NameEquals("valueType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - valueType = new SecurityValueType(property.Value.GetString()); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new ConnectionToIPNotAllowed(displayName.Value, description.Value, isEnabled, ruleType, Optional.ToNullable(valueType), allowlistValues); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionToIPNotAllowed.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionToIPNotAllowed.cs deleted file mode 100644 index ee11c5a492c0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectionToIPNotAllowed.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in CIDR notation. - public partial class ConnectionToIPNotAllowed : AllowlistCustomAlertRule - { - /// Initializes a new instance of ConnectionToIPNotAllowed. - /// Status of the custom alert. - /// The values to allow. The format of the values depends on the rule type. - /// is null. - public ConnectionToIPNotAllowed(bool isEnabled, IEnumerable allowlistValues) : base(isEnabled, allowlistValues) - { - Argument.AssertNotNull(allowlistValues, nameof(allowlistValues)); - - RuleType = "ConnectionToIpNotAllowed"; - } - - /// Initializes a new instance of ConnectionToIPNotAllowed. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The value type of the items in the list. - /// The values to allow. The format of the values depends on the rule type. - internal ConnectionToIPNotAllowed(string displayName, string description, bool isEnabled, string ruleType, SecurityValueType? valueType, IList allowlistValues) : base(displayName, description, isEnabled, ruleType, valueType, allowlistValues) - { - RuleType = ruleType ?? "ConnectionToIpNotAllowed"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectorSettingList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectorSettingList.Serialization.cs deleted file mode 100644 index 3a643acdb19b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectorSettingList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class ConnectorSettingList - { - internal static ConnectorSettingList DeserializeConnectorSettingList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityCloudConnectorData.DeserializeSecurityCloudConnectorData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new ConnectorSettingList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectorSettingList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectorSettingList.cs deleted file mode 100644 index cb0e23c8cd11..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ConnectorSettingList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// For a subscription, list of all cloud account connectors and their settings. - internal partial class ConnectorSettingList - { - /// Initializes a new instance of ConnectorSettingList. - internal ConnectorSettingList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of ConnectorSettingList. - /// List of all the cloud account connector settings. - /// The URI to fetch the next page. - internal ConnectorSettingList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of all the cloud account connector settings. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ContainerRegistryVulnerabilityProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ContainerRegistryVulnerabilityProperties.Serialization.cs deleted file mode 100644 index c568c348dadc..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ContainerRegistryVulnerabilityProperties.Serialization.cs +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class ContainerRegistryVulnerabilityProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("assessedResourceType"u8); - writer.WriteStringValue(AssessedResourceType.ToString()); - writer.WriteEndObject(); - } - - internal static ContainerRegistryVulnerabilityProperties DeserializeContainerRegistryVulnerabilityProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional type = default; - Optional> cvss = default; - Optional patchable = default; - Optional> cve = default; - Optional publishedTime = default; - Optional> vendorReferences = default; - Optional repositoryName = default; - Optional imageDigest = default; - AssessedResourceType assessedResourceType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("cvss"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, SecurityCvss.DeserializeSecurityCvss(property0.Value)); - } - cvss = dictionary; - continue; - } - if (property.NameEquals("patchable"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - patchable = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("cve"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityCve.DeserializeSecurityCve(item)); - } - cve = array; - continue; - } - if (property.NameEquals("publishedTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - publishedTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("vendorReferences"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(VendorReference.DeserializeVendorReference(item)); - } - vendorReferences = array; - continue; - } - if (property.NameEquals("repositoryName"u8)) - { - repositoryName = property.Value.GetString(); - continue; - } - if (property.NameEquals("imageDigest"u8)) - { - imageDigest = property.Value.GetString(); - continue; - } - if (property.NameEquals("assessedResourceType"u8)) - { - assessedResourceType = new AssessedResourceType(property.Value.GetString()); - continue; - } - } - return new ContainerRegistryVulnerabilityProperties(assessedResourceType, type.Value, Optional.ToDictionary(cvss), Optional.ToNullable(patchable), Optional.ToList(cve), Optional.ToNullable(publishedTime), Optional.ToList(vendorReferences), repositoryName.Value, imageDigest.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ContainerRegistryVulnerabilityProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ContainerRegistryVulnerabilityProperties.cs deleted file mode 100644 index 4e0d1b1a8acb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ContainerRegistryVulnerabilityProperties.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Additional context fields for container registry Vulnerability assessment. - public partial class ContainerRegistryVulnerabilityProperties : SecuritySubAssessmentAdditionalInfo - { - /// Initializes a new instance of ContainerRegistryVulnerabilityProperties. - public ContainerRegistryVulnerabilityProperties() - { - Cvss = new ChangeTrackingDictionary(); - Cve = new ChangeTrackingList(); - VendorReferences = new ChangeTrackingList(); - AssessedResourceType = AssessedResourceType.ContainerRegistryVulnerability; - } - - /// Initializes a new instance of ContainerRegistryVulnerabilityProperties. - /// Sub-assessment resource type. - /// Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, Vulnerability. - /// Dictionary from cvss version to cvss details object. - /// Indicates whether a patch is available or not. - /// List of CVEs. - /// Published time. - /// - /// Name of the repository which the vulnerable image belongs to. - /// Digest of the vulnerable image. - internal ContainerRegistryVulnerabilityProperties(AssessedResourceType assessedResourceType, string containerRegistryVulnerabilityPropertiesType, IReadOnlyDictionary cvss, bool? isPatchable, IReadOnlyList cve, DateTimeOffset? publishedOn, IReadOnlyList vendorReferences, string repositoryName, string imageDigest) : base(assessedResourceType) - { - ContainerRegistryVulnerabilityPropertiesType = containerRegistryVulnerabilityPropertiesType; - Cvss = cvss; - IsPatchable = isPatchable; - Cve = cve; - PublishedOn = publishedOn; - VendorReferences = vendorReferences; - RepositoryName = repositoryName; - ImageDigest = imageDigest; - AssessedResourceType = assessedResourceType; - } - - /// Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, Vulnerability. - public string ContainerRegistryVulnerabilityPropertiesType { get; } - /// Dictionary from cvss version to cvss details object. - public IReadOnlyDictionary Cvss { get; } - /// Indicates whether a patch is available or not. - public bool? IsPatchable { get; } - /// List of CVEs. - public IReadOnlyList Cve { get; } - /// Published time. - public DateTimeOffset? PublishedOn { get; } - /// Gets the vendor references. - public IReadOnlyList VendorReferences { get; } - /// Name of the repository which the vulnerable image belongs to. - public string RepositoryName { get; } - /// Digest of the vulnerable image. - public string ImageDigest { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAwsOffering.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAwsOffering.Serialization.cs deleted file mode 100644 index e269e5ff6abf..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAwsOffering.Serialization.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class CspmMonitorAwsOffering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(NativeCloudConnection)) - { - writer.WritePropertyName("nativeCloudConnection"u8); - writer.WriteObjectValue(NativeCloudConnection); - } - writer.WritePropertyName("offeringType"u8); - writer.WriteStringValue(OfferingType.ToString()); - writer.WriteEndObject(); - } - - internal static CspmMonitorAwsOffering DeserializeCspmMonitorAwsOffering(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional nativeCloudConnection = default; - OfferingType offeringType = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("nativeCloudConnection"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - nativeCloudConnection = CspmMonitorAwsOfferingNativeCloudConnection.DeserializeCspmMonitorAwsOfferingNativeCloudConnection(property.Value); - continue; - } - if (property.NameEquals("offeringType"u8)) - { - offeringType = new OfferingType(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new CspmMonitorAwsOffering(offeringType, description.Value, nativeCloudConnection.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAwsOffering.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAwsOffering.cs deleted file mode 100644 index d11d026530d5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAwsOffering.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The CSPM monitoring for AWS offering. - public partial class CspmMonitorAwsOffering : SecurityCenterCloudOffering - { - /// Initializes a new instance of CspmMonitorAwsOffering. - public CspmMonitorAwsOffering() - { - OfferingType = OfferingType.CspmMonitorAws; - } - - /// Initializes a new instance of CspmMonitorAwsOffering. - /// The type of the security offering. - /// The offering description. - /// The native cloud connection configuration. - internal CspmMonitorAwsOffering(OfferingType offeringType, string description, CspmMonitorAwsOfferingNativeCloudConnection nativeCloudConnection) : base(offeringType, description) - { - NativeCloudConnection = nativeCloudConnection; - OfferingType = offeringType; - } - - /// The native cloud connection configuration. - internal CspmMonitorAwsOfferingNativeCloudConnection NativeCloudConnection { get; set; } - /// The cloud role ARN in AWS for this feature. - public string CloudRoleArn - { - get => NativeCloudConnection is null ? default : NativeCloudConnection.CloudRoleArn; - set - { - if (NativeCloudConnection is null) - NativeCloudConnection = new CspmMonitorAwsOfferingNativeCloudConnection(); - NativeCloudConnection.CloudRoleArn = value; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAwsOfferingNativeCloudConnection.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAwsOfferingNativeCloudConnection.Serialization.cs deleted file mode 100644 index 2360522b2427..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAwsOfferingNativeCloudConnection.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class CspmMonitorAwsOfferingNativeCloudConnection : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(CloudRoleArn)) - { - writer.WritePropertyName("cloudRoleArn"u8); - writer.WriteStringValue(CloudRoleArn); - } - writer.WriteEndObject(); - } - - internal static CspmMonitorAwsOfferingNativeCloudConnection DeserializeCspmMonitorAwsOfferingNativeCloudConnection(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional cloudRoleArn = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("cloudRoleArn"u8)) - { - cloudRoleArn = property.Value.GetString(); - continue; - } - } - return new CspmMonitorAwsOfferingNativeCloudConnection(cloudRoleArn.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAwsOfferingNativeCloudConnection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAwsOfferingNativeCloudConnection.cs deleted file mode 100644 index 003582c4da2a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAwsOfferingNativeCloudConnection.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The native cloud connection configuration. - internal partial class CspmMonitorAwsOfferingNativeCloudConnection - { - /// Initializes a new instance of CspmMonitorAwsOfferingNativeCloudConnection. - public CspmMonitorAwsOfferingNativeCloudConnection() - { - } - - /// Initializes a new instance of CspmMonitorAwsOfferingNativeCloudConnection. - /// The cloud role ARN in AWS for this feature. - internal CspmMonitorAwsOfferingNativeCloudConnection(string cloudRoleArn) - { - CloudRoleArn = cloudRoleArn; - } - - /// The cloud role ARN in AWS for this feature. - public string CloudRoleArn { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAzureDevOpsOffering.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAzureDevOpsOffering.Serialization.cs deleted file mode 100644 index 3d4e2fc3f9b3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAzureDevOpsOffering.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class CspmMonitorAzureDevOpsOffering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("offeringType"u8); - writer.WriteStringValue(OfferingType.ToString()); - writer.WriteEndObject(); - } - - internal static CspmMonitorAzureDevOpsOffering DeserializeCspmMonitorAzureDevOpsOffering(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - OfferingType offeringType = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("offeringType"u8)) - { - offeringType = new OfferingType(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new CspmMonitorAzureDevOpsOffering(offeringType, description.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAzureDevOpsOffering.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAzureDevOpsOffering.cs deleted file mode 100644 index a5aa674ef56b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorAzureDevOpsOffering.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The CSPM monitoring for AzureDevOps offering. - public partial class CspmMonitorAzureDevOpsOffering : SecurityCenterCloudOffering - { - /// Initializes a new instance of CspmMonitorAzureDevOpsOffering. - public CspmMonitorAzureDevOpsOffering() - { - OfferingType = OfferingType.CspmMonitorAzureDevOps; - } - - /// Initializes a new instance of CspmMonitorAzureDevOpsOffering. - /// The type of the security offering. - /// The offering description. - internal CspmMonitorAzureDevOpsOffering(OfferingType offeringType, string description) : base(offeringType, description) - { - OfferingType = offeringType; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGcpOffering.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGcpOffering.Serialization.cs deleted file mode 100644 index cb06102f0608..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGcpOffering.Serialization.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class CspmMonitorGcpOffering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(NativeCloudConnection)) - { - writer.WritePropertyName("nativeCloudConnection"u8); - writer.WriteObjectValue(NativeCloudConnection); - } - writer.WritePropertyName("offeringType"u8); - writer.WriteStringValue(OfferingType.ToString()); - writer.WriteEndObject(); - } - - internal static CspmMonitorGcpOffering DeserializeCspmMonitorGcpOffering(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional nativeCloudConnection = default; - OfferingType offeringType = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("nativeCloudConnection"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - nativeCloudConnection = CspmMonitorGcpOfferingNativeCloudConnection.DeserializeCspmMonitorGcpOfferingNativeCloudConnection(property.Value); - continue; - } - if (property.NameEquals("offeringType"u8)) - { - offeringType = new OfferingType(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new CspmMonitorGcpOffering(offeringType, description.Value, nativeCloudConnection.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGcpOffering.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGcpOffering.cs deleted file mode 100644 index 9eb6a5021bcd..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGcpOffering.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The CSPM monitoring for GCP offering. - public partial class CspmMonitorGcpOffering : SecurityCenterCloudOffering - { - /// Initializes a new instance of CspmMonitorGcpOffering. - public CspmMonitorGcpOffering() - { - OfferingType = OfferingType.CspmMonitorGcp; - } - - /// Initializes a new instance of CspmMonitorGcpOffering. - /// The type of the security offering. - /// The offering description. - /// The native cloud connection configuration. - internal CspmMonitorGcpOffering(OfferingType offeringType, string description, CspmMonitorGcpOfferingNativeCloudConnection nativeCloudConnection) : base(offeringType, description) - { - NativeCloudConnection = nativeCloudConnection; - OfferingType = offeringType; - } - - /// The native cloud connection configuration. - public CspmMonitorGcpOfferingNativeCloudConnection NativeCloudConnection { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGcpOfferingNativeCloudConnection.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGcpOfferingNativeCloudConnection.Serialization.cs deleted file mode 100644 index d660ac8b3766..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGcpOfferingNativeCloudConnection.Serialization.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class CspmMonitorGcpOfferingNativeCloudConnection : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(WorkloadIdentityProviderId)) - { - writer.WritePropertyName("workloadIdentityProviderId"u8); - writer.WriteStringValue(WorkloadIdentityProviderId); - } - if (Optional.IsDefined(ServiceAccountEmailAddress)) - { - writer.WritePropertyName("serviceAccountEmailAddress"u8); - writer.WriteStringValue(ServiceAccountEmailAddress); - } - writer.WriteEndObject(); - } - - internal static CspmMonitorGcpOfferingNativeCloudConnection DeserializeCspmMonitorGcpOfferingNativeCloudConnection(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional workloadIdentityProviderId = default; - Optional serviceAccountEmailAddress = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("workloadIdentityProviderId"u8)) - { - workloadIdentityProviderId = property.Value.GetString(); - continue; - } - if (property.NameEquals("serviceAccountEmailAddress"u8)) - { - serviceAccountEmailAddress = property.Value.GetString(); - continue; - } - } - return new CspmMonitorGcpOfferingNativeCloudConnection(workloadIdentityProviderId.Value, serviceAccountEmailAddress.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGcpOfferingNativeCloudConnection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGcpOfferingNativeCloudConnection.cs deleted file mode 100644 index 6cb895f9b58a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGcpOfferingNativeCloudConnection.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The native cloud connection configuration. - public partial class CspmMonitorGcpOfferingNativeCloudConnection - { - /// Initializes a new instance of CspmMonitorGcpOfferingNativeCloudConnection. - public CspmMonitorGcpOfferingNativeCloudConnection() - { - } - - /// Initializes a new instance of CspmMonitorGcpOfferingNativeCloudConnection. - /// The GCP workload identity provider id for the offering. - /// The service account email address in GCP for this offering. - internal CspmMonitorGcpOfferingNativeCloudConnection(string workloadIdentityProviderId, string serviceAccountEmailAddress) - { - WorkloadIdentityProviderId = workloadIdentityProviderId; - ServiceAccountEmailAddress = serviceAccountEmailAddress; - } - - /// The GCP workload identity provider id for the offering. - public string WorkloadIdentityProviderId { get; set; } - /// The service account email address in GCP for this offering. - public string ServiceAccountEmailAddress { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGithubOffering.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGithubOffering.Serialization.cs deleted file mode 100644 index 32080c9d8a1e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGithubOffering.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class CspmMonitorGithubOffering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("offeringType"u8); - writer.WriteStringValue(OfferingType.ToString()); - writer.WriteEndObject(); - } - - internal static CspmMonitorGithubOffering DeserializeCspmMonitorGithubOffering(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - OfferingType offeringType = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("offeringType"u8)) - { - offeringType = new OfferingType(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new CspmMonitorGithubOffering(offeringType, description.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGithubOffering.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGithubOffering.cs deleted file mode 100644 index d16a1ad37dea..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CspmMonitorGithubOffering.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The CSPM monitoring for github offering. - public partial class CspmMonitorGithubOffering : SecurityCenterCloudOffering - { - /// Initializes a new instance of CspmMonitorGithubOffering. - public CspmMonitorGithubOffering() - { - OfferingType = OfferingType.CspmMonitorGithub; - } - - /// Initializes a new instance of CspmMonitorGithubOffering. - /// The type of the security offering. - /// The offering description. - internal CspmMonitorGithubOffering(OfferingType offeringType, string description) : base(offeringType, description) - { - OfferingType = offeringType; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAlertRule.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAlertRule.Serialization.cs deleted file mode 100644 index cc5370fd95a1..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAlertRule.Serialization.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class CustomAlertRule : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static CustomAlertRule DeserializeCustomAlertRule(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("ruleType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "AllowlistCustomAlertRule": return AllowlistCustomAlertRule.DeserializeAllowlistCustomAlertRule(element); - case "AmqpC2DMessagesNotInAllowedRange": return AmqpC2DMessagesNotInAllowedRange.DeserializeAmqpC2DMessagesNotInAllowedRange(element); - case "AmqpC2DRejectedMessagesNotInAllowedRange": return AmqpC2DRejectedMessagesNotInAllowedRange.DeserializeAmqpC2DRejectedMessagesNotInAllowedRange(element); - case "AmqpD2CMessagesNotInAllowedRange": return AmqpD2CMessagesNotInAllowedRange.DeserializeAmqpD2CMessagesNotInAllowedRange(element); - case "ConnectionFromIpNotAllowed": return ConnectionFromIPNotAllowed.DeserializeConnectionFromIPNotAllowed(element); - case "ConnectionToIpNotAllowed": return ConnectionToIPNotAllowed.DeserializeConnectionToIPNotAllowed(element); - case "DenylistCustomAlertRule": return DenylistCustomAlertRule.DeserializeDenylistCustomAlertRule(element); - case "DirectMethodInvokesNotInAllowedRange": return DirectMethodInvokesNotInAllowedRange.DeserializeDirectMethodInvokesNotInAllowedRange(element); - case "FailedLocalLoginsNotInAllowedRange": return FailedLocalLoginsNotInAllowedRange.DeserializeFailedLocalLoginsNotInAllowedRange(element); - case "FileUploadsNotInAllowedRange": return FileUploadsNotInAllowedRange.DeserializeFileUploadsNotInAllowedRange(element); - case "HttpC2DMessagesNotInAllowedRange": return HttpC2DMessagesNotInAllowedRange.DeserializeHttpC2DMessagesNotInAllowedRange(element); - case "HttpC2DRejectedMessagesNotInAllowedRange": return HttpC2DRejectedMessagesNotInAllowedRange.DeserializeHttpC2DRejectedMessagesNotInAllowedRange(element); - case "HttpD2CMessagesNotInAllowedRange": return HttpD2CMessagesNotInAllowedRange.DeserializeHttpD2CMessagesNotInAllowedRange(element); - case "ListCustomAlertRule": return ListCustomAlertRule.DeserializeListCustomAlertRule(element); - case "LocalUserNotAllowed": return LocalUserNotAllowed.DeserializeLocalUserNotAllowed(element); - case "MqttC2DMessagesNotInAllowedRange": return MqttC2DMessagesNotInAllowedRange.DeserializeMqttC2DMessagesNotInAllowedRange(element); - case "MqttC2DRejectedMessagesNotInAllowedRange": return MqttC2DRejectedMessagesNotInAllowedRange.DeserializeMqttC2DRejectedMessagesNotInAllowedRange(element); - case "MqttD2CMessagesNotInAllowedRange": return MqttD2CMessagesNotInAllowedRange.DeserializeMqttD2CMessagesNotInAllowedRange(element); - case "ProcessNotAllowed": return ProcessNotAllowed.DeserializeProcessNotAllowed(element); - case "QueuePurgesNotInAllowedRange": return QueuePurgesNotInAllowedRange.DeserializeQueuePurgesNotInAllowedRange(element); - case "TwinUpdatesNotInAllowedRange": return TwinUpdatesNotInAllowedRange.DeserializeTwinUpdatesNotInAllowedRange(element); - case "UnauthorizedOperationsNotInAllowedRange": return UnauthorizedOperationsNotInAllowedRange.DeserializeUnauthorizedOperationsNotInAllowedRange(element); - case "ActiveConnectionsNotInAllowedRange": return ActiveConnectionsNotInAllowedRange.DeserializeActiveConnectionsNotInAllowedRange(element); - case "TimeWindowCustomAlertRule": return TimeWindowCustomAlertRule.DeserializeTimeWindowCustomAlertRule(element); - case "ThresholdCustomAlertRule": return ThresholdCustomAlertRule.DeserializeThresholdCustomAlertRule(element); - } - } - return UnknownCustomAlertRule.DeserializeUnknownCustomAlertRule(element); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAlertRule.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAlertRule.cs deleted file mode 100644 index decc0f49816d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAlertRule.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// - /// A custom alert rule. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , , , , , , , , , , , and . - /// - public abstract partial class CustomAlertRule - { - /// Initializes a new instance of CustomAlertRule. - /// Status of the custom alert. - protected CustomAlertRule(bool isEnabled) - { - IsEnabled = isEnabled; - } - - /// Initializes a new instance of CustomAlertRule. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - internal CustomAlertRule(string displayName, string description, bool isEnabled, string ruleType) - { - DisplayName = displayName; - Description = description; - IsEnabled = isEnabled; - RuleType = ruleType; - } - - /// The display name of the custom alert. - public string DisplayName { get; } - /// The description of the custom alert. - public string Description { get; } - /// Status of the custom alert. - public bool IsEnabled { get; set; } - /// The type of the custom alert rule. - internal string RuleType { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationCreateOrUpdateContent.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationCreateOrUpdateContent.Serialization.cs deleted file mode 100644 index ee0953f5beda..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationCreateOrUpdateContent.Serialization.cs +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class CustomAssessmentAutomationCreateOrUpdateContent : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(CompressedQuery)) - { - writer.WritePropertyName("compressedQuery"u8); - writer.WriteStringValue(CompressedQuery); - } - if (Optional.IsDefined(SupportedCloud)) - { - writer.WritePropertyName("supportedCloud"u8); - writer.WriteStringValue(SupportedCloud.Value.ToString()); - } - if (Optional.IsDefined(Severity)) - { - writer.WritePropertyName("severity"u8); - writer.WriteStringValue(Severity.Value.ToString()); - } - if (Optional.IsDefined(DisplayName)) - { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (Optional.IsDefined(RemediationDescription)) - { - writer.WritePropertyName("remediationDescription"u8); - writer.WriteStringValue(RemediationDescription); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static CustomAssessmentAutomationCreateOrUpdateContent DeserializeCustomAssessmentAutomationCreateOrUpdateContent(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional compressedQuery = default; - Optional supportedCloud = default; - Optional severity = default; - Optional displayName = default; - Optional description = default; - Optional remediationDescription = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("compressedQuery"u8)) - { - compressedQuery = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("supportedCloud"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - supportedCloud = new CustomAssessmentAutomationSupportedCloud(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("severity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - severity = new CustomAssessmentSeverity(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("displayName"u8)) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("description"u8)) - { - description = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("remediationDescription"u8)) - { - remediationDescription = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new CustomAssessmentAutomationCreateOrUpdateContent(id, name, type, systemData.Value, compressedQuery.Value, Optional.ToNullable(supportedCloud), Optional.ToNullable(severity), displayName.Value, description.Value, remediationDescription.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationCreateOrUpdateContent.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationCreateOrUpdateContent.cs deleted file mode 100644 index 072d0910174b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationCreateOrUpdateContent.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Custom Assessment Automation request. - public partial class CustomAssessmentAutomationCreateOrUpdateContent : ResourceData - { - /// Initializes a new instance of CustomAssessmentAutomationCreateOrUpdateContent. - public CustomAssessmentAutomationCreateOrUpdateContent() - { - } - - /// Initializes a new instance of CustomAssessmentAutomationCreateOrUpdateContent. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Base 64 encoded KQL query representing the assessment automation results required. - /// Relevant cloud for the custom assessment automation. - /// The severity to relate to the assessments generated by this assessment automation. - /// The display name of the assessments generated by this assessment automation. - /// The description to relate to the assessments generated by this assessment automation. - /// The remediation description to relate to the assessments generated by this assessment automation. - internal CustomAssessmentAutomationCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string compressedQuery, CustomAssessmentAutomationSupportedCloud? supportedCloud, CustomAssessmentSeverity? severity, string displayName, string description, string remediationDescription) : base(id, name, resourceType, systemData) - { - CompressedQuery = compressedQuery; - SupportedCloud = supportedCloud; - Severity = severity; - DisplayName = displayName; - Description = description; - RemediationDescription = remediationDescription; - } - - /// Base 64 encoded KQL query representing the assessment automation results required. - public string CompressedQuery { get; set; } - /// Relevant cloud for the custom assessment automation. - public CustomAssessmentAutomationSupportedCloud? SupportedCloud { get; set; } - /// The severity to relate to the assessments generated by this assessment automation. - public CustomAssessmentSeverity? Severity { get; set; } - /// The display name of the assessments generated by this assessment automation. - public string DisplayName { get; set; } - /// The description to relate to the assessments generated by this assessment automation. - public string Description { get; set; } - /// The remediation description to relate to the assessments generated by this assessment automation. - public string RemediationDescription { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationData.Serialization.cs deleted file mode 100644 index 4addc554fc16..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationData.Serialization.cs +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class CustomAssessmentAutomationData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(CompressedQuery)) - { - writer.WritePropertyName("compressedQuery"u8); - writer.WriteStringValue(CompressedQuery); - } - if (Optional.IsDefined(SupportedCloud)) - { - writer.WritePropertyName("supportedCloud"u8); - writer.WriteStringValue(SupportedCloud.Value.ToString()); - } - if (Optional.IsDefined(Severity)) - { - writer.WritePropertyName("severity"u8); - writer.WriteStringValue(Severity.Value.ToString()); - } - if (Optional.IsDefined(DisplayName)) - { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (Optional.IsDefined(RemediationDescription)) - { - writer.WritePropertyName("remediationDescription"u8); - writer.WriteStringValue(RemediationDescription); - } - if (Optional.IsDefined(AssessmentKey)) - { - writer.WritePropertyName("assessmentKey"u8); - writer.WriteStringValue(AssessmentKey); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static CustomAssessmentAutomationData DeserializeCustomAssessmentAutomationData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional compressedQuery = default; - Optional supportedCloud = default; - Optional severity = default; - Optional displayName = default; - Optional description = default; - Optional remediationDescription = default; - Optional assessmentKey = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("compressedQuery"u8)) - { - compressedQuery = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("supportedCloud"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - supportedCloud = new CustomAssessmentAutomationSupportedCloud(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("severity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - severity = new CustomAssessmentSeverity(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("displayName"u8)) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("description"u8)) - { - description = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("remediationDescription"u8)) - { - remediationDescription = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("assessmentKey"u8)) - { - assessmentKey = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new CustomAssessmentAutomationData(id, name, type, systemData.Value, compressedQuery.Value, Optional.ToNullable(supportedCloud), Optional.ToNullable(severity), displayName.Value, description.Value, remediationDescription.Value, assessmentKey.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationSupportedCloud.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationSupportedCloud.cs deleted file mode 100644 index 7db1e5be3776..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationSupportedCloud.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Relevant cloud for the custom assessment automation. - public readonly partial struct CustomAssessmentAutomationSupportedCloud : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CustomAssessmentAutomationSupportedCloud(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AwsValue = "AWS"; - private const string GcpValue = "GCP"; - - /// AWS. - public static CustomAssessmentAutomationSupportedCloud Aws { get; } = new CustomAssessmentAutomationSupportedCloud(AwsValue); - /// GCP. - public static CustomAssessmentAutomationSupportedCloud Gcp { get; } = new CustomAssessmentAutomationSupportedCloud(GcpValue); - /// Determines if two values are the same. - public static bool operator ==(CustomAssessmentAutomationSupportedCloud left, CustomAssessmentAutomationSupportedCloud right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CustomAssessmentAutomationSupportedCloud left, CustomAssessmentAutomationSupportedCloud right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator CustomAssessmentAutomationSupportedCloud(string value) => new CustomAssessmentAutomationSupportedCloud(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CustomAssessmentAutomationSupportedCloud other && Equals(other); - /// - public bool Equals(CustomAssessmentAutomationSupportedCloud other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationsListResult.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationsListResult.Serialization.cs deleted file mode 100644 index c2db83c8d69b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationsListResult.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class CustomAssessmentAutomationsListResult - { - internal static CustomAssessmentAutomationsListResult DeserializeCustomAssessmentAutomationsListResult(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CustomAssessmentAutomationData.DeserializeCustomAssessmentAutomationData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new CustomAssessmentAutomationsListResult(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationsListResult.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationsListResult.cs deleted file mode 100644 index 070fc22e9281..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentAutomationsListResult.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A list of Custom Assessment Automations. - internal partial class CustomAssessmentAutomationsListResult - { - /// Initializes a new instance of CustomAssessmentAutomationsListResult. - internal CustomAssessmentAutomationsListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of CustomAssessmentAutomationsListResult. - /// Collection of Custom Assessment Automations. - /// The link used to get the next page of operations. - internal CustomAssessmentAutomationsListResult(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of Custom Assessment Automations. - public IReadOnlyList Value { get; } - /// The link used to get the next page of operations. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentSeverity.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentSeverity.cs deleted file mode 100644 index 2de71f70d202..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomAssessmentSeverity.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The severity to relate to the assessments generated by this assessment automation. - public readonly partial struct CustomAssessmentSeverity : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public CustomAssessmentSeverity(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string HighValue = "High"; - private const string MediumValue = "Medium"; - private const string LowValue = "Low"; - - /// High. - public static CustomAssessmentSeverity High { get; } = new CustomAssessmentSeverity(HighValue); - /// Medium. - public static CustomAssessmentSeverity Medium { get; } = new CustomAssessmentSeverity(MediumValue); - /// Low. - public static CustomAssessmentSeverity Low { get; } = new CustomAssessmentSeverity(LowValue); - /// Determines if two values are the same. - public static bool operator ==(CustomAssessmentSeverity left, CustomAssessmentSeverity right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(CustomAssessmentSeverity left, CustomAssessmentSeverity right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator CustomAssessmentSeverity(string value) => new CustomAssessmentSeverity(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is CustomAssessmentSeverity other && Equals(other); - /// - public bool Equals(CustomAssessmentSeverity other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomEntityStoreAssignmentCreateOrUpdateContent.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomEntityStoreAssignmentCreateOrUpdateContent.Serialization.cs deleted file mode 100644 index 35aa28a0bd4a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomEntityStoreAssignmentCreateOrUpdateContent.Serialization.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class CustomEntityStoreAssignmentCreateOrUpdateContent : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Principal)) - { - writer.WritePropertyName("principal"u8); - writer.WriteStringValue(Principal); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomEntityStoreAssignmentCreateOrUpdateContent.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomEntityStoreAssignmentCreateOrUpdateContent.cs deleted file mode 100644 index 4a7666033892..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomEntityStoreAssignmentCreateOrUpdateContent.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// describes the custom entity store assignment request. - public partial class CustomEntityStoreAssignmentCreateOrUpdateContent - { - /// Initializes a new instance of CustomEntityStoreAssignmentCreateOrUpdateContent. - public CustomEntityStoreAssignmentCreateOrUpdateContent() - { - } - - /// The principal assigned with entity store. If not provided, will use caller principal. Format of principal is: [AAD type]=[PrincipalObjectId];[TenantId]. - public string Principal { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomEntityStoreAssignmentData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomEntityStoreAssignmentData.Serialization.cs deleted file mode 100644 index d1c815d1bd3d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomEntityStoreAssignmentData.Serialization.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class CustomEntityStoreAssignmentData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Principal)) - { - writer.WritePropertyName("principal"u8); - writer.WriteStringValue(Principal); - } - if (Optional.IsDefined(EntityStoreDatabaseLink)) - { - writer.WritePropertyName("entityStoreDatabaseLink"u8); - writer.WriteStringValue(EntityStoreDatabaseLink); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static CustomEntityStoreAssignmentData DeserializeCustomEntityStoreAssignmentData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional principal = default; - Optional entityStoreDatabaseLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("principal"u8)) - { - principal = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("entityStoreDatabaseLink"u8)) - { - entityStoreDatabaseLink = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new CustomEntityStoreAssignmentData(id, name, type, systemData.Value, principal.Value, entityStoreDatabaseLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomEntityStoreAssignmentsListResult.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomEntityStoreAssignmentsListResult.Serialization.cs deleted file mode 100644 index 739c8a0f601e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomEntityStoreAssignmentsListResult.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class CustomEntityStoreAssignmentsListResult - { - internal static CustomEntityStoreAssignmentsListResult DeserializeCustomEntityStoreAssignmentsListResult(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(CustomEntityStoreAssignmentData.DeserializeCustomEntityStoreAssignmentData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new CustomEntityStoreAssignmentsListResult(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomEntityStoreAssignmentsListResult.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomEntityStoreAssignmentsListResult.cs deleted file mode 100644 index b27ec5fd6535..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/CustomEntityStoreAssignmentsListResult.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A list of custom entity store assignments. - internal partial class CustomEntityStoreAssignmentsListResult - { - /// Initializes a new instance of CustomEntityStoreAssignmentsListResult. - internal CustomEntityStoreAssignmentsListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of CustomEntityStoreAssignmentsListResult. - /// Collection of custom entity store assignments. - /// The link used to get the next page of operations. - internal CustomEntityStoreAssignmentsListResult(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of custom entity store assignments. - public IReadOnlyList Value { get; } - /// The link used to get the next page of operations. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DataExportSettings.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DataExportSettings.Serialization.cs deleted file mode 100644 index 171f4d4f7a8d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DataExportSettings.Serialization.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DataExportSettings : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static DataExportSettings DeserializeDataExportSettings(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - SettingKind kind = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional enabled = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kind"u8)) - { - kind = new SettingKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("enabled"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new DataExportSettings(id, name, type, systemData.Value, kind, Optional.ToNullable(enabled)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DataExportSettings.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DataExportSettings.cs deleted file mode 100644 index 0e337d5dd774..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DataExportSettings.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Represents a data export setting. - public partial class DataExportSettings : SecuritySettingData - { - /// Initializes a new instance of DataExportSettings. - public DataExportSettings() - { - Kind = SettingKind.DataExportSettings; - } - - /// Initializes a new instance of DataExportSettings. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// the kind of the settings string. - /// Is the data export setting enabled. - internal DataExportSettings(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SettingKind kind, bool? isEnabled) : base(id, name, resourceType, systemData, kind) - { - IsEnabled = isEnabled; - Kind = kind; - } - - /// Is the data export setting enabled. - public bool? IsEnabled { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOffering.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOffering.Serialization.cs deleted file mode 100644 index 076e29d4f4d6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOffering.Serialization.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderCspmAwsOffering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(VmScanners)) - { - writer.WritePropertyName("vmScanners"u8); - writer.WriteObjectValue(VmScanners); - } - writer.WritePropertyName("offeringType"u8); - writer.WriteStringValue(OfferingType.ToString()); - writer.WriteEndObject(); - } - - internal static DefenderCspmAwsOffering DeserializeDefenderCspmAwsOffering(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional vmScanners = default; - OfferingType offeringType = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("vmScanners"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - vmScanners = DefenderCspmAwsOfferingVmScanners.DeserializeDefenderCspmAwsOfferingVmScanners(property.Value); - continue; - } - if (property.NameEquals("offeringType"u8)) - { - offeringType = new OfferingType(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new DefenderCspmAwsOffering(offeringType, description.Value, vmScanners.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOffering.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOffering.cs deleted file mode 100644 index d6d3bc5d6705..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOffering.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The CSPM P1 for Aws offering. - public partial class DefenderCspmAwsOffering : SecurityCenterCloudOffering - { - /// Initializes a new instance of DefenderCspmAwsOffering. - public DefenderCspmAwsOffering() - { - OfferingType = OfferingType.DefenderCspmAws; - } - - /// Initializes a new instance of DefenderCspmAwsOffering. - /// The type of the security offering. - /// The offering description. - /// The Microsoft Defender for Server VM scanning configuration. - internal DefenderCspmAwsOffering(OfferingType offeringType, string description, DefenderCspmAwsOfferingVmScanners vmScanners) : base(offeringType, description) - { - VmScanners = vmScanners; - OfferingType = offeringType; - } - - /// The Microsoft Defender for Server VM scanning configuration. - public DefenderCspmAwsOfferingVmScanners VmScanners { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOfferingVmScanners.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOfferingVmScanners.Serialization.cs deleted file mode 100644 index d8af31f7e397..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOfferingVmScanners.Serialization.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderCspmAwsOfferingVmScanners : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(Enabled.Value); - } - if (Optional.IsDefined(Configuration)) - { - writer.WritePropertyName("configuration"u8); - writer.WriteObjectValue(Configuration); - } - writer.WriteEndObject(); - } - - internal static DefenderCspmAwsOfferingVmScanners DeserializeDefenderCspmAwsOfferingVmScanners(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - Optional configuration = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("configuration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - configuration = DefenderCspmAwsOfferingVmScannersConfiguration.DeserializeDefenderCspmAwsOfferingVmScannersConfiguration(property.Value); - continue; - } - } - return new DefenderCspmAwsOfferingVmScanners(Optional.ToNullable(enabled), configuration.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOfferingVmScanners.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOfferingVmScanners.cs deleted file mode 100644 index ef9c2ac77999..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOfferingVmScanners.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The Microsoft Defender for Server VM scanning configuration. - public partial class DefenderCspmAwsOfferingVmScanners - { - /// Initializes a new instance of DefenderCspmAwsOfferingVmScanners. - public DefenderCspmAwsOfferingVmScanners() - { - } - - /// Initializes a new instance of DefenderCspmAwsOfferingVmScanners. - /// Is Microsoft Defender for Server VM scanning enabled. - /// configuration for Microsoft Defender for Server VM scanning. - internal DefenderCspmAwsOfferingVmScanners(bool? enabled, DefenderCspmAwsOfferingVmScannersConfiguration configuration) - { - Enabled = enabled; - Configuration = configuration; - } - - /// Is Microsoft Defender for Server VM scanning enabled. - public bool? Enabled { get; set; } - /// configuration for Microsoft Defender for Server VM scanning. - public DefenderCspmAwsOfferingVmScannersConfiguration Configuration { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOfferingVmScannersConfiguration.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOfferingVmScannersConfiguration.Serialization.cs deleted file mode 100644 index b0f127bc3d15..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOfferingVmScannersConfiguration.Serialization.cs +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderCspmAwsOfferingVmScannersConfiguration : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(CloudRoleArn)) - { - writer.WritePropertyName("cloudRoleArn"u8); - writer.WriteStringValue(CloudRoleArn); - } - if (Optional.IsDefined(ScanningMode)) - { - writer.WritePropertyName("scanningMode"u8); - writer.WriteStringValue(ScanningMode.Value.ToString()); - } - if (Optional.IsCollectionDefined(ExclusionTags)) - { - writer.WritePropertyName("exclusionTags"u8); - writer.WriteStartObject(); - foreach (var item in ExclusionTags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - } - - internal static DefenderCspmAwsOfferingVmScannersConfiguration DeserializeDefenderCspmAwsOfferingVmScannersConfiguration(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional cloudRoleArn = default; - Optional scanningMode = default; - Optional> exclusionTags = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("cloudRoleArn"u8)) - { - cloudRoleArn = property.Value.GetString(); - continue; - } - if (property.NameEquals("scanningMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - scanningMode = new DefenderForServersScanningMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("exclusionTags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - exclusionTags = dictionary; - continue; - } - } - return new DefenderCspmAwsOfferingVmScannersConfiguration(cloudRoleArn.Value, Optional.ToNullable(scanningMode), Optional.ToDictionary(exclusionTags)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOfferingVmScannersConfiguration.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOfferingVmScannersConfiguration.cs deleted file mode 100644 index 9567c17bd733..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmAwsOfferingVmScannersConfiguration.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// configuration for Microsoft Defender for Server VM scanning. - public partial class DefenderCspmAwsOfferingVmScannersConfiguration - { - /// Initializes a new instance of DefenderCspmAwsOfferingVmScannersConfiguration. - public DefenderCspmAwsOfferingVmScannersConfiguration() - { - ExclusionTags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of DefenderCspmAwsOfferingVmScannersConfiguration. - /// The cloud role ARN in AWS for this feature. - /// The scanning mode for the vm scan. - /// VM tags that indicates that VM should not be scanned. - internal DefenderCspmAwsOfferingVmScannersConfiguration(string cloudRoleArn, DefenderForServersScanningMode? scanningMode, IDictionary exclusionTags) - { - CloudRoleArn = cloudRoleArn; - ScanningMode = scanningMode; - ExclusionTags = exclusionTags; - } - - /// The cloud role ARN in AWS for this feature. - public string CloudRoleArn { get; set; } - /// The scanning mode for the vm scan. - public DefenderForServersScanningMode? ScanningMode { get; set; } - /// VM tags that indicates that VM should not be scanned. - public IDictionary ExclusionTags { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmGcpOffering.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmGcpOffering.Serialization.cs deleted file mode 100644 index 541007b7a9dc..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmGcpOffering.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderCspmGcpOffering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("offeringType"u8); - writer.WriteStringValue(OfferingType.ToString()); - writer.WriteEndObject(); - } - - internal static DefenderCspmGcpOffering DeserializeDefenderCspmGcpOffering(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - OfferingType offeringType = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("offeringType"u8)) - { - offeringType = new OfferingType(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new DefenderCspmGcpOffering(offeringType, description.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmGcpOffering.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmGcpOffering.cs deleted file mode 100644 index ac419a31bf71..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderCspmGcpOffering.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The CSPM P1 for GCP offering. - public partial class DefenderCspmGcpOffering : SecurityCenterCloudOffering - { - /// Initializes a new instance of DefenderCspmGcpOffering. - public DefenderCspmGcpOffering() - { - OfferingType = OfferingType.DefenderCspmGcp; - } - - /// Initializes a new instance of DefenderCspmGcpOffering. - /// The type of the security offering. - /// The offering description. - internal DefenderCspmGcpOffering(OfferingType offeringType, string description) : base(offeringType, description) - { - OfferingType = offeringType; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOffering.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOffering.Serialization.cs deleted file mode 100644 index ed68d096d094..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOffering.Serialization.cs +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForContainersAwsOffering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(KubernetesService)) - { - writer.WritePropertyName("kubernetesService"u8); - writer.WriteObjectValue(KubernetesService); - } - if (Optional.IsDefined(KubernetesScubaReader)) - { - writer.WritePropertyName("kubernetesScubaReader"u8); - writer.WriteObjectValue(KubernetesScubaReader); - } - if (Optional.IsDefined(CloudWatchToKinesis)) - { - writer.WritePropertyName("cloudWatchToKinesis"u8); - writer.WriteObjectValue(CloudWatchToKinesis); - } - if (Optional.IsDefined(KinesisToS3)) - { - writer.WritePropertyName("kinesisToS3"u8); - writer.WriteObjectValue(KinesisToS3); - } - if (Optional.IsDefined(ContainerVulnerabilityAssessment)) - { - writer.WritePropertyName("containerVulnerabilityAssessment"u8); - writer.WriteObjectValue(ContainerVulnerabilityAssessment); - } - if (Optional.IsDefined(ContainerVulnerabilityAssessmentTask)) - { - writer.WritePropertyName("containerVulnerabilityAssessmentTask"u8); - writer.WriteObjectValue(ContainerVulnerabilityAssessmentTask); - } - if (Optional.IsDefined(IsContainerVulnerabilityAssessmentEnabled)) - { - writer.WritePropertyName("enableContainerVulnerabilityAssessment"u8); - writer.WriteBooleanValue(IsContainerVulnerabilityAssessmentEnabled.Value); - } - if (Optional.IsDefined(IsAutoProvisioningEnabled)) - { - writer.WritePropertyName("autoProvisioning"u8); - writer.WriteBooleanValue(IsAutoProvisioningEnabled.Value); - } - if (Optional.IsDefined(KubeAuditRetentionTime)) - { - writer.WritePropertyName("kubeAuditRetentionTime"u8); - writer.WriteNumberValue(KubeAuditRetentionTime.Value); - } - if (Optional.IsDefined(ScubaExternalId)) - { - writer.WritePropertyName("scubaExternalId"u8); - writer.WriteStringValue(ScubaExternalId); - } - writer.WritePropertyName("offeringType"u8); - writer.WriteStringValue(OfferingType.ToString()); - writer.WriteEndObject(); - } - - internal static DefenderForContainersAwsOffering DeserializeDefenderForContainersAwsOffering(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional kubernetesService = default; - Optional kubernetesScubaReader = default; - Optional cloudWatchToKinesis = default; - Optional kinesisToS3 = default; - Optional containerVulnerabilityAssessment = default; - Optional containerVulnerabilityAssessmentTask = default; - Optional enableContainerVulnerabilityAssessment = default; - Optional autoProvisioning = default; - Optional kubeAuditRetentionTime = default; - Optional scubaExternalId = default; - OfferingType offeringType = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kubernetesService"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - kubernetesService = DefenderForContainersAwsOfferingKubernetesService.DeserializeDefenderForContainersAwsOfferingKubernetesService(property.Value); - continue; - } - if (property.NameEquals("kubernetesScubaReader"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - kubernetesScubaReader = DefenderForContainersAwsOfferingKubernetesScubaReader.DeserializeDefenderForContainersAwsOfferingKubernetesScubaReader(property.Value); - continue; - } - if (property.NameEquals("cloudWatchToKinesis"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - cloudWatchToKinesis = DefenderForContainersAwsOfferingCloudWatchToKinesis.DeserializeDefenderForContainersAwsOfferingCloudWatchToKinesis(property.Value); - continue; - } - if (property.NameEquals("kinesisToS3"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - kinesisToS3 = DefenderForContainersAwsOfferingKinesisToS3.DeserializeDefenderForContainersAwsOfferingKinesisToS3(property.Value); - continue; - } - if (property.NameEquals("containerVulnerabilityAssessment"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - containerVulnerabilityAssessment = DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.DeserializeDefenderForContainersAwsOfferingContainerVulnerabilityAssessment(property.Value); - continue; - } - if (property.NameEquals("containerVulnerabilityAssessmentTask"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - containerVulnerabilityAssessmentTask = DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.DeserializeDefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask(property.Value); - continue; - } - if (property.NameEquals("enableContainerVulnerabilityAssessment"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enableContainerVulnerabilityAssessment = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("autoProvisioning"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - autoProvisioning = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("kubeAuditRetentionTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - kubeAuditRetentionTime = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("scubaExternalId"u8)) - { - scubaExternalId = property.Value.GetString(); - continue; - } - if (property.NameEquals("offeringType"u8)) - { - offeringType = new OfferingType(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new DefenderForContainersAwsOffering(offeringType, description.Value, kubernetesService.Value, kubernetesScubaReader.Value, cloudWatchToKinesis.Value, kinesisToS3.Value, containerVulnerabilityAssessment.Value, containerVulnerabilityAssessmentTask.Value, Optional.ToNullable(enableContainerVulnerabilityAssessment), Optional.ToNullable(autoProvisioning), Optional.ToNullable(kubeAuditRetentionTime), scubaExternalId.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOffering.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOffering.cs deleted file mode 100644 index 6ea9076f697a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOffering.cs +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The Defender for Containers AWS offering. - public partial class DefenderForContainersAwsOffering : SecurityCenterCloudOffering - { - /// Initializes a new instance of DefenderForContainersAwsOffering. - public DefenderForContainersAwsOffering() - { - OfferingType = OfferingType.DefenderForContainersAws; - } - - /// Initializes a new instance of DefenderForContainersAwsOffering. - /// The type of the security offering. - /// The offering description. - /// The kubernetes service connection configuration. - /// The kubernetes to scuba connection configuration. - /// The cloudwatch to kinesis connection configuration. - /// The kinesis to s3 connection configuration. - /// The container vulnerability assessment configuration. - /// The container vulnerability assessment task configuration. - /// Enable container vulnerability assessment feature. - /// Is audit logs pipeline auto provisioning enabled. - /// The retention time in days of kube audit logs set on the CloudWatch log group. - /// The externalId used by the data reader to prevent the confused deputy attack. - internal DefenderForContainersAwsOffering(OfferingType offeringType, string description, DefenderForContainersAwsOfferingKubernetesService kubernetesService, DefenderForContainersAwsOfferingKubernetesScubaReader kubernetesScubaReader, DefenderForContainersAwsOfferingCloudWatchToKinesis cloudWatchToKinesis, DefenderForContainersAwsOfferingKinesisToS3 kinesisToS3, DefenderForContainersAwsOfferingContainerVulnerabilityAssessment containerVulnerabilityAssessment, DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask containerVulnerabilityAssessmentTask, bool? isContainerVulnerabilityAssessmentEnabled, bool? isAutoProvisioningEnabled, long? kubeAuditRetentionTime, string scubaExternalId) : base(offeringType, description) - { - KubernetesService = kubernetesService; - KubernetesScubaReader = kubernetesScubaReader; - CloudWatchToKinesis = cloudWatchToKinesis; - KinesisToS3 = kinesisToS3; - ContainerVulnerabilityAssessment = containerVulnerabilityAssessment; - ContainerVulnerabilityAssessmentTask = containerVulnerabilityAssessmentTask; - IsContainerVulnerabilityAssessmentEnabled = isContainerVulnerabilityAssessmentEnabled; - IsAutoProvisioningEnabled = isAutoProvisioningEnabled; - KubeAuditRetentionTime = kubeAuditRetentionTime; - ScubaExternalId = scubaExternalId; - OfferingType = offeringType; - } - - /// The kubernetes service connection configuration. - internal DefenderForContainersAwsOfferingKubernetesService KubernetesService { get; set; } - /// The cloud role ARN in AWS for this feature used for provisioning resources. - public string KubernetesServiceCloudRoleArn - { - get => KubernetesService is null ? default : KubernetesService.CloudRoleArn; - set - { - if (KubernetesService is null) - KubernetesService = new DefenderForContainersAwsOfferingKubernetesService(); - KubernetesService.CloudRoleArn = value; - } - } - - /// The kubernetes to scuba connection configuration. - internal DefenderForContainersAwsOfferingKubernetesScubaReader KubernetesScubaReader { get; set; } - /// The cloud role ARN in AWS for this feature used for reading data. - public string KubernetesScubaReaderCloudRoleArn - { - get => KubernetesScubaReader is null ? default : KubernetesScubaReader.CloudRoleArn; - set - { - if (KubernetesScubaReader is null) - KubernetesScubaReader = new DefenderForContainersAwsOfferingKubernetesScubaReader(); - KubernetesScubaReader.CloudRoleArn = value; - } - } - - /// The cloudwatch to kinesis connection configuration. - internal DefenderForContainersAwsOfferingCloudWatchToKinesis CloudWatchToKinesis { get; set; } - /// The cloud role ARN in AWS used by CloudWatch to transfer data into Kinesis. - public string CloudRoleArn - { - get => CloudWatchToKinesis is null ? default : CloudWatchToKinesis.CloudRoleArn; - set - { - if (CloudWatchToKinesis is null) - CloudWatchToKinesis = new DefenderForContainersAwsOfferingCloudWatchToKinesis(); - CloudWatchToKinesis.CloudRoleArn = value; - } - } - - /// The kinesis to s3 connection configuration. - internal DefenderForContainersAwsOfferingKinesisToS3 KinesisToS3 { get; set; } - /// The cloud role ARN in AWS used by Kinesis to transfer data into S3. - public string KinesisToS3CloudRoleArn - { - get => KinesisToS3 is null ? default : KinesisToS3.CloudRoleArn; - set - { - if (KinesisToS3 is null) - KinesisToS3 = new DefenderForContainersAwsOfferingKinesisToS3(); - KinesisToS3.CloudRoleArn = value; - } - } - - /// The container vulnerability assessment configuration. - internal DefenderForContainersAwsOfferingContainerVulnerabilityAssessment ContainerVulnerabilityAssessment { get; set; } - /// The cloud role ARN in AWS for this feature. - public string ContainerVulnerabilityAssessmentCloudRoleArn - { - get => ContainerVulnerabilityAssessment is null ? default : ContainerVulnerabilityAssessment.CloudRoleArn; - set - { - if (ContainerVulnerabilityAssessment is null) - ContainerVulnerabilityAssessment = new DefenderForContainersAwsOfferingContainerVulnerabilityAssessment(); - ContainerVulnerabilityAssessment.CloudRoleArn = value; - } - } - - /// The container vulnerability assessment task configuration. - internal DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask ContainerVulnerabilityAssessmentTask { get; set; } - /// The cloud role ARN in AWS for this feature. - public string ContainerVulnerabilityAssessmentTaskCloudRoleArn - { - get => ContainerVulnerabilityAssessmentTask is null ? default : ContainerVulnerabilityAssessmentTask.CloudRoleArn; - set - { - if (ContainerVulnerabilityAssessmentTask is null) - ContainerVulnerabilityAssessmentTask = new DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask(); - ContainerVulnerabilityAssessmentTask.CloudRoleArn = value; - } - } - - /// Enable container vulnerability assessment feature. - public bool? IsContainerVulnerabilityAssessmentEnabled { get; set; } - /// Is audit logs pipeline auto provisioning enabled. - public bool? IsAutoProvisioningEnabled { get; set; } - /// The retention time in days of kube audit logs set on the CloudWatch log group. - public long? KubeAuditRetentionTime { get; set; } - /// The externalId used by the data reader to prevent the confused deputy attack. - public string ScubaExternalId { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingCloudWatchToKinesis.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingCloudWatchToKinesis.Serialization.cs deleted file mode 100644 index 61f9ecee47c9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingCloudWatchToKinesis.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class DefenderForContainersAwsOfferingCloudWatchToKinesis : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(CloudRoleArn)) - { - writer.WritePropertyName("cloudRoleArn"u8); - writer.WriteStringValue(CloudRoleArn); - } - writer.WriteEndObject(); - } - - internal static DefenderForContainersAwsOfferingCloudWatchToKinesis DeserializeDefenderForContainersAwsOfferingCloudWatchToKinesis(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional cloudRoleArn = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("cloudRoleArn"u8)) - { - cloudRoleArn = property.Value.GetString(); - continue; - } - } - return new DefenderForContainersAwsOfferingCloudWatchToKinesis(cloudRoleArn.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingCloudWatchToKinesis.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingCloudWatchToKinesis.cs deleted file mode 100644 index c6836afc817d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingCloudWatchToKinesis.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The cloudwatch to kinesis connection configuration. - internal partial class DefenderForContainersAwsOfferingCloudWatchToKinesis - { - /// Initializes a new instance of DefenderForContainersAwsOfferingCloudWatchToKinesis. - public DefenderForContainersAwsOfferingCloudWatchToKinesis() - { - } - - /// Initializes a new instance of DefenderForContainersAwsOfferingCloudWatchToKinesis. - /// The cloud role ARN in AWS used by CloudWatch to transfer data into Kinesis. - internal DefenderForContainersAwsOfferingCloudWatchToKinesis(string cloudRoleArn) - { - CloudRoleArn = cloudRoleArn; - } - - /// The cloud role ARN in AWS used by CloudWatch to transfer data into Kinesis. - public string CloudRoleArn { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.Serialization.cs deleted file mode 100644 index 12308f8ead54..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class DefenderForContainersAwsOfferingContainerVulnerabilityAssessment : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(CloudRoleArn)) - { - writer.WritePropertyName("cloudRoleArn"u8); - writer.WriteStringValue(CloudRoleArn); - } - writer.WriteEndObject(); - } - - internal static DefenderForContainersAwsOfferingContainerVulnerabilityAssessment DeserializeDefenderForContainersAwsOfferingContainerVulnerabilityAssessment(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional cloudRoleArn = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("cloudRoleArn"u8)) - { - cloudRoleArn = property.Value.GetString(); - continue; - } - } - return new DefenderForContainersAwsOfferingContainerVulnerabilityAssessment(cloudRoleArn.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.cs deleted file mode 100644 index 9091d190ba67..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessment.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The container vulnerability assessment configuration. - internal partial class DefenderForContainersAwsOfferingContainerVulnerabilityAssessment - { - /// Initializes a new instance of DefenderForContainersAwsOfferingContainerVulnerabilityAssessment. - public DefenderForContainersAwsOfferingContainerVulnerabilityAssessment() - { - } - - /// Initializes a new instance of DefenderForContainersAwsOfferingContainerVulnerabilityAssessment. - /// The cloud role ARN in AWS for this feature. - internal DefenderForContainersAwsOfferingContainerVulnerabilityAssessment(string cloudRoleArn) - { - CloudRoleArn = cloudRoleArn; - } - - /// The cloud role ARN in AWS for this feature. - public string CloudRoleArn { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.Serialization.cs deleted file mode 100644 index 0bd2d0b74c1b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(CloudRoleArn)) - { - writer.WritePropertyName("cloudRoleArn"u8); - writer.WriteStringValue(CloudRoleArn); - } - writer.WriteEndObject(); - } - - internal static DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask DeserializeDefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional cloudRoleArn = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("cloudRoleArn"u8)) - { - cloudRoleArn = property.Value.GetString(); - continue; - } - } - return new DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask(cloudRoleArn.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.cs deleted file mode 100644 index f98300dd89c9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The container vulnerability assessment task configuration. - internal partial class DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask - { - /// Initializes a new instance of DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask. - public DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask() - { - } - - /// Initializes a new instance of DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask. - /// The cloud role ARN in AWS for this feature. - internal DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask(string cloudRoleArn) - { - CloudRoleArn = cloudRoleArn; - } - - /// The cloud role ARN in AWS for this feature. - public string CloudRoleArn { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKinesisToS3.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKinesisToS3.Serialization.cs deleted file mode 100644 index 4fcaa444fd81..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKinesisToS3.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class DefenderForContainersAwsOfferingKinesisToS3 : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(CloudRoleArn)) - { - writer.WritePropertyName("cloudRoleArn"u8); - writer.WriteStringValue(CloudRoleArn); - } - writer.WriteEndObject(); - } - - internal static DefenderForContainersAwsOfferingKinesisToS3 DeserializeDefenderForContainersAwsOfferingKinesisToS3(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional cloudRoleArn = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("cloudRoleArn"u8)) - { - cloudRoleArn = property.Value.GetString(); - continue; - } - } - return new DefenderForContainersAwsOfferingKinesisToS3(cloudRoleArn.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKinesisToS3.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKinesisToS3.cs deleted file mode 100644 index bffc5ee0b89d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKinesisToS3.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The kinesis to s3 connection configuration. - internal partial class DefenderForContainersAwsOfferingKinesisToS3 - { - /// Initializes a new instance of DefenderForContainersAwsOfferingKinesisToS3. - public DefenderForContainersAwsOfferingKinesisToS3() - { - } - - /// Initializes a new instance of DefenderForContainersAwsOfferingKinesisToS3. - /// The cloud role ARN in AWS used by Kinesis to transfer data into S3. - internal DefenderForContainersAwsOfferingKinesisToS3(string cloudRoleArn) - { - CloudRoleArn = cloudRoleArn; - } - - /// The cloud role ARN in AWS used by Kinesis to transfer data into S3. - public string CloudRoleArn { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKubernetesScubaReader.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKubernetesScubaReader.Serialization.cs deleted file mode 100644 index bfa99e6131bc..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKubernetesScubaReader.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class DefenderForContainersAwsOfferingKubernetesScubaReader : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(CloudRoleArn)) - { - writer.WritePropertyName("cloudRoleArn"u8); - writer.WriteStringValue(CloudRoleArn); - } - writer.WriteEndObject(); - } - - internal static DefenderForContainersAwsOfferingKubernetesScubaReader DeserializeDefenderForContainersAwsOfferingKubernetesScubaReader(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional cloudRoleArn = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("cloudRoleArn"u8)) - { - cloudRoleArn = property.Value.GetString(); - continue; - } - } - return new DefenderForContainersAwsOfferingKubernetesScubaReader(cloudRoleArn.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKubernetesScubaReader.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKubernetesScubaReader.cs deleted file mode 100644 index d14a0aa4e45e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKubernetesScubaReader.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The kubernetes to scuba connection configuration. - internal partial class DefenderForContainersAwsOfferingKubernetesScubaReader - { - /// Initializes a new instance of DefenderForContainersAwsOfferingKubernetesScubaReader. - public DefenderForContainersAwsOfferingKubernetesScubaReader() - { - } - - /// Initializes a new instance of DefenderForContainersAwsOfferingKubernetesScubaReader. - /// The cloud role ARN in AWS for this feature used for reading data. - internal DefenderForContainersAwsOfferingKubernetesScubaReader(string cloudRoleArn) - { - CloudRoleArn = cloudRoleArn; - } - - /// The cloud role ARN in AWS for this feature used for reading data. - public string CloudRoleArn { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKubernetesService.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKubernetesService.Serialization.cs deleted file mode 100644 index 84058f250da5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKubernetesService.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class DefenderForContainersAwsOfferingKubernetesService : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(CloudRoleArn)) - { - writer.WritePropertyName("cloudRoleArn"u8); - writer.WriteStringValue(CloudRoleArn); - } - writer.WriteEndObject(); - } - - internal static DefenderForContainersAwsOfferingKubernetesService DeserializeDefenderForContainersAwsOfferingKubernetesService(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional cloudRoleArn = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("cloudRoleArn"u8)) - { - cloudRoleArn = property.Value.GetString(); - continue; - } - } - return new DefenderForContainersAwsOfferingKubernetesService(cloudRoleArn.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKubernetesService.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKubernetesService.cs deleted file mode 100644 index a1deab63e668..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersAwsOfferingKubernetesService.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The kubernetes service connection configuration. - internal partial class DefenderForContainersAwsOfferingKubernetesService - { - /// Initializes a new instance of DefenderForContainersAwsOfferingKubernetesService. - public DefenderForContainersAwsOfferingKubernetesService() - { - } - - /// Initializes a new instance of DefenderForContainersAwsOfferingKubernetesService. - /// The cloud role ARN in AWS for this feature used for provisioning resources. - internal DefenderForContainersAwsOfferingKubernetesService(string cloudRoleArn) - { - CloudRoleArn = cloudRoleArn; - } - - /// The cloud role ARN in AWS for this feature used for provisioning resources. - public string CloudRoleArn { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOffering.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOffering.Serialization.cs deleted file mode 100644 index a33c6ddec072..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOffering.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForContainersGcpOffering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(NativeCloudConnection)) - { - writer.WritePropertyName("nativeCloudConnection"u8); - writer.WriteObjectValue(NativeCloudConnection); - } - if (Optional.IsDefined(DataPipelineNativeCloudConnection)) - { - writer.WritePropertyName("dataPipelineNativeCloudConnection"u8); - writer.WriteObjectValue(DataPipelineNativeCloudConnection); - } - if (Optional.IsDefined(IsAuditLogsAutoProvisioningEnabled)) - { - writer.WritePropertyName("auditLogsAutoProvisioningFlag"u8); - writer.WriteBooleanValue(IsAuditLogsAutoProvisioningEnabled.Value); - } - if (Optional.IsDefined(IsDefenderAgentAutoProvisioningEnabled)) - { - writer.WritePropertyName("defenderAgentAutoProvisioningFlag"u8); - writer.WriteBooleanValue(IsDefenderAgentAutoProvisioningEnabled.Value); - } - if (Optional.IsDefined(IsPolicyAgentAutoProvisioningEnabled)) - { - writer.WritePropertyName("policyAgentAutoProvisioningFlag"u8); - writer.WriteBooleanValue(IsPolicyAgentAutoProvisioningEnabled.Value); - } - writer.WritePropertyName("offeringType"u8); - writer.WriteStringValue(OfferingType.ToString()); - writer.WriteEndObject(); - } - - internal static DefenderForContainersGcpOffering DeserializeDefenderForContainersGcpOffering(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional nativeCloudConnection = default; - Optional dataPipelineNativeCloudConnection = default; - Optional auditLogsAutoProvisioningFlag = default; - Optional defenderAgentAutoProvisioningFlag = default; - Optional policyAgentAutoProvisioningFlag = default; - OfferingType offeringType = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("nativeCloudConnection"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - nativeCloudConnection = DefenderForContainersGcpOfferingNativeCloudConnection.DeserializeDefenderForContainersGcpOfferingNativeCloudConnection(property.Value); - continue; - } - if (property.NameEquals("dataPipelineNativeCloudConnection"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - dataPipelineNativeCloudConnection = DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.DeserializeDefenderForContainersGcpOfferingDataPipelineNativeCloudConnection(property.Value); - continue; - } - if (property.NameEquals("auditLogsAutoProvisioningFlag"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - auditLogsAutoProvisioningFlag = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("defenderAgentAutoProvisioningFlag"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - defenderAgentAutoProvisioningFlag = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("policyAgentAutoProvisioningFlag"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - policyAgentAutoProvisioningFlag = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("offeringType"u8)) - { - offeringType = new OfferingType(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new DefenderForContainersGcpOffering(offeringType, description.Value, nativeCloudConnection.Value, dataPipelineNativeCloudConnection.Value, Optional.ToNullable(auditLogsAutoProvisioningFlag), Optional.ToNullable(defenderAgentAutoProvisioningFlag), Optional.ToNullable(policyAgentAutoProvisioningFlag)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOffering.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOffering.cs deleted file mode 100644 index 7e547ab2ded8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOffering.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The containers GCP offering. - public partial class DefenderForContainersGcpOffering : SecurityCenterCloudOffering - { - /// Initializes a new instance of DefenderForContainersGcpOffering. - public DefenderForContainersGcpOffering() - { - OfferingType = OfferingType.DefenderForContainersGcp; - } - - /// Initializes a new instance of DefenderForContainersGcpOffering. - /// The type of the security offering. - /// The offering description. - /// The native cloud connection configuration. - /// The native cloud connection configuration. - /// Is audit logs data collection enabled. - /// Is Microsoft Defender for Cloud Kubernetes agent auto provisioning enabled. - /// Is Policy Kubernetes agent auto provisioning enabled. - internal DefenderForContainersGcpOffering(OfferingType offeringType, string description, DefenderForContainersGcpOfferingNativeCloudConnection nativeCloudConnection, DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection dataPipelineNativeCloudConnection, bool? isAuditLogsAutoProvisioningEnabled, bool? isDefenderAgentAutoProvisioningEnabled, bool? isPolicyAgentAutoProvisioningEnabled) : base(offeringType, description) - { - NativeCloudConnection = nativeCloudConnection; - DataPipelineNativeCloudConnection = dataPipelineNativeCloudConnection; - IsAuditLogsAutoProvisioningEnabled = isAuditLogsAutoProvisioningEnabled; - IsDefenderAgentAutoProvisioningEnabled = isDefenderAgentAutoProvisioningEnabled; - IsPolicyAgentAutoProvisioningEnabled = isPolicyAgentAutoProvisioningEnabled; - OfferingType = offeringType; - } - - /// The native cloud connection configuration. - public DefenderForContainersGcpOfferingNativeCloudConnection NativeCloudConnection { get; set; } - /// The native cloud connection configuration. - public DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection DataPipelineNativeCloudConnection { get; set; } - /// Is audit logs data collection enabled. - public bool? IsAuditLogsAutoProvisioningEnabled { get; set; } - /// Is Microsoft Defender for Cloud Kubernetes agent auto provisioning enabled. - public bool? IsDefenderAgentAutoProvisioningEnabled { get; set; } - /// Is Policy Kubernetes agent auto provisioning enabled. - public bool? IsPolicyAgentAutoProvisioningEnabled { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.Serialization.cs deleted file mode 100644 index 0a0ca4db85ea..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.Serialization.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ServiceAccountEmailAddress)) - { - writer.WritePropertyName("serviceAccountEmailAddress"u8); - writer.WriteStringValue(ServiceAccountEmailAddress); - } - if (Optional.IsDefined(WorkloadIdentityProviderId)) - { - writer.WritePropertyName("workloadIdentityProviderId"u8); - writer.WriteStringValue(WorkloadIdentityProviderId); - } - writer.WriteEndObject(); - } - - internal static DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection DeserializeDefenderForContainersGcpOfferingDataPipelineNativeCloudConnection(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional serviceAccountEmailAddress = default; - Optional workloadIdentityProviderId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("serviceAccountEmailAddress"u8)) - { - serviceAccountEmailAddress = property.Value.GetString(); - continue; - } - if (property.NameEquals("workloadIdentityProviderId"u8)) - { - workloadIdentityProviderId = property.Value.GetString(); - continue; - } - } - return new DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection(serviceAccountEmailAddress.Value, workloadIdentityProviderId.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.cs deleted file mode 100644 index 54e0fcf385ac..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The native cloud connection configuration. - public partial class DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection - { - /// Initializes a new instance of DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection. - public DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection() - { - } - - /// Initializes a new instance of DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection. - /// The data collection service account email address in GCP for this offering. - /// The data collection GCP workload identity provider id for this offering. - internal DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection(string serviceAccountEmailAddress, string workloadIdentityProviderId) - { - ServiceAccountEmailAddress = serviceAccountEmailAddress; - WorkloadIdentityProviderId = workloadIdentityProviderId; - } - - /// The data collection service account email address in GCP for this offering. - public string ServiceAccountEmailAddress { get; set; } - /// The data collection GCP workload identity provider id for this offering. - public string WorkloadIdentityProviderId { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOfferingNativeCloudConnection.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOfferingNativeCloudConnection.Serialization.cs deleted file mode 100644 index aab3cfbbbbd3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOfferingNativeCloudConnection.Serialization.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForContainersGcpOfferingNativeCloudConnection : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ServiceAccountEmailAddress)) - { - writer.WritePropertyName("serviceAccountEmailAddress"u8); - writer.WriteStringValue(ServiceAccountEmailAddress); - } - if (Optional.IsDefined(WorkloadIdentityProviderId)) - { - writer.WritePropertyName("workloadIdentityProviderId"u8); - writer.WriteStringValue(WorkloadIdentityProviderId); - } - writer.WriteEndObject(); - } - - internal static DefenderForContainersGcpOfferingNativeCloudConnection DeserializeDefenderForContainersGcpOfferingNativeCloudConnection(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional serviceAccountEmailAddress = default; - Optional workloadIdentityProviderId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("serviceAccountEmailAddress"u8)) - { - serviceAccountEmailAddress = property.Value.GetString(); - continue; - } - if (property.NameEquals("workloadIdentityProviderId"u8)) - { - workloadIdentityProviderId = property.Value.GetString(); - continue; - } - } - return new DefenderForContainersGcpOfferingNativeCloudConnection(serviceAccountEmailAddress.Value, workloadIdentityProviderId.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOfferingNativeCloudConnection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOfferingNativeCloudConnection.cs deleted file mode 100644 index 2db0248b1f43..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForContainersGcpOfferingNativeCloudConnection.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The native cloud connection configuration. - public partial class DefenderForContainersGcpOfferingNativeCloudConnection - { - /// Initializes a new instance of DefenderForContainersGcpOfferingNativeCloudConnection. - public DefenderForContainersGcpOfferingNativeCloudConnection() - { - } - - /// Initializes a new instance of DefenderForContainersGcpOfferingNativeCloudConnection. - /// The service account email address in GCP for this offering. - /// The GCP workload identity provider id for this offering. - internal DefenderForContainersGcpOfferingNativeCloudConnection(string serviceAccountEmailAddress, string workloadIdentityProviderId) - { - ServiceAccountEmailAddress = serviceAccountEmailAddress; - WorkloadIdentityProviderId = workloadIdentityProviderId; - } - - /// The service account email address in GCP for this offering. - public string ServiceAccountEmailAddress { get; set; } - /// The GCP workload identity provider id for this offering. - public string WorkloadIdentityProviderId { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOffering.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOffering.Serialization.cs deleted file mode 100644 index b07e630e9157..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOffering.Serialization.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForDatabasesAwsOffering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ArcAutoProvisioning)) - { - writer.WritePropertyName("arcAutoProvisioning"u8); - writer.WriteObjectValue(ArcAutoProvisioning); - } - if (Optional.IsDefined(Rds)) - { - writer.WritePropertyName("rds"u8); - writer.WriteObjectValue(Rds); - } - writer.WritePropertyName("offeringType"u8); - writer.WriteStringValue(OfferingType.ToString()); - writer.WriteEndObject(); - } - - internal static DefenderForDatabasesAwsOffering DeserializeDefenderForDatabasesAwsOffering(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional arcAutoProvisioning = default; - Optional rds = default; - OfferingType offeringType = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("arcAutoProvisioning"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - arcAutoProvisioning = DefenderForDatabasesAwsOfferingArcAutoProvisioning.DeserializeDefenderForDatabasesAwsOfferingArcAutoProvisioning(property.Value); - continue; - } - if (property.NameEquals("rds"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - rds = DefenderForDatabasesAwsOfferingRds.DeserializeDefenderForDatabasesAwsOfferingRds(property.Value); - continue; - } - if (property.NameEquals("offeringType"u8)) - { - offeringType = new OfferingType(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new DefenderForDatabasesAwsOffering(offeringType, description.Value, arcAutoProvisioning.Value, rds.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOffering.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOffering.cs deleted file mode 100644 index 92eb9f66cd27..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOffering.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The Defender for Databases AWS offering. - public partial class DefenderForDatabasesAwsOffering : SecurityCenterCloudOffering - { - /// Initializes a new instance of DefenderForDatabasesAwsOffering. - public DefenderForDatabasesAwsOffering() - { - OfferingType = OfferingType.DefenderForDatabasesAws; - } - - /// Initializes a new instance of DefenderForDatabasesAwsOffering. - /// The type of the security offering. - /// The offering description. - /// The ARC autoprovisioning configuration. - /// The RDS configuration. - internal DefenderForDatabasesAwsOffering(OfferingType offeringType, string description, DefenderForDatabasesAwsOfferingArcAutoProvisioning arcAutoProvisioning, DefenderForDatabasesAwsOfferingRds rds) : base(offeringType, description) - { - ArcAutoProvisioning = arcAutoProvisioning; - Rds = rds; - OfferingType = offeringType; - } - - /// The ARC autoprovisioning configuration. - public DefenderForDatabasesAwsOfferingArcAutoProvisioning ArcAutoProvisioning { get; set; } - /// The RDS configuration. - public DefenderForDatabasesAwsOfferingRds Rds { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOfferingArcAutoProvisioning.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOfferingArcAutoProvisioning.Serialization.cs deleted file mode 100644 index 44c539fb0de2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOfferingArcAutoProvisioning.Serialization.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForDatabasesAwsOfferingArcAutoProvisioning : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (Optional.IsDefined(CloudRoleArn)) - { - writer.WritePropertyName("cloudRoleArn"u8); - writer.WriteStringValue(CloudRoleArn); - } - writer.WriteEndObject(); - } - - internal static DefenderForDatabasesAwsOfferingArcAutoProvisioning DeserializeDefenderForDatabasesAwsOfferingArcAutoProvisioning(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - Optional cloudRoleArn = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("cloudRoleArn"u8)) - { - cloudRoleArn = property.Value.GetString(); - continue; - } - } - return new DefenderForDatabasesAwsOfferingArcAutoProvisioning(Optional.ToNullable(enabled), cloudRoleArn.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOfferingArcAutoProvisioning.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOfferingArcAutoProvisioning.cs deleted file mode 100644 index 7d7075aa44e0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOfferingArcAutoProvisioning.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The ARC autoprovisioning configuration. - public partial class DefenderForDatabasesAwsOfferingArcAutoProvisioning - { - /// Initializes a new instance of DefenderForDatabasesAwsOfferingArcAutoProvisioning. - public DefenderForDatabasesAwsOfferingArcAutoProvisioning() - { - } - - /// Initializes a new instance of DefenderForDatabasesAwsOfferingArcAutoProvisioning. - /// Is arc auto provisioning enabled. - /// The cloud role ARN in AWS for this feature. - internal DefenderForDatabasesAwsOfferingArcAutoProvisioning(bool? isEnabled, string cloudRoleArn) - { - IsEnabled = isEnabled; - CloudRoleArn = cloudRoleArn; - } - - /// Is arc auto provisioning enabled. - public bool? IsEnabled { get; set; } - /// The cloud role ARN in AWS for this feature. - public string CloudRoleArn { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOfferingRds.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOfferingRds.Serialization.cs deleted file mode 100644 index 85ca1fa2f2cb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOfferingRds.Serialization.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForDatabasesAwsOfferingRds : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (Optional.IsDefined(CloudRoleArn)) - { - writer.WritePropertyName("cloudRoleArn"u8); - writer.WriteStringValue(CloudRoleArn); - } - writer.WriteEndObject(); - } - - internal static DefenderForDatabasesAwsOfferingRds DeserializeDefenderForDatabasesAwsOfferingRds(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - Optional cloudRoleArn = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("cloudRoleArn"u8)) - { - cloudRoleArn = property.Value.GetString(); - continue; - } - } - return new DefenderForDatabasesAwsOfferingRds(Optional.ToNullable(enabled), cloudRoleArn.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOfferingRds.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOfferingRds.cs deleted file mode 100644 index a148fbbc8dce..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesAwsOfferingRds.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The RDS configuration. - public partial class DefenderForDatabasesAwsOfferingRds - { - /// Initializes a new instance of DefenderForDatabasesAwsOfferingRds. - public DefenderForDatabasesAwsOfferingRds() - { - } - - /// Initializes a new instance of DefenderForDatabasesAwsOfferingRds. - /// Is RDS protection enabled. - /// The cloud role ARN in AWS for this feature. - internal DefenderForDatabasesAwsOfferingRds(bool? isEnabled, string cloudRoleArn) - { - IsEnabled = isEnabled; - CloudRoleArn = cloudRoleArn; - } - - /// Is RDS protection enabled. - public bool? IsEnabled { get; set; } - /// The cloud role ARN in AWS for this feature. - public string CloudRoleArn { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesGcpOffering.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesGcpOffering.Serialization.cs deleted file mode 100644 index 86d9c06a0c12..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesGcpOffering.Serialization.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForDatabasesGcpOffering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ArcAutoProvisioning)) - { - writer.WritePropertyName("arcAutoProvisioning"u8); - writer.WriteObjectValue(ArcAutoProvisioning); - } - if (Optional.IsDefined(DefenderForDatabasesArcAutoProvisioning)) - { - writer.WritePropertyName("defenderForDatabasesArcAutoProvisioning"u8); - writer.WriteObjectValue(DefenderForDatabasesArcAutoProvisioning); - } - writer.WritePropertyName("offeringType"u8); - writer.WriteStringValue(OfferingType.ToString()); - writer.WriteEndObject(); - } - - internal static DefenderForDatabasesGcpOffering DeserializeDefenderForDatabasesGcpOffering(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional arcAutoProvisioning = default; - Optional defenderForDatabasesArcAutoProvisioning = default; - OfferingType offeringType = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("arcAutoProvisioning"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - arcAutoProvisioning = DefenderForDatabasesGcpOfferingArcAutoProvisioning.DeserializeDefenderForDatabasesGcpOfferingArcAutoProvisioning(property.Value); - continue; - } - if (property.NameEquals("defenderForDatabasesArcAutoProvisioning"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - defenderForDatabasesArcAutoProvisioning = GcpDefenderForDatabasesArcAutoProvisioning.DeserializeGcpDefenderForDatabasesArcAutoProvisioning(property.Value); - continue; - } - if (property.NameEquals("offeringType"u8)) - { - offeringType = new OfferingType(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new DefenderForDatabasesGcpOffering(offeringType, description.Value, arcAutoProvisioning.Value, defenderForDatabasesArcAutoProvisioning.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesGcpOffering.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesGcpOffering.cs deleted file mode 100644 index c4b563162e93..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesGcpOffering.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The Defender for Databases GCP offering configurations. - public partial class DefenderForDatabasesGcpOffering : SecurityCenterCloudOffering - { - /// Initializes a new instance of DefenderForDatabasesGcpOffering. - public DefenderForDatabasesGcpOffering() - { - OfferingType = OfferingType.DefenderForDatabasesGcp; - } - - /// Initializes a new instance of DefenderForDatabasesGcpOffering. - /// The type of the security offering. - /// The offering description. - /// The ARC autoprovisioning configuration. - /// The native cloud connection configuration. - internal DefenderForDatabasesGcpOffering(OfferingType offeringType, string description, DefenderForDatabasesGcpOfferingArcAutoProvisioning arcAutoProvisioning, GcpDefenderForDatabasesArcAutoProvisioning defenderForDatabasesArcAutoProvisioning) : base(offeringType, description) - { - ArcAutoProvisioning = arcAutoProvisioning; - DefenderForDatabasesArcAutoProvisioning = defenderForDatabasesArcAutoProvisioning; - OfferingType = offeringType; - } - - /// The ARC autoprovisioning configuration. - internal DefenderForDatabasesGcpOfferingArcAutoProvisioning ArcAutoProvisioning { get; set; } - /// Is arc auto provisioning enabled. - public bool? IsEnabled - { - get => ArcAutoProvisioning is null ? default : ArcAutoProvisioning.IsEnabled; - set - { - if (ArcAutoProvisioning is null) - ArcAutoProvisioning = new DefenderForDatabasesGcpOfferingArcAutoProvisioning(); - ArcAutoProvisioning.IsEnabled = value; - } - } - - /// The native cloud connection configuration. - public GcpDefenderForDatabasesArcAutoProvisioning DefenderForDatabasesArcAutoProvisioning { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesGcpOfferingArcAutoProvisioning.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesGcpOfferingArcAutoProvisioning.Serialization.cs deleted file mode 100644 index 92008c095e87..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesGcpOfferingArcAutoProvisioning.Serialization.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class DefenderForDatabasesGcpOfferingArcAutoProvisioning : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - writer.WriteEndObject(); - } - - internal static DefenderForDatabasesGcpOfferingArcAutoProvisioning DeserializeDefenderForDatabasesGcpOfferingArcAutoProvisioning(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - } - return new DefenderForDatabasesGcpOfferingArcAutoProvisioning(Optional.ToNullable(enabled)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesGcpOfferingArcAutoProvisioning.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesGcpOfferingArcAutoProvisioning.cs deleted file mode 100644 index 983eaf9a4e94..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDatabasesGcpOfferingArcAutoProvisioning.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The ARC autoprovisioning configuration. - internal partial class DefenderForDatabasesGcpOfferingArcAutoProvisioning - { - /// Initializes a new instance of DefenderForDatabasesGcpOfferingArcAutoProvisioning. - public DefenderForDatabasesGcpOfferingArcAutoProvisioning() - { - } - - /// Initializes a new instance of DefenderForDatabasesGcpOfferingArcAutoProvisioning. - /// Is arc auto provisioning enabled. - internal DefenderForDatabasesGcpOfferingArcAutoProvisioning(bool? isEnabled) - { - IsEnabled = isEnabled; - } - - /// Is arc auto provisioning enabled. - public bool? IsEnabled { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDevOpsAzureDevOpsOffering.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDevOpsAzureDevOpsOffering.Serialization.cs deleted file mode 100644 index a4901b658aaa..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDevOpsAzureDevOpsOffering.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForDevOpsAzureDevOpsOffering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("offeringType"u8); - writer.WriteStringValue(OfferingType.ToString()); - writer.WriteEndObject(); - } - - internal static DefenderForDevOpsAzureDevOpsOffering DeserializeDefenderForDevOpsAzureDevOpsOffering(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - OfferingType offeringType = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("offeringType"u8)) - { - offeringType = new OfferingType(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new DefenderForDevOpsAzureDevOpsOffering(offeringType, description.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDevOpsAzureDevOpsOffering.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDevOpsAzureDevOpsOffering.cs deleted file mode 100644 index d3b86a05d58d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDevOpsAzureDevOpsOffering.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The Defender for DevOps for Azure DevOps offering. - public partial class DefenderForDevOpsAzureDevOpsOffering : SecurityCenterCloudOffering - { - /// Initializes a new instance of DefenderForDevOpsAzureDevOpsOffering. - public DefenderForDevOpsAzureDevOpsOffering() - { - OfferingType = OfferingType.DefenderForDevOpsAzureDevOps; - } - - /// Initializes a new instance of DefenderForDevOpsAzureDevOpsOffering. - /// The type of the security offering. - /// The offering description. - internal DefenderForDevOpsAzureDevOpsOffering(OfferingType offeringType, string description) : base(offeringType, description) - { - OfferingType = offeringType; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDevOpsGithubOffering.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDevOpsGithubOffering.Serialization.cs deleted file mode 100644 index 0455eeb4d37c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDevOpsGithubOffering.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForDevOpsGithubOffering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("offeringType"u8); - writer.WriteStringValue(OfferingType.ToString()); - writer.WriteEndObject(); - } - - internal static DefenderForDevOpsGithubOffering DeserializeDefenderForDevOpsGithubOffering(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - OfferingType offeringType = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("offeringType"u8)) - { - offeringType = new OfferingType(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new DefenderForDevOpsGithubOffering(offeringType, description.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDevOpsGithubOffering.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDevOpsGithubOffering.cs deleted file mode 100644 index ae2bea386506..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForDevOpsGithubOffering.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The Defender for DevOps for Github offering. - public partial class DefenderForDevOpsGithubOffering : SecurityCenterCloudOffering - { - /// Initializes a new instance of DefenderForDevOpsGithubOffering. - public DefenderForDevOpsGithubOffering() - { - OfferingType = OfferingType.DefenderForDevOpsGithub; - } - - /// Initializes a new instance of DefenderForDevOpsGithubOffering. - /// The type of the security offering. - /// The offering description. - internal DefenderForDevOpsGithubOffering(OfferingType offeringType, string description) : base(offeringType, description) - { - OfferingType = offeringType; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOffering.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOffering.Serialization.cs deleted file mode 100644 index c48003de67fc..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOffering.Serialization.cs +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForServersAwsOffering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(DefenderForServers)) - { - writer.WritePropertyName("defenderForServers"u8); - writer.WriteObjectValue(DefenderForServers); - } - if (Optional.IsDefined(ArcAutoProvisioning)) - { - writer.WritePropertyName("arcAutoProvisioning"u8); - writer.WriteObjectValue(ArcAutoProvisioning); - } - if (Optional.IsDefined(VaAutoProvisioning)) - { - writer.WritePropertyName("vaAutoProvisioning"u8); - writer.WriteObjectValue(VaAutoProvisioning); - } - if (Optional.IsDefined(MdeAutoProvisioning)) - { - writer.WritePropertyName("mdeAutoProvisioning"u8); - writer.WriteObjectValue(MdeAutoProvisioning); - } - if (Optional.IsDefined(SubPlan)) - { - writer.WritePropertyName("subPlan"u8); - writer.WriteObjectValue(SubPlan); - } - if (Optional.IsDefined(VmScanners)) - { - writer.WritePropertyName("vmScanners"u8); - writer.WriteObjectValue(VmScanners); - } - writer.WritePropertyName("offeringType"u8); - writer.WriteStringValue(OfferingType.ToString()); - writer.WriteEndObject(); - } - - internal static DefenderForServersAwsOffering DeserializeDefenderForServersAwsOffering(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional defenderForServers = default; - Optional arcAutoProvisioning = default; - Optional vaAutoProvisioning = default; - Optional mdeAutoProvisioning = default; - Optional subPlan = default; - Optional vmScanners = default; - OfferingType offeringType = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("defenderForServers"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - defenderForServers = AwsDefenderForServersInfo.DeserializeAwsDefenderForServersInfo(property.Value); - continue; - } - if (property.NameEquals("arcAutoProvisioning"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - arcAutoProvisioning = DefenderForServersAwsOfferingArcAutoProvisioning.DeserializeDefenderForServersAwsOfferingArcAutoProvisioning(property.Value); - continue; - } - if (property.NameEquals("vaAutoProvisioning"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - vaAutoProvisioning = DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning.DeserializeDefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning(property.Value); - continue; - } - if (property.NameEquals("mdeAutoProvisioning"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - mdeAutoProvisioning = DefenderForServersAwsOfferingMdeAutoProvisioning.DeserializeDefenderForServersAwsOfferingMdeAutoProvisioning(property.Value); - continue; - } - if (property.NameEquals("subPlan"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - subPlan = DefenderForServersAwsOfferingSubPlan.DeserializeDefenderForServersAwsOfferingSubPlan(property.Value); - continue; - } - if (property.NameEquals("vmScanners"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - vmScanners = DefenderForServersAwsOfferingVmScanners.DeserializeDefenderForServersAwsOfferingVmScanners(property.Value); - continue; - } - if (property.NameEquals("offeringType"u8)) - { - offeringType = new OfferingType(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new DefenderForServersAwsOffering(offeringType, description.Value, defenderForServers.Value, arcAutoProvisioning.Value, vaAutoProvisioning.Value, mdeAutoProvisioning.Value, subPlan.Value, vmScanners.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOffering.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOffering.cs deleted file mode 100644 index 46b292f4f1fb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOffering.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The Defender for Servers AWS offering. - public partial class DefenderForServersAwsOffering : SecurityCenterCloudOffering - { - /// Initializes a new instance of DefenderForServersAwsOffering. - public DefenderForServersAwsOffering() - { - OfferingType = OfferingType.DefenderForServersAws; - } - - /// Initializes a new instance of DefenderForServersAwsOffering. - /// The type of the security offering. - /// The offering description. - /// The Defender for servers connection configuration. - /// The ARC autoprovisioning configuration. - /// The Vulnerability Assessment autoprovisioning configuration. - /// The Microsoft Defender for Endpoint autoprovisioning configuration. - /// configuration for the servers offering subPlan. - /// The Microsoft Defender for Server VM scanning configuration. - internal DefenderForServersAwsOffering(OfferingType offeringType, string description, AwsDefenderForServersInfo defenderForServers, DefenderForServersAwsOfferingArcAutoProvisioning arcAutoProvisioning, DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning vaAutoProvisioning, DefenderForServersAwsOfferingMdeAutoProvisioning mdeAutoProvisioning, DefenderForServersAwsOfferingSubPlan subPlan, DefenderForServersAwsOfferingVmScanners vmScanners) : base(offeringType, description) - { - DefenderForServers = defenderForServers; - ArcAutoProvisioning = arcAutoProvisioning; - VaAutoProvisioning = vaAutoProvisioning; - MdeAutoProvisioning = mdeAutoProvisioning; - SubPlan = subPlan; - VmScanners = vmScanners; - OfferingType = offeringType; - } - - /// The Defender for servers connection configuration. - internal AwsDefenderForServersInfo DefenderForServers { get; set; } - /// The cloud role ARN in AWS for this feature. - public string DefenderForServersCloudRoleArn - { - get => DefenderForServers is null ? default : DefenderForServers.CloudRoleArn; - set - { - if (DefenderForServers is null) - DefenderForServers = new AwsDefenderForServersInfo(); - DefenderForServers.CloudRoleArn = value; - } - } - - /// The ARC autoprovisioning configuration. - public DefenderForServersAwsOfferingArcAutoProvisioning ArcAutoProvisioning { get; set; } - /// The Vulnerability Assessment autoprovisioning configuration. - public DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning VaAutoProvisioning { get; set; } - /// The Microsoft Defender for Endpoint autoprovisioning configuration. - public DefenderForServersAwsOfferingMdeAutoProvisioning MdeAutoProvisioning { get; set; } - /// configuration for the servers offering subPlan. - internal DefenderForServersAwsOfferingSubPlan SubPlan { get; set; } - /// The available sub plans. - public AvailableSubPlanType? AvailableSubPlanType - { - get => SubPlan is null ? default : SubPlan.AvailableSubPlanType; - set - { - if (SubPlan is null) - SubPlan = new DefenderForServersAwsOfferingSubPlan(); - SubPlan.AvailableSubPlanType = value; - } - } - - /// The Microsoft Defender for Server VM scanning configuration. - public DefenderForServersAwsOfferingVmScanners VmScanners { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingArcAutoProvisioning.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingArcAutoProvisioning.Serialization.cs deleted file mode 100644 index 0bc6bc4384c2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingArcAutoProvisioning.Serialization.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForServersAwsOfferingArcAutoProvisioning : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (Optional.IsDefined(CloudRoleArn)) - { - writer.WritePropertyName("cloudRoleArn"u8); - writer.WriteStringValue(CloudRoleArn); - } - writer.WriteEndObject(); - } - - internal static DefenderForServersAwsOfferingArcAutoProvisioning DeserializeDefenderForServersAwsOfferingArcAutoProvisioning(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - Optional cloudRoleArn = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("cloudRoleArn"u8)) - { - cloudRoleArn = property.Value.GetString(); - continue; - } - } - return new DefenderForServersAwsOfferingArcAutoProvisioning(Optional.ToNullable(enabled), cloudRoleArn.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingArcAutoProvisioning.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingArcAutoProvisioning.cs deleted file mode 100644 index 79c575f374ca..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingArcAutoProvisioning.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The ARC autoprovisioning configuration. - public partial class DefenderForServersAwsOfferingArcAutoProvisioning - { - /// Initializes a new instance of DefenderForServersAwsOfferingArcAutoProvisioning. - public DefenderForServersAwsOfferingArcAutoProvisioning() - { - } - - /// Initializes a new instance of DefenderForServersAwsOfferingArcAutoProvisioning. - /// Is arc auto provisioning enabled. - /// The cloud role ARN in AWS for this feature. - internal DefenderForServersAwsOfferingArcAutoProvisioning(bool? isEnabled, string cloudRoleArn) - { - IsEnabled = isEnabled; - CloudRoleArn = cloudRoleArn; - } - - /// Is arc auto provisioning enabled. - public bool? IsEnabled { get; set; } - /// The cloud role ARN in AWS for this feature. - public string CloudRoleArn { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingMdeAutoProvisioning.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingMdeAutoProvisioning.Serialization.cs deleted file mode 100644 index 9087274ac8a5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingMdeAutoProvisioning.Serialization.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForServersAwsOfferingMdeAutoProvisioning : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (Optional.IsDefined(Configuration)) - { - writer.WritePropertyName("configuration"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Configuration); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(Configuration.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - - internal static DefenderForServersAwsOfferingMdeAutoProvisioning DeserializeDefenderForServersAwsOfferingMdeAutoProvisioning(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - Optional configuration = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("configuration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - configuration = BinaryData.FromString(property.Value.GetRawText()); - continue; - } - } - return new DefenderForServersAwsOfferingMdeAutoProvisioning(Optional.ToNullable(enabled), configuration.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingMdeAutoProvisioning.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingMdeAutoProvisioning.cs deleted file mode 100644 index 94cf001a53b3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingMdeAutoProvisioning.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The Microsoft Defender for Endpoint autoprovisioning configuration. - public partial class DefenderForServersAwsOfferingMdeAutoProvisioning - { - /// Initializes a new instance of DefenderForServersAwsOfferingMdeAutoProvisioning. - public DefenderForServersAwsOfferingMdeAutoProvisioning() - { - } - - /// Initializes a new instance of DefenderForServersAwsOfferingMdeAutoProvisioning. - /// Is Microsoft Defender for Endpoint auto provisioning enabled. - /// configuration for Microsoft Defender for Endpoint autoprovisioning. - internal DefenderForServersAwsOfferingMdeAutoProvisioning(bool? isEnabled, BinaryData configuration) - { - IsEnabled = isEnabled; - Configuration = configuration; - } - - /// Is Microsoft Defender for Endpoint auto provisioning enabled. - public bool? IsEnabled { get; set; } - /// - /// configuration for Microsoft Defender for Endpoint autoprovisioning - /// - /// To assign an object to this property use . - /// - /// - /// To assign an already formated json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public BinaryData Configuration { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingSubPlan.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingSubPlan.Serialization.cs deleted file mode 100644 index e10534ce7979..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingSubPlan.Serialization.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class DefenderForServersAwsOfferingSubPlan : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(AvailableSubPlanType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(AvailableSubPlanType.Value.ToString()); - } - writer.WriteEndObject(); - } - - internal static DefenderForServersAwsOfferingSubPlan DeserializeDefenderForServersAwsOfferingSubPlan(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = new AvailableSubPlanType(property.Value.GetString()); - continue; - } - } - return new DefenderForServersAwsOfferingSubPlan(Optional.ToNullable(type)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingSubPlan.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingSubPlan.cs deleted file mode 100644 index 5d0b9eafb680..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingSubPlan.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// configuration for the servers offering subPlan. - internal partial class DefenderForServersAwsOfferingSubPlan - { - /// Initializes a new instance of DefenderForServersAwsOfferingSubPlan. - public DefenderForServersAwsOfferingSubPlan() - { - } - - /// Initializes a new instance of DefenderForServersAwsOfferingSubPlan. - /// The available sub plans. - internal DefenderForServersAwsOfferingSubPlan(AvailableSubPlanType? availableSubPlanType) - { - AvailableSubPlanType = availableSubPlanType; - } - - /// The available sub plans. - public AvailableSubPlanType? AvailableSubPlanType { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVmScanners.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVmScanners.Serialization.cs deleted file mode 100644 index dc59b4054d0f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVmScanners.Serialization.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForServersAwsOfferingVmScanners : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (Optional.IsDefined(Configuration)) - { - writer.WritePropertyName("configuration"u8); - writer.WriteObjectValue(Configuration); - } - writer.WriteEndObject(); - } - - internal static DefenderForServersAwsOfferingVmScanners DeserializeDefenderForServersAwsOfferingVmScanners(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - Optional configuration = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("configuration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - configuration = DefenderForServersAwsOfferingVmScannersConfiguration.DeserializeDefenderForServersAwsOfferingVmScannersConfiguration(property.Value); - continue; - } - } - return new DefenderForServersAwsOfferingVmScanners(Optional.ToNullable(enabled), configuration.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVmScanners.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVmScanners.cs deleted file mode 100644 index b815424933fd..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVmScanners.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The Microsoft Defender for Server VM scanning configuration. - public partial class DefenderForServersAwsOfferingVmScanners - { - /// Initializes a new instance of DefenderForServersAwsOfferingVmScanners. - public DefenderForServersAwsOfferingVmScanners() - { - } - - /// Initializes a new instance of DefenderForServersAwsOfferingVmScanners. - /// Is Microsoft Defender for Server VM scanning enabled. - /// configuration for Microsoft Defender for Server VM scanning. - internal DefenderForServersAwsOfferingVmScanners(bool? isEnabled, DefenderForServersAwsOfferingVmScannersConfiguration configuration) - { - IsEnabled = isEnabled; - Configuration = configuration; - } - - /// Is Microsoft Defender for Server VM scanning enabled. - public bool? IsEnabled { get; set; } - /// configuration for Microsoft Defender for Server VM scanning. - public DefenderForServersAwsOfferingVmScannersConfiguration Configuration { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVmScannersConfiguration.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVmScannersConfiguration.Serialization.cs deleted file mode 100644 index cce491d9f2e3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVmScannersConfiguration.Serialization.cs +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForServersAwsOfferingVmScannersConfiguration : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(CloudRoleArn)) - { - writer.WritePropertyName("cloudRoleArn"u8); - writer.WriteStringValue(CloudRoleArn); - } - if (Optional.IsDefined(ScanningMode)) - { - writer.WritePropertyName("scanningMode"u8); - writer.WriteStringValue(ScanningMode.Value.ToString()); - } - if (Optional.IsCollectionDefined(ExclusionTags)) - { - writer.WritePropertyName("exclusionTags"u8); - writer.WriteStartObject(); - foreach (var item in ExclusionTags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - } - - internal static DefenderForServersAwsOfferingVmScannersConfiguration DeserializeDefenderForServersAwsOfferingVmScannersConfiguration(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional cloudRoleArn = default; - Optional scanningMode = default; - Optional> exclusionTags = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("cloudRoleArn"u8)) - { - cloudRoleArn = property.Value.GetString(); - continue; - } - if (property.NameEquals("scanningMode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - scanningMode = new DefenderForServersScanningMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("exclusionTags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - exclusionTags = dictionary; - continue; - } - } - return new DefenderForServersAwsOfferingVmScannersConfiguration(cloudRoleArn.Value, Optional.ToNullable(scanningMode), Optional.ToDictionary(exclusionTags)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVmScannersConfiguration.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVmScannersConfiguration.cs deleted file mode 100644 index 00badc0963f4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVmScannersConfiguration.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// configuration for Microsoft Defender for Server VM scanning. - public partial class DefenderForServersAwsOfferingVmScannersConfiguration - { - /// Initializes a new instance of DefenderForServersAwsOfferingVmScannersConfiguration. - public DefenderForServersAwsOfferingVmScannersConfiguration() - { - ExclusionTags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of DefenderForServersAwsOfferingVmScannersConfiguration. - /// The cloud role ARN in AWS for this feature. - /// The scanning mode for the vm scan. - /// VM tags that indicates that VM should not be scanned. - internal DefenderForServersAwsOfferingVmScannersConfiguration(string cloudRoleArn, DefenderForServersScanningMode? scanningMode, IDictionary exclusionTags) - { - CloudRoleArn = cloudRoleArn; - ScanningMode = scanningMode; - ExclusionTags = exclusionTags; - } - - /// The cloud role ARN in AWS for this feature. - public string CloudRoleArn { get; set; } - /// The scanning mode for the vm scan. - public DefenderForServersScanningMode? ScanningMode { get; set; } - /// VM tags that indicates that VM should not be scanned. - public IDictionary ExclusionTags { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning.Serialization.cs deleted file mode 100644 index c64c8161c62e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning.Serialization.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (Optional.IsDefined(Configuration)) - { - writer.WritePropertyName("configuration"u8); - writer.WriteObjectValue(Configuration); - } - writer.WriteEndObject(); - } - - internal static DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning DeserializeDefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - Optional configuration = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("configuration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - configuration = DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration.DeserializeDefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration(property.Value); - continue; - } - } - return new DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning(Optional.ToNullable(enabled), configuration.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning.cs deleted file mode 100644 index 74abd1df83de..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The Vulnerability Assessment autoprovisioning configuration. - public partial class DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning - { - /// Initializes a new instance of DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning. - public DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning() - { - } - - /// Initializes a new instance of DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning. - /// Is Vulnerability Assessment auto provisioning enabled. - /// configuration for Vulnerability Assessment autoprovisioning. - internal DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioning(bool? isEnabled, DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration configuration) - { - IsEnabled = isEnabled; - Configuration = configuration; - } - - /// Is Vulnerability Assessment auto provisioning enabled. - public bool? IsEnabled { get; set; } - /// configuration for Vulnerability Assessment autoprovisioning. - internal DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration Configuration { get; set; } - /// The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - public VulnerabilityAssessmentAutoProvisioningType? VulnerabilityAssessmentAutoProvisioningType - { - get => Configuration is null ? default : Configuration.VulnerabilityAssessmentAutoProvisioningType; - set - { - if (Configuration is null) - Configuration = new DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration(); - Configuration.VulnerabilityAssessmentAutoProvisioningType = value; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration.Serialization.cs deleted file mode 100644 index 5ea72268d96f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration.Serialization.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(VulnerabilityAssessmentAutoProvisioningType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(VulnerabilityAssessmentAutoProvisioningType.Value.ToString()); - } - writer.WriteEndObject(); - } - - internal static DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration DeserializeDefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = new VulnerabilityAssessmentAutoProvisioningType(property.Value.GetString()); - continue; - } - } - return new DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration(Optional.ToNullable(type)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration.cs deleted file mode 100644 index c9652fc29923..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// configuration for Vulnerability Assessment autoprovisioning. - internal partial class DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration - { - /// Initializes a new instance of DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration. - public DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration() - { - } - - /// Initializes a new instance of DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration. - /// The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - internal DefenderForServersAwsOfferingVulnerabilityAssessmentAutoProvisioningConfiguration(VulnerabilityAssessmentAutoProvisioningType? vulnerabilityAssessmentAutoProvisioningType) - { - VulnerabilityAssessmentAutoProvisioningType = vulnerabilityAssessmentAutoProvisioningType; - } - - /// The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - public VulnerabilityAssessmentAutoProvisioningType? VulnerabilityAssessmentAutoProvisioningType { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOffering.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOffering.Serialization.cs deleted file mode 100644 index a0783207468c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOffering.Serialization.cs +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForServersGcpOffering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(DefenderForServers)) - { - writer.WritePropertyName("defenderForServers"u8); - writer.WriteObjectValue(DefenderForServers); - } - if (Optional.IsDefined(ArcAutoProvisioning)) - { - writer.WritePropertyName("arcAutoProvisioning"u8); - writer.WriteObjectValue(ArcAutoProvisioning); - } - if (Optional.IsDefined(VulnerabilityAssessmentAutoProvisioning)) - { - writer.WritePropertyName("vaAutoProvisioning"u8); - writer.WriteObjectValue(VulnerabilityAssessmentAutoProvisioning); - } - if (Optional.IsDefined(MdeAutoProvisioning)) - { - writer.WritePropertyName("mdeAutoProvisioning"u8); - writer.WriteObjectValue(MdeAutoProvisioning); - } - if (Optional.IsDefined(SubPlan)) - { - writer.WritePropertyName("subPlan"u8); - writer.WriteObjectValue(SubPlan); - } - writer.WritePropertyName("offeringType"u8); - writer.WriteStringValue(OfferingType.ToString()); - writer.WriteEndObject(); - } - - internal static DefenderForServersGcpOffering DeserializeDefenderForServersGcpOffering(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional defenderForServers = default; - Optional arcAutoProvisioning = default; - Optional vaAutoProvisioning = default; - Optional mdeAutoProvisioning = default; - Optional subPlan = default; - OfferingType offeringType = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("defenderForServers"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - defenderForServers = GcpDefenderForServersInfo.DeserializeGcpDefenderForServersInfo(property.Value); - continue; - } - if (property.NameEquals("arcAutoProvisioning"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - arcAutoProvisioning = DefenderForServersGcpOfferingArcAutoProvisioning.DeserializeDefenderForServersGcpOfferingArcAutoProvisioning(property.Value); - continue; - } - if (property.NameEquals("vaAutoProvisioning"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - vaAutoProvisioning = DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning.DeserializeDefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning(property.Value); - continue; - } - if (property.NameEquals("mdeAutoProvisioning"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - mdeAutoProvisioning = DefenderForServersGcpOfferingMdeAutoProvisioning.DeserializeDefenderForServersGcpOfferingMdeAutoProvisioning(property.Value); - continue; - } - if (property.NameEquals("subPlan"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - subPlan = DefenderForServersGcpOfferingSubPlan.DeserializeDefenderForServersGcpOfferingSubPlan(property.Value); - continue; - } - if (property.NameEquals("offeringType"u8)) - { - offeringType = new OfferingType(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new DefenderForServersGcpOffering(offeringType, description.Value, defenderForServers.Value, arcAutoProvisioning.Value, vaAutoProvisioning.Value, mdeAutoProvisioning.Value, subPlan.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOffering.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOffering.cs deleted file mode 100644 index 5c85910e31c5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOffering.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The Defender for Servers GCP offering configurations. - public partial class DefenderForServersGcpOffering : SecurityCenterCloudOffering - { - /// Initializes a new instance of DefenderForServersGcpOffering. - public DefenderForServersGcpOffering() - { - OfferingType = OfferingType.DefenderForServersGcp; - } - - /// Initializes a new instance of DefenderForServersGcpOffering. - /// The type of the security offering. - /// The offering description. - /// The Defender for servers connection configuration. - /// The ARC autoprovisioning configuration. - /// The Vulnerability Assessment autoprovisioning configuration. - /// The Microsoft Defender for Endpoint autoprovisioning configuration. - /// configuration for the servers offering subPlan. - internal DefenderForServersGcpOffering(OfferingType offeringType, string description, GcpDefenderForServersInfo defenderForServers, DefenderForServersGcpOfferingArcAutoProvisioning arcAutoProvisioning, DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning vulnerabilityAssessmentAutoProvisioning, DefenderForServersGcpOfferingMdeAutoProvisioning mdeAutoProvisioning, DefenderForServersGcpOfferingSubPlan subPlan) : base(offeringType, description) - { - DefenderForServers = defenderForServers; - ArcAutoProvisioning = arcAutoProvisioning; - VulnerabilityAssessmentAutoProvisioning = vulnerabilityAssessmentAutoProvisioning; - MdeAutoProvisioning = mdeAutoProvisioning; - SubPlan = subPlan; - OfferingType = offeringType; - } - - /// The Defender for servers connection configuration. - public GcpDefenderForServersInfo DefenderForServers { get; set; } - /// The ARC autoprovisioning configuration. - internal DefenderForServersGcpOfferingArcAutoProvisioning ArcAutoProvisioning { get; set; } - - /// The Vulnerability Assessment autoprovisioning configuration. - public DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning VulnerabilityAssessmentAutoProvisioning { get; set; } - /// The Microsoft Defender for Endpoint autoprovisioning configuration. - public DefenderForServersGcpOfferingMdeAutoProvisioning MdeAutoProvisioning { get; set; } - /// configuration for the servers offering subPlan. - internal DefenderForServersGcpOfferingSubPlan SubPlan { get; set; } - /// The available sub plans. - public AvailableSubPlanType? AvailableSubPlanType - { - get => SubPlan is null ? default : SubPlan.AvailableSubPlanType; - set - { - if (SubPlan is null) - SubPlan = new DefenderForServersGcpOfferingSubPlan(); - SubPlan.AvailableSubPlanType = value; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingArcAutoProvisioning.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingArcAutoProvisioning.Serialization.cs deleted file mode 100644 index 3099eea53e6d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingArcAutoProvisioning.Serialization.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class DefenderForServersGcpOfferingArcAutoProvisioning : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - writer.WriteEndObject(); - } - - internal static DefenderForServersGcpOfferingArcAutoProvisioning DeserializeDefenderForServersGcpOfferingArcAutoProvisioning(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - } - return new DefenderForServersGcpOfferingArcAutoProvisioning(Optional.ToNullable(enabled)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingArcAutoProvisioning.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingArcAutoProvisioning.cs deleted file mode 100644 index f2b6073df56b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingArcAutoProvisioning.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The ARC autoprovisioning configuration. - internal partial class DefenderForServersGcpOfferingArcAutoProvisioning - { - /// Initializes a new instance of DefenderForServersGcpOfferingArcAutoProvisioning. - public DefenderForServersGcpOfferingArcAutoProvisioning() - { - } - - /// Initializes a new instance of DefenderForServersGcpOfferingArcAutoProvisioning. - /// Is arc auto provisioning enabled. - internal DefenderForServersGcpOfferingArcAutoProvisioning(bool? isEnabled) - { - IsEnabled = isEnabled; - } - - /// Is arc auto provisioning enabled. - public bool? IsEnabled { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingMdeAutoProvisioning.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingMdeAutoProvisioning.Serialization.cs deleted file mode 100644 index 644f922f55ea..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingMdeAutoProvisioning.Serialization.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForServersGcpOfferingMdeAutoProvisioning : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (Optional.IsDefined(Configuration)) - { - writer.WritePropertyName("configuration"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Configuration); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(Configuration.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - - internal static DefenderForServersGcpOfferingMdeAutoProvisioning DeserializeDefenderForServersGcpOfferingMdeAutoProvisioning(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - Optional configuration = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("configuration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - configuration = BinaryData.FromString(property.Value.GetRawText()); - continue; - } - } - return new DefenderForServersGcpOfferingMdeAutoProvisioning(Optional.ToNullable(enabled), configuration.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingMdeAutoProvisioning.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingMdeAutoProvisioning.cs deleted file mode 100644 index 866d3db8842c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingMdeAutoProvisioning.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The Microsoft Defender for Endpoint autoprovisioning configuration. - public partial class DefenderForServersGcpOfferingMdeAutoProvisioning - { - /// Initializes a new instance of DefenderForServersGcpOfferingMdeAutoProvisioning. - public DefenderForServersGcpOfferingMdeAutoProvisioning() - { - } - - /// Initializes a new instance of DefenderForServersGcpOfferingMdeAutoProvisioning. - /// Is Microsoft Defender for Endpoint auto provisioning enabled. - /// configuration for Microsoft Defender for Endpoint autoprovisioning. - internal DefenderForServersGcpOfferingMdeAutoProvisioning(bool? isEnabled, BinaryData configuration) - { - IsEnabled = isEnabled; - Configuration = configuration; - } - - /// Is Microsoft Defender for Endpoint auto provisioning enabled. - public bool? IsEnabled { get; set; } - /// - /// configuration for Microsoft Defender for Endpoint autoprovisioning - /// - /// To assign an object to this property use . - /// - /// - /// To assign an already formated json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public BinaryData Configuration { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingSubPlan.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingSubPlan.Serialization.cs deleted file mode 100644 index c88e5e15acec..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingSubPlan.Serialization.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class DefenderForServersGcpOfferingSubPlan : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(AvailableSubPlanType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(AvailableSubPlanType.Value.ToString()); - } - writer.WriteEndObject(); - } - - internal static DefenderForServersGcpOfferingSubPlan DeserializeDefenderForServersGcpOfferingSubPlan(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = new AvailableSubPlanType(property.Value.GetString()); - continue; - } - } - return new DefenderForServersGcpOfferingSubPlan(Optional.ToNullable(type)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingSubPlan.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingSubPlan.cs deleted file mode 100644 index 04e7c525eeeb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingSubPlan.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// configuration for the servers offering subPlan. - internal partial class DefenderForServersGcpOfferingSubPlan - { - /// Initializes a new instance of DefenderForServersGcpOfferingSubPlan. - public DefenderForServersGcpOfferingSubPlan() - { - } - - /// Initializes a new instance of DefenderForServersGcpOfferingSubPlan. - /// The available sub plans. - internal DefenderForServersGcpOfferingSubPlan(AvailableSubPlanType? availableSubPlanType) - { - AvailableSubPlanType = availableSubPlanType; - } - - /// The available sub plans. - public AvailableSubPlanType? AvailableSubPlanType { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning.Serialization.cs deleted file mode 100644 index 0e9a01595988..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning.Serialization.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - if (Optional.IsDefined(Configuration)) - { - writer.WritePropertyName("configuration"u8); - writer.WriteObjectValue(Configuration); - } - writer.WriteEndObject(); - } - - internal static DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning DeserializeDefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional enabled = default; - Optional configuration = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("enabled"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("configuration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - configuration = DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration.DeserializeDefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration(property.Value); - continue; - } - } - return new DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning(Optional.ToNullable(enabled), configuration.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning.cs deleted file mode 100644 index 5ad8e151c46a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The Vulnerability Assessment autoprovisioning configuration. - public partial class DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning - { - /// Initializes a new instance of DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning. - public DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning() - { - } - - /// Initializes a new instance of DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning. - /// Is Vulnerability Assessment auto provisioning enabled. - /// configuration for Vulnerability Assessment autoprovisioning. - internal DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioning(bool? isEnabled, DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration configuration) - { - IsEnabled = isEnabled; - Configuration = configuration; - } - - /// Is Vulnerability Assessment auto provisioning enabled. - public bool? IsEnabled { get; set; } - /// configuration for Vulnerability Assessment autoprovisioning. - internal DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration Configuration { get; set; } - /// The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - public VulnerabilityAssessmentAutoProvisioningType? VulnerabilityAssessmentAutoProvisioningType - { - get => Configuration is null ? default : Configuration.VulnerabilityAssessmentAutoProvisioningType; - set - { - if (Configuration is null) - Configuration = new DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration(); - Configuration.VulnerabilityAssessmentAutoProvisioningType = value; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration.Serialization.cs deleted file mode 100644 index 84833747cd59..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration.Serialization.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(VulnerabilityAssessmentAutoProvisioningType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(VulnerabilityAssessmentAutoProvisioningType.Value.ToString()); - } - writer.WriteEndObject(); - } - - internal static DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration DeserializeDefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = new VulnerabilityAssessmentAutoProvisioningType(property.Value.GetString()); - continue; - } - } - return new DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration(Optional.ToNullable(type)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration.cs deleted file mode 100644 index d638eea6c5bc..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// configuration for Vulnerability Assessment autoprovisioning. - internal partial class DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration - { - /// Initializes a new instance of DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration. - public DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration() - { - } - - /// Initializes a new instance of DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration. - /// The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - internal DefenderForServersGcpOfferingVulnerabilityAssessmentAutoProvisioningConfiguration(VulnerabilityAssessmentAutoProvisioningType? vulnerabilityAssessmentAutoProvisioningType) - { - VulnerabilityAssessmentAutoProvisioningType = vulnerabilityAssessmentAutoProvisioningType; - } - - /// The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - public VulnerabilityAssessmentAutoProvisioningType? VulnerabilityAssessmentAutoProvisioningType { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersScanningMode.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersScanningMode.cs deleted file mode 100644 index 4e9be5b38494..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DefenderForServersScanningMode.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The scanning mode for the vm scan. - public readonly partial struct DefenderForServersScanningMode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public DefenderForServersScanningMode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DefaultValue = "Default"; - - /// Default. - public static DefenderForServersScanningMode Default { get; } = new DefenderForServersScanningMode(DefaultValue); - /// Determines if two values are the same. - public static bool operator ==(DefenderForServersScanningMode left, DefenderForServersScanningMode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(DefenderForServersScanningMode left, DefenderForServersScanningMode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator DefenderForServersScanningMode(string value) => new DefenderForServersScanningMode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is DefenderForServersScanningMode other && Equals(other); - /// - public bool Equals(DefenderForServersScanningMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DenylistCustomAlertRule.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DenylistCustomAlertRule.Serialization.cs deleted file mode 100644 index f13ba13038e8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DenylistCustomAlertRule.Serialization.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DenylistCustomAlertRule : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("denylistValues"u8); - writer.WriteStartArray(); - foreach (var item in DenylistValues) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static DenylistCustomAlertRule DeserializeDenylistCustomAlertRule(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList denylistValues = default; - Optional valueType = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("denylistValues"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - denylistValues = array; - continue; - } - if (property.NameEquals("valueType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - valueType = new SecurityValueType(property.Value.GetString()); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new DenylistCustomAlertRule(displayName.Value, description.Value, isEnabled, ruleType, Optional.ToNullable(valueType), denylistValues); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DenylistCustomAlertRule.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DenylistCustomAlertRule.cs deleted file mode 100644 index d0f33b9aab3f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DenylistCustomAlertRule.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A custom alert rule that checks if a value (depends on the custom alert type) is denied. - public partial class DenylistCustomAlertRule : ListCustomAlertRule - { - /// Initializes a new instance of DenylistCustomAlertRule. - /// Status of the custom alert. - /// The values to deny. The format of the values depends on the rule type. - /// is null. - public DenylistCustomAlertRule(bool isEnabled, IEnumerable denylistValues) : base(isEnabled) - { - Argument.AssertNotNull(denylistValues, nameof(denylistValues)); - - DenylistValues = denylistValues.ToList(); - RuleType = "DenylistCustomAlertRule"; - } - - /// Initializes a new instance of DenylistCustomAlertRule. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The value type of the items in the list. - /// The values to deny. The format of the values depends on the rule type. - internal DenylistCustomAlertRule(string displayName, string description, bool isEnabled, string ruleType, SecurityValueType? valueType, IList denylistValues) : base(displayName, description, isEnabled, ruleType, valueType) - { - DenylistValues = denylistValues; - RuleType = ruleType ?? "DenylistCustomAlertRule"; - } - - /// The values to deny. The format of the values depends on the rule type. - public IList DenylistValues { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DeviceSecurityGroupData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DeviceSecurityGroupData.Serialization.cs deleted file mode 100644 index f865dcea9fb7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DeviceSecurityGroupData.Serialization.cs +++ /dev/null @@ -1,184 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class DeviceSecurityGroupData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(ThresholdRules)) - { - writer.WritePropertyName("thresholdRules"u8); - writer.WriteStartArray(); - foreach (var item in ThresholdRules) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(TimeWindowRules)) - { - writer.WritePropertyName("timeWindowRules"u8); - writer.WriteStartArray(); - foreach (var item in TimeWindowRules) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(AllowlistRules)) - { - writer.WritePropertyName("allowlistRules"u8); - writer.WriteStartArray(); - foreach (var item in AllowlistRules) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(DenylistRules)) - { - writer.WritePropertyName("denylistRules"u8); - writer.WriteStartArray(); - foreach (var item in DenylistRules) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static DeviceSecurityGroupData DeserializeDeviceSecurityGroupData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional> thresholdRules = default; - Optional> timeWindowRules = default; - Optional> allowlistRules = default; - Optional> denylistRules = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("thresholdRules"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ThresholdCustomAlertRule.DeserializeThresholdCustomAlertRule(item)); - } - thresholdRules = array; - continue; - } - if (property0.NameEquals("timeWindowRules"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(TimeWindowCustomAlertRule.DeserializeTimeWindowCustomAlertRule(item)); - } - timeWindowRules = array; - continue; - } - if (property0.NameEquals("allowlistRules"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(AllowlistCustomAlertRule.DeserializeAllowlistCustomAlertRule(item)); - } - allowlistRules = array; - continue; - } - if (property0.NameEquals("denylistRules"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(DenylistCustomAlertRule.DeserializeDenylistCustomAlertRule(item)); - } - denylistRules = array; - continue; - } - } - continue; - } - } - return new DeviceSecurityGroupData(id, name, type, systemData.Value, Optional.ToList(thresholdRules), Optional.ToList(timeWindowRules), Optional.ToList(allowlistRules), Optional.ToList(denylistRules)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DeviceSecurityGroupList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DeviceSecurityGroupList.Serialization.cs deleted file mode 100644 index 59c44a35e8ff..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DeviceSecurityGroupList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class DeviceSecurityGroupList - { - internal static DeviceSecurityGroupList DeserializeDeviceSecurityGroupList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DeviceSecurityGroupData.DeserializeDeviceSecurityGroupData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new DeviceSecurityGroupList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DeviceSecurityGroupList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DeviceSecurityGroupList.cs deleted file mode 100644 index ce8200dd4484..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DeviceSecurityGroupList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of device security groups. - internal partial class DeviceSecurityGroupList - { - /// Initializes a new instance of DeviceSecurityGroupList. - internal DeviceSecurityGroupList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of DeviceSecurityGroupList. - /// List of device security group objects. - /// The URI to fetch the next page. - internal DeviceSecurityGroupList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of device security group objects. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DirectMethodInvokesNotInAllowedRange.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DirectMethodInvokesNotInAllowedRange.Serialization.cs deleted file mode 100644 index bcb697eee984..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DirectMethodInvokesNotInAllowedRange.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DirectMethodInvokesNotInAllowedRange : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("timeWindowSize"u8); - writer.WriteStringValue(TimeWindowSize, "P"); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static DirectMethodInvokesNotInAllowedRange DeserializeDirectMethodInvokesNotInAllowedRange(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - TimeSpan timeWindowSize = default; - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeWindowSize"u8)) - { - timeWindowSize = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new DirectMethodInvokesNotInAllowedRange(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DirectMethodInvokesNotInAllowedRange.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DirectMethodInvokesNotInAllowedRange.cs deleted file mode 100644 index 7264210859f8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DirectMethodInvokesNotInAllowedRange.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Number of direct method invokes is not in allowed range. - public partial class DirectMethodInvokesNotInAllowedRange : TimeWindowCustomAlertRule - { - /// Initializes a new instance of DirectMethodInvokesNotInAllowedRange. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - public DirectMethodInvokesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(isEnabled, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = "DirectMethodInvokesNotInAllowedRange"; - } - - /// Initializes a new instance of DirectMethodInvokesNotInAllowedRange. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - internal DirectMethodInvokesNotInAllowedRange(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(displayName, description, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = ruleType ?? "DirectMethodInvokesNotInAllowedRange"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DiscoveredSecuritySolution.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DiscoveredSecuritySolution.Serialization.cs deleted file mode 100644 index a6ea83bf87d5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DiscoveredSecuritySolution.Serialization.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class DiscoveredSecuritySolution : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("securityFamily"u8); - writer.WriteStringValue(SecurityFamily.ToString()); - writer.WritePropertyName("offer"u8); - writer.WriteStringValue(Offer); - writer.WritePropertyName("publisher"u8); - writer.WriteStringValue(Publisher); - writer.WritePropertyName("sku"u8); - writer.WriteStringValue(Sku); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static DiscoveredSecuritySolution DeserializeDiscoveredSecuritySolution(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - SecurityFamily securityFamily = default; - string offer = default; - string publisher = default; - string sku = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("securityFamily"u8)) - { - securityFamily = new SecurityFamily(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("offer"u8)) - { - offer = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("publisher"u8)) - { - publisher = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("sku"u8)) - { - sku = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new DiscoveredSecuritySolution(id, name, type, systemData.Value, securityFamily, offer, publisher, sku, Optional.ToNullable(location)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DiscoveredSecuritySolution.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DiscoveredSecuritySolution.cs deleted file mode 100644 index dd89222965f1..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DiscoveredSecuritySolution.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The DiscoveredSecuritySolution. - public partial class DiscoveredSecuritySolution : ResourceData - { - /// Initializes a new instance of DiscoveredSecuritySolution. - /// The security family of the discovered solution. - /// The security solutions' image offer. - /// The security solutions' image publisher. - /// The security solutions' image sku. - /// , or is null. - public DiscoveredSecuritySolution(SecurityFamily securityFamily, string offer, string publisher, string sku) - { - Argument.AssertNotNull(offer, nameof(offer)); - Argument.AssertNotNull(publisher, nameof(publisher)); - Argument.AssertNotNull(sku, nameof(sku)); - - SecurityFamily = securityFamily; - Offer = offer; - Publisher = publisher; - Sku = sku; - } - - /// Initializes a new instance of DiscoveredSecuritySolution. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The security family of the discovered solution. - /// The security solutions' image offer. - /// The security solutions' image publisher. - /// The security solutions' image sku. - /// Location where the resource is stored. - internal DiscoveredSecuritySolution(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SecurityFamily securityFamily, string offer, string publisher, string sku, AzureLocation? location) : base(id, name, resourceType, systemData) - { - SecurityFamily = securityFamily; - Offer = offer; - Publisher = publisher; - Sku = sku; - Location = location; - } - - /// The security family of the discovered solution. - public SecurityFamily SecurityFamily { get; set; } - /// The security solutions' image offer. - public string Offer { get; set; } - /// The security solutions' image publisher. - public string Publisher { get; set; } - /// The security solutions' image sku. - public string Sku { get; set; } - /// Location where the resource is stored. - public AzureLocation? Location { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DiscoveredSecuritySolutionList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DiscoveredSecuritySolutionList.Serialization.cs deleted file mode 100644 index 6db7d463e74f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DiscoveredSecuritySolutionList.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class DiscoveredSecuritySolutionList - { - internal static DiscoveredSecuritySolutionList DeserializeDiscoveredSecuritySolutionList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(DiscoveredSecuritySolution.DeserializeDiscoveredSecuritySolution(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new DiscoveredSecuritySolutionList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DiscoveredSecuritySolutionList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DiscoveredSecuritySolutionList.cs deleted file mode 100644 index 37ac7df1b083..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/DiscoveredSecuritySolutionList.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The DiscoveredSecuritySolutionList. - internal partial class DiscoveredSecuritySolutionList - { - /// Initializes a new instance of DiscoveredSecuritySolutionList. - internal DiscoveredSecuritySolutionList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of DiscoveredSecuritySolutionList. - /// - /// The URI to fetch the next page. - internal DiscoveredSecuritySolutionList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Gets the value. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/EffectiveNetworkSecurityGroups.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/EffectiveNetworkSecurityGroups.Serialization.cs deleted file mode 100644 index f89c69e9f9a0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/EffectiveNetworkSecurityGroups.Serialization.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class EffectiveNetworkSecurityGroups : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(NetworkInterface)) - { - writer.WritePropertyName("networkInterface"u8); - writer.WriteStringValue(NetworkInterface); - } - if (Optional.IsCollectionDefined(NetworkSecurityGroups)) - { - writer.WritePropertyName("networkSecurityGroups"u8); - writer.WriteStartArray(); - foreach (var item in NetworkSecurityGroups) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static EffectiveNetworkSecurityGroups DeserializeEffectiveNetworkSecurityGroups(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional networkInterface = default; - Optional> networkSecurityGroups = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("networkInterface"u8)) - { - networkInterface = property.Value.GetString(); - continue; - } - if (property.NameEquals("networkSecurityGroups"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - networkSecurityGroups = array; - continue; - } - } - return new EffectiveNetworkSecurityGroups(networkInterface.Value, Optional.ToList(networkSecurityGroups)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/EffectiveNetworkSecurityGroups.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/EffectiveNetworkSecurityGroups.cs deleted file mode 100644 index e7c27da294ba..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/EffectiveNetworkSecurityGroups.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Describes the Network Security Groups effective on a network interface. - public partial class EffectiveNetworkSecurityGroups - { - /// Initializes a new instance of EffectiveNetworkSecurityGroups. - public EffectiveNetworkSecurityGroups() - { - NetworkSecurityGroups = new ChangeTrackingList(); - } - - /// Initializes a new instance of EffectiveNetworkSecurityGroups. - /// The Azure resource ID of the network interface. - /// The Network Security Groups effective on the network interface. - internal EffectiveNetworkSecurityGroups(string networkInterface, IList networkSecurityGroups) - { - NetworkInterface = networkInterface; - NetworkSecurityGroups = networkSecurityGroups; - } - - /// The Azure resource ID of the network interface. - public string NetworkInterface { get; set; } - /// The Network Security Groups effective on the network interface. - public IList NetworkSecurityGroups { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/EndOfSupportStatus.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/EndOfSupportStatus.cs deleted file mode 100644 index 28803eafb750..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/EndOfSupportStatus.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// End of support status. - public readonly partial struct EndOfSupportStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public EndOfSupportStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NoneValue = "None"; - private const string NoLongerSupportedValue = "noLongerSupported"; - private const string VersionNoLongerSupportedValue = "versionNoLongerSupported"; - private const string UpcomingNoLongerSupportedValue = "upcomingNoLongerSupported"; - private const string UpcomingVersionNoLongerSupportedValue = "upcomingVersionNoLongerSupported"; - - /// None. - public static EndOfSupportStatus None { get; } = new EndOfSupportStatus(NoneValue); - /// noLongerSupported. - public static EndOfSupportStatus NoLongerSupported { get; } = new EndOfSupportStatus(NoLongerSupportedValue); - /// versionNoLongerSupported. - public static EndOfSupportStatus VersionNoLongerSupported { get; } = new EndOfSupportStatus(VersionNoLongerSupportedValue); - /// upcomingNoLongerSupported. - public static EndOfSupportStatus UpcomingNoLongerSupported { get; } = new EndOfSupportStatus(UpcomingNoLongerSupportedValue); - /// upcomingVersionNoLongerSupported. - public static EndOfSupportStatus UpcomingVersionNoLongerSupported { get; } = new EndOfSupportStatus(UpcomingVersionNoLongerSupportedValue); - /// Determines if two values are the same. - public static bool operator ==(EndOfSupportStatus left, EndOfSupportStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(EndOfSupportStatus left, EndOfSupportStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator EndOfSupportStatus(string value) => new EndOfSupportStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is EndOfSupportStatus other && Equals(other); - /// - public bool Equals(EndOfSupportStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/EnvironmentType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/EnvironmentType.cs deleted file mode 100644 index 4c9e13cc99e3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/EnvironmentType.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The type of the environment data. - internal readonly partial struct EnvironmentType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public EnvironmentType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AwsAccountValue = "AwsAccount"; - private const string GcpProjectValue = "GcpProject"; - private const string GithubScopeValue = "GithubScope"; - private const string AzureDevOpsScopeValue = "AzureDevOpsScope"; - - /// AwsAccount. - public static EnvironmentType AwsAccount { get; } = new EnvironmentType(AwsAccountValue); - /// GcpProject. - public static EnvironmentType GcpProject { get; } = new EnvironmentType(GcpProjectValue); - /// GithubScope. - public static EnvironmentType GithubScope { get; } = new EnvironmentType(GithubScopeValue); - /// AzureDevOpsScope. - public static EnvironmentType AzureDevOpsScope { get; } = new EnvironmentType(AzureDevOpsScopeValue); - /// Determines if two values are the same. - public static bool operator ==(EnvironmentType left, EnvironmentType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(EnvironmentType left, EnvironmentType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator EnvironmentType(string value) => new EnvironmentType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is EnvironmentType other && Equals(other); - /// - public bool Equals(EnvironmentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExecuteGovernanceRuleParams.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExecuteGovernanceRuleParams.Serialization.cs deleted file mode 100644 index 82d750fa65a7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExecuteGovernanceRuleParams.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class ExecuteGovernanceRuleParams : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Override)) - { - writer.WritePropertyName("override"u8); - writer.WriteBooleanValue(Override.Value); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExecuteGovernanceRuleParams.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExecuteGovernanceRuleParams.cs deleted file mode 100644 index 6338d23d447e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExecuteGovernanceRuleParams.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Governance rule execution parameters. - public partial class ExecuteGovernanceRuleParams - { - /// Initializes a new instance of ExecuteGovernanceRuleParams. - public ExecuteGovernanceRuleParams() - { - } - - /// Describe if governance rule should be override. - public bool? Override { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExecuteRuleStatus.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExecuteRuleStatus.Serialization.cs deleted file mode 100644 index b938fce43a39..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExecuteRuleStatus.Serialization.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class ExecuteRuleStatus - { - internal static ExecuteRuleStatus DeserializeExecuteRuleStatus(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional operationId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("operationId"u8)) - { - operationId = property.Value.GetString(); - continue; - } - } - return new ExecuteRuleStatus(operationId.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExecuteRuleStatus.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExecuteRuleStatus.cs deleted file mode 100644 index 17504e309978..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExecuteRuleStatus.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Execute status of Security GovernanceRule over a given scope. - public partial class ExecuteRuleStatus - { - /// Initializes a new instance of ExecuteRuleStatus. - internal ExecuteRuleStatus() - { - } - - /// Initializes a new instance of ExecuteRuleStatus. - /// Unique key for the execution of GovernanceRule. - internal ExecuteRuleStatus(string operationId) - { - OperationId = operationId; - } - - /// Unique key for the execution of GovernanceRule. - public string OperationId { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolution.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolution.Serialization.cs deleted file mode 100644 index 414e19d86c8e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolution.Serialization.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class ExternalSecuritySolution : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Kind != null) - { - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.Value.ToString()); - } - else - { - writer.WriteNull("kind"); - } - writer.WriteEndObject(); - } - - internal static ExternalSecuritySolution DeserializeExternalSecuritySolution(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("kind", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "AAD": return AadExternalSecuritySolution.DeserializeAadExternalSecuritySolution(element); - case "ATA": return AtaExternalSecuritySolution.DeserializeAtaExternalSecuritySolution(element); - case "CEF": return CefExternalSecuritySolution.DeserializeCefExternalSecuritySolution(element); - } - } - ExternalSecuritySolutionKind? kind = default; - Optional location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kind"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - kind = null; - continue; - } - kind = new ExternalSecuritySolutionKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - } - return new ExternalSecuritySolution(id, name, type, systemData.Value, kind, Optional.ToNullable(location)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolution.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolution.cs deleted file mode 100644 index 34777cbf4269..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolution.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// - /// Represents a security solution external to Microsoft Defender for Cloud which sends information to an OMS workspace and whose data is displayed by Microsoft Defender for Cloud. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public partial class ExternalSecuritySolution : ResourceData - { - /// Initializes a new instance of ExternalSecuritySolution. - public ExternalSecuritySolution() - { - } - - /// Initializes a new instance of ExternalSecuritySolution. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The kind of the external solution. - /// Location where the resource is stored. - internal ExternalSecuritySolution(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ExternalSecuritySolutionKind? kind, AzureLocation? location) : base(id, name, resourceType, systemData) - { - Kind = kind; - Location = location; - } - /// Location where the resource is stored. - public AzureLocation? Location { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolutionKind.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolutionKind.cs deleted file mode 100644 index ba04136a8a74..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolutionKind.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The kind of the external solution. - public readonly partial struct ExternalSecuritySolutionKind : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ExternalSecuritySolutionKind(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CefValue = "CEF"; - private const string AtaValue = "ATA"; - private const string AadValue = "AAD"; - - /// CEF. - public static ExternalSecuritySolutionKind Cef { get; } = new ExternalSecuritySolutionKind(CefValue); - /// ATA. - public static ExternalSecuritySolutionKind Ata { get; } = new ExternalSecuritySolutionKind(AtaValue); - /// AAD. - public static ExternalSecuritySolutionKind Aad { get; } = new ExternalSecuritySolutionKind(AadValue); - /// Determines if two values are the same. - public static bool operator ==(ExternalSecuritySolutionKind left, ExternalSecuritySolutionKind right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ExternalSecuritySolutionKind left, ExternalSecuritySolutionKind right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ExternalSecuritySolutionKind(string value) => new ExternalSecuritySolutionKind(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ExternalSecuritySolutionKind other && Equals(other); - /// - public bool Equals(ExternalSecuritySolutionKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolutionList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolutionList.Serialization.cs deleted file mode 100644 index 6b42c3b1da5c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolutionList.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class ExternalSecuritySolutionList - { - internal static ExternalSecuritySolutionList DeserializeExternalSecuritySolutionList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ExternalSecuritySolution.DeserializeExternalSecuritySolution(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new ExternalSecuritySolutionList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolutionList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolutionList.cs deleted file mode 100644 index 3012f1447ffe..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolutionList.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The ExternalSecuritySolutionList. - internal partial class ExternalSecuritySolutionList - { - /// Initializes a new instance of ExternalSecuritySolutionList. - internal ExternalSecuritySolutionList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of ExternalSecuritySolutionList. - /// - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// The URI to fetch the next page. - internal ExternalSecuritySolutionList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// - /// Gets the value - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolutionProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolutionProperties.Serialization.cs deleted file mode 100644 index ff74ae7648cb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolutionProperties.Serialization.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class ExternalSecuritySolutionProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(DeviceVendor)) - { - writer.WritePropertyName("deviceVendor"u8); - writer.WriteStringValue(DeviceVendor); - } - if (Optional.IsDefined(DeviceType)) - { - writer.WritePropertyName("deviceType"u8); - writer.WriteStringValue(DeviceType); - } - if (Optional.IsDefined(Workspace)) - { - writer.WritePropertyName("workspace"u8); - JsonSerializer.Serialize(writer, Workspace); - } - foreach (var item in AdditionalProperties) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - - internal static ExternalSecuritySolutionProperties DeserializeExternalSecuritySolutionProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional deviceVendor = default; - Optional deviceType = default; - Optional workspace = default; - IDictionary additionalProperties = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("deviceVendor"u8)) - { - deviceVendor = property.Value.GetString(); - continue; - } - if (property.NameEquals("deviceType"u8)) - { - deviceType = property.Value.GetString(); - continue; - } - if (property.NameEquals("workspace"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - workspace = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - additionalProperties = additionalPropertiesDictionary; - return new ExternalSecuritySolutionProperties(deviceVendor.Value, deviceType.Value, workspace, additionalProperties); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolutionProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolutionProperties.cs deleted file mode 100644 index e9265b0087de..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ExternalSecuritySolutionProperties.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The solution properties (correspond to the solution kind). - public partial class ExternalSecuritySolutionProperties - { - /// Initializes a new instance of ExternalSecuritySolutionProperties. - public ExternalSecuritySolutionProperties() - { - AdditionalProperties = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of ExternalSecuritySolutionProperties. - /// - /// - /// Represents an OMS workspace to which the solution is connected. - /// Additional Properties. - internal ExternalSecuritySolutionProperties(string deviceVendor, string deviceType, WritableSubResource workspace, IDictionary additionalProperties) - { - DeviceVendor = deviceVendor; - DeviceType = deviceType; - Workspace = workspace; - AdditionalProperties = additionalProperties; - } - - /// Gets or sets the device vendor. - public string DeviceVendor { get; set; } - /// Gets or sets the device type. - public string DeviceType { get; set; } - /// Represents an OMS workspace to which the solution is connected. - internal WritableSubResource Workspace { get; set; } - /// Gets or sets Id. - public ResourceIdentifier WorkspaceId - { - get => Workspace is null ? default : Workspace.Id; - set - { - if (Workspace is null) - Workspace = new WritableSubResource(); - Workspace.Id = value; - } - } - - /// - /// Additional Properties - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formated json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public IDictionary AdditionalProperties { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/FailedLocalLoginsNotInAllowedRange.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/FailedLocalLoginsNotInAllowedRange.Serialization.cs deleted file mode 100644 index bbd826f41e26..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/FailedLocalLoginsNotInAllowedRange.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class FailedLocalLoginsNotInAllowedRange : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("timeWindowSize"u8); - writer.WriteStringValue(TimeWindowSize, "P"); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static FailedLocalLoginsNotInAllowedRange DeserializeFailedLocalLoginsNotInAllowedRange(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - TimeSpan timeWindowSize = default; - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeWindowSize"u8)) - { - timeWindowSize = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new FailedLocalLoginsNotInAllowedRange(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/FailedLocalLoginsNotInAllowedRange.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/FailedLocalLoginsNotInAllowedRange.cs deleted file mode 100644 index 5cb4dc31642f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/FailedLocalLoginsNotInAllowedRange.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Number of failed local logins is not in allowed range. - public partial class FailedLocalLoginsNotInAllowedRange : TimeWindowCustomAlertRule - { - /// Initializes a new instance of FailedLocalLoginsNotInAllowedRange. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - public FailedLocalLoginsNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(isEnabled, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = "FailedLocalLoginsNotInAllowedRange"; - } - - /// Initializes a new instance of FailedLocalLoginsNotInAllowedRange. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - internal FailedLocalLoginsNotInAllowedRange(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(displayName, description, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = ruleType ?? "FailedLocalLoginsNotInAllowedRange"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/FileUploadsNotInAllowedRange.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/FileUploadsNotInAllowedRange.Serialization.cs deleted file mode 100644 index ac02c94d9e49..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/FileUploadsNotInAllowedRange.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class FileUploadsNotInAllowedRange : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("timeWindowSize"u8); - writer.WriteStringValue(TimeWindowSize, "P"); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static FileUploadsNotInAllowedRange DeserializeFileUploadsNotInAllowedRange(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - TimeSpan timeWindowSize = default; - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeWindowSize"u8)) - { - timeWindowSize = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new FileUploadsNotInAllowedRange(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/FileUploadsNotInAllowedRange.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/FileUploadsNotInAllowedRange.cs deleted file mode 100644 index e9d9bc00694b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/FileUploadsNotInAllowedRange.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Number of file uploads is not in allowed range. - public partial class FileUploadsNotInAllowedRange : TimeWindowCustomAlertRule - { - /// Initializes a new instance of FileUploadsNotInAllowedRange. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - public FileUploadsNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(isEnabled, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = "FileUploadsNotInAllowedRange"; - } - - /// Initializes a new instance of FileUploadsNotInAllowedRange. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - internal FileUploadsNotInAllowedRange(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(displayName, description, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = ruleType ?? "FileUploadsNotInAllowedRange"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpCredentialsDetailsProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpCredentialsDetailsProperties.Serialization.cs deleted file mode 100644 index d1bcec1e752a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpCredentialsDetailsProperties.Serialization.cs +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class GcpCredentialsDetailsProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("organizationId"u8); - writer.WriteStringValue(OrganizationId); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(GcpCredentialType); - writer.WritePropertyName("projectId"u8); - writer.WriteStringValue(ProjectId); - writer.WritePropertyName("privateKeyId"u8); - writer.WriteStringValue(PrivateKeyId); - writer.WritePropertyName("privateKey"u8); - writer.WriteStringValue(PrivateKey); - writer.WritePropertyName("clientEmail"u8); - writer.WriteStringValue(ClientEmail); - writer.WritePropertyName("clientId"u8); - writer.WriteStringValue(ClientId); - writer.WritePropertyName("authUri"u8); - writer.WriteStringValue(AuthUri.AbsoluteUri); - writer.WritePropertyName("tokenUri"u8); - writer.WriteStringValue(TokenUri.AbsoluteUri); - writer.WritePropertyName("authProviderX509CertUrl"u8); - writer.WriteStringValue(AuthProviderX509CertUri.AbsoluteUri); - writer.WritePropertyName("clientX509CertUrl"u8); - writer.WriteStringValue(ClientX509CertUri.AbsoluteUri); - writer.WritePropertyName("authenticationType"u8); - writer.WriteStringValue(AuthenticationType.ToString()); - writer.WriteEndObject(); - } - - internal static GcpCredentialsDetailsProperties DeserializeGcpCredentialsDetailsProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string organizationId = default; - string type = default; - string projectId = default; - string privateKeyId = default; - string privateKey = default; - string clientEmail = default; - string clientId = default; - Uri authUri = default; - Uri tokenUri = default; - Uri authProviderX509CertUrl = default; - Uri clientX509CertUrl = default; - Optional authenticationProvisioningState = default; - Optional> grantedPermissions = default; - AuthenticationType authenticationType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("organizationId"u8)) - { - organizationId = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("projectId"u8)) - { - projectId = property.Value.GetString(); - continue; - } - if (property.NameEquals("privateKeyId"u8)) - { - privateKeyId = property.Value.GetString(); - continue; - } - if (property.NameEquals("privateKey"u8)) - { - privateKey = property.Value.GetString(); - continue; - } - if (property.NameEquals("clientEmail"u8)) - { - clientEmail = property.Value.GetString(); - continue; - } - if (property.NameEquals("clientId"u8)) - { - clientId = property.Value.GetString(); - continue; - } - if (property.NameEquals("authUri"u8)) - { - authUri = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("tokenUri"u8)) - { - tokenUri = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("authProviderX509CertUrl"u8)) - { - authProviderX509CertUrl = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("clientX509CertUrl"u8)) - { - clientX509CertUrl = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("authenticationProvisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - authenticationProvisioningState = new AuthenticationProvisioningState(property.Value.GetString()); - continue; - } - if (property.NameEquals("grantedPermissions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(new SecurityCenterCloudPermission(item.GetString())); - } - grantedPermissions = array; - continue; - } - if (property.NameEquals("authenticationType"u8)) - { - authenticationType = new AuthenticationType(property.Value.GetString()); - continue; - } - } - return new GcpCredentialsDetailsProperties(Optional.ToNullable(authenticationProvisioningState), Optional.ToList(grantedPermissions), authenticationType, organizationId, type, projectId, privateKeyId, privateKey, clientEmail, clientId, authUri, tokenUri, authProviderX509CertUrl, clientX509CertUrl); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpCredentialsDetailsProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpCredentialsDetailsProperties.cs deleted file mode 100644 index 4afd9fd35f86..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpCredentialsDetailsProperties.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// GCP cloud account connector based service to service credentials, the credentials are composed of the organization ID and a JSON API key (write only). - public partial class GcpCredentialsDetailsProperties : AuthenticationDetailsProperties - { - /// Initializes a new instance of GcpCredentialsDetailsProperties. - /// The organization ID of the GCP cloud account. - /// Type field of the API key (write only). - /// Project ID field of the API key (write only). - /// Private key ID field of the API key (write only). - /// Private key field of the API key (write only). - /// Client email field of the API key (write only). - /// Client ID field of the API key (write only). - /// Auth URI field of the API key (write only). - /// Token URI field of the API key (write only). - /// Auth provider x509 certificate URL field of the API key (write only). - /// Client x509 certificate URL field of the API key (write only). - /// , , , , , , , , , or is null. - public GcpCredentialsDetailsProperties(string organizationId, string gcpCredentialType, string projectId, string privateKeyId, string privateKey, string clientEmail, string clientId, Uri authUri, Uri tokenUri, Uri authProviderX509CertUri, Uri clientX509CertUri) - { - Argument.AssertNotNull(organizationId, nameof(organizationId)); - Argument.AssertNotNull(gcpCredentialType, nameof(gcpCredentialType)); - Argument.AssertNotNull(projectId, nameof(projectId)); - Argument.AssertNotNull(privateKeyId, nameof(privateKeyId)); - Argument.AssertNotNull(privateKey, nameof(privateKey)); - Argument.AssertNotNull(clientEmail, nameof(clientEmail)); - Argument.AssertNotNull(clientId, nameof(clientId)); - Argument.AssertNotNull(authUri, nameof(authUri)); - Argument.AssertNotNull(tokenUri, nameof(tokenUri)); - Argument.AssertNotNull(authProviderX509CertUri, nameof(authProviderX509CertUri)); - Argument.AssertNotNull(clientX509CertUri, nameof(clientX509CertUri)); - - OrganizationId = organizationId; - GcpCredentialType = gcpCredentialType; - ProjectId = projectId; - PrivateKeyId = privateKeyId; - PrivateKey = privateKey; - ClientEmail = clientEmail; - ClientId = clientId; - AuthUri = authUri; - TokenUri = tokenUri; - AuthProviderX509CertUri = authProviderX509CertUri; - ClientX509CertUri = clientX509CertUri; - AuthenticationType = AuthenticationType.GcpCredentials; - } - - /// Initializes a new instance of GcpCredentialsDetailsProperties. - /// State of the multi-cloud connector. - /// The permissions detected in the cloud account. - /// Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use account organization credentials. - /// The organization ID of the GCP cloud account. - /// Type field of the API key (write only). - /// Project ID field of the API key (write only). - /// Private key ID field of the API key (write only). - /// Private key field of the API key (write only). - /// Client email field of the API key (write only). - /// Client ID field of the API key (write only). - /// Auth URI field of the API key (write only). - /// Token URI field of the API key (write only). - /// Auth provider x509 certificate URL field of the API key (write only). - /// Client x509 certificate URL field of the API key (write only). - internal GcpCredentialsDetailsProperties(AuthenticationProvisioningState? authenticationProvisioningState, IReadOnlyList grantedPermissions, AuthenticationType authenticationType, string organizationId, string gcpCredentialType, string projectId, string privateKeyId, string privateKey, string clientEmail, string clientId, Uri authUri, Uri tokenUri, Uri authProviderX509CertUri, Uri clientX509CertUri) : base(authenticationProvisioningState, grantedPermissions, authenticationType) - { - OrganizationId = organizationId; - GcpCredentialType = gcpCredentialType; - ProjectId = projectId; - PrivateKeyId = privateKeyId; - PrivateKey = privateKey; - ClientEmail = clientEmail; - ClientId = clientId; - AuthUri = authUri; - TokenUri = tokenUri; - AuthProviderX509CertUri = authProviderX509CertUri; - ClientX509CertUri = clientX509CertUri; - AuthenticationType = authenticationType; - } - - /// The organization ID of the GCP cloud account. - public string OrganizationId { get; set; } - /// Type field of the API key (write only). - public string GcpCredentialType { get; set; } - /// Project ID field of the API key (write only). - public string ProjectId { get; set; } - /// Private key ID field of the API key (write only). - public string PrivateKeyId { get; set; } - /// Private key field of the API key (write only). - public string PrivateKey { get; set; } - /// Client email field of the API key (write only). - public string ClientEmail { get; set; } - /// Client ID field of the API key (write only). - public string ClientId { get; set; } - /// Auth URI field of the API key (write only). - public Uri AuthUri { get; set; } - /// Token URI field of the API key (write only). - public Uri TokenUri { get; set; } - /// Auth provider x509 certificate URL field of the API key (write only). - public Uri AuthProviderX509CertUri { get; set; } - /// Client x509 certificate URL field of the API key (write only). - public Uri ClientX509CertUri { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpDefenderForDatabasesArcAutoProvisioning.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpDefenderForDatabasesArcAutoProvisioning.Serialization.cs deleted file mode 100644 index 4ea1df2ca6a9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpDefenderForDatabasesArcAutoProvisioning.Serialization.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class GcpDefenderForDatabasesArcAutoProvisioning : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ServiceAccountEmailAddress)) - { - writer.WritePropertyName("serviceAccountEmailAddress"u8); - writer.WriteStringValue(ServiceAccountEmailAddress); - } - if (Optional.IsDefined(WorkloadIdentityProviderId)) - { - writer.WritePropertyName("workloadIdentityProviderId"u8); - writer.WriteStringValue(WorkloadIdentityProviderId); - } - writer.WriteEndObject(); - } - - internal static GcpDefenderForDatabasesArcAutoProvisioning DeserializeGcpDefenderForDatabasesArcAutoProvisioning(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional serviceAccountEmailAddress = default; - Optional workloadIdentityProviderId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("serviceAccountEmailAddress"u8)) - { - serviceAccountEmailAddress = property.Value.GetString(); - continue; - } - if (property.NameEquals("workloadIdentityProviderId"u8)) - { - workloadIdentityProviderId = property.Value.GetString(); - continue; - } - } - return new GcpDefenderForDatabasesArcAutoProvisioning(serviceAccountEmailAddress.Value, workloadIdentityProviderId.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpDefenderForDatabasesArcAutoProvisioning.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpDefenderForDatabasesArcAutoProvisioning.cs deleted file mode 100644 index c19b2e58513b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpDefenderForDatabasesArcAutoProvisioning.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The native cloud connection configuration. - public partial class GcpDefenderForDatabasesArcAutoProvisioning - { - /// Initializes a new instance of GcpDefenderForDatabasesArcAutoProvisioning. - public GcpDefenderForDatabasesArcAutoProvisioning() - { - } - - /// Initializes a new instance of GcpDefenderForDatabasesArcAutoProvisioning. - /// The service account email address in GCP for this offering. - /// The GCP workload identity provider id for this offering. - internal GcpDefenderForDatabasesArcAutoProvisioning(string serviceAccountEmailAddress, string workloadIdentityProviderId) - { - ServiceAccountEmailAddress = serviceAccountEmailAddress; - WorkloadIdentityProviderId = workloadIdentityProviderId; - } - - /// The service account email address in GCP for this offering. - public string ServiceAccountEmailAddress { get; set; } - /// The GCP workload identity provider id for this offering. - public string WorkloadIdentityProviderId { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpDefenderForServersInfo.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpDefenderForServersInfo.Serialization.cs deleted file mode 100644 index 628fff6efcc0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpDefenderForServersInfo.Serialization.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class GcpDefenderForServersInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(WorkloadIdentityProviderId)) - { - writer.WritePropertyName("workloadIdentityProviderId"u8); - writer.WriteStringValue(WorkloadIdentityProviderId); - } - if (Optional.IsDefined(ServiceAccountEmailAddress)) - { - writer.WritePropertyName("serviceAccountEmailAddress"u8); - writer.WriteStringValue(ServiceAccountEmailAddress); - } - writer.WriteEndObject(); - } - - internal static GcpDefenderForServersInfo DeserializeGcpDefenderForServersInfo(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional workloadIdentityProviderId = default; - Optional serviceAccountEmailAddress = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("workloadIdentityProviderId"u8)) - { - workloadIdentityProviderId = property.Value.GetString(); - continue; - } - if (property.NameEquals("serviceAccountEmailAddress"u8)) - { - serviceAccountEmailAddress = property.Value.GetString(); - continue; - } - } - return new GcpDefenderForServersInfo(workloadIdentityProviderId.Value, serviceAccountEmailAddress.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpDefenderForServersInfo.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpDefenderForServersInfo.cs deleted file mode 100644 index 4bdbe6a68e69..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpDefenderForServersInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The Defender for servers connection configuration. - public partial class GcpDefenderForServersInfo - { - /// Initializes a new instance of GcpDefenderForServersInfo. - public GcpDefenderForServersInfo() - { - } - - /// Initializes a new instance of GcpDefenderForServersInfo. - /// The workload identity provider id in GCP for this feature. - /// The service account email address in GCP for this feature. - internal GcpDefenderForServersInfo(string workloadIdentityProviderId, string serviceAccountEmailAddress) - { - WorkloadIdentityProviderId = workloadIdentityProviderId; - ServiceAccountEmailAddress = serviceAccountEmailAddress; - } - - /// The workload identity provider id in GCP for this feature. - public string WorkloadIdentityProviderId { get; set; } - /// The service account email address in GCP for this feature. - public string ServiceAccountEmailAddress { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpMemberOrganizationalInfo.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpMemberOrganizationalInfo.Serialization.cs deleted file mode 100644 index 40e06512cd2e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpMemberOrganizationalInfo.Serialization.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class GcpMemberOrganizationalInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ParentHierarchyId)) - { - writer.WritePropertyName("parentHierarchyId"u8); - writer.WriteStringValue(ParentHierarchyId); - } - if (Optional.IsDefined(ManagementProjectNumber)) - { - writer.WritePropertyName("managementProjectNumber"u8); - writer.WriteStringValue(ManagementProjectNumber); - } - writer.WritePropertyName("organizationMembershipType"u8); - writer.WriteStringValue(OrganizationMembershipType.ToString()); - writer.WriteEndObject(); - } - - internal static GcpMemberOrganizationalInfo DeserializeGcpMemberOrganizationalInfo(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional parentHierarchyId = default; - Optional managementProjectNumber = default; - OrganizationMembershipType organizationMembershipType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("parentHierarchyId"u8)) - { - parentHierarchyId = property.Value.GetString(); - continue; - } - if (property.NameEquals("managementProjectNumber"u8)) - { - managementProjectNumber = property.Value.GetString(); - continue; - } - if (property.NameEquals("organizationMembershipType"u8)) - { - organizationMembershipType = new OrganizationMembershipType(property.Value.GetString()); - continue; - } - } - return new GcpMemberOrganizationalInfo(organizationMembershipType, parentHierarchyId.Value, managementProjectNumber.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpMemberOrganizationalInfo.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpMemberOrganizationalInfo.cs deleted file mode 100644 index a19b5d235fd4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpMemberOrganizationalInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The gcpOrganization data for the member account. - public partial class GcpMemberOrganizationalInfo : GcpOrganizationalInfo - { - /// Initializes a new instance of GcpMemberOrganizationalInfo. - public GcpMemberOrganizationalInfo() - { - OrganizationMembershipType = OrganizationMembershipType.Member; - } - - /// Initializes a new instance of GcpMemberOrganizationalInfo. - /// The multi cloud account's membership type in the organization. - /// If the multi cloud account is not of membership type organization, this will be the ID of the project's parent. - /// The GCP management project number from organizational onboarding. - internal GcpMemberOrganizationalInfo(OrganizationMembershipType organizationMembershipType, string parentHierarchyId, string managementProjectNumber) : base(organizationMembershipType) - { - ParentHierarchyId = parentHierarchyId; - ManagementProjectNumber = managementProjectNumber; - OrganizationMembershipType = organizationMembershipType; - } - - /// If the multi cloud account is not of membership type organization, this will be the ID of the project's parent. - public string ParentHierarchyId { get; set; } - /// The GCP management project number from organizational onboarding. - public string ManagementProjectNumber { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpOrganizationalInfo.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpOrganizationalInfo.Serialization.cs deleted file mode 100644 index bee4acd1249b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpOrganizationalInfo.Serialization.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class GcpOrganizationalInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("organizationMembershipType"u8); - writer.WriteStringValue(OrganizationMembershipType.ToString()); - writer.WriteEndObject(); - } - - internal static GcpOrganizationalInfo DeserializeGcpOrganizationalInfo(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("organizationMembershipType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "Member": return GcpMemberOrganizationalInfo.DeserializeGcpMemberOrganizationalInfo(element); - case "Organization": return GcpParentOrganizationalInfo.DeserializeGcpParentOrganizationalInfo(element); - } - } - return UnknownGcpOrganizationalData.DeserializeUnknownGcpOrganizationalData(element); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpOrganizationalInfo.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpOrganizationalInfo.cs deleted file mode 100644 index 10d46478c430..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpOrganizationalInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// - /// The gcpOrganization data - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public abstract partial class GcpOrganizationalInfo - { - /// Initializes a new instance of GcpOrganizationalInfo. - protected GcpOrganizationalInfo() - { - } - - /// Initializes a new instance of GcpOrganizationalInfo. - /// The multi cloud account's membership type in the organization. - internal GcpOrganizationalInfo(OrganizationMembershipType organizationMembershipType) - { - OrganizationMembershipType = organizationMembershipType; - } - - /// The multi cloud account's membership type in the organization. - internal OrganizationMembershipType OrganizationMembershipType { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpParentOrganizationalInfo.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpParentOrganizationalInfo.Serialization.cs deleted file mode 100644 index 1be7902443a9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpParentOrganizationalInfo.Serialization.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class GcpParentOrganizationalInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(ExcludedProjectNumbers)) - { - writer.WritePropertyName("excludedProjectNumbers"u8); - writer.WriteStartArray(); - foreach (var item in ExcludedProjectNumbers) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(ServiceAccountEmailAddress)) - { - writer.WritePropertyName("serviceAccountEmailAddress"u8); - writer.WriteStringValue(ServiceAccountEmailAddress); - } - if (Optional.IsDefined(WorkloadIdentityProviderId)) - { - writer.WritePropertyName("workloadIdentityProviderId"u8); - writer.WriteStringValue(WorkloadIdentityProviderId); - } - writer.WritePropertyName("organizationMembershipType"u8); - writer.WriteStringValue(OrganizationMembershipType.ToString()); - writer.WriteEndObject(); - } - - internal static GcpParentOrganizationalInfo DeserializeGcpParentOrganizationalInfo(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> excludedProjectNumbers = default; - Optional serviceAccountEmailAddress = default; - Optional workloadIdentityProviderId = default; - OrganizationMembershipType organizationMembershipType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("excludedProjectNumbers"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - excludedProjectNumbers = array; - continue; - } - if (property.NameEquals("serviceAccountEmailAddress"u8)) - { - serviceAccountEmailAddress = property.Value.GetString(); - continue; - } - if (property.NameEquals("workloadIdentityProviderId"u8)) - { - workloadIdentityProviderId = property.Value.GetString(); - continue; - } - if (property.NameEquals("organizationMembershipType"u8)) - { - organizationMembershipType = new OrganizationMembershipType(property.Value.GetString()); - continue; - } - } - return new GcpParentOrganizationalInfo(organizationMembershipType, Optional.ToList(excludedProjectNumbers), serviceAccountEmailAddress.Value, workloadIdentityProviderId.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpParentOrganizationalInfo.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpParentOrganizationalInfo.cs deleted file mode 100644 index a1eaf752892c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpParentOrganizationalInfo.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The gcpOrganization data for the parent account. - public partial class GcpParentOrganizationalInfo : GcpOrganizationalInfo - { - /// Initializes a new instance of GcpParentOrganizationalInfo. - public GcpParentOrganizationalInfo() - { - ExcludedProjectNumbers = new ChangeTrackingList(); - OrganizationMembershipType = OrganizationMembershipType.Organization; - } - - /// Initializes a new instance of GcpParentOrganizationalInfo. - /// The multi cloud account's membership type in the organization. - /// If the multi cloud account is of membership type organization, list of accounts excluded from offering. - /// The service account email address which represents the organization level permissions container. - /// The GCP workload identity provider id which represents the permissions required to auto provision security connectors. - internal GcpParentOrganizationalInfo(OrganizationMembershipType organizationMembershipType, IList excludedProjectNumbers, string serviceAccountEmailAddress, string workloadIdentityProviderId) : base(organizationMembershipType) - { - ExcludedProjectNumbers = excludedProjectNumbers; - ServiceAccountEmailAddress = serviceAccountEmailAddress; - WorkloadIdentityProviderId = workloadIdentityProviderId; - OrganizationMembershipType = organizationMembershipType; - } - - /// If the multi cloud account is of membership type organization, list of accounts excluded from offering. - public IList ExcludedProjectNumbers { get; } - /// The service account email address which represents the organization level permissions container. - public string ServiceAccountEmailAddress { get; set; } - /// The GCP workload identity provider id which represents the permissions required to auto provision security connectors. - public string WorkloadIdentityProviderId { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpProjectDetails.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpProjectDetails.Serialization.cs deleted file mode 100644 index 53e0a41005cd..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpProjectDetails.Serialization.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class GcpProjectDetails : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ProjectNumber)) - { - writer.WritePropertyName("projectNumber"u8); - writer.WriteStringValue(ProjectNumber); - } - if (Optional.IsDefined(ProjectId)) - { - writer.WritePropertyName("projectId"u8); - writer.WriteStringValue(ProjectId); - } - writer.WriteEndObject(); - } - - internal static GcpProjectDetails DeserializeGcpProjectDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional projectNumber = default; - Optional projectId = default; - Optional workloadIdentityPoolId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("projectNumber"u8)) - { - projectNumber = property.Value.GetString(); - continue; - } - if (property.NameEquals("projectId"u8)) - { - projectId = property.Value.GetString(); - continue; - } - if (property.NameEquals("workloadIdentityPoolId"u8)) - { - workloadIdentityPoolId = property.Value.GetString(); - continue; - } - } - return new GcpProjectDetails(projectNumber.Value, projectId.Value, workloadIdentityPoolId.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpProjectDetails.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpProjectDetails.cs deleted file mode 100644 index 81cce54007aa..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpProjectDetails.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The details about the project represented by the security connector. - public partial class GcpProjectDetails - { - /// Initializes a new instance of GcpProjectDetails. - public GcpProjectDetails() - { - } - - /// Initializes a new instance of GcpProjectDetails. - /// The unique GCP Project number. - /// The GCP Project id. - /// The GCP workload identity federation pool id. - internal GcpProjectDetails(string projectNumber, string projectId, string workloadIdentityPoolId) - { - ProjectNumber = projectNumber; - ProjectId = projectId; - WorkloadIdentityPoolId = workloadIdentityPoolId; - } - - /// The unique GCP Project number. - public string ProjectNumber { get; set; } - /// The GCP Project id. - public string ProjectId { get; set; } - /// The GCP workload identity federation pool id. - public string WorkloadIdentityPoolId { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpProjectEnvironment.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpProjectEnvironment.Serialization.cs deleted file mode 100644 index e74e9c367b1d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpProjectEnvironment.Serialization.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class GcpProjectEnvironment : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(OrganizationalData)) - { - writer.WritePropertyName("organizationalData"u8); - writer.WriteObjectValue(OrganizationalData); - } - if (Optional.IsDefined(ProjectDetails)) - { - writer.WritePropertyName("projectDetails"u8); - writer.WriteObjectValue(ProjectDetails); - } - writer.WritePropertyName("environmentType"u8); - writer.WriteStringValue(EnvironmentType.ToString()); - writer.WriteEndObject(); - } - - internal static GcpProjectEnvironment DeserializeGcpProjectEnvironment(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional organizationalData = default; - Optional projectDetails = default; - EnvironmentType environmentType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("organizationalData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - organizationalData = GcpOrganizationalInfo.DeserializeGcpOrganizationalInfo(property.Value); - continue; - } - if (property.NameEquals("projectDetails"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - projectDetails = GcpProjectDetails.DeserializeGcpProjectDetails(property.Value); - continue; - } - if (property.NameEquals("environmentType"u8)) - { - environmentType = new EnvironmentType(property.Value.GetString()); - continue; - } - } - return new GcpProjectEnvironment(environmentType, organizationalData.Value, projectDetails.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpProjectEnvironment.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpProjectEnvironment.cs deleted file mode 100644 index 738612c15ee5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GcpProjectEnvironment.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The GCP project connector environment data. - public partial class GcpProjectEnvironment : SecurityConnectorEnvironment - { - /// Initializes a new instance of GcpProjectEnvironment. - public GcpProjectEnvironment() - { - EnvironmentType = EnvironmentType.GcpProject; - } - - /// Initializes a new instance of GcpProjectEnvironment. - /// The type of the environment data. - /// - /// The Gcp project's organizational data - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// The Gcp project's details. - internal GcpProjectEnvironment(EnvironmentType environmentType, GcpOrganizationalInfo organizationalData, GcpProjectDetails projectDetails) : base(environmentType) - { - OrganizationalData = organizationalData; - ProjectDetails = projectDetails; - EnvironmentType = environmentType; - } - - /// - /// The Gcp project's organizational data - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public GcpOrganizationalInfo OrganizationalData { get; set; } - /// The Gcp project's details. - public GcpProjectDetails ProjectDetails { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GithubScopeEnvironment.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GithubScopeEnvironment.Serialization.cs deleted file mode 100644 index 7216c450fe32..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GithubScopeEnvironment.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class GithubScopeEnvironment : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("environmentType"u8); - writer.WriteStringValue(EnvironmentType.ToString()); - writer.WriteEndObject(); - } - - internal static GithubScopeEnvironment DeserializeGithubScopeEnvironment(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - EnvironmentType environmentType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("environmentType"u8)) - { - environmentType = new EnvironmentType(property.Value.GetString()); - continue; - } - } - return new GithubScopeEnvironment(environmentType); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GithubScopeEnvironment.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GithubScopeEnvironment.cs deleted file mode 100644 index ca229abf0b07..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GithubScopeEnvironment.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The github scope connector's environment data. - public partial class GithubScopeEnvironment : SecurityConnectorEnvironment - { - /// Initializes a new instance of GithubScopeEnvironment. - public GithubScopeEnvironment() - { - EnvironmentType = EnvironmentType.GithubScope; - } - - /// Initializes a new instance of GithubScopeEnvironment. - /// The type of the environment data. - internal GithubScopeEnvironment(EnvironmentType environmentType) : base(environmentType) - { - EnvironmentType = environmentType; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceAssignmentAdditionalInfo.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceAssignmentAdditionalInfo.Serialization.cs deleted file mode 100644 index 2b0304793aa7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceAssignmentAdditionalInfo.Serialization.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class GovernanceAssignmentAdditionalInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(TicketNumber)) - { - writer.WritePropertyName("ticketNumber"u8); - writer.WriteNumberValue(TicketNumber.Value); - } - if (Optional.IsDefined(TicketLink)) - { - writer.WritePropertyName("ticketLink"u8); - writer.WriteStringValue(TicketLink); - } - if (Optional.IsDefined(TicketStatus)) - { - writer.WritePropertyName("ticketStatus"u8); - writer.WriteStringValue(TicketStatus); - } - writer.WriteEndObject(); - } - - internal static GovernanceAssignmentAdditionalInfo DeserializeGovernanceAssignmentAdditionalInfo(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional ticketNumber = default; - Optional ticketLink = default; - Optional ticketStatus = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("ticketNumber"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - ticketNumber = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("ticketLink"u8)) - { - ticketLink = property.Value.GetString(); - continue; - } - if (property.NameEquals("ticketStatus"u8)) - { - ticketStatus = property.Value.GetString(); - continue; - } - } - return new GovernanceAssignmentAdditionalInfo(Optional.ToNullable(ticketNumber), ticketLink.Value, ticketStatus.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceAssignmentAdditionalInfo.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceAssignmentAdditionalInfo.cs deleted file mode 100644 index 464bc9d0a890..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceAssignmentAdditionalInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Describe the additional data of GovernanceAssignment - optional. - public partial class GovernanceAssignmentAdditionalInfo - { - /// Initializes a new instance of GovernanceAssignmentAdditionalInfo. - public GovernanceAssignmentAdditionalInfo() - { - } - - /// Initializes a new instance of GovernanceAssignmentAdditionalInfo. - /// Ticket number associated with this GovernanceAssignment. - /// Ticket link associated with this GovernanceAssignment - for example: https://snow.com. - /// The ticket status associated with this GovernanceAssignment - for example: Active. - internal GovernanceAssignmentAdditionalInfo(int? ticketNumber, string ticketLink, string ticketStatus) - { - TicketNumber = ticketNumber; - TicketLink = ticketLink; - TicketStatus = ticketStatus; - } - - /// Ticket number associated with this GovernanceAssignment. - public int? TicketNumber { get; set; } - /// Ticket link associated with this GovernanceAssignment - for example: https://snow.com. - public string TicketLink { get; set; } - /// The ticket status associated with this GovernanceAssignment - for example: Active. - public string TicketStatus { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceAssignmentData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceAssignmentData.Serialization.cs deleted file mode 100644 index 336d855754a2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceAssignmentData.Serialization.cs +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class GovernanceAssignmentData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Owner)) - { - writer.WritePropertyName("owner"u8); - writer.WriteStringValue(Owner); - } - if (Optional.IsDefined(RemediationDueOn)) - { - writer.WritePropertyName("remediationDueDate"u8); - writer.WriteStringValue(RemediationDueOn.Value, "O"); - } - if (Optional.IsDefined(RemediationEta)) - { - writer.WritePropertyName("remediationEta"u8); - writer.WriteObjectValue(RemediationEta); - } - if (Optional.IsDefined(IsGracePeriod)) - { - writer.WritePropertyName("isGracePeriod"u8); - writer.WriteBooleanValue(IsGracePeriod.Value); - } - if (Optional.IsDefined(GovernanceEmailNotification)) - { - writer.WritePropertyName("governanceEmailNotification"u8); - writer.WriteObjectValue(GovernanceEmailNotification); - } - if (Optional.IsDefined(AdditionalData)) - { - writer.WritePropertyName("additionalData"u8); - writer.WriteObjectValue(AdditionalData); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static GovernanceAssignmentData DeserializeGovernanceAssignmentData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional owner = default; - Optional remediationDueDate = default; - Optional remediationEta = default; - Optional isGracePeriod = default; - Optional governanceEmailNotification = default; - Optional additionalData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("owner"u8)) - { - owner = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("remediationDueDate"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - remediationDueDate = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("remediationEta"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - remediationEta = RemediationEta.DeserializeRemediationEta(property0.Value); - continue; - } - if (property0.NameEquals("isGracePeriod"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isGracePeriod = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("governanceEmailNotification"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - governanceEmailNotification = GovernanceEmailNotification.DeserializeGovernanceEmailNotification(property0.Value); - continue; - } - if (property0.NameEquals("additionalData"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - additionalData = GovernanceAssignmentAdditionalInfo.DeserializeGovernanceAssignmentAdditionalInfo(property0.Value); - continue; - } - } - continue; - } - } - return new GovernanceAssignmentData(id, name, type, systemData.Value, owner.Value, Optional.ToNullable(remediationDueDate), remediationEta.Value, Optional.ToNullable(isGracePeriod), governanceEmailNotification.Value, additionalData.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceAssignmentsList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceAssignmentsList.Serialization.cs deleted file mode 100644 index 0b6cb4f52aca..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceAssignmentsList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class GovernanceAssignmentsList - { - internal static GovernanceAssignmentsList DeserializeGovernanceAssignmentsList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(GovernanceAssignmentData.DeserializeGovernanceAssignmentData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new GovernanceAssignmentsList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceAssignmentsList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceAssignmentsList.cs deleted file mode 100644 index fe613ef2348f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceAssignmentsList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Page of a security governance assignments list. - internal partial class GovernanceAssignmentsList - { - /// Initializes a new instance of GovernanceAssignmentsList. - internal GovernanceAssignmentsList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of GovernanceAssignmentsList. - /// Collection of governance assignments in this page. - /// The URI to fetch the next page. - internal GovernanceAssignmentsList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of governance assignments in this page. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceEmailNotification.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceEmailNotification.Serialization.cs deleted file mode 100644 index 6ecfee310a78..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceEmailNotification.Serialization.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class GovernanceEmailNotification : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(IsManagerEmailNotificationDisabled)) - { - writer.WritePropertyName("disableManagerEmailNotification"u8); - writer.WriteBooleanValue(IsManagerEmailNotificationDisabled.Value); - } - if (Optional.IsDefined(IsOwnerEmailNotificationDisabled)) - { - writer.WritePropertyName("disableOwnerEmailNotification"u8); - writer.WriteBooleanValue(IsOwnerEmailNotificationDisabled.Value); - } - writer.WriteEndObject(); - } - - internal static GovernanceEmailNotification DeserializeGovernanceEmailNotification(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional disableManagerEmailNotification = default; - Optional disableOwnerEmailNotification = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("disableManagerEmailNotification"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - disableManagerEmailNotification = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("disableOwnerEmailNotification"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - disableOwnerEmailNotification = property.Value.GetBoolean(); - continue; - } - } - return new GovernanceEmailNotification(Optional.ToNullable(disableManagerEmailNotification), Optional.ToNullable(disableOwnerEmailNotification)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceEmailNotification.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceEmailNotification.cs deleted file mode 100644 index 7a2500c4677f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceEmailNotification.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The governance email weekly notification configuration. - public partial class GovernanceEmailNotification - { - /// Initializes a new instance of GovernanceEmailNotification. - public GovernanceEmailNotification() - { - } - - /// Initializes a new instance of GovernanceEmailNotification. - /// Exclude manager from weekly email notification. - /// Exclude owner from weekly email notification. - internal GovernanceEmailNotification(bool? isManagerEmailNotificationDisabled, bool? isOwnerEmailNotificationDisabled) - { - IsManagerEmailNotificationDisabled = isManagerEmailNotificationDisabled; - IsOwnerEmailNotificationDisabled = isOwnerEmailNotificationDisabled; - } - - /// Exclude manager from weekly email notification. - public bool? IsManagerEmailNotificationDisabled { get; set; } - /// Exclude owner from weekly email notification. - public bool? IsOwnerEmailNotificationDisabled { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleData.Serialization.cs deleted file mode 100644 index 7933f7497dba..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleData.Serialization.cs +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class GovernanceRuleData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(DisplayName)) - { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (Optional.IsDefined(RemediationTimeframe)) - { - writer.WritePropertyName("remediationTimeframe"u8); - writer.WriteStringValue(RemediationTimeframe); - } - if (Optional.IsDefined(IsGracePeriod)) - { - writer.WritePropertyName("isGracePeriod"u8); - writer.WriteBooleanValue(IsGracePeriod.Value); - } - if (Optional.IsDefined(RulePriority)) - { - writer.WritePropertyName("rulePriority"u8); - writer.WriteNumberValue(RulePriority.Value); - } - if (Optional.IsDefined(IsDisabled)) - { - writer.WritePropertyName("isDisabled"u8); - writer.WriteBooleanValue(IsDisabled.Value); - } - if (Optional.IsDefined(RuleType)) - { - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType.Value.ToString()); - } - if (Optional.IsDefined(SourceResourceType)) - { - writer.WritePropertyName("sourceResourceType"u8); - writer.WriteStringValue(SourceResourceType.Value.ToString()); - } - if (Optional.IsCollectionDefined(ConditionSets)) - { - writer.WritePropertyName("conditionSets"u8); - writer.WriteStartArray(); - foreach (var item in ConditionSets) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } -#if NET6_0_OR_GREATER - writer.WriteRawValue(item); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.ToString()).RootElement); -#endif - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(OwnerSource)) - { - writer.WritePropertyName("ownerSource"u8); - writer.WriteObjectValue(OwnerSource); - } - if (Optional.IsDefined(GovernanceEmailNotification)) - { - writer.WritePropertyName("governanceEmailNotification"u8); - writer.WriteObjectValue(GovernanceEmailNotification); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static GovernanceRuleData DeserializeGovernanceRuleData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional displayName = default; - Optional description = default; - Optional remediationTimeframe = default; - Optional isGracePeriod = default; - Optional rulePriority = default; - Optional isDisabled = default; - Optional ruleType = default; - Optional sourceResourceType = default; - Optional> conditionSets = default; - Optional ownerSource = default; - Optional governanceEmailNotification = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("displayName"u8)) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("description"u8)) - { - description = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("remediationTimeframe"u8)) - { - remediationTimeframe = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("isGracePeriod"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isGracePeriod = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("rulePriority"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - rulePriority = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("isDisabled"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isDisabled = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("ruleType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - ruleType = new GovernanceRuleType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("sourceResourceType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - sourceResourceType = new GovernanceRuleSourceResourceType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("conditionSets"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(BinaryData.FromString(item.GetRawText())); - } - } - conditionSets = array; - continue; - } - if (property0.NameEquals("ownerSource"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - ownerSource = GovernanceRuleOwnerSource.DeserializeGovernanceRuleOwnerSource(property0.Value); - continue; - } - if (property0.NameEquals("governanceEmailNotification"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - governanceEmailNotification = GovernanceRuleEmailNotification.DeserializeGovernanceRuleEmailNotification(property0.Value); - continue; - } - } - continue; - } - } - return new GovernanceRuleData(id, name, type, systemData.Value, displayName.Value, description.Value, remediationTimeframe.Value, Optional.ToNullable(isGracePeriod), Optional.ToNullable(rulePriority), Optional.ToNullable(isDisabled), Optional.ToNullable(ruleType), Optional.ToNullable(sourceResourceType), Optional.ToList(conditionSets), ownerSource.Value, governanceEmailNotification.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleEmailNotification.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleEmailNotification.Serialization.cs deleted file mode 100644 index a835461e6742..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleEmailNotification.Serialization.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class GovernanceRuleEmailNotification : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(IsManagerEmailNotificationDisabled)) - { - writer.WritePropertyName("disableManagerEmailNotification"u8); - writer.WriteBooleanValue(IsManagerEmailNotificationDisabled.Value); - } - if (Optional.IsDefined(IsOwnerEmailNotificationDisabled)) - { - writer.WritePropertyName("disableOwnerEmailNotification"u8); - writer.WriteBooleanValue(IsOwnerEmailNotificationDisabled.Value); - } - writer.WriteEndObject(); - } - - internal static GovernanceRuleEmailNotification DeserializeGovernanceRuleEmailNotification(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional disableManagerEmailNotification = default; - Optional disableOwnerEmailNotification = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("disableManagerEmailNotification"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - disableManagerEmailNotification = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("disableOwnerEmailNotification"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - disableOwnerEmailNotification = property.Value.GetBoolean(); - continue; - } - } - return new GovernanceRuleEmailNotification(Optional.ToNullable(disableManagerEmailNotification), Optional.ToNullable(disableOwnerEmailNotification)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleEmailNotification.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleEmailNotification.cs deleted file mode 100644 index ab57ed2716aa..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleEmailNotification.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The governance email weekly notification configuration. - public partial class GovernanceRuleEmailNotification - { - /// Initializes a new instance of GovernanceRuleEmailNotification. - public GovernanceRuleEmailNotification() - { - } - - /// Initializes a new instance of GovernanceRuleEmailNotification. - /// Defines whether manager email notifications are disabled. - /// Defines whether owner email notifications are disabled. - internal GovernanceRuleEmailNotification(bool? isManagerEmailNotificationDisabled, bool? isOwnerEmailNotificationDisabled) - { - IsManagerEmailNotificationDisabled = isManagerEmailNotificationDisabled; - IsOwnerEmailNotificationDisabled = isOwnerEmailNotificationDisabled; - } - - /// Defines whether manager email notifications are disabled. - public bool? IsManagerEmailNotificationDisabled { get; set; } - /// Defines whether owner email notifications are disabled. - public bool? IsOwnerEmailNotificationDisabled { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleList.Serialization.cs deleted file mode 100644 index c5bba0f459a2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class GovernanceRuleList - { - internal static GovernanceRuleList DeserializeGovernanceRuleList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(GovernanceRuleData.DeserializeGovernanceRuleData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new GovernanceRuleList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleList.cs deleted file mode 100644 index 5e3effd16bd1..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Page of a security governanceRules list. - internal partial class GovernanceRuleList - { - /// Initializes a new instance of GovernanceRuleList. - internal GovernanceRuleList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of GovernanceRuleList. - /// Collection of governanceRules in this page. - /// The URI to fetch the next page. - internal GovernanceRuleList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of governanceRules in this page. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleOwnerSource.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleOwnerSource.Serialization.cs deleted file mode 100644 index 03229e4b5b6a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleOwnerSource.Serialization.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class GovernanceRuleOwnerSource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(SourceType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(SourceType.Value.ToString()); - } - if (Optional.IsDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStringValue(Value); - } - writer.WriteEndObject(); - } - - internal static GovernanceRuleOwnerSource DeserializeGovernanceRuleOwnerSource(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional type = default; - Optional value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = new GovernanceRuleOwnerSourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("value"u8)) - { - value = property.Value.GetString(); - continue; - } - } - return new GovernanceRuleOwnerSource(Optional.ToNullable(type), value.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleOwnerSource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleOwnerSource.cs deleted file mode 100644 index 38238f0d2843..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleOwnerSource.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Describe the owner source of governance rule. - public partial class GovernanceRuleOwnerSource - { - /// Initializes a new instance of GovernanceRuleOwnerSource. - public GovernanceRuleOwnerSource() - { - } - - /// Initializes a new instance of GovernanceRuleOwnerSource. - /// The owner type for the governance rule owner source. - /// The source value e.g. tag key like owner name or email address. - internal GovernanceRuleOwnerSource(GovernanceRuleOwnerSourceType? sourceType, string value) - { - SourceType = sourceType; - Value = value; - } - - /// The owner type for the governance rule owner source. - public GovernanceRuleOwnerSourceType? SourceType { get; set; } - /// The source value e.g. tag key like owner name or email address. - public string Value { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleOwnerSourceType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleOwnerSourceType.cs deleted file mode 100644 index dc3394e695ed..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleOwnerSourceType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The owner type for the governance rule owner source. - public readonly partial struct GovernanceRuleOwnerSourceType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public GovernanceRuleOwnerSourceType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ByTagValue = "ByTag"; - private const string ManuallyValue = "Manually"; - - /// The rule source type defined using resource tag. - public static GovernanceRuleOwnerSourceType ByTag { get; } = new GovernanceRuleOwnerSourceType(ByTagValue); - /// The rule source type defined manually. - public static GovernanceRuleOwnerSourceType Manually { get; } = new GovernanceRuleOwnerSourceType(ManuallyValue); - /// Determines if two values are the same. - public static bool operator ==(GovernanceRuleOwnerSourceType left, GovernanceRuleOwnerSourceType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(GovernanceRuleOwnerSourceType left, GovernanceRuleOwnerSourceType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator GovernanceRuleOwnerSourceType(string value) => new GovernanceRuleOwnerSourceType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is GovernanceRuleOwnerSourceType other && Equals(other); - /// - public bool Equals(GovernanceRuleOwnerSourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleSourceResourceType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleSourceResourceType.cs deleted file mode 100644 index 49d2c5660c68..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleSourceResourceType.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The governance rule source, what the rule affects, e.g. Assessments. - public readonly partial struct GovernanceRuleSourceResourceType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public GovernanceRuleSourceResourceType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AssessmentsValue = "Assessments"; - - /// The source of the governance rule is assessments. - public static GovernanceRuleSourceResourceType Assessments { get; } = new GovernanceRuleSourceResourceType(AssessmentsValue); - /// Determines if two values are the same. - public static bool operator ==(GovernanceRuleSourceResourceType left, GovernanceRuleSourceResourceType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(GovernanceRuleSourceResourceType left, GovernanceRuleSourceResourceType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator GovernanceRuleSourceResourceType(string value) => new GovernanceRuleSourceResourceType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is GovernanceRuleSourceResourceType other && Equals(other); - /// - public bool Equals(GovernanceRuleSourceResourceType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleType.cs deleted file mode 100644 index bbcc15a5e640..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/GovernanceRuleType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The rule type of the governance rule, defines the source of the rule e.g. Integrated. - public readonly partial struct GovernanceRuleType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public GovernanceRuleType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string IntegratedValue = "Integrated"; - private const string ServiceNowValue = "ServiceNow"; - - /// The source of the rule type definition is integrated. - public static GovernanceRuleType Integrated { get; } = new GovernanceRuleType(IntegratedValue); - /// The source of the rule type definition is ServiceNow. - public static GovernanceRuleType ServiceNow { get; } = new GovernanceRuleType(ServiceNowValue); - /// Determines if two values are the same. - public static bool operator ==(GovernanceRuleType left, GovernanceRuleType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(GovernanceRuleType left, GovernanceRuleType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator GovernanceRuleType(string value) => new GovernanceRuleType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is GovernanceRuleType other && Equals(other); - /// - public bool Equals(GovernanceRuleType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpC2DMessagesNotInAllowedRange.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpC2DMessagesNotInAllowedRange.Serialization.cs deleted file mode 100644 index 9516e6bd4c5b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpC2DMessagesNotInAllowedRange.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class HttpC2DMessagesNotInAllowedRange : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("timeWindowSize"u8); - writer.WriteStringValue(TimeWindowSize, "P"); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static HttpC2DMessagesNotInAllowedRange DeserializeHttpC2DMessagesNotInAllowedRange(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - TimeSpan timeWindowSize = default; - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeWindowSize"u8)) - { - timeWindowSize = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new HttpC2DMessagesNotInAllowedRange(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpC2DMessagesNotInAllowedRange.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpC2DMessagesNotInAllowedRange.cs deleted file mode 100644 index 83625f79cf44..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpC2DMessagesNotInAllowedRange.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Number of cloud to device messages (HTTP protocol) is not in allowed range. - public partial class HttpC2DMessagesNotInAllowedRange : TimeWindowCustomAlertRule - { - /// Initializes a new instance of HttpC2DMessagesNotInAllowedRange. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - public HttpC2DMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(isEnabled, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = "HttpC2DMessagesNotInAllowedRange"; - } - - /// Initializes a new instance of HttpC2DMessagesNotInAllowedRange. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - internal HttpC2DMessagesNotInAllowedRange(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(displayName, description, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = ruleType ?? "HttpC2DMessagesNotInAllowedRange"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpC2DRejectedMessagesNotInAllowedRange.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpC2DRejectedMessagesNotInAllowedRange.Serialization.cs deleted file mode 100644 index 14ac912a91b0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpC2DRejectedMessagesNotInAllowedRange.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class HttpC2DRejectedMessagesNotInAllowedRange : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("timeWindowSize"u8); - writer.WriteStringValue(TimeWindowSize, "P"); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static HttpC2DRejectedMessagesNotInAllowedRange DeserializeHttpC2DRejectedMessagesNotInAllowedRange(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - TimeSpan timeWindowSize = default; - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeWindowSize"u8)) - { - timeWindowSize = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new HttpC2DRejectedMessagesNotInAllowedRange(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpC2DRejectedMessagesNotInAllowedRange.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpC2DRejectedMessagesNotInAllowedRange.cs deleted file mode 100644 index b683e739749c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpC2DRejectedMessagesNotInAllowedRange.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Number of rejected cloud to device messages (HTTP protocol) is not in allowed range. - public partial class HttpC2DRejectedMessagesNotInAllowedRange : TimeWindowCustomAlertRule - { - /// Initializes a new instance of HttpC2DRejectedMessagesNotInAllowedRange. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - public HttpC2DRejectedMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(isEnabled, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = "HttpC2DRejectedMessagesNotInAllowedRange"; - } - - /// Initializes a new instance of HttpC2DRejectedMessagesNotInAllowedRange. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - internal HttpC2DRejectedMessagesNotInAllowedRange(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(displayName, description, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = ruleType ?? "HttpC2DRejectedMessagesNotInAllowedRange"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpD2CMessagesNotInAllowedRange.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpD2CMessagesNotInAllowedRange.Serialization.cs deleted file mode 100644 index 1591d2f3afb4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpD2CMessagesNotInAllowedRange.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class HttpD2CMessagesNotInAllowedRange : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("timeWindowSize"u8); - writer.WriteStringValue(TimeWindowSize, "P"); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static HttpD2CMessagesNotInAllowedRange DeserializeHttpD2CMessagesNotInAllowedRange(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - TimeSpan timeWindowSize = default; - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeWindowSize"u8)) - { - timeWindowSize = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new HttpD2CMessagesNotInAllowedRange(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpD2CMessagesNotInAllowedRange.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpD2CMessagesNotInAllowedRange.cs deleted file mode 100644 index 042e7e0a8268..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HttpD2CMessagesNotInAllowedRange.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Number of device to cloud messages (HTTP protocol) is not in allowed range. - public partial class HttpD2CMessagesNotInAllowedRange : TimeWindowCustomAlertRule - { - /// Initializes a new instance of HttpD2CMessagesNotInAllowedRange. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - public HttpD2CMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(isEnabled, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = "HttpD2CMessagesNotInAllowedRange"; - } - - /// Initializes a new instance of HttpD2CMessagesNotInAllowedRange. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - internal HttpD2CMessagesNotInAllowedRange(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(displayName, description, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = ruleType ?? "HttpD2CMessagesNotInAllowedRange"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HybridComputeProvisioningState.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HybridComputeProvisioningState.cs deleted file mode 100644 index 6e21a7ad5f86..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HybridComputeProvisioningState.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// State of the service principal and its secret. - public readonly partial struct HybridComputeProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public HybridComputeProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ValidValue = "Valid"; - private const string InvalidValue = "Invalid"; - private const string ExpiredValue = "Expired"; - - /// Valid service principal details. - public static HybridComputeProvisioningState Valid { get; } = new HybridComputeProvisioningState(ValidValue); - /// Invalid service principal details. - public static HybridComputeProvisioningState Invalid { get; } = new HybridComputeProvisioningState(InvalidValue); - /// the service principal details are expired. - public static HybridComputeProvisioningState Expired { get; } = new HybridComputeProvisioningState(ExpiredValue); - /// Determines if two values are the same. - public static bool operator ==(HybridComputeProvisioningState left, HybridComputeProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(HybridComputeProvisioningState left, HybridComputeProvisioningState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator HybridComputeProvisioningState(string value) => new HybridComputeProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is HybridComputeProvisioningState other && Equals(other); - /// - public bool Equals(HybridComputeProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HybridComputeSettingsProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HybridComputeSettingsProperties.Serialization.cs deleted file mode 100644 index aa8f508e304e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HybridComputeSettingsProperties.Serialization.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class HybridComputeSettingsProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("autoProvision"u8); - writer.WriteStringValue(AutoProvision.ToString()); - if (Optional.IsDefined(ResourceGroupName)) - { - writer.WritePropertyName("resourceGroupName"u8); - writer.WriteStringValue(ResourceGroupName); - } - if (Optional.IsDefined(Region)) - { - writer.WritePropertyName("region"u8); - writer.WriteStringValue(Region); - } - if (Optional.IsDefined(ProxyServer)) - { - writer.WritePropertyName("proxyServer"u8); - writer.WriteObjectValue(ProxyServer); - } - if (Optional.IsDefined(ServicePrincipal)) - { - writer.WritePropertyName("servicePrincipal"u8); - writer.WriteObjectValue(ServicePrincipal); - } - writer.WriteEndObject(); - } - - internal static HybridComputeSettingsProperties DeserializeHybridComputeSettingsProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional hybridComputeProvisioningState = default; - AutoProvisionState autoProvision = default; - Optional resourceGroupName = default; - Optional region = default; - Optional proxyServer = default; - Optional servicePrincipal = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("hybridComputeProvisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - hybridComputeProvisioningState = new HybridComputeProvisioningState(property.Value.GetString()); - continue; - } - if (property.NameEquals("autoProvision"u8)) - { - autoProvision = new AutoProvisionState(property.Value.GetString()); - continue; - } - if (property.NameEquals("resourceGroupName"u8)) - { - resourceGroupName = property.Value.GetString(); - continue; - } - if (property.NameEquals("region"u8)) - { - region = property.Value.GetString(); - continue; - } - if (property.NameEquals("proxyServer"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - proxyServer = ProxyServerProperties.DeserializeProxyServerProperties(property.Value); - continue; - } - if (property.NameEquals("servicePrincipal"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - servicePrincipal = ServicePrincipalProperties.DeserializeServicePrincipalProperties(property.Value); - continue; - } - } - return new HybridComputeSettingsProperties(Optional.ToNullable(hybridComputeProvisioningState), autoProvision, resourceGroupName.Value, region.Value, proxyServer.Value, servicePrincipal.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HybridComputeSettingsProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HybridComputeSettingsProperties.cs deleted file mode 100644 index 72f9f2840005..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/HybridComputeSettingsProperties.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Settings for hybrid compute management. - public partial class HybridComputeSettingsProperties - { - /// Initializes a new instance of HybridComputeSettingsProperties. - /// Whether or not to automatically install Azure Arc (hybrid compute) agents on machines. - public HybridComputeSettingsProperties(AutoProvisionState autoProvision) - { - AutoProvision = autoProvision; - } - - /// Initializes a new instance of HybridComputeSettingsProperties. - /// State of the service principal and its secret. - /// Whether or not to automatically install Azure Arc (hybrid compute) agents on machines. - /// The name of the resource group where Arc (Hybrid Compute) connectors are connected. - /// The location where the metadata of machines will be stored. - /// For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the non-Azure machine can use. - /// An object to access resources that are secured by an Azure AD tenant. - internal HybridComputeSettingsProperties(HybridComputeProvisioningState? hybridComputeProvisioningState, AutoProvisionState autoProvision, string resourceGroupName, string region, ProxyServerProperties proxyServer, ServicePrincipalProperties servicePrincipal) - { - HybridComputeProvisioningState = hybridComputeProvisioningState; - AutoProvision = autoProvision; - ResourceGroupName = resourceGroupName; - Region = region; - ProxyServer = proxyServer; - ServicePrincipal = servicePrincipal; - } - - /// State of the service principal and its secret. - public HybridComputeProvisioningState? HybridComputeProvisioningState { get; } - /// Whether or not to automatically install Azure Arc (hybrid compute) agents on machines. - public AutoProvisionState AutoProvision { get; set; } - /// The name of the resource group where Arc (Hybrid Compute) connectors are connected. - public string ResourceGroupName { get; set; } - /// The location where the metadata of machines will be stored. - public string Region { get; set; } - /// For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the non-Azure machine can use. - public ProxyServerProperties ProxyServer { get; set; } - /// An object to access resources that are secured by an Azure AD tenant. - public ServicePrincipalProperties ServicePrincipal { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ImplementationEffort.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ImplementationEffort.cs deleted file mode 100644 index e809497ba00c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ImplementationEffort.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The implementation effort required to remediate this assessment. - public readonly partial struct ImplementationEffort : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ImplementationEffort(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string LowValue = "Low"; - private const string ModerateValue = "Moderate"; - private const string HighValue = "High"; - - /// Low. - public static ImplementationEffort Low { get; } = new ImplementationEffort(LowValue); - /// Moderate. - public static ImplementationEffort Moderate { get; } = new ImplementationEffort(ModerateValue); - /// High. - public static ImplementationEffort High { get; } = new ImplementationEffort(HighValue); - /// Determines if two values are the same. - public static bool operator ==(ImplementationEffort left, ImplementationEffort right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ImplementationEffort left, ImplementationEffort right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ImplementationEffort(string value) => new ImplementationEffort(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ImplementationEffort other && Equals(other); - /// - public bool Equals(ImplementationEffort other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/InformationProtectionAwsOffering.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/InformationProtectionAwsOffering.Serialization.cs deleted file mode 100644 index b25fb1f2002e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/InformationProtectionAwsOffering.Serialization.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class InformationProtectionAwsOffering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(InformationProtection)) - { - writer.WritePropertyName("informationProtection"u8); - writer.WriteObjectValue(InformationProtection); - } - writer.WritePropertyName("offeringType"u8); - writer.WriteStringValue(OfferingType.ToString()); - writer.WriteEndObject(); - } - - internal static InformationProtectionAwsOffering DeserializeInformationProtectionAwsOffering(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional informationProtection = default; - OfferingType offeringType = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("informationProtection"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - informationProtection = AwsInformationProtection.DeserializeAwsInformationProtection(property.Value); - continue; - } - if (property.NameEquals("offeringType"u8)) - { - offeringType = new OfferingType(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new InformationProtectionAwsOffering(offeringType, description.Value, informationProtection.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/InformationProtectionAwsOffering.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/InformationProtectionAwsOffering.cs deleted file mode 100644 index 081c8adc771b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/InformationProtectionAwsOffering.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The information protection for AWS offering. - public partial class InformationProtectionAwsOffering : SecurityCenterCloudOffering - { - /// Initializes a new instance of InformationProtectionAwsOffering. - public InformationProtectionAwsOffering() - { - OfferingType = OfferingType.InformationProtectionAws; - } - - /// Initializes a new instance of InformationProtectionAwsOffering. - /// The type of the security offering. - /// The offering description. - /// The native cloud connection configuration. - internal InformationProtectionAwsOffering(OfferingType offeringType, string description, AwsInformationProtection informationProtection) : base(offeringType, description) - { - InformationProtection = informationProtection; - OfferingType = offeringType; - } - - /// The native cloud connection configuration. - internal AwsInformationProtection InformationProtection { get; set; } - /// The cloud role ARN in AWS for this feature. - public string InformationProtectionCloudRoleArn - { - get => InformationProtection is null ? default : InformationProtection.CloudRoleArn; - set - { - if (InformationProtection is null) - InformationProtection = new AwsInformationProtection(); - InformationProtection.CloudRoleArn = value; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionConnectionString.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionConnectionString.Serialization.cs deleted file mode 100644 index 366da14c4b26..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionConnectionString.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class IngestionConnectionString - { - internal static IngestionConnectionString DeserializeIngestionConnectionString(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional location = default; - Optional value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("value"u8)) - { - value = property.Value.GetString(); - continue; - } - } - return new IngestionConnectionString(Optional.ToNullable(location), value.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionConnectionString.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionConnectionString.cs deleted file mode 100644 index 0d22777349d8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionConnectionString.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Connection string for ingesting security data and logs. - public partial class IngestionConnectionString - { - /// Initializes a new instance of IngestionConnectionString. - internal IngestionConnectionString() - { - } - - /// Initializes a new instance of IngestionConnectionString. - /// The region where ingested logs and data resides. - /// Connection string value. - internal IngestionConnectionString(AzureLocation? location, string value) - { - Location = location; - Value = value; - } - - /// The region where ingested logs and data resides. - public AzureLocation? Location { get; } - /// Connection string value. - public string Value { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionSettingData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionSettingData.Serialization.cs deleted file mode 100644 index 385d20470b8b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionSettingData.Serialization.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class IngestionSettingData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Properties); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(Properties.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - - internal static IngestionSettingData DeserializeIngestionSettingData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional properties = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - properties = BinaryData.FromString(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - } - return new IngestionSettingData(id, name, type, systemData.Value, properties.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionSettingList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionSettingList.Serialization.cs deleted file mode 100644 index 780e9dd0af78..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionSettingList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class IngestionSettingList - { - internal static IngestionSettingList DeserializeIngestionSettingList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(IngestionSettingData.DeserializeIngestionSettingData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new IngestionSettingList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionSettingList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionSettingList.cs deleted file mode 100644 index 82922e251afb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionSettingList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of ingestion settings. - internal partial class IngestionSettingList - { - /// Initializes a new instance of IngestionSettingList. - internal IngestionSettingList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of IngestionSettingList. - /// List of ingestion settings. - /// The URI to fetch the next page. - internal IngestionSettingList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of ingestion settings. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionSettingToken.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionSettingToken.Serialization.cs deleted file mode 100644 index fe17d5d2f593..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionSettingToken.Serialization.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class IngestionSettingToken - { - internal static IngestionSettingToken DeserializeIngestionSettingToken(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional token = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("token"u8)) - { - token = property.Value.GetString(); - continue; - } - } - return new IngestionSettingToken(token.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionSettingToken.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionSettingToken.cs deleted file mode 100644 index 0111bba362d0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IngestionSettingToken.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Configures how to correlate scan data and logs with resources associated with the subscription. - public partial class IngestionSettingToken - { - /// Initializes a new instance of IngestionSettingToken. - internal IngestionSettingToken() - { - } - - /// Initializes a new instance of IngestionSettingToken. - /// The token is used for correlating security data and logs with the resources in the subscription. - internal IngestionSettingToken(string token) - { - Token = token; - } - - /// The token is used for correlating security data and logs with the resources in the subscription. - public string Token { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedAlertData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedAlertData.Serialization.cs deleted file mode 100644 index 87b97e03f85b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedAlertData.Serialization.cs +++ /dev/null @@ -1,211 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class IotSecurityAggregatedAlertData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static IotSecurityAggregatedAlertData DeserializeIotSecurityAggregatedAlertData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> tags = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional alertType = default; - Optional alertDisplayName = default; - Optional aggregatedDateUtc = default; - Optional vendorName = default; - Optional reportedSeverity = default; - Optional remediationSteps = default; - Optional description = default; - Optional count = default; - Optional effectedResourceType = default; - Optional systemSource = default; - Optional actionTaken = default; - Optional logAnalyticsQuery = default; - Optional> topDevicesList = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("alertType"u8)) - { - alertType = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("alertDisplayName"u8)) - { - alertDisplayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("aggregatedDateUtc"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - aggregatedDateUtc = property0.Value.GetDateTimeOffset("D"); - continue; - } - if (property0.NameEquals("vendorName"u8)) - { - vendorName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("reportedSeverity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - reportedSeverity = new ReportedSeverity(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("remediationSteps"u8)) - { - remediationSteps = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("description"u8)) - { - description = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("count"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - count = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("effectedResourceType"u8)) - { - effectedResourceType = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("systemSource"u8)) - { - systemSource = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("actionTaken"u8)) - { - actionTaken = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("logAnalyticsQuery"u8)) - { - logAnalyticsQuery = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("topDevicesList"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(IotSecurityAggregatedAlertTopDevice.DeserializeIotSecurityAggregatedAlertTopDevice(item)); - } - topDevicesList = array; - continue; - } - } - continue; - } - } - return new IotSecurityAggregatedAlertData(id, name, type, systemData.Value, alertType.Value, alertDisplayName.Value, Optional.ToNullable(aggregatedDateUtc), vendorName.Value, Optional.ToNullable(reportedSeverity), remediationSteps.Value, description.Value, Optional.ToNullable(count), effectedResourceType.Value, systemSource.Value, actionTaken.Value, logAnalyticsQuery.Value, Optional.ToList(topDevicesList), Optional.ToDictionary(tags)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedAlertList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedAlertList.Serialization.cs deleted file mode 100644 index 1c55e053c0fa..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedAlertList.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class IotSecurityAggregatedAlertList - { - internal static IotSecurityAggregatedAlertList DeserializeIotSecurityAggregatedAlertList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(IotSecurityAggregatedAlertData.DeserializeIotSecurityAggregatedAlertData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new IotSecurityAggregatedAlertList(value, nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedAlertList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedAlertList.cs deleted file mode 100644 index b674b84093d5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedAlertList.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of IoT Security solution aggregated alert data. - internal partial class IotSecurityAggregatedAlertList - { - /// Initializes a new instance of IotSecurityAggregatedAlertList. - /// List of aggregated alerts data. - /// is null. - internal IotSecurityAggregatedAlertList(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of IotSecurityAggregatedAlertList. - /// List of aggregated alerts data. - /// When there is too much alert data for one page, use this URI to fetch the next page. - internal IotSecurityAggregatedAlertList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of aggregated alerts data. - public IReadOnlyList Value { get; } - /// When there is too much alert data for one page, use this URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedAlertTopDevice.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedAlertTopDevice.Serialization.cs deleted file mode 100644 index 027d4e55bb7b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedAlertTopDevice.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class IotSecurityAggregatedAlertTopDevice - { - internal static IotSecurityAggregatedAlertTopDevice DeserializeIotSecurityAggregatedAlertTopDevice(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional deviceId = default; - Optional alertsCount = default; - Optional lastOccurrence = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("deviceId"u8)) - { - deviceId = property.Value.GetString(); - continue; - } - if (property.NameEquals("alertsCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - alertsCount = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("lastOccurrence"u8)) - { - lastOccurrence = property.Value.GetString(); - continue; - } - } - return new IotSecurityAggregatedAlertTopDevice(deviceId.Value, Optional.ToNullable(alertsCount), lastOccurrence.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedAlertTopDevice.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedAlertTopDevice.cs deleted file mode 100644 index 106cb1f977c6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedAlertTopDevice.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The IotSecurityAggregatedAlertTopDevice. - public partial class IotSecurityAggregatedAlertTopDevice - { - /// Initializes a new instance of IotSecurityAggregatedAlertTopDevice. - internal IotSecurityAggregatedAlertTopDevice() - { - } - - /// Initializes a new instance of IotSecurityAggregatedAlertTopDevice. - /// Name of the device. - /// Number of alerts raised for this device. - /// Most recent time this alert was raised for this device, on this day. - internal IotSecurityAggregatedAlertTopDevice(string deviceId, long? alertsCount, string lastOccurrence) - { - DeviceId = deviceId; - AlertsCount = alertsCount; - LastOccurrence = lastOccurrence; - } - - /// Name of the device. - public string DeviceId { get; } - /// Number of alerts raised for this device. - public long? AlertsCount { get; } - /// Most recent time this alert was raised for this device, on this day. - public string LastOccurrence { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedRecommendationData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedRecommendationData.Serialization.cs deleted file mode 100644 index af8cf66e504b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedRecommendationData.Serialization.cs +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class IotSecurityAggregatedRecommendationData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(RecommendationName)) - { - writer.WritePropertyName("recommendationName"u8); - writer.WriteStringValue(RecommendationName); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static IotSecurityAggregatedRecommendationData DeserializeIotSecurityAggregatedRecommendationData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> tags = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional recommendationName = default; - Optional recommendationDisplayName = default; - Optional description = default; - Optional recommendationTypeId = default; - Optional detectedBy = default; - Optional remediationSteps = default; - Optional reportedSeverity = default; - Optional healthyDevices = default; - Optional unhealthyDeviceCount = default; - Optional logAnalyticsQuery = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("recommendationName"u8)) - { - recommendationName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("recommendationDisplayName"u8)) - { - recommendationDisplayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("description"u8)) - { - description = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("recommendationTypeId"u8)) - { - recommendationTypeId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("detectedBy"u8)) - { - detectedBy = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("remediationSteps"u8)) - { - remediationSteps = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("reportedSeverity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - reportedSeverity = new ReportedSeverity(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("healthyDevices"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - healthyDevices = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("unhealthyDeviceCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - unhealthyDeviceCount = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("logAnalyticsQuery"u8)) - { - logAnalyticsQuery = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new IotSecurityAggregatedRecommendationData(id, name, type, systemData.Value, recommendationName.Value, recommendationDisplayName.Value, description.Value, recommendationTypeId.Value, detectedBy.Value, remediationSteps.Value, Optional.ToNullable(reportedSeverity), Optional.ToNullable(healthyDevices), Optional.ToNullable(unhealthyDeviceCount), logAnalyticsQuery.Value, Optional.ToDictionary(tags)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedRecommendationList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedRecommendationList.Serialization.cs deleted file mode 100644 index d94ba41339ab..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedRecommendationList.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class IotSecurityAggregatedRecommendationList - { - internal static IotSecurityAggregatedRecommendationList DeserializeIotSecurityAggregatedRecommendationList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(IotSecurityAggregatedRecommendationData.DeserializeIotSecurityAggregatedRecommendationData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new IotSecurityAggregatedRecommendationList(value, nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedRecommendationList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedRecommendationList.cs deleted file mode 100644 index 15457519bffd..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAggregatedRecommendationList.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of IoT Security solution aggregated recommendations. - internal partial class IotSecurityAggregatedRecommendationList - { - /// Initializes a new instance of IotSecurityAggregatedRecommendationList. - /// List of aggregated recommendations data. - /// is null. - internal IotSecurityAggregatedRecommendationList(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of IotSecurityAggregatedRecommendationList. - /// List of aggregated recommendations data. - /// When there is too much alert data for one page, use this URI to fetch the next page. - internal IotSecurityAggregatedRecommendationList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of aggregated recommendations data. - public IReadOnlyList Value { get; } - /// When there is too much alert data for one page, use this URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAlertedDevice.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAlertedDevice.Serialization.cs deleted file mode 100644 index 74d5e8f9f0e5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAlertedDevice.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class IotSecurityAlertedDevice : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } - - internal static IotSecurityAlertedDevice DeserializeIotSecurityAlertedDevice(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional deviceId = default; - Optional alertsCount = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("deviceId"u8)) - { - deviceId = property.Value.GetString(); - continue; - } - if (property.NameEquals("alertsCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - alertsCount = property.Value.GetInt64(); - continue; - } - } - return new IotSecurityAlertedDevice(deviceId.Value, Optional.ToNullable(alertsCount)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAlertedDevice.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAlertedDevice.cs deleted file mode 100644 index e27366ade2bf..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityAlertedDevice.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Statistical information about the number of alerts per device during last set number of days. - public partial class IotSecurityAlertedDevice - { - /// Initializes a new instance of IotSecurityAlertedDevice. - public IotSecurityAlertedDevice() - { - } - - /// Initializes a new instance of IotSecurityAlertedDevice. - /// Device identifier. - /// Number of alerts raised for this device. - internal IotSecurityAlertedDevice(string deviceId, long? alertsCount) - { - DeviceId = deviceId; - AlertsCount = alertsCount; - } - - /// Device identifier. - public string DeviceId { get; } - /// Number of alerts raised for this device. - public long? AlertsCount { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityDeviceAlert.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityDeviceAlert.Serialization.cs deleted file mode 100644 index 357ea145846e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityDeviceAlert.Serialization.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class IotSecurityDeviceAlert : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } - - internal static IotSecurityDeviceAlert DeserializeIotSecurityDeviceAlert(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional alertDisplayName = default; - Optional reportedSeverity = default; - Optional alertsCount = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("alertDisplayName"u8)) - { - alertDisplayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("reportedSeverity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - reportedSeverity = new ReportedSeverity(property.Value.GetString()); - continue; - } - if (property.NameEquals("alertsCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - alertsCount = property.Value.GetInt64(); - continue; - } - } - return new IotSecurityDeviceAlert(alertDisplayName.Value, Optional.ToNullable(reportedSeverity), Optional.ToNullable(alertsCount)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityDeviceAlert.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityDeviceAlert.cs deleted file mode 100644 index 08cca3c51a7b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityDeviceAlert.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Statistical information about the number of alerts per alert type during last set number of days. - public partial class IotSecurityDeviceAlert - { - /// Initializes a new instance of IotSecurityDeviceAlert. - public IotSecurityDeviceAlert() - { - } - - /// Initializes a new instance of IotSecurityDeviceAlert. - /// Display name of the alert. - /// Assessed Alert severity. - /// Number of alerts raised for this alert type. - internal IotSecurityDeviceAlert(string alertDisplayName, ReportedSeverity? reportedSeverity, long? alertsCount) - { - AlertDisplayName = alertDisplayName; - ReportedSeverity = reportedSeverity; - AlertsCount = alertsCount; - } - - /// Display name of the alert. - public string AlertDisplayName { get; } - /// Assessed Alert severity. - public ReportedSeverity? ReportedSeverity { get; } - /// Number of alerts raised for this alert type. - public long? AlertsCount { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityDeviceRecommendation.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityDeviceRecommendation.Serialization.cs deleted file mode 100644 index 7c184104e36e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityDeviceRecommendation.Serialization.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class IotSecurityDeviceRecommendation : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } - - internal static IotSecurityDeviceRecommendation DeserializeIotSecurityDeviceRecommendation(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional recommendationDisplayName = default; - Optional reportedSeverity = default; - Optional devicesCount = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("recommendationDisplayName"u8)) - { - recommendationDisplayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("reportedSeverity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - reportedSeverity = new ReportedSeverity(property.Value.GetString()); - continue; - } - if (property.NameEquals("devicesCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - devicesCount = property.Value.GetInt64(); - continue; - } - } - return new IotSecurityDeviceRecommendation(recommendationDisplayName.Value, Optional.ToNullable(reportedSeverity), Optional.ToNullable(devicesCount)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityDeviceRecommendation.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityDeviceRecommendation.cs deleted file mode 100644 index a65fae25c282..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityDeviceRecommendation.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Statistical information about the number of recommendations per device, per recommendation type. - public partial class IotSecurityDeviceRecommendation - { - /// Initializes a new instance of IotSecurityDeviceRecommendation. - public IotSecurityDeviceRecommendation() - { - } - - /// Initializes a new instance of IotSecurityDeviceRecommendation. - /// Display name of the recommendation. - /// Assessed recommendation severity. - /// Number of devices with this recommendation. - internal IotSecurityDeviceRecommendation(string recommendationDisplayName, ReportedSeverity? reportedSeverity, long? devicesCount) - { - RecommendationDisplayName = recommendationDisplayName; - ReportedSeverity = reportedSeverity; - DevicesCount = devicesCount; - } - - /// Display name of the recommendation. - public string RecommendationDisplayName { get; } - /// Assessed recommendation severity. - public ReportedSeverity? ReportedSeverity { get; } - /// Number of devices with this recommendation. - public long? DevicesCount { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityRecommendationType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityRecommendationType.cs deleted file mode 100644 index dd76c47ce371..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecurityRecommendationType.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The type of IoT Security recommendation. - public readonly partial struct IotSecurityRecommendationType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public IotSecurityRecommendationType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string IotAcrAuthenticationValue = "IoT_ACRAuthentication"; - private const string IotAgentSendsUnutilizedMessagesValue = "IoT_AgentSendsUnutilizedMessages"; - private const string IotBaselineValue = "IoT_Baseline"; - private const string IotEdgeHubMemOptimizeValue = "IoT_EdgeHubMemOptimize"; - private const string IotEdgeLoggingOptionsValue = "IoT_EdgeLoggingOptions"; - private const string IotInconsistentModuleSettingsValue = "IoT_InconsistentModuleSettings"; - private const string IotInstallAgentValue = "IoT_InstallAgent"; - private const string IotIPFilterDenyAllValue = "IoT_IPFilter_DenyAll"; - private const string IotIPFilterPermissiveRuleValue = "IoT_IPFilter_PermissiveRule"; - private const string IotOpenPortsValue = "IoT_OpenPorts"; - private const string IotPermissiveFirewallPolicyValue = "IoT_PermissiveFirewallPolicy"; - private const string IotPermissiveInputFirewallRulesValue = "IoT_PermissiveInputFirewallRules"; - private const string IotPermissiveOutputFirewallRulesValue = "IoT_PermissiveOutputFirewallRules"; - private const string IotPrivilegedDockerOptionsValue = "IoT_PrivilegedDockerOptions"; - private const string IotSharedCredentialsValue = "IoT_SharedCredentials"; - private const string IotVulnerableTlsCipherSuiteValue = "IoT_VulnerableTLSCipherSuite"; - - /// Authentication schema used for pull an edge module from an ACR repository does not use Service Principal Authentication. - public static IotSecurityRecommendationType IotAcrAuthentication { get; } = new IotSecurityRecommendationType(IotAcrAuthenticationValue); - /// IoT agent message size capacity is currently underutilized, causing an increase in the number of sent messages. Adjust message intervals for better utilization. - public static IotSecurityRecommendationType IotAgentSendsUnutilizedMessages { get; } = new IotSecurityRecommendationType(IotAgentSendsUnutilizedMessagesValue); - /// Identified security related system configuration issues. - public static IotSecurityRecommendationType IotBaseline { get; } = new IotSecurityRecommendationType(IotBaselineValue); - /// You can optimize Edge Hub memory usage by turning off protocol heads for any protocols not used by Edge modules in your solution. - public static IotSecurityRecommendationType IotEdgeHubMemOptimize { get; } = new IotSecurityRecommendationType(IotEdgeHubMemOptimizeValue); - /// Logging is disabled for this edge module. - public static IotSecurityRecommendationType IotEdgeLoggingOptions { get; } = new IotSecurityRecommendationType(IotEdgeLoggingOptionsValue); - /// A minority within a device security group has inconsistent Edge Module settings with the rest of their group. - public static IotSecurityRecommendationType IotInconsistentModuleSettings { get; } = new IotSecurityRecommendationType(IotInconsistentModuleSettingsValue); - /// Install the Azure Security of Things Agent. - public static IotSecurityRecommendationType IotInstallAgent { get; } = new IotSecurityRecommendationType(IotInstallAgentValue); - /// IP Filter Configuration should have rules defined for allowed traffic and should deny all other traffic by default. - public static IotSecurityRecommendationType IotIPFilterDenyAll { get; } = new IotSecurityRecommendationType(IotIPFilterDenyAllValue); - /// An Allow IP Filter rules source IP range is too large. Overly permissive rules might expose your IoT hub to malicious intenders. - public static IotSecurityRecommendationType IotIPFilterPermissiveRule { get; } = new IotSecurityRecommendationType(IotIPFilterPermissiveRuleValue); - /// A listening endpoint was found on the device. - public static IotSecurityRecommendationType IotOpenPorts { get; } = new IotSecurityRecommendationType(IotOpenPortsValue); - /// An Allowed firewall policy was found (INPUT/OUTPUT). The policy should Deny all traffic by default and define rules to allow necessary communication to/from the device. - public static IotSecurityRecommendationType IotPermissiveFirewallPolicy { get; } = new IotSecurityRecommendationType(IotPermissiveFirewallPolicyValue); - /// A rule in the firewall has been found that contains a permissive pattern for a wide range of IP addresses or Ports. - public static IotSecurityRecommendationType IotPermissiveInputFirewallRules { get; } = new IotSecurityRecommendationType(IotPermissiveInputFirewallRulesValue); - /// A rule in the firewall has been found that contains a permissive pattern for a wide range of IP addresses or Ports. - public static IotSecurityRecommendationType IotPermissiveOutputFirewallRules { get; } = new IotSecurityRecommendationType(IotPermissiveOutputFirewallRulesValue); - /// Edge module is configured to run in privileged mode, with extensive Linux capabilities or with host-level network access (send/receive data to host machine). - public static IotSecurityRecommendationType IotPrivilegedDockerOptions { get; } = new IotSecurityRecommendationType(IotPrivilegedDockerOptionsValue); - /// Same authentication credentials to the IoT Hub used by multiple devices. This could indicate an illegitimate device impersonating a legitimate device. It also exposes the risk of device impersonation by an attacker. - public static IotSecurityRecommendationType IotSharedCredentials { get; } = new IotSecurityRecommendationType(IotSharedCredentialsValue); - /// Insecure TLS configurations detected. Immediate upgrade recommended. - public static IotSecurityRecommendationType IotVulnerableTlsCipherSuite { get; } = new IotSecurityRecommendationType(IotVulnerableTlsCipherSuiteValue); - /// Determines if two values are the same. - public static bool operator ==(IotSecurityRecommendationType left, IotSecurityRecommendationType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(IotSecurityRecommendationType left, IotSecurityRecommendationType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator IotSecurityRecommendationType(string value) => new IotSecurityRecommendationType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is IotSecurityRecommendationType other && Equals(other); - /// - public bool Equals(IotSecurityRecommendationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionAnalyticsModelData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionAnalyticsModelData.Serialization.cs deleted file mode 100644 index 5dd02c35febd..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionAnalyticsModelData.Serialization.cs +++ /dev/null @@ -1,196 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class IotSecuritySolutionAnalyticsModelData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(TopAlertedDevices)) - { - writer.WritePropertyName("topAlertedDevices"u8); - writer.WriteStartArray(); - foreach (var item in TopAlertedDevices) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(MostPrevalentDeviceAlerts)) - { - writer.WritePropertyName("mostPrevalentDeviceAlerts"u8); - writer.WriteStartArray(); - foreach (var item in MostPrevalentDeviceAlerts) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(MostPrevalentDeviceRecommendations)) - { - writer.WritePropertyName("mostPrevalentDeviceRecommendations"u8); - writer.WriteStartArray(); - foreach (var item in MostPrevalentDeviceRecommendations) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static IotSecuritySolutionAnalyticsModelData DeserializeIotSecuritySolutionAnalyticsModelData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional metrics = default; - Optional unhealthyDeviceCount = default; - Optional> devicesMetrics = default; - Optional> topAlertedDevices = default; - Optional> mostPrevalentDeviceAlerts = default; - Optional> mostPrevalentDeviceRecommendations = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("metrics"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - metrics = IotSeverityMetrics.DeserializeIotSeverityMetrics(property0.Value); - continue; - } - if (property0.NameEquals("unhealthyDeviceCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - unhealthyDeviceCount = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("devicesMetrics"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(IotSecuritySolutionAnalyticsModelDevicesMetrics.DeserializeIotSecuritySolutionAnalyticsModelDevicesMetrics(item)); - } - devicesMetrics = array; - continue; - } - if (property0.NameEquals("topAlertedDevices"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(IotSecurityAlertedDevice.DeserializeIotSecurityAlertedDevice(item)); - } - topAlertedDevices = array; - continue; - } - if (property0.NameEquals("mostPrevalentDeviceAlerts"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(IotSecurityDeviceAlert.DeserializeIotSecurityDeviceAlert(item)); - } - mostPrevalentDeviceAlerts = array; - continue; - } - if (property0.NameEquals("mostPrevalentDeviceRecommendations"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(IotSecurityDeviceRecommendation.DeserializeIotSecurityDeviceRecommendation(item)); - } - mostPrevalentDeviceRecommendations = array; - continue; - } - } - continue; - } - } - return new IotSecuritySolutionAnalyticsModelData(id, name, type, systemData.Value, metrics.Value, Optional.ToNullable(unhealthyDeviceCount), Optional.ToList(devicesMetrics), Optional.ToList(topAlertedDevices), Optional.ToList(mostPrevalentDeviceAlerts), Optional.ToList(mostPrevalentDeviceRecommendations)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionAnalyticsModelDevicesMetrics.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionAnalyticsModelDevicesMetrics.Serialization.cs deleted file mode 100644 index cf6a43daa72b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionAnalyticsModelDevicesMetrics.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class IotSecuritySolutionAnalyticsModelDevicesMetrics - { - internal static IotSecuritySolutionAnalyticsModelDevicesMetrics DeserializeIotSecuritySolutionAnalyticsModelDevicesMetrics(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional date = default; - Optional devicesMetrics = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("date"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - date = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("devicesMetrics"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - devicesMetrics = IotSeverityMetrics.DeserializeIotSeverityMetrics(property.Value); - continue; - } - } - return new IotSecuritySolutionAnalyticsModelDevicesMetrics(Optional.ToNullable(date), devicesMetrics.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionAnalyticsModelDevicesMetrics.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionAnalyticsModelDevicesMetrics.cs deleted file mode 100644 index 475b6219b059..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionAnalyticsModelDevicesMetrics.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The IotSecuritySolutionAnalyticsModelDevicesMetrics. - public partial class IotSecuritySolutionAnalyticsModelDevicesMetrics - { - /// Initializes a new instance of IotSecuritySolutionAnalyticsModelDevicesMetrics. - internal IotSecuritySolutionAnalyticsModelDevicesMetrics() - { - } - - /// Initializes a new instance of IotSecuritySolutionAnalyticsModelDevicesMetrics. - /// Aggregation of IoT Security solution device alert metrics by date. - /// Device alert count by severity. - internal IotSecuritySolutionAnalyticsModelDevicesMetrics(DateTimeOffset? date, IotSeverityMetrics devicesMetrics) - { - Date = date; - DevicesMetrics = devicesMetrics; - } - /// Device alert count by severity. - public IotSeverityMetrics DevicesMetrics { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionAnalyticsModelList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionAnalyticsModelList.Serialization.cs deleted file mode 100644 index 7cf570412e52..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionAnalyticsModelList.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class IotSecuritySolutionAnalyticsModelList - { - internal static IotSecuritySolutionAnalyticsModelList DeserializeIotSecuritySolutionAnalyticsModelList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(IotSecuritySolutionAnalyticsModelData.DeserializeIotSecuritySolutionAnalyticsModelData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new IotSecuritySolutionAnalyticsModelList(value, nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionAnalyticsModelList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionAnalyticsModelList.cs deleted file mode 100644 index c5a239e16f19..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionAnalyticsModelList.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of Security analytics of your IoT Security solution. - internal partial class IotSecuritySolutionAnalyticsModelList - { - /// Initializes a new instance of IotSecuritySolutionAnalyticsModelList. - /// List of Security analytics of your IoT Security solution. - /// is null. - internal IotSecuritySolutionAnalyticsModelList(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of IotSecuritySolutionAnalyticsModelList. - /// List of Security analytics of your IoT Security solution. - /// When there is too much alert data for one page, use this URI to fetch the next page. - internal IotSecuritySolutionAnalyticsModelList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of Security analytics of your IoT Security solution. - public IReadOnlyList Value { get; } - /// When there is too much alert data for one page, use this URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionData.Serialization.cs deleted file mode 100644 index cf82e6261c71..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionData.Serialization.cs +++ /dev/null @@ -1,331 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class IotSecuritySolutionData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Workspace)) - { - writer.WritePropertyName("workspace"u8); - writer.WriteStringValue(Workspace); - } - if (Optional.IsDefined(DisplayName)) - { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); - } - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } - if (Optional.IsCollectionDefined(Export)) - { - writer.WritePropertyName("export"u8); - writer.WriteStartArray(); - foreach (var item in Export) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(DisabledDataSources)) - { - writer.WritePropertyName("disabledDataSources"u8); - writer.WriteStartArray(); - foreach (var item in DisabledDataSources) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(IotHubs)) - { - writer.WritePropertyName("iotHubs"u8); - writer.WriteStartArray(); - foreach (var item in IotHubs) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(UserDefinedResources)) - { - writer.WritePropertyName("userDefinedResources"u8); - writer.WriteObjectValue(UserDefinedResources); - } - if (Optional.IsCollectionDefined(RecommendationsConfiguration)) - { - writer.WritePropertyName("recommendationsConfiguration"u8); - writer.WriteStartArray(); - foreach (var item in RecommendationsConfiguration) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(UnmaskedIPLoggingStatus)) - { - writer.WritePropertyName("unmaskedIpLoggingStatus"u8); - writer.WriteStringValue(UnmaskedIPLoggingStatus.Value.ToString()); - } - if (Optional.IsCollectionDefined(AdditionalWorkspaces)) - { - writer.WritePropertyName("additionalWorkspaces"u8); - writer.WriteStartArray(); - foreach (var item in AdditionalWorkspaces) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static IotSecuritySolutionData DeserializeIotSecuritySolutionData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional workspace = default; - Optional displayName = default; - Optional status = default; - Optional> export = default; - Optional> disabledDataSources = default; - Optional> iotHubs = default; - Optional userDefinedResources = default; - Optional> autoDiscoveredResources = default; - Optional> recommendationsConfiguration = default; - Optional unmaskedIPLoggingStatus = default; - Optional> additionalWorkspaces = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("workspace"u8)) - { - workspace = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("displayName"u8)) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("status"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = new SecuritySolutionStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("export"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(new IotSecuritySolutionExportOption(item.GetString())); - } - export = array; - continue; - } - if (property0.NameEquals("disabledDataSources"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(new IotSecuritySolutionDataSource(item.GetString())); - } - disabledDataSources = array; - continue; - } - if (property0.NameEquals("iotHubs"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - iotHubs = array; - continue; - } - if (property0.NameEquals("userDefinedResources"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - userDefinedResources = UserDefinedResourcesProperties.DeserializeUserDefinedResourcesProperties(property0.Value); - continue; - } - if (property0.NameEquals("autoDiscoveredResources"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - autoDiscoveredResources = array; - continue; - } - if (property0.NameEquals("recommendationsConfiguration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(RecommendationConfigurationProperties.DeserializeRecommendationConfigurationProperties(item)); - } - recommendationsConfiguration = array; - continue; - } - if (property0.NameEquals("unmaskedIpLoggingStatus"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - unmaskedIPLoggingStatus = new UnmaskedIPLoggingStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("additionalWorkspaces"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(AdditionalWorkspacesProperties.DeserializeAdditionalWorkspacesProperties(item)); - } - additionalWorkspaces = array; - continue; - } - } - continue; - } - } - return new IotSecuritySolutionData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, workspace.Value, displayName.Value, Optional.ToNullable(status), Optional.ToList(export), Optional.ToList(disabledDataSources), Optional.ToList(iotHubs), userDefinedResources.Value, Optional.ToList(autoDiscoveredResources), Optional.ToList(recommendationsConfiguration), Optional.ToNullable(unmaskedIPLoggingStatus), Optional.ToList(additionalWorkspaces)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionDataSource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionDataSource.cs deleted file mode 100644 index d57d81b8ccc5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionDataSource.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The IotSecuritySolutionDataSource. - public readonly partial struct IotSecuritySolutionDataSource : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public IotSecuritySolutionDataSource(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string TwinDataValue = "TwinData"; - - /// Devices twin data. - public static IotSecuritySolutionDataSource TwinData { get; } = new IotSecuritySolutionDataSource(TwinDataValue); - /// Determines if two values are the same. - public static bool operator ==(IotSecuritySolutionDataSource left, IotSecuritySolutionDataSource right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(IotSecuritySolutionDataSource left, IotSecuritySolutionDataSource right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator IotSecuritySolutionDataSource(string value) => new IotSecuritySolutionDataSource(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is IotSecuritySolutionDataSource other && Equals(other); - /// - public bool Equals(IotSecuritySolutionDataSource other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionExportOption.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionExportOption.cs deleted file mode 100644 index 681653c077dd..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionExportOption.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The IotSecuritySolutionExportOption. - public readonly partial struct IotSecuritySolutionExportOption : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public IotSecuritySolutionExportOption(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string RawEventsValue = "RawEvents"; - - /// Agent raw events. - public static IotSecuritySolutionExportOption RawEvents { get; } = new IotSecuritySolutionExportOption(RawEventsValue); - /// Determines if two values are the same. - public static bool operator ==(IotSecuritySolutionExportOption left, IotSecuritySolutionExportOption right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(IotSecuritySolutionExportOption left, IotSecuritySolutionExportOption right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator IotSecuritySolutionExportOption(string value) => new IotSecuritySolutionExportOption(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is IotSecuritySolutionExportOption other && Equals(other); - /// - public bool Equals(IotSecuritySolutionExportOption other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionPatch.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionPatch.Serialization.cs deleted file mode 100644 index f5c1f26499f3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionPatch.Serialization.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class IotSecuritySolutionPatch : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(UserDefinedResources)) - { - writer.WritePropertyName("userDefinedResources"u8); - writer.WriteObjectValue(UserDefinedResources); - } - if (Optional.IsCollectionDefined(RecommendationsConfiguration)) - { - writer.WritePropertyName("recommendationsConfiguration"u8); - writer.WriteStartArray(); - foreach (var item in RecommendationsConfiguration) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static IotSecuritySolutionPatch DeserializeIotSecuritySolutionPatch(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> tags = default; - Optional userDefinedResources = default; - Optional> recommendationsConfiguration = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("userDefinedResources"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - userDefinedResources = UserDefinedResourcesProperties.DeserializeUserDefinedResourcesProperties(property0.Value); - continue; - } - if (property0.NameEquals("recommendationsConfiguration"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(RecommendationConfigurationProperties.DeserializeRecommendationConfigurationProperties(item)); - } - recommendationsConfiguration = array; - continue; - } - } - continue; - } - } - return new IotSecuritySolutionPatch(Optional.ToDictionary(tags), userDefinedResources.Value, Optional.ToList(recommendationsConfiguration)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionPatch.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionPatch.cs deleted file mode 100644 index 8c87c39e1f73..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionPatch.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The IotSecuritySolutionPatch. - public partial class IotSecuritySolutionPatch : SecurityCenterTagsResourceInfo - { - /// Initializes a new instance of IotSecuritySolutionPatch. - public IotSecuritySolutionPatch() - { - RecommendationsConfiguration = new ChangeTrackingList(); - } - - /// Initializes a new instance of IotSecuritySolutionPatch. - /// Resource tags. - /// Properties of the IoT Security solution's user defined resources. - /// List of the configuration status for each recommendation type. - internal IotSecuritySolutionPatch(IDictionary tags, UserDefinedResourcesProperties userDefinedResources, IList recommendationsConfiguration) : base(tags) - { - UserDefinedResources = userDefinedResources; - RecommendationsConfiguration = recommendationsConfiguration; - } - - /// Properties of the IoT Security solution's user defined resources. - public UserDefinedResourcesProperties UserDefinedResources { get; set; } - /// List of the configuration status for each recommendation type. - public IList RecommendationsConfiguration { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionsList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionsList.Serialization.cs deleted file mode 100644 index 132a9f215f00..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionsList.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class IotSecuritySolutionsList - { - internal static IotSecuritySolutionsList DeserializeIotSecuritySolutionsList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(IotSecuritySolutionData.DeserializeIotSecuritySolutionData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new IotSecuritySolutionsList(value, nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionsList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionsList.cs deleted file mode 100644 index 7863d23aad4f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSecuritySolutionsList.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of IoT Security solutions. - internal partial class IotSecuritySolutionsList - { - /// Initializes a new instance of IotSecuritySolutionsList. - /// List of IoT Security solutions. - /// is null. - internal IotSecuritySolutionsList(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of IotSecuritySolutionsList. - /// List of IoT Security solutions. - /// The URI to fetch the next page. - internal IotSecuritySolutionsList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of IoT Security solutions. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSeverityMetrics.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSeverityMetrics.Serialization.cs deleted file mode 100644 index 7e88e811ceee..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSeverityMetrics.Serialization.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class IotSeverityMetrics - { - internal static IotSeverityMetrics DeserializeIotSeverityMetrics(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional high = default; - Optional medium = default; - Optional low = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("high"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - high = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("medium"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - medium = property.Value.GetInt64(); - continue; - } - if (property.NameEquals("low"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - low = property.Value.GetInt64(); - continue; - } - } - return new IotSeverityMetrics(Optional.ToNullable(high), Optional.ToNullable(medium), Optional.ToNullable(low)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSeverityMetrics.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSeverityMetrics.cs deleted file mode 100644 index 55b0b64e6e4c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/IotSeverityMetrics.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// IoT Security solution analytics severity metrics. - public partial class IotSeverityMetrics - { - /// Initializes a new instance of IotSeverityMetrics. - internal IotSeverityMetrics() - { - } - - /// Initializes a new instance of IotSeverityMetrics. - /// Count of high severity alerts/recommendations. - /// Count of medium severity alerts/recommendations. - /// Count of low severity alerts/recommendations. - internal IotSeverityMetrics(long? high, long? medium, long? low) - { - High = high; - Medium = medium; - Low = low; - } - - /// Count of high severity alerts/recommendations. - public long? High { get; } - /// Count of medium severity alerts/recommendations. - public long? Medium { get; } - /// Count of low severity alerts/recommendations. - public long? Low { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPoliciesList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPoliciesList.Serialization.cs deleted file mode 100644 index ab144eb44933..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPoliciesList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class JitNetworkAccessPoliciesList - { - internal static JitNetworkAccessPoliciesList DeserializeJitNetworkAccessPoliciesList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new JitNetworkAccessPoliciesList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPoliciesList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPoliciesList.cs deleted file mode 100644 index 48bb86a5d0f8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPoliciesList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The JitNetworkAccessPoliciesList. - internal partial class JitNetworkAccessPoliciesList - { - /// Initializes a new instance of JitNetworkAccessPoliciesList. - internal JitNetworkAccessPoliciesList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of JitNetworkAccessPoliciesList. - /// - /// The URI to fetch the next page. - internal JitNetworkAccessPoliciesList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Gets the value. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyData.Serialization.cs deleted file mode 100644 index bc71269c37db..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyData.Serialization.cs +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class JitNetworkAccessPolicyData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Kind)) - { - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("virtualMachines"u8); - writer.WriteStartArray(); - foreach (var item in VirtualMachines) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - if (Optional.IsCollectionDefined(Requests)) - { - writer.WritePropertyName("requests"u8); - writer.WriteStartArray(); - foreach (var item in Requests) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static JitNetworkAccessPolicyData DeserializeJitNetworkAccessPolicyData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional kind = default; - Optional location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - IList virtualMachines = default; - Optional> requests = default; - Optional provisioningState = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kind"u8)) - { - kind = property.Value.GetString(); - continue; - } - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("virtualMachines"u8)) - { - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(JitNetworkAccessPolicyVirtualMachine.DeserializeJitNetworkAccessPolicyVirtualMachine(item)); - } - virtualMachines = array; - continue; - } - if (property0.NameEquals("requests"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(JitNetworkAccessRequestInfo.DeserializeJitNetworkAccessRequestInfo(item)); - } - requests = array; - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - provisioningState = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new JitNetworkAccessPolicyData(id, name, type, systemData.Value, virtualMachines, Optional.ToList(requests), provisioningState.Value, kind.Value, Optional.ToNullable(location)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiateContent.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiateContent.Serialization.cs deleted file mode 100644 index 616df33bc9af..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiateContent.Serialization.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class JitNetworkAccessPolicyInitiateContent : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("virtualMachines"u8); - writer.WriteStartArray(); - foreach (var item in VirtualMachines) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - if (Optional.IsDefined(Justification)) - { - writer.WritePropertyName("justification"u8); - writer.WriteStringValue(Justification); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiateContent.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiateContent.cs deleted file mode 100644 index af564b6504f6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiateContent.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The JitNetworkAccessPolicyInitiateContent. - public partial class JitNetworkAccessPolicyInitiateContent - { - /// Initializes a new instance of JitNetworkAccessPolicyInitiateContent. - /// A list of virtual machines & ports to open access for. - /// is null. - public JitNetworkAccessPolicyInitiateContent(IEnumerable virtualMachines) - { - Argument.AssertNotNull(virtualMachines, nameof(virtualMachines)); - - VirtualMachines = virtualMachines.ToList(); - } - - /// A list of virtual machines & ports to open access for. - public IList VirtualMachines { get; } - /// The justification for making the initiate request. - public string Justification { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiatePort.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiatePort.Serialization.cs deleted file mode 100644 index 95e47a3297c8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiatePort.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class JitNetworkAccessPolicyInitiatePort : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("number"u8); - writer.WriteNumberValue(Number); - if (Optional.IsDefined(AllowedSourceAddressPrefix)) - { - writer.WritePropertyName("allowedSourceAddressPrefix"u8); - writer.WriteStringValue(AllowedSourceAddressPrefix); - } - writer.WritePropertyName("endTimeUtc"u8); - writer.WriteStringValue(EndOn, "O"); - writer.WriteEndObject(); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiatePort.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiatePort.cs deleted file mode 100644 index be1da8c1777d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiatePort.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The JitNetworkAccessPolicyInitiatePort. - public partial class JitNetworkAccessPolicyInitiatePort - { - /// Initializes a new instance of JitNetworkAccessPolicyInitiatePort. - /// - /// The time to close the request in UTC. - public JitNetworkAccessPolicyInitiatePort(int number, DateTimeOffset endOn) - { - Number = number; - EndOn = endOn; - } - - /// Gets the number. - public int Number { get; } - /// Source of the allowed traffic. If omitted, the request will be for the source IP address of the initiate request. - public string AllowedSourceAddressPrefix { get; set; } - /// The time to close the request in UTC. - public DateTimeOffset EndOn { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiateVirtualMachine.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiateVirtualMachine.Serialization.cs deleted file mode 100644 index 2966dd584bc0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiateVirtualMachine.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class JitNetworkAccessPolicyInitiateVirtualMachine : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - writer.WritePropertyName("ports"u8); - writer.WriteStartArray(); - foreach (var item in Ports) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - writer.WriteEndObject(); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiateVirtualMachine.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiateVirtualMachine.cs deleted file mode 100644 index eaba42415623..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyInitiateVirtualMachine.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The JitNetworkAccessPolicyInitiateVirtualMachine. - public partial class JitNetworkAccessPolicyInitiateVirtualMachine - { - /// Initializes a new instance of JitNetworkAccessPolicyInitiateVirtualMachine. - /// Resource ID of the virtual machine that is linked to this policy. - /// The ports to open for the resource with the `id`. - /// or is null. - public JitNetworkAccessPolicyInitiateVirtualMachine(ResourceIdentifier id, IEnumerable ports) - { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(ports, nameof(ports)); - - Id = id; - Ports = ports.ToList(); - } - - /// Resource ID of the virtual machine that is linked to this policy. - public ResourceIdentifier Id { get; } - /// The ports to open for the resource with the `id`. - public IList Ports { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyVirtualMachine.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyVirtualMachine.Serialization.cs deleted file mode 100644 index 822c0814c04b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyVirtualMachine.Serialization.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class JitNetworkAccessPolicyVirtualMachine : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - writer.WritePropertyName("ports"u8); - writer.WriteStartArray(); - foreach (var item in Ports) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - if (Optional.IsDefined(PublicIPAddress)) - { - writer.WritePropertyName("publicIpAddress"u8); - writer.WriteStringValue(PublicIPAddress); - } - writer.WriteEndObject(); - } - - internal static JitNetworkAccessPolicyVirtualMachine DeserializeJitNetworkAccessPolicyVirtualMachine(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - IList ports = default; - Optional publicIPAddress = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("ports"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JitNetworkAccessPortRule.DeserializeJitNetworkAccessPortRule(item)); - } - ports = array; - continue; - } - if (property.NameEquals("publicIpAddress"u8)) - { - publicIPAddress = property.Value.GetString(); - continue; - } - } - return new JitNetworkAccessPolicyVirtualMachine(id, ports, publicIPAddress.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyVirtualMachine.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyVirtualMachine.cs deleted file mode 100644 index c1649ad85948..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPolicyVirtualMachine.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The JitNetworkAccessPolicyVirtualMachine. - public partial class JitNetworkAccessPolicyVirtualMachine - { - /// Initializes a new instance of JitNetworkAccessPolicyVirtualMachine. - /// Resource ID of the virtual machine that is linked to this policy. - /// Port configurations for the virtual machine. - /// or is null. - public JitNetworkAccessPolicyVirtualMachine(ResourceIdentifier id, IEnumerable ports) - { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(ports, nameof(ports)); - - Id = id; - Ports = ports.ToList(); - } - - /// Initializes a new instance of JitNetworkAccessPolicyVirtualMachine. - /// Resource ID of the virtual machine that is linked to this policy. - /// Port configurations for the virtual machine. - /// Public IP address of the Azure Firewall that is linked to this policy, if applicable. - internal JitNetworkAccessPolicyVirtualMachine(ResourceIdentifier id, IList ports, string publicIPAddress) - { - Id = id; - Ports = ports; - PublicIPAddress = publicIPAddress; - } - - /// Resource ID of the virtual machine that is linked to this policy. - public ResourceIdentifier Id { get; set; } - /// Port configurations for the virtual machine. - public IList Ports { get; } - /// Public IP address of the Azure Firewall that is linked to this policy, if applicable. - public string PublicIPAddress { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPortProtocol.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPortProtocol.cs deleted file mode 100644 index 447969c58f7a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPortProtocol.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The JitNetworkAccessPortProtocol. - public readonly partial struct JitNetworkAccessPortProtocol : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public JitNetworkAccessPortProtocol(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string TcpValue = "TCP"; - private const string UdpValue = "UDP"; - private const string AllValue = "*"; - - /// TCP. - public static JitNetworkAccessPortProtocol Tcp { get; } = new JitNetworkAccessPortProtocol(TcpValue); - /// UDP. - public static JitNetworkAccessPortProtocol Udp { get; } = new JitNetworkAccessPortProtocol(UdpValue); - /// *. - public static JitNetworkAccessPortProtocol All { get; } = new JitNetworkAccessPortProtocol(AllValue); - /// Determines if two values are the same. - public static bool operator ==(JitNetworkAccessPortProtocol left, JitNetworkAccessPortProtocol right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(JitNetworkAccessPortProtocol left, JitNetworkAccessPortProtocol right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator JitNetworkAccessPortProtocol(string value) => new JitNetworkAccessPortProtocol(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is JitNetworkAccessPortProtocol other && Equals(other); - /// - public bool Equals(JitNetworkAccessPortProtocol other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPortRule.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPortRule.Serialization.cs deleted file mode 100644 index d9f052a7d2ca..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPortRule.Serialization.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class JitNetworkAccessPortRule : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("number"u8); - writer.WriteNumberValue(Number); - writer.WritePropertyName("protocol"u8); - writer.WriteStringValue(Protocol.ToString()); - if (Optional.IsDefined(AllowedSourceAddressPrefix)) - { - writer.WritePropertyName("allowedSourceAddressPrefix"u8); - writer.WriteStringValue(AllowedSourceAddressPrefix); - } - if (Optional.IsCollectionDefined(AllowedSourceAddressPrefixes)) - { - writer.WritePropertyName("allowedSourceAddressPrefixes"u8); - writer.WriteStartArray(); - foreach (var item in AllowedSourceAddressPrefixes) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WritePropertyName("maxRequestAccessDuration"u8); - writer.WriteStringValue(MaxRequestAccessDuration, "P"); - writer.WriteEndObject(); - } - - internal static JitNetworkAccessPortRule DeserializeJitNetworkAccessPortRule(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int number = default; - JitNetworkAccessPortProtocol protocol = default; - Optional allowedSourceAddressPrefix = default; - Optional> allowedSourceAddressPrefixes = default; - TimeSpan maxRequestAccessDuration = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("number"u8)) - { - number = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("protocol"u8)) - { - protocol = new JitNetworkAccessPortProtocol(property.Value.GetString()); - continue; - } - if (property.NameEquals("allowedSourceAddressPrefix"u8)) - { - allowedSourceAddressPrefix = property.Value.GetString(); - continue; - } - if (property.NameEquals("allowedSourceAddressPrefixes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowedSourceAddressPrefixes = array; - continue; - } - if (property.NameEquals("maxRequestAccessDuration"u8)) - { - maxRequestAccessDuration = property.Value.GetTimeSpan("P"); - continue; - } - } - return new JitNetworkAccessPortRule(number, protocol, allowedSourceAddressPrefix.Value, Optional.ToList(allowedSourceAddressPrefixes), maxRequestAccessDuration); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPortRule.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPortRule.cs deleted file mode 100644 index 284d640dd1b3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPortRule.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The JitNetworkAccessPortRule. - public partial class JitNetworkAccessPortRule - { - /// Initializes a new instance of JitNetworkAccessPortRule. - /// - /// - /// Maximum duration requests can be made for. In ISO 8601 duration format. Minimum 5 minutes, maximum 1 day. - public JitNetworkAccessPortRule(int number, JitNetworkAccessPortProtocol protocol, TimeSpan maxRequestAccessDuration) - { - Number = number; - Protocol = protocol; - AllowedSourceAddressPrefixes = new ChangeTrackingList(); - MaxRequestAccessDuration = maxRequestAccessDuration; - } - - /// Initializes a new instance of JitNetworkAccessPortRule. - /// - /// - /// Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, for example "192.168.0.3" or "192.168.0.0/16". - /// Mutually exclusive with the "allowedSourceAddressPrefix" parameter. - /// Maximum duration requests can be made for. In ISO 8601 duration format. Minimum 5 minutes, maximum 1 day. - internal JitNetworkAccessPortRule(int number, JitNetworkAccessPortProtocol protocol, string allowedSourceAddressPrefix, IList allowedSourceAddressPrefixes, TimeSpan maxRequestAccessDuration) - { - Number = number; - Protocol = protocol; - AllowedSourceAddressPrefix = allowedSourceAddressPrefix; - AllowedSourceAddressPrefixes = allowedSourceAddressPrefixes; - MaxRequestAccessDuration = maxRequestAccessDuration; - } - - /// Gets or sets the number. - public int Number { get; set; } - /// Gets or sets the protocol. - public JitNetworkAccessPortProtocol Protocol { get; set; } - /// Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, for example "192.168.0.3" or "192.168.0.0/16". - public string AllowedSourceAddressPrefix { get; set; } - /// Mutually exclusive with the "allowedSourceAddressPrefix" parameter. - public IList AllowedSourceAddressPrefixes { get; } - /// Maximum duration requests can be made for. In ISO 8601 duration format. Minimum 5 minutes, maximum 1 day. - public TimeSpan MaxRequestAccessDuration { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPortStatus.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPortStatus.cs deleted file mode 100644 index bd6650271d6f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPortStatus.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The status of the port. - public readonly partial struct JitNetworkAccessPortStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public JitNetworkAccessPortStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string RevokedValue = "Revoked"; - private const string InitiatedValue = "Initiated"; - - /// Revoked. - public static JitNetworkAccessPortStatus Revoked { get; } = new JitNetworkAccessPortStatus(RevokedValue); - /// Initiated. - public static JitNetworkAccessPortStatus Initiated { get; } = new JitNetworkAccessPortStatus(InitiatedValue); - /// Determines if two values are the same. - public static bool operator ==(JitNetworkAccessPortStatus left, JitNetworkAccessPortStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(JitNetworkAccessPortStatus left, JitNetworkAccessPortStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator JitNetworkAccessPortStatus(string value) => new JitNetworkAccessPortStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is JitNetworkAccessPortStatus other && Equals(other); - /// - public bool Equals(JitNetworkAccessPortStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPortStatusReason.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPortStatusReason.cs deleted file mode 100644 index 6ca720ed6316..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessPortStatusReason.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A description of why the `status` has its value. - public readonly partial struct JitNetworkAccessPortStatusReason : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public JitNetworkAccessPortStatusReason(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ExpiredValue = "Expired"; - private const string UserRequestedValue = "UserRequested"; - private const string NewerRequestInitiatedValue = "NewerRequestInitiated"; - - /// Expired. - public static JitNetworkAccessPortStatusReason Expired { get; } = new JitNetworkAccessPortStatusReason(ExpiredValue); - /// UserRequested. - public static JitNetworkAccessPortStatusReason UserRequested { get; } = new JitNetworkAccessPortStatusReason(UserRequestedValue); - /// NewerRequestInitiated. - public static JitNetworkAccessPortStatusReason NewerRequestInitiated { get; } = new JitNetworkAccessPortStatusReason(NewerRequestInitiatedValue); - /// Determines if two values are the same. - public static bool operator ==(JitNetworkAccessPortStatusReason left, JitNetworkAccessPortStatusReason right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(JitNetworkAccessPortStatusReason left, JitNetworkAccessPortStatusReason right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator JitNetworkAccessPortStatusReason(string value) => new JitNetworkAccessPortStatusReason(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is JitNetworkAccessPortStatusReason other && Equals(other); - /// - public bool Equals(JitNetworkAccessPortStatusReason other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestInfo.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestInfo.Serialization.cs deleted file mode 100644 index 0f7970e16540..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestInfo.Serialization.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class JitNetworkAccessRequestInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("virtualMachines"u8); - writer.WriteStartArray(); - foreach (var item in VirtualMachines) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - writer.WritePropertyName("startTimeUtc"u8); - writer.WriteStringValue(StartOn, "O"); - writer.WritePropertyName("requestor"u8); - writer.WriteStringValue(Requestor); - if (Optional.IsDefined(Justification)) - { - writer.WritePropertyName("justification"u8); - writer.WriteStringValue(Justification); - } - writer.WriteEndObject(); - } - - internal static JitNetworkAccessRequestInfo DeserializeJitNetworkAccessRequestInfo(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList virtualMachines = default; - DateTimeOffset startTimeUtc = default; - string requestor = default; - Optional justification = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("virtualMachines"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JitNetworkAccessRequestVirtualMachine.DeserializeJitNetworkAccessRequestVirtualMachine(item)); - } - virtualMachines = array; - continue; - } - if (property.NameEquals("startTimeUtc"u8)) - { - startTimeUtc = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("requestor"u8)) - { - requestor = property.Value.GetString(); - continue; - } - if (property.NameEquals("justification"u8)) - { - justification = property.Value.GetString(); - continue; - } - } - return new JitNetworkAccessRequestInfo(virtualMachines, startTimeUtc, requestor, justification.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestInfo.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestInfo.cs deleted file mode 100644 index d26da23ae4c5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The JitNetworkAccessRequestInfo. - public partial class JitNetworkAccessRequestInfo - { - /// Initializes a new instance of JitNetworkAccessRequestInfo. - /// - /// The start time of the request in UTC. - /// The identity of the person who made the request. - /// or is null. - public JitNetworkAccessRequestInfo(IEnumerable virtualMachines, DateTimeOffset startOn, string requestor) - { - Argument.AssertNotNull(virtualMachines, nameof(virtualMachines)); - Argument.AssertNotNull(requestor, nameof(requestor)); - - VirtualMachines = virtualMachines.ToList(); - StartOn = startOn; - Requestor = requestor; - } - - /// Initializes a new instance of JitNetworkAccessRequestInfo. - /// - /// The start time of the request in UTC. - /// The identity of the person who made the request. - /// The justification for making the initiate request. - internal JitNetworkAccessRequestInfo(IList virtualMachines, DateTimeOffset startOn, string requestor, string justification) - { - VirtualMachines = virtualMachines; - StartOn = startOn; - Requestor = requestor; - Justification = justification; - } - - /// Gets the virtual machines. - public IList VirtualMachines { get; } - /// The start time of the request in UTC. - public DateTimeOffset StartOn { get; set; } - /// The identity of the person who made the request. - public string Requestor { get; set; } - /// The justification for making the initiate request. - public string Justification { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestPort.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestPort.Serialization.cs deleted file mode 100644 index df4ef5a8862e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestPort.Serialization.cs +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class JitNetworkAccessRequestPort : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("number"u8); - writer.WriteNumberValue(Number); - if (Optional.IsDefined(AllowedSourceAddressPrefix)) - { - writer.WritePropertyName("allowedSourceAddressPrefix"u8); - writer.WriteStringValue(AllowedSourceAddressPrefix); - } - if (Optional.IsCollectionDefined(AllowedSourceAddressPrefixes)) - { - writer.WritePropertyName("allowedSourceAddressPrefixes"u8); - writer.WriteStartArray(); - foreach (var item in AllowedSourceAddressPrefixes) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WritePropertyName("endTimeUtc"u8); - writer.WriteStringValue(EndOn, "O"); - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); - writer.WritePropertyName("statusReason"u8); - writer.WriteStringValue(StatusReason.ToString()); - if (Optional.IsDefined(MappedPort)) - { - writer.WritePropertyName("mappedPort"u8); - writer.WriteNumberValue(MappedPort.Value); - } - writer.WriteEndObject(); - } - - internal static JitNetworkAccessRequestPort DeserializeJitNetworkAccessRequestPort(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int number = default; - Optional allowedSourceAddressPrefix = default; - Optional> allowedSourceAddressPrefixes = default; - DateTimeOffset endTimeUtc = default; - JitNetworkAccessPortStatus status = default; - JitNetworkAccessPortStatusReason statusReason = default; - Optional mappedPort = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("number"u8)) - { - number = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("allowedSourceAddressPrefix"u8)) - { - allowedSourceAddressPrefix = property.Value.GetString(); - continue; - } - if (property.NameEquals("allowedSourceAddressPrefixes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowedSourceAddressPrefixes = array; - continue; - } - if (property.NameEquals("endTimeUtc"u8)) - { - endTimeUtc = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("status"u8)) - { - status = new JitNetworkAccessPortStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("statusReason"u8)) - { - statusReason = new JitNetworkAccessPortStatusReason(property.Value.GetString()); - continue; - } - if (property.NameEquals("mappedPort"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - mappedPort = property.Value.GetInt32(); - continue; - } - } - return new JitNetworkAccessRequestPort(number, allowedSourceAddressPrefix.Value, Optional.ToList(allowedSourceAddressPrefixes), endTimeUtc, status, statusReason, Optional.ToNullable(mappedPort)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestPort.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestPort.cs deleted file mode 100644 index c7b33649ac6d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestPort.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The JitNetworkAccessRequestPort. - public partial class JitNetworkAccessRequestPort - { - /// Initializes a new instance of JitNetworkAccessRequestPort. - /// - /// The date & time at which the request ends in UTC. - /// The status of the port. - /// A description of why the `status` has its value. - public JitNetworkAccessRequestPort(int number, DateTimeOffset endOn, JitNetworkAccessPortStatus status, JitNetworkAccessPortStatusReason statusReason) - { - Number = number; - AllowedSourceAddressPrefixes = new ChangeTrackingList(); - EndOn = endOn; - Status = status; - StatusReason = statusReason; - } - - /// Initializes a new instance of JitNetworkAccessRequestPort. - /// - /// Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, for example "192.168.0.3" or "192.168.0.0/16". - /// Mutually exclusive with the "allowedSourceAddressPrefix" parameter. - /// The date & time at which the request ends in UTC. - /// The status of the port. - /// A description of why the `status` has its value. - /// The port which is mapped to this port's `number` in the Azure Firewall, if applicable. - internal JitNetworkAccessRequestPort(int number, string allowedSourceAddressPrefix, IList allowedSourceAddressPrefixes, DateTimeOffset endOn, JitNetworkAccessPortStatus status, JitNetworkAccessPortStatusReason statusReason, int? mappedPort) - { - Number = number; - AllowedSourceAddressPrefix = allowedSourceAddressPrefix; - AllowedSourceAddressPrefixes = allowedSourceAddressPrefixes; - EndOn = endOn; - Status = status; - StatusReason = statusReason; - MappedPort = mappedPort; - } - - /// Gets or sets the number. - public int Number { get; set; } - /// Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, for example "192.168.0.3" or "192.168.0.0/16". - public string AllowedSourceAddressPrefix { get; set; } - /// Mutually exclusive with the "allowedSourceAddressPrefix" parameter. - public IList AllowedSourceAddressPrefixes { get; } - /// The date & time at which the request ends in UTC. - public DateTimeOffset EndOn { get; set; } - /// The status of the port. - public JitNetworkAccessPortStatus Status { get; set; } - /// A description of why the `status` has its value. - public JitNetworkAccessPortStatusReason StatusReason { get; set; } - /// The port which is mapped to this port's `number` in the Azure Firewall, if applicable. - public int? MappedPort { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestVirtualMachine.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestVirtualMachine.Serialization.cs deleted file mode 100644 index 861355bbd124..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestVirtualMachine.Serialization.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class JitNetworkAccessRequestVirtualMachine : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - writer.WritePropertyName("ports"u8); - writer.WriteStartArray(); - foreach (var item in Ports) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - writer.WriteEndObject(); - } - - internal static JitNetworkAccessRequestVirtualMachine DeserializeJitNetworkAccessRequestVirtualMachine(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - IList ports = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("ports"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JitNetworkAccessRequestPort.DeserializeJitNetworkAccessRequestPort(item)); - } - ports = array; - continue; - } - } - return new JitNetworkAccessRequestVirtualMachine(id, ports); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestVirtualMachine.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestVirtualMachine.cs deleted file mode 100644 index 8c41c79abba7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/JitNetworkAccessRequestVirtualMachine.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The JitNetworkAccessRequestVirtualMachine. - public partial class JitNetworkAccessRequestVirtualMachine - { - /// Initializes a new instance of JitNetworkAccessRequestVirtualMachine. - /// Resource ID of the virtual machine that is linked to this policy. - /// The ports that were opened for the virtual machine. - /// or is null. - public JitNetworkAccessRequestVirtualMachine(ResourceIdentifier id, IEnumerable ports) - { - Argument.AssertNotNull(id, nameof(id)); - Argument.AssertNotNull(ports, nameof(ports)); - - Id = id; - Ports = ports.ToList(); - } - - /// Initializes a new instance of JitNetworkAccessRequestVirtualMachine. - /// Resource ID of the virtual machine that is linked to this policy. - /// The ports that were opened for the virtual machine. - internal JitNetworkAccessRequestVirtualMachine(ResourceIdentifier id, IList ports) - { - Id = id; - Ports = ports; - } - - /// Resource ID of the virtual machine that is linked to this policy. - public ResourceIdentifier Id { get; set; } - /// The ports that were opened for the virtual machine. - public IList Ports { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/KillChainIntent.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/KillChainIntent.cs deleted file mode 100644 index 7876e44bca47..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/KillChainIntent.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The kill chain related intent behind the alert. For list of supported values, and explanations of Azure Security Center's supported kill chain intents. - public readonly partial struct KillChainIntent : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public KillChainIntent(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string UnknownValue = "Unknown"; - private const string PreAttackValue = "PreAttack"; - private const string InitialAccessValue = "InitialAccess"; - private const string PersistenceValue = "Persistence"; - private const string PrivilegeEscalationValue = "PrivilegeEscalation"; - private const string DefenseEvasionValue = "DefenseEvasion"; - private const string CredentialAccessValue = "CredentialAccess"; - private const string DiscoveryValue = "Discovery"; - private const string LateralMovementValue = "LateralMovement"; - private const string ExecutionValue = "Execution"; - private const string CollectionValue = "Collection"; - private const string ExfiltrationValue = "Exfiltration"; - private const string CommandAndControlValue = "CommandAndControl"; - private const string ImpactValue = "Impact"; - private const string ProbingValue = "Probing"; - private const string ExploitationValue = "Exploitation"; - - /// Unknown. - public static KillChainIntent Unknown { get; } = new KillChainIntent(UnknownValue); - /// PreAttack could be either an attempt to access a certain resource regardless of a malicious intent, or a failed attempt to gain access to a target system to gather information prior to exploitation. This step is usually detected as an attempt, originating from outside the network, to scan the target system and find a way in. Further details on the PreAttack stage can be read in [MITRE Pre-Att&ck matrix](https://attack.mitre.org/matrices/pre/). - public static KillChainIntent PreAttack { get; } = new KillChainIntent(PreAttackValue); - /// InitialAccess is the stage where an attacker manages to get foothold on the attacked resource. - public static KillChainIntent InitialAccess { get; } = new KillChainIntent(InitialAccessValue); - /// Persistence is any access, action, or configuration change to a system that gives a threat actor a persistent presence on that system. - public static KillChainIntent Persistence { get; } = new KillChainIntent(PersistenceValue); - /// Privilege escalation is the result of actions that allow an adversary to obtain a higher level of permissions on a system or network. - public static KillChainIntent PrivilegeEscalation { get; } = new KillChainIntent(PrivilegeEscalationValue); - /// Defense evasion consists of techniques an adversary may use to evade detection or avoid other defenses. - public static KillChainIntent DefenseEvasion { get; } = new KillChainIntent(DefenseEvasionValue); - /// Credential access represents techniques resulting in access to or control over system, domain, or service credentials that are used within an enterprise environment. - public static KillChainIntent CredentialAccess { get; } = new KillChainIntent(CredentialAccessValue); - /// Discovery consists of techniques that allow the adversary to gain knowledge about the system and internal network. - public static KillChainIntent Discovery { get; } = new KillChainIntent(DiscoveryValue); - /// Lateral movement consists of techniques that enable an adversary to access and control remote systems on a network and could, but does not necessarily, include execution of tools on remote systems. - public static KillChainIntent LateralMovement { get; } = new KillChainIntent(LateralMovementValue); - /// The execution tactic represents techniques that result in execution of adversary-controlled code on a local or remote system. - public static KillChainIntent Execution { get; } = new KillChainIntent(ExecutionValue); - /// Collection consists of techniques used to identify and gather information, such as sensitive files, from a target network prior to exfiltration. - public static KillChainIntent Collection { get; } = new KillChainIntent(CollectionValue); - /// Exfiltration refers to techniques and attributes that result or aid in the adversary removing files and information from a target network. - public static KillChainIntent Exfiltration { get; } = new KillChainIntent(ExfiltrationValue); - /// The command and control tactic represents how adversaries communicate with systems under their control within a target network. - public static KillChainIntent CommandAndControl { get; } = new KillChainIntent(CommandAndControlValue); - /// Impact events primarily try to directly reduce the availability or integrity of a system, service, or network; including manipulation of data to impact a business or operational process. - public static KillChainIntent Impact { get; } = new KillChainIntent(ImpactValue); - /// Probing could be either an attempt to access a certain resource regardless of a malicious intent, or a failed attempt to gain access to a target system to gather information prior to exploitation. - public static KillChainIntent Probing { get; } = new KillChainIntent(ProbingValue); - /// Exploitation is the stage where an attacker manages to get a foothold on the attacked resource. This stage is relevant for compute hosts and resources such as user accounts, certificates etc. - public static KillChainIntent Exploitation { get; } = new KillChainIntent(ExploitationValue); - /// Determines if two values are the same. - public static bool operator ==(KillChainIntent left, KillChainIntent right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(KillChainIntent left, KillChainIntent right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator KillChainIntent(string value) => new KillChainIntent(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is KillChainIntent other && Equals(other); - /// - public bool Equals(KillChainIntent other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ListCustomAlertRule.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ListCustomAlertRule.Serialization.cs deleted file mode 100644 index ef14fd8e08c9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ListCustomAlertRule.Serialization.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class ListCustomAlertRule : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static ListCustomAlertRule DeserializeListCustomAlertRule(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("ruleType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "AllowlistCustomAlertRule": return AllowlistCustomAlertRule.DeserializeAllowlistCustomAlertRule(element); - case "ConnectionFromIpNotAllowed": return ConnectionFromIPNotAllowed.DeserializeConnectionFromIPNotAllowed(element); - case "ConnectionToIpNotAllowed": return ConnectionToIPNotAllowed.DeserializeConnectionToIPNotAllowed(element); - case "DenylistCustomAlertRule": return DenylistCustomAlertRule.DeserializeDenylistCustomAlertRule(element); - case "LocalUserNotAllowed": return LocalUserNotAllowed.DeserializeLocalUserNotAllowed(element); - case "ProcessNotAllowed": return ProcessNotAllowed.DeserializeProcessNotAllowed(element); - } - } - Optional valueType = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = "ListCustomAlertRule"; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("valueType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - valueType = new SecurityValueType(property.Value.GetString()); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new ListCustomAlertRule(displayName.Value, description.Value, isEnabled, ruleType, Optional.ToNullable(valueType)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ListCustomAlertRule.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ListCustomAlertRule.cs deleted file mode 100644 index ed3a5e81dd16..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ListCustomAlertRule.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// - /// A List custom alert rule. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , and . - /// - public partial class ListCustomAlertRule : CustomAlertRule - { - /// Initializes a new instance of ListCustomAlertRule. - /// Status of the custom alert. - public ListCustomAlertRule(bool isEnabled) : base(isEnabled) - { - RuleType = "ListCustomAlertRule"; - } - - /// Initializes a new instance of ListCustomAlertRule. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The value type of the items in the list. - internal ListCustomAlertRule(string displayName, string description, bool isEnabled, string ruleType, SecurityValueType? valueType) : base(displayName, description, isEnabled, ruleType) - { - ValueType = valueType; - RuleType = ruleType ?? "ListCustomAlertRule"; - } - - /// The value type of the items in the list. - public SecurityValueType? ValueType { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/LocalUserNotAllowed.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/LocalUserNotAllowed.Serialization.cs deleted file mode 100644 index 69eb8145ba50..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/LocalUserNotAllowed.Serialization.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class LocalUserNotAllowed : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("allowlistValues"u8); - writer.WriteStartArray(); - foreach (var item in AllowlistValues) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static LocalUserNotAllowed DeserializeLocalUserNotAllowed(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList allowlistValues = default; - Optional valueType = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("allowlistValues"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowlistValues = array; - continue; - } - if (property.NameEquals("valueType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - valueType = new SecurityValueType(property.Value.GetString()); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new LocalUserNotAllowed(displayName.Value, description.Value, isEnabled, ruleType, Optional.ToNullable(valueType), allowlistValues); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/LocalUserNotAllowed.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/LocalUserNotAllowed.cs deleted file mode 100644 index 0e773cf08991..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/LocalUserNotAllowed.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Login by a local user that isn't allowed. Allow list consists of login names to allow. - public partial class LocalUserNotAllowed : AllowlistCustomAlertRule - { - /// Initializes a new instance of LocalUserNotAllowed. - /// Status of the custom alert. - /// The values to allow. The format of the values depends on the rule type. - /// is null. - public LocalUserNotAllowed(bool isEnabled, IEnumerable allowlistValues) : base(isEnabled, allowlistValues) - { - Argument.AssertNotNull(allowlistValues, nameof(allowlistValues)); - - RuleType = "LocalUserNotAllowed"; - } - - /// Initializes a new instance of LocalUserNotAllowed. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The value type of the items in the list. - /// The values to allow. The format of the values depends on the rule type. - internal LocalUserNotAllowed(string displayName, string description, bool isEnabled, string ruleType, SecurityValueType? valueType, IList allowlistValues) : base(displayName, description, isEnabled, ruleType, valueType, allowlistValues) - { - RuleType = ruleType ?? "LocalUserNotAllowed"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/LogAnalyticsIdentifier.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/LogAnalyticsIdentifier.Serialization.cs deleted file mode 100644 index a458a55ef476..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/LogAnalyticsIdentifier.Serialization.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class LogAnalyticsIdentifier - { - internal static LogAnalyticsIdentifier DeserializeLogAnalyticsIdentifier(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional workspaceId = default; - Optional workspaceSubscriptionId = default; - Optional workspaceResourceGroup = default; - Optional agentId = default; - ResourceIdentifierType type = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("workspaceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - workspaceId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("workspaceSubscriptionId"u8)) - { - workspaceSubscriptionId = property.Value.GetString(); - continue; - } - if (property.NameEquals("workspaceResourceGroup"u8)) - { - workspaceResourceGroup = property.Value.GetString(); - continue; - } - if (property.NameEquals("agentId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - agentId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceIdentifierType(property.Value.GetString()); - continue; - } - } - return new LogAnalyticsIdentifier(type, Optional.ToNullable(workspaceId), workspaceSubscriptionId.Value, workspaceResourceGroup.Value, Optional.ToNullable(agentId)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/LogAnalyticsIdentifier.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/LogAnalyticsIdentifier.cs deleted file mode 100644 index d5e2dc8406db..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/LogAnalyticsIdentifier.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Represents a Log Analytics workspace scope identifier. - public partial class LogAnalyticsIdentifier : SecurityAlertResourceIdentifier - { - /// Initializes a new instance of LogAnalyticsIdentifier. - internal LogAnalyticsIdentifier() - { - ResourceIdentifierType = ResourceIdentifierType.LogAnalytics; - } - - /// Initializes a new instance of LogAnalyticsIdentifier. - /// There can be multiple identifiers of different type per alert, this field specify the identifier type. - /// The LogAnalytics workspace id that stores this alert. - /// The azure subscription id for the LogAnalytics workspace storing this alert. - /// The azure resource group for the LogAnalytics workspace storing this alert. - /// (optional) The LogAnalytics agent id reporting the event that this alert is based on. - internal LogAnalyticsIdentifier(ResourceIdentifierType resourceIdentifierType, Guid? workspaceId, string workspaceSubscriptionId, string workspaceResourceGroup, Guid? agentId) : base(resourceIdentifierType) - { - WorkspaceId = workspaceId; - WorkspaceSubscriptionId = workspaceSubscriptionId; - WorkspaceResourceGroup = workspaceResourceGroup; - AgentId = agentId; - ResourceIdentifierType = resourceIdentifierType; - } - - /// The LogAnalytics workspace id that stores this alert. - public Guid? WorkspaceId { get; } - /// The azure subscription id for the LogAnalytics workspace storing this alert. - public string WorkspaceSubscriptionId { get; } - /// The azure resource group for the LogAnalytics workspace storing this alert. - public string WorkspaceResourceGroup { get; } - /// (optional) The LogAnalytics agent id reporting the event that this alert is based on. - public Guid? AgentId { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MdeOnboarding.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MdeOnboarding.Serialization.cs deleted file mode 100644 index 8d9163afc33b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MdeOnboarding.Serialization.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class MdeOnboarding : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(OnboardingPackageWindows)) - { - writer.WritePropertyName("onboardingPackageWindows"u8); - writer.WriteBase64StringValue(OnboardingPackageWindows, "D"); - } - if (Optional.IsDefined(OnboardingPackageLinux)) - { - writer.WritePropertyName("onboardingPackageLinux"u8); - writer.WriteBase64StringValue(OnboardingPackageLinux, "D"); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static MdeOnboarding DeserializeMdeOnboarding(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional onboardingPackageWindows = default; - Optional onboardingPackageLinux = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("onboardingPackageWindows"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - onboardingPackageWindows = property0.Value.GetBytesFromBase64("D"); - continue; - } - if (property0.NameEquals("onboardingPackageLinux"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - onboardingPackageLinux = property0.Value.GetBytesFromBase64("D"); - continue; - } - } - continue; - } - } - return new MdeOnboarding(id, name, type, systemData.Value, onboardingPackageWindows.Value, onboardingPackageLinux.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MdeOnboarding.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MdeOnboarding.cs deleted file mode 100644 index a2e47e1ca2c3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MdeOnboarding.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The resource of the configuration or data needed to onboard the machine to MDE. - public partial class MdeOnboarding : ResourceData - { - /// Initializes a new instance of MdeOnboarding. - public MdeOnboarding() - { - } - - /// Initializes a new instance of MdeOnboarding. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The onboarding package used to onboard Windows machines to MDE, coded in base64. This can also be used for onboarding using the dedicated VM Extension. - /// The onboarding package used to onboard Linux machines to MDE, coded in base64. This can also be used for onboarding using the dedicated VM Extension. - internal MdeOnboarding(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, byte[] onboardingPackageWindows, byte[] onboardingPackageLinux) : base(id, name, resourceType, systemData) - { - OnboardingPackageWindows = onboardingPackageWindows; - OnboardingPackageLinux = onboardingPackageLinux; - } - - /// The onboarding package used to onboard Windows machines to MDE, coded in base64. This can also be used for onboarding using the dedicated VM Extension. - public byte[] OnboardingPackageWindows { get; set; } - /// The onboarding package used to onboard Linux machines to MDE, coded in base64. This can also be used for onboarding using the dedicated VM Extension. - public byte[] OnboardingPackageLinux { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MdeOnboardingDataList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MdeOnboardingDataList.Serialization.cs deleted file mode 100644 index ef38792b2b01..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MdeOnboardingDataList.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class MdeOnboardingDataList - { - internal static MdeOnboardingDataList DeserializeMdeOnboardingDataList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(MdeOnboarding.DeserializeMdeOnboarding(item)); - } - value = array; - continue; - } - } - return new MdeOnboardingDataList(Optional.ToList(value)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MdeOnboardingDataList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MdeOnboardingDataList.cs deleted file mode 100644 index dfac945a5269..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MdeOnboardingDataList.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of all MDE onboarding data resources. - internal partial class MdeOnboardingDataList - { - /// Initializes a new instance of MdeOnboardingDataList. - internal MdeOnboardingDataList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of MdeOnboardingDataList. - /// List of the resources of the configuration or data needed to onboard the machine to MDE. - internal MdeOnboardingDataList(IReadOnlyList value) - { - Value = value; - } - - /// List of the resources of the configuration or data needed to onboard the machine to MDE. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttC2DMessagesNotInAllowedRange.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttC2DMessagesNotInAllowedRange.Serialization.cs deleted file mode 100644 index 815ebd2fe2e7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttC2DMessagesNotInAllowedRange.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class MqttC2DMessagesNotInAllowedRange : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("timeWindowSize"u8); - writer.WriteStringValue(TimeWindowSize, "P"); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static MqttC2DMessagesNotInAllowedRange DeserializeMqttC2DMessagesNotInAllowedRange(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - TimeSpan timeWindowSize = default; - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeWindowSize"u8)) - { - timeWindowSize = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new MqttC2DMessagesNotInAllowedRange(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttC2DMessagesNotInAllowedRange.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttC2DMessagesNotInAllowedRange.cs deleted file mode 100644 index 0770d594075c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttC2DMessagesNotInAllowedRange.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Number of cloud to device messages (MQTT protocol) is not in allowed range. - public partial class MqttC2DMessagesNotInAllowedRange : TimeWindowCustomAlertRule - { - /// Initializes a new instance of MqttC2DMessagesNotInAllowedRange. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - public MqttC2DMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(isEnabled, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = "MqttC2DMessagesNotInAllowedRange"; - } - - /// Initializes a new instance of MqttC2DMessagesNotInAllowedRange. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - internal MqttC2DMessagesNotInAllowedRange(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(displayName, description, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = ruleType ?? "MqttC2DMessagesNotInAllowedRange"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttC2DRejectedMessagesNotInAllowedRange.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttC2DRejectedMessagesNotInAllowedRange.Serialization.cs deleted file mode 100644 index 40282485e2bd..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttC2DRejectedMessagesNotInAllowedRange.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class MqttC2DRejectedMessagesNotInAllowedRange : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("timeWindowSize"u8); - writer.WriteStringValue(TimeWindowSize, "P"); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static MqttC2DRejectedMessagesNotInAllowedRange DeserializeMqttC2DRejectedMessagesNotInAllowedRange(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - TimeSpan timeWindowSize = default; - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeWindowSize"u8)) - { - timeWindowSize = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new MqttC2DRejectedMessagesNotInAllowedRange(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttC2DRejectedMessagesNotInAllowedRange.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttC2DRejectedMessagesNotInAllowedRange.cs deleted file mode 100644 index 715f99ad2082..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttC2DRejectedMessagesNotInAllowedRange.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Number of rejected cloud to device messages (MQTT protocol) is not in allowed range. - public partial class MqttC2DRejectedMessagesNotInAllowedRange : TimeWindowCustomAlertRule - { - /// Initializes a new instance of MqttC2DRejectedMessagesNotInAllowedRange. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - public MqttC2DRejectedMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(isEnabled, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = "MqttC2DRejectedMessagesNotInAllowedRange"; - } - - /// Initializes a new instance of MqttC2DRejectedMessagesNotInAllowedRange. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - internal MqttC2DRejectedMessagesNotInAllowedRange(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(displayName, description, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = ruleType ?? "MqttC2DRejectedMessagesNotInAllowedRange"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttD2CMessagesNotInAllowedRange.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttD2CMessagesNotInAllowedRange.Serialization.cs deleted file mode 100644 index 89626fcb231b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttD2CMessagesNotInAllowedRange.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class MqttD2CMessagesNotInAllowedRange : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("timeWindowSize"u8); - writer.WriteStringValue(TimeWindowSize, "P"); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static MqttD2CMessagesNotInAllowedRange DeserializeMqttD2CMessagesNotInAllowedRange(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - TimeSpan timeWindowSize = default; - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeWindowSize"u8)) - { - timeWindowSize = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new MqttD2CMessagesNotInAllowedRange(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttD2CMessagesNotInAllowedRange.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttD2CMessagesNotInAllowedRange.cs deleted file mode 100644 index c8528d18367f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/MqttD2CMessagesNotInAllowedRange.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Number of device to cloud messages (MQTT protocol) is not in allowed range. - public partial class MqttD2CMessagesNotInAllowedRange : TimeWindowCustomAlertRule - { - /// Initializes a new instance of MqttD2CMessagesNotInAllowedRange. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - public MqttD2CMessagesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(isEnabled, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = "MqttD2CMessagesNotInAllowedRange"; - } - - /// Initializes a new instance of MqttD2CMessagesNotInAllowedRange. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - internal MqttD2CMessagesNotInAllowedRange(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(displayName, description, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = ruleType ?? "MqttD2CMessagesNotInAllowedRange"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OfferingType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OfferingType.cs deleted file mode 100644 index 2d48f51fc441..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OfferingType.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The type of the security offering. - internal readonly partial struct OfferingType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public OfferingType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string CspmMonitorAwsValue = "CspmMonitorAws"; - private const string DefenderForContainersAwsValue = "DefenderForContainersAws"; - private const string DefenderForServersAwsValue = "DefenderForServersAws"; - private const string DefenderForDatabasesAwsValue = "DefenderForDatabasesAws"; - private const string InformationProtectionAwsValue = "InformationProtectionAws"; - private const string CspmMonitorGcpValue = "CspmMonitorGcp"; - private const string CspmMonitorGithubValue = "CspmMonitorGithub"; - private const string CspmMonitorAzureDevOpsValue = "CspmMonitorAzureDevOps"; - private const string DefenderForServersGcpValue = "DefenderForServersGcp"; - private const string DefenderForContainersGcpValue = "DefenderForContainersGcp"; - private const string DefenderForDatabasesGcpValue = "DefenderForDatabasesGcp"; - private const string DefenderCspmAwsValue = "DefenderCspmAws"; - private const string DefenderCspmGcpValue = "DefenderCspmGcp"; - private const string DefenderForDevOpsGithubValue = "DefenderForDevOpsGithub"; - private const string DefenderForDevOpsAzureDevOpsValue = "DefenderForDevOpsAzureDevOps"; - - /// CspmMonitorAws. - public static OfferingType CspmMonitorAws { get; } = new OfferingType(CspmMonitorAwsValue); - /// DefenderForContainersAws. - public static OfferingType DefenderForContainersAws { get; } = new OfferingType(DefenderForContainersAwsValue); - /// DefenderForServersAws. - public static OfferingType DefenderForServersAws { get; } = new OfferingType(DefenderForServersAwsValue); - /// DefenderForDatabasesAws. - public static OfferingType DefenderForDatabasesAws { get; } = new OfferingType(DefenderForDatabasesAwsValue); - /// InformationProtectionAws. - public static OfferingType InformationProtectionAws { get; } = new OfferingType(InformationProtectionAwsValue); - /// CspmMonitorGcp. - public static OfferingType CspmMonitorGcp { get; } = new OfferingType(CspmMonitorGcpValue); - /// CspmMonitorGithub. - public static OfferingType CspmMonitorGithub { get; } = new OfferingType(CspmMonitorGithubValue); - /// CspmMonitorAzureDevOps. - public static OfferingType CspmMonitorAzureDevOps { get; } = new OfferingType(CspmMonitorAzureDevOpsValue); - /// DefenderForServersGcp. - public static OfferingType DefenderForServersGcp { get; } = new OfferingType(DefenderForServersGcpValue); - /// DefenderForContainersGcp. - public static OfferingType DefenderForContainersGcp { get; } = new OfferingType(DefenderForContainersGcpValue); - /// DefenderForDatabasesGcp. - public static OfferingType DefenderForDatabasesGcp { get; } = new OfferingType(DefenderForDatabasesGcpValue); - /// DefenderCspmAws. - public static OfferingType DefenderCspmAws { get; } = new OfferingType(DefenderCspmAwsValue); - /// DefenderCspmGcp. - public static OfferingType DefenderCspmGcp { get; } = new OfferingType(DefenderCspmGcpValue); - /// DefenderForDevOpsGithub. - public static OfferingType DefenderForDevOpsGithub { get; } = new OfferingType(DefenderForDevOpsGithubValue); - /// DefenderForDevOpsAzureDevOps. - public static OfferingType DefenderForDevOpsAzureDevOps { get; } = new OfferingType(DefenderForDevOpsAzureDevOpsValue); - /// Determines if two values are the same. - public static bool operator ==(OfferingType left, OfferingType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(OfferingType left, OfferingType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator OfferingType(string value) => new OfferingType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is OfferingType other && Equals(other); - /// - public bool Equals(OfferingType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OnPremiseResourceDetails.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OnPremiseResourceDetails.Serialization.cs deleted file mode 100644 index 848ea419e589..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OnPremiseResourceDetails.Serialization.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class OnPremiseResourceDetails : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("workspaceId"u8); - writer.WriteStringValue(WorkspaceId); - writer.WritePropertyName("vmuuid"u8); - writer.WriteStringValue(VmUuid); - writer.WritePropertyName("sourceComputerId"u8); - writer.WriteStringValue(SourceComputerId); - writer.WritePropertyName("machineName"u8); - writer.WriteStringValue(MachineName); - writer.WritePropertyName("source"u8); - writer.WriteStringValue(Source.ToString()); - writer.WriteEndObject(); - } - - internal static OnPremiseResourceDetails DeserializeOnPremiseResourceDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("source", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "OnPremiseSql": return OnPremiseSqlResourceDetails.DeserializeOnPremiseSqlResourceDetails(element); - } - } - ResourceIdentifier workspaceId = default; - Guid vmuuid = default; - string sourceComputerId = default; - string machineName = default; - Source source = "AutoRest.CSharp.Output.Models.Types.EnumTypeValue"; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("workspaceId"u8)) - { - workspaceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("vmuuid"u8)) - { - vmuuid = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("sourceComputerId"u8)) - { - sourceComputerId = property.Value.GetString(); - continue; - } - if (property.NameEquals("machineName"u8)) - { - machineName = property.Value.GetString(); - continue; - } - if (property.NameEquals("source"u8)) - { - source = new Source(property.Value.GetString()); - continue; - } - } - return new OnPremiseResourceDetails(source, workspaceId, vmuuid, sourceComputerId, machineName); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OnPremiseResourceDetails.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OnPremiseResourceDetails.cs deleted file mode 100644 index c47a6b282066..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OnPremiseResourceDetails.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// - /// Details of the On Premise resource that was assessed - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - public partial class OnPremiseResourceDetails : SecurityCenterResourceDetails - { - /// Initializes a new instance of OnPremiseResourceDetails. - /// Azure resource Id of the workspace the machine is attached to. - /// The unique Id of the machine. - /// The oms agent Id installed on the machine. - /// The name of the machine. - /// , or is null. - public OnPremiseResourceDetails(ResourceIdentifier workspaceId, Guid vmUuid, string sourceComputerId, string machineName) - { - Argument.AssertNotNull(workspaceId, nameof(workspaceId)); - Argument.AssertNotNull(sourceComputerId, nameof(sourceComputerId)); - Argument.AssertNotNull(machineName, nameof(machineName)); - - WorkspaceId = workspaceId; - VmUuid = vmUuid; - SourceComputerId = sourceComputerId; - MachineName = machineName; - Source = Source.OnPremise; - } - - /// Initializes a new instance of OnPremiseResourceDetails. - /// The platform where the assessed resource resides. - /// Azure resource Id of the workspace the machine is attached to. - /// The unique Id of the machine. - /// The oms agent Id installed on the machine. - /// The name of the machine. - internal OnPremiseResourceDetails(Source source, ResourceIdentifier workspaceId, Guid vmUuid, string sourceComputerId, string machineName) : base(source) - { - WorkspaceId = workspaceId; - VmUuid = vmUuid; - SourceComputerId = sourceComputerId; - MachineName = machineName; - Source = source; - } - - /// Azure resource Id of the workspace the machine is attached to. - public ResourceIdentifier WorkspaceId { get; set; } - /// The unique Id of the machine. - public Guid VmUuid { get; set; } - /// The oms agent Id installed on the machine. - public string SourceComputerId { get; set; } - /// The name of the machine. - public string MachineName { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OnPremiseSqlResourceDetails.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OnPremiseSqlResourceDetails.Serialization.cs deleted file mode 100644 index 071fe8773dc7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OnPremiseSqlResourceDetails.Serialization.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class OnPremiseSqlResourceDetails : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("serverName"u8); - writer.WriteStringValue(ServerName); - writer.WritePropertyName("databaseName"u8); - writer.WriteStringValue(DatabaseName); - writer.WritePropertyName("workspaceId"u8); - writer.WriteStringValue(WorkspaceId); - writer.WritePropertyName("vmuuid"u8); - writer.WriteStringValue(VmUuid); - writer.WritePropertyName("sourceComputerId"u8); - writer.WriteStringValue(SourceComputerId); - writer.WritePropertyName("machineName"u8); - writer.WriteStringValue(MachineName); - writer.WritePropertyName("source"u8); - writer.WriteStringValue(Source.ToString()); - writer.WriteEndObject(); - } - - internal static OnPremiseSqlResourceDetails DeserializeOnPremiseSqlResourceDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string serverName = default; - string databaseName = default; - ResourceIdentifier workspaceId = default; - Guid vmuuid = default; - string sourceComputerId = default; - string machineName = default; - Source source = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("serverName"u8)) - { - serverName = property.Value.GetString(); - continue; - } - if (property.NameEquals("databaseName"u8)) - { - databaseName = property.Value.GetString(); - continue; - } - if (property.NameEquals("workspaceId"u8)) - { - workspaceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("vmuuid"u8)) - { - vmuuid = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("sourceComputerId"u8)) - { - sourceComputerId = property.Value.GetString(); - continue; - } - if (property.NameEquals("machineName"u8)) - { - machineName = property.Value.GetString(); - continue; - } - if (property.NameEquals("source"u8)) - { - source = new Source(property.Value.GetString()); - continue; - } - } - return new OnPremiseSqlResourceDetails(source, workspaceId, vmuuid, sourceComputerId, machineName, serverName, databaseName); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OnPremiseSqlResourceDetails.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OnPremiseSqlResourceDetails.cs deleted file mode 100644 index 0c2606c5a280..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OnPremiseSqlResourceDetails.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Details of the On Premise Sql resource that was assessed. - public partial class OnPremiseSqlResourceDetails : OnPremiseResourceDetails - { - /// Initializes a new instance of OnPremiseSqlResourceDetails. - /// Azure resource Id of the workspace the machine is attached to. - /// The unique Id of the machine. - /// The oms agent Id installed on the machine. - /// The name of the machine. - /// The Sql server name installed on the machine. - /// The Sql database name installed on the machine. - /// , , , or is null. - public OnPremiseSqlResourceDetails(ResourceIdentifier workspaceId, Guid vmUuid, string sourceComputerId, string machineName, string serverName, string databaseName) : base(workspaceId, vmUuid, sourceComputerId, machineName) - { - Argument.AssertNotNull(workspaceId, nameof(workspaceId)); - Argument.AssertNotNull(sourceComputerId, nameof(sourceComputerId)); - Argument.AssertNotNull(machineName, nameof(machineName)); - Argument.AssertNotNull(serverName, nameof(serverName)); - Argument.AssertNotNull(databaseName, nameof(databaseName)); - - ServerName = serverName; - DatabaseName = databaseName; - Source = Source.OnPremiseSql; - } - - /// Initializes a new instance of OnPremiseSqlResourceDetails. - /// The platform where the assessed resource resides. - /// Azure resource Id of the workspace the machine is attached to. - /// The unique Id of the machine. - /// The oms agent Id installed on the machine. - /// The name of the machine. - /// The Sql server name installed on the machine. - /// The Sql database name installed on the machine. - internal OnPremiseSqlResourceDetails(Source source, ResourceIdentifier workspaceId, Guid vmUuid, string sourceComputerId, string machineName, string serverName, string databaseName) : base(source, workspaceId, vmUuid, sourceComputerId, machineName) - { - ServerName = serverName; - DatabaseName = databaseName; - Source = source; - } - - /// The Sql server name installed on the machine. - public string ServerName { get; set; } - /// The Sql database name installed on the machine. - public string DatabaseName { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OrganizationMembershipType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OrganizationMembershipType.cs deleted file mode 100644 index a8e1bc0c493d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/OrganizationMembershipType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The multi cloud account's membership type in the organization. - internal readonly partial struct OrganizationMembershipType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public OrganizationMembershipType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string MemberValue = "Member"; - private const string OrganizationValue = "Organization"; - - /// Member. - public static OrganizationMembershipType Member { get; } = new OrganizationMembershipType(MemberValue); - /// Organization. - public static OrganizationMembershipType Organization { get; } = new OrganizationMembershipType(OrganizationValue); - /// Determines if two values are the same. - public static bool operator ==(OrganizationMembershipType left, OrganizationMembershipType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(OrganizationMembershipType left, OrganizationMembershipType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator OrganizationMembershipType(string value) => new OrganizationMembershipType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is OrganizationMembershipType other && Equals(other); - /// - public bool Equals(OrganizationMembershipType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PathRecommendation.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PathRecommendation.Serialization.cs deleted file mode 100644 index c842db6cb708..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PathRecommendation.Serialization.cs +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class PathRecommendation : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Path)) - { - writer.WritePropertyName("path"u8); - writer.WriteStringValue(Path); - } - if (Optional.IsDefined(Action)) - { - writer.WritePropertyName("action"u8); - writer.WriteStringValue(Action.Value.ToString()); - } - if (Optional.IsDefined(IotSecurityRecommendationType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(IotSecurityRecommendationType.Value.ToString()); - } - if (Optional.IsDefined(PublisherInfo)) - { - writer.WritePropertyName("publisherInfo"u8); - writer.WriteObjectValue(PublisherInfo); - } - if (Optional.IsDefined(IsCommon)) - { - writer.WritePropertyName("common"u8); - writer.WriteBooleanValue(IsCommon.Value); - } - if (Optional.IsCollectionDefined(UserSids)) - { - writer.WritePropertyName("userSids"u8); - writer.WriteStartArray(); - foreach (var item in UserSids) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Usernames)) - { - writer.WritePropertyName("usernames"u8); - writer.WriteStartArray(); - foreach (var item in Usernames) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(FileType)) - { - writer.WritePropertyName("fileType"u8); - writer.WriteStringValue(FileType.Value.ToString()); - } - if (Optional.IsDefined(ConfigurationStatus)) - { - writer.WritePropertyName("configurationStatus"u8); - writer.WriteStringValue(ConfigurationStatus.Value.ToString()); - } - writer.WriteEndObject(); - } - - internal static PathRecommendation DeserializePathRecommendation(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional path = default; - Optional action = default; - Optional type = default; - Optional publisherInfo = default; - Optional common = default; - Optional> userSids = default; - Optional> usernames = default; - Optional fileType = default; - Optional configurationStatus = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("path"u8)) - { - path = property.Value.GetString(); - continue; - } - if (property.NameEquals("action"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - action = new RecommendationAction(property.Value.GetString()); - continue; - } - if (property.NameEquals("type"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - type = new IotSecurityRecommendationType(property.Value.GetString()); - continue; - } - if (property.NameEquals("publisherInfo"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - publisherInfo = SecurityCenterPublisherInfo.DeserializeSecurityCenterPublisherInfo(property.Value); - continue; - } - if (property.NameEquals("common"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - common = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("userSids"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - userSids = array; - continue; - } - if (property.NameEquals("usernames"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(UserRecommendation.DeserializeUserRecommendation(item)); - } - usernames = array; - continue; - } - if (property.NameEquals("fileType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - fileType = new PathRecommendationFileType(property.Value.GetString()); - continue; - } - if (property.NameEquals("configurationStatus"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - configurationStatus = new SecurityCenterConfigurationStatus(property.Value.GetString()); - continue; - } - } - return new PathRecommendation(path.Value, Optional.ToNullable(action), Optional.ToNullable(type), publisherInfo.Value, Optional.ToNullable(common), Optional.ToList(userSids), Optional.ToList(usernames), Optional.ToNullable(fileType), Optional.ToNullable(configurationStatus)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PathRecommendation.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PathRecommendation.cs deleted file mode 100644 index 6340afcf7f39..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PathRecommendation.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Represents a path that is recommended to be allowed and its properties. - public partial class PathRecommendation - { - /// Initializes a new instance of PathRecommendation. - public PathRecommendation() - { - UserSids = new ChangeTrackingList(); - Usernames = new ChangeTrackingList(); - } - - /// Initializes a new instance of PathRecommendation. - /// The full path of the file, or an identifier of the application. - /// The recommendation action of the machine or rule. - /// The type of IoT Security recommendation. - /// Represents the publisher information of a process/rule. - /// Whether the application is commonly run on the machine. - /// - /// - /// The type of the file (for Linux files - Executable is used). - /// The configuration status of the machines group or machine or rule. - internal PathRecommendation(string path, RecommendationAction? action, IotSecurityRecommendationType? iotSecurityRecommendationType, SecurityCenterPublisherInfo publisherInfo, bool? isCommon, IList userSids, IList usernames, PathRecommendationFileType? fileType, SecurityCenterConfigurationStatus? configurationStatus) - { - Path = path; - Action = action; - IotSecurityRecommendationType = iotSecurityRecommendationType; - PublisherInfo = publisherInfo; - IsCommon = isCommon; - UserSids = userSids; - Usernames = usernames; - FileType = fileType; - ConfigurationStatus = configurationStatus; - } - - /// The full path of the file, or an identifier of the application. - public string Path { get; set; } - /// The recommendation action of the machine or rule. - public RecommendationAction? Action { get; set; } - /// The type of IoT Security recommendation. - public IotSecurityRecommendationType? IotSecurityRecommendationType { get; set; } - /// Represents the publisher information of a process/rule. - public SecurityCenterPublisherInfo PublisherInfo { get; set; } - /// Whether the application is commonly run on the machine. - public bool? IsCommon { get; set; } - /// Gets the user sids. - public IList UserSids { get; } - /// Gets the usernames. - public IList Usernames { get; } - /// The type of the file (for Linux files - Executable is used). - public PathRecommendationFileType? FileType { get; set; } - /// The configuration status of the machines group or machine or rule. - public SecurityCenterConfigurationStatus? ConfigurationStatus { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PathRecommendationFileType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PathRecommendationFileType.cs deleted file mode 100644 index d262b383ded0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PathRecommendationFileType.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The type of the file (for Linux files - Executable is used). - public readonly partial struct PathRecommendationFileType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public PathRecommendationFileType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ExeValue = "Exe"; - private const string DllValue = "Dll"; - private const string MsiValue = "Msi"; - private const string ScriptValue = "Script"; - private const string ExecutableValue = "Executable"; - private const string UnknownValue = "Unknown"; - - /// Exe. - public static PathRecommendationFileType Exe { get; } = new PathRecommendationFileType(ExeValue); - /// Dll. - public static PathRecommendationFileType Dll { get; } = new PathRecommendationFileType(DllValue); - /// Msi. - public static PathRecommendationFileType Msi { get; } = new PathRecommendationFileType(MsiValue); - /// Script. - public static PathRecommendationFileType Script { get; } = new PathRecommendationFileType(ScriptValue); - /// Executable. - public static PathRecommendationFileType Executable { get; } = new PathRecommendationFileType(ExecutableValue); - /// Unknown. - public static PathRecommendationFileType Unknown { get; } = new PathRecommendationFileType(UnknownValue); - /// Determines if two values are the same. - public static bool operator ==(PathRecommendationFileType left, PathRecommendationFileType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(PathRecommendationFileType left, PathRecommendationFileType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator PathRecommendationFileType(string value) => new PathRecommendationFileType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is PathRecommendationFileType other && Equals(other); - /// - public bool Equals(PathRecommendationFileType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PricingList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PricingList.Serialization.cs deleted file mode 100644 index 0c2ed30e73c3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PricingList.Serialization.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class PricingList - { - internal static PricingList DeserializePricingList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityCenterPricingData.DeserializeSecurityCenterPricingData(item)); - } - value = array; - continue; - } - } - return new PricingList(value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PricingList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PricingList.cs deleted file mode 100644 index 858472de3dd2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/PricingList.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of pricing configurations response. - internal partial class PricingList - { - /// Initializes a new instance of PricingList. - /// List of pricing configurations. - /// is null. - internal PricingList(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of PricingList. - /// List of pricing configurations. - internal PricingList(IReadOnlyList value) - { - Value = value; - } - - /// List of pricing configurations. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ProcessNotAllowed.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ProcessNotAllowed.Serialization.cs deleted file mode 100644 index 9098754a79c3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ProcessNotAllowed.Serialization.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class ProcessNotAllowed : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("allowlistValues"u8); - writer.WriteStartArray(); - foreach (var item in AllowlistValues) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static ProcessNotAllowed DeserializeProcessNotAllowed(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList allowlistValues = default; - Optional valueType = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("allowlistValues"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowlistValues = array; - continue; - } - if (property.NameEquals("valueType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - valueType = new SecurityValueType(property.Value.GetString()); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new ProcessNotAllowed(displayName.Value, description.Value, isEnabled, ruleType, Optional.ToNullable(valueType), allowlistValues); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ProcessNotAllowed.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ProcessNotAllowed.cs deleted file mode 100644 index 42a69cae57c1..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ProcessNotAllowed.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Execution of a process that isn't allowed. Allow list consists of process names to allow. - public partial class ProcessNotAllowed : AllowlistCustomAlertRule - { - /// Initializes a new instance of ProcessNotAllowed. - /// Status of the custom alert. - /// The values to allow. The format of the values depends on the rule type. - /// is null. - public ProcessNotAllowed(bool isEnabled, IEnumerable allowlistValues) : base(isEnabled, allowlistValues) - { - Argument.AssertNotNull(allowlistValues, nameof(allowlistValues)); - - RuleType = "ProcessNotAllowed"; - } - - /// Initializes a new instance of ProcessNotAllowed. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The value type of the items in the list. - /// The values to allow. The format of the values depends on the rule type. - internal ProcessNotAllowed(string displayName, string description, bool isEnabled, string ruleType, SecurityValueType? valueType, IList allowlistValues) : base(displayName, description, isEnabled, ruleType, valueType, allowlistValues) - { - RuleType = ruleType ?? "ProcessNotAllowed"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ProxyServerProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ProxyServerProperties.Serialization.cs deleted file mode 100644 index 47d4e2b5ee8e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ProxyServerProperties.Serialization.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class ProxyServerProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(IP)) - { - writer.WritePropertyName("ip"u8); - writer.WriteStringValue(IP); - } - if (Optional.IsDefined(Port)) - { - writer.WritePropertyName("port"u8); - writer.WriteStringValue(Port); - } - writer.WriteEndObject(); - } - - internal static ProxyServerProperties DeserializeProxyServerProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional ip = default; - Optional port = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("ip"u8)) - { - ip = property.Value.GetString(); - continue; - } - if (property.NameEquals("port"u8)) - { - port = property.Value.GetString(); - continue; - } - } - return new ProxyServerProperties(ip.Value, port.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ProxyServerProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ProxyServerProperties.cs deleted file mode 100644 index 78de8fe0ca4a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ProxyServerProperties.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the non-Azure machine can use. - public partial class ProxyServerProperties - { - /// Initializes a new instance of ProxyServerProperties. - public ProxyServerProperties() - { - } - - /// Initializes a new instance of ProxyServerProperties. - /// Proxy server IP. - /// Proxy server port. - internal ProxyServerProperties(string ip, string port) - { - IP = ip; - Port = port; - } - - /// Proxy server IP. - public string IP { get; set; } - /// Proxy server port. - public string Port { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/QueuePurgesNotInAllowedRange.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/QueuePurgesNotInAllowedRange.Serialization.cs deleted file mode 100644 index 5bffaff67275..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/QueuePurgesNotInAllowedRange.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class QueuePurgesNotInAllowedRange : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("timeWindowSize"u8); - writer.WriteStringValue(TimeWindowSize, "P"); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static QueuePurgesNotInAllowedRange DeserializeQueuePurgesNotInAllowedRange(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - TimeSpan timeWindowSize = default; - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeWindowSize"u8)) - { - timeWindowSize = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new QueuePurgesNotInAllowedRange(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/QueuePurgesNotInAllowedRange.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/QueuePurgesNotInAllowedRange.cs deleted file mode 100644 index 91f835927742..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/QueuePurgesNotInAllowedRange.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Number of device queue purges is not in allowed range. - public partial class QueuePurgesNotInAllowedRange : TimeWindowCustomAlertRule - { - /// Initializes a new instance of QueuePurgesNotInAllowedRange. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - public QueuePurgesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(isEnabled, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = "QueuePurgesNotInAllowedRange"; - } - - /// Initializes a new instance of QueuePurgesNotInAllowedRange. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - internal QueuePurgesNotInAllowedRange(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(displayName, description, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = ruleType ?? "QueuePurgesNotInAllowedRange"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendationAction.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendationAction.cs deleted file mode 100644 index 4698c1fd31fa..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendationAction.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The recommendation action of the machine or rule. - public readonly partial struct RecommendationAction : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public RecommendationAction(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string RecommendedValue = "Recommended"; - private const string AddValue = "Add"; - private const string RemoveValue = "Remove"; - - /// Recommended. - public static RecommendationAction Recommended { get; } = new RecommendationAction(RecommendedValue); - /// Add. - public static RecommendationAction Add { get; } = new RecommendationAction(AddValue); - /// Remove. - public static RecommendationAction Remove { get; } = new RecommendationAction(RemoveValue); - /// Determines if two values are the same. - public static bool operator ==(RecommendationAction left, RecommendationAction right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(RecommendationAction left, RecommendationAction right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator RecommendationAction(string value) => new RecommendationAction(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is RecommendationAction other && Equals(other); - /// - public bool Equals(RecommendationAction other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendationConfigStatus.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendationConfigStatus.cs deleted file mode 100644 index f4bee5d4d752..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendationConfigStatus.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Recommendation status. When the recommendation status is disabled recommendations are not generated. - public readonly partial struct RecommendationConfigStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public RecommendationConfigStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DisabledValue = "Disabled"; - private const string EnabledValue = "Enabled"; - - /// Disabled. - public static RecommendationConfigStatus Disabled { get; } = new RecommendationConfigStatus(DisabledValue); - /// Enabled. - public static RecommendationConfigStatus Enabled { get; } = new RecommendationConfigStatus(EnabledValue); - /// Determines if two values are the same. - public static bool operator ==(RecommendationConfigStatus left, RecommendationConfigStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(RecommendationConfigStatus left, RecommendationConfigStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator RecommendationConfigStatus(string value) => new RecommendationConfigStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is RecommendationConfigStatus other && Equals(other); - /// - public bool Equals(RecommendationConfigStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendationConfigurationProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendationConfigurationProperties.Serialization.cs deleted file mode 100644 index 25e6ded6ddca..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendationConfigurationProperties.Serialization.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class RecommendationConfigurationProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("recommendationType"u8); - writer.WriteStringValue(RecommendationType.ToString()); - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.ToString()); - writer.WriteEndObject(); - } - - internal static RecommendationConfigurationProperties DeserializeRecommendationConfigurationProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IotSecurityRecommendationType recommendationType = default; - Optional name = default; - RecommendationConfigStatus status = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("recommendationType"u8)) - { - recommendationType = new IotSecurityRecommendationType(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("status"u8)) - { - status = new RecommendationConfigStatus(property.Value.GetString()); - continue; - } - } - return new RecommendationConfigurationProperties(recommendationType, name.Value, status); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendationConfigurationProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendationConfigurationProperties.cs deleted file mode 100644 index a08c364f9ebe..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendationConfigurationProperties.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The type of IoT Security recommendation. - public partial class RecommendationConfigurationProperties - { - /// Initializes a new instance of RecommendationConfigurationProperties. - /// The type of IoT Security recommendation. - /// Recommendation status. When the recommendation status is disabled recommendations are not generated. - public RecommendationConfigurationProperties(IotSecurityRecommendationType recommendationType, RecommendationConfigStatus status) - { - RecommendationType = recommendationType; - Status = status; - } - - /// Initializes a new instance of RecommendationConfigurationProperties. - /// The type of IoT Security recommendation. - /// - /// Recommendation status. When the recommendation status is disabled recommendations are not generated. - internal RecommendationConfigurationProperties(IotSecurityRecommendationType recommendationType, string name, RecommendationConfigStatus status) - { - RecommendationType = recommendationType; - Name = name; - Status = status; - } - - /// The type of IoT Security recommendation. - public IotSecurityRecommendationType RecommendationType { get; set; } - /// Gets the name. - public string Name { get; } - /// Recommendation status. When the recommendation status is disabled recommendations are not generated. - public RecommendationConfigStatus Status { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendationStatus.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendationStatus.cs deleted file mode 100644 index fa51f3cef619..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendationStatus.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The initial recommendation status of the machine group or machine. - public readonly partial struct RecommendationStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public RecommendationStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string RecommendedValue = "Recommended"; - private const string NotRecommendedValue = "NotRecommended"; - private const string NotAvailableValue = "NotAvailable"; - private const string NoStatusValue = "NoStatus"; - - /// Recommended. - public static RecommendationStatus Recommended { get; } = new RecommendationStatus(RecommendedValue); - /// NotRecommended. - public static RecommendationStatus NotRecommended { get; } = new RecommendationStatus(NotRecommendedValue); - /// NotAvailable. - public static RecommendationStatus NotAvailable { get; } = new RecommendationStatus(NotAvailableValue); - /// NoStatus. - public static RecommendationStatus NoStatus { get; } = new RecommendationStatus(NoStatusValue); - /// Determines if two values are the same. - public static bool operator ==(RecommendationStatus left, RecommendationStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(RecommendationStatus left, RecommendationStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator RecommendationStatus(string value) => new RecommendationStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is RecommendationStatus other && Equals(other); - /// - public bool Equals(RecommendationStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendedSecurityRule.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendedSecurityRule.Serialization.cs deleted file mode 100644 index cf72cfd1dcc8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendedSecurityRule.Serialization.cs +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class RecommendedSecurityRule : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (Optional.IsDefined(Direction)) - { - writer.WritePropertyName("direction"u8); - writer.WriteStringValue(Direction.Value.ToString()); - } - if (Optional.IsDefined(DestinationPort)) - { - writer.WritePropertyName("destinationPort"u8); - writer.WriteNumberValue(DestinationPort.Value); - } - if (Optional.IsCollectionDefined(Protocols)) - { - writer.WritePropertyName("protocols"u8); - writer.WriteStartArray(); - foreach (var item in Protocols) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(IPAddresses)) - { - writer.WritePropertyName("ipAddresses"u8); - writer.WriteStartArray(); - foreach (var item in IPAddresses) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static RecommendedSecurityRule DeserializeRecommendedSecurityRule(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional name = default; - Optional direction = default; - Optional destinationPort = default; - Optional> protocols = default; - Optional> ipAddresses = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("direction"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - direction = new SecurityTrafficDirection(property.Value.GetString()); - continue; - } - if (property.NameEquals("destinationPort"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - destinationPort = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("protocols"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(new SecurityTransportProtocol(item.GetString())); - } - protocols = array; - continue; - } - if (property.NameEquals("ipAddresses"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - ipAddresses = array; - continue; - } - } - return new RecommendedSecurityRule(name.Value, Optional.ToNullable(direction), Optional.ToNullable(destinationPort), Optional.ToList(protocols), Optional.ToList(ipAddresses)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendedSecurityRule.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendedSecurityRule.cs deleted file mode 100644 index 4024401e80bd..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RecommendedSecurityRule.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// 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 RecommendedSecurityRule - { - /// Initializes a new instance of RecommendedSecurityRule. - public RecommendedSecurityRule() - { - Protocols = new ChangeTrackingList(); - IPAddresses = new ChangeTrackingList(); - } - - /// Initializes a new instance of RecommendedSecurityRule. - /// The name of the rule. - /// The rule's direction. - /// 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. - internal RecommendedSecurityRule(string name, SecurityTrafficDirection? direction, int? destinationPort, IList protocols, IList ipAddresses) - { - Name = name; - Direction = direction; - DestinationPort = destinationPort; - Protocols = protocols; - IPAddresses = ipAddresses; - } - - /// The name of the rule. - public string Name { get; set; } - /// The rule's direction. - public SecurityTrafficDirection? Direction { get; set; } - /// The rule's destination port. - public int? DestinationPort { get; set; } - /// The rule's transport protocols. - public IList Protocols { get; } - /// The remote IP addresses that should be able to communicate with the Azure resource on the rule's destination port and protocol. - public IList IPAddresses { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceAssessmentData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceAssessmentData.Serialization.cs deleted file mode 100644 index b2827058efe1..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceAssessmentData.Serialization.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class RegulatoryComplianceAssessmentData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(State)) - { - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.Value.ToString()); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static RegulatoryComplianceAssessmentData DeserializeRegulatoryComplianceAssessmentData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional description = default; - Optional assessmentType = default; - Optional assessmentDetailsLink = default; - Optional state = default; - Optional passedResources = default; - Optional failedResources = default; - Optional skippedResources = default; - Optional unsupportedResources = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("description"u8)) - { - description = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("assessmentType"u8)) - { - assessmentType = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("assessmentDetailsLink"u8)) - { - assessmentDetailsLink = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("state"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - state = new RegulatoryComplianceState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("passedResources"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - passedResources = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("failedResources"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - failedResources = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("skippedResources"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - skippedResources = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("unsupportedResources"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - unsupportedResources = property0.Value.GetInt32(); - continue; - } - } - continue; - } - } - return new RegulatoryComplianceAssessmentData(id, name, type, systemData.Value, description.Value, assessmentType.Value, assessmentDetailsLink.Value, Optional.ToNullable(state), Optional.ToNullable(passedResources), Optional.ToNullable(failedResources), Optional.ToNullable(skippedResources), Optional.ToNullable(unsupportedResources)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceAssessmentList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceAssessmentList.Serialization.cs deleted file mode 100644 index 8f99aa204db4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceAssessmentList.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class RegulatoryComplianceAssessmentList - { - internal static RegulatoryComplianceAssessmentList DeserializeRegulatoryComplianceAssessmentList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(RegulatoryComplianceAssessmentData.DeserializeRegulatoryComplianceAssessmentData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new RegulatoryComplianceAssessmentList(value, nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceAssessmentList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceAssessmentList.cs deleted file mode 100644 index 0b330342619c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceAssessmentList.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of regulatory compliance assessment response. - internal partial class RegulatoryComplianceAssessmentList - { - /// Initializes a new instance of RegulatoryComplianceAssessmentList. - /// - /// is null. - internal RegulatoryComplianceAssessmentList(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of RegulatoryComplianceAssessmentList. - /// - /// The URI to fetch the next page. - internal RegulatoryComplianceAssessmentList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Gets the value. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceControlData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceControlData.Serialization.cs deleted file mode 100644 index 3a9177d2268e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceControlData.Serialization.cs +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class RegulatoryComplianceControlData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(State)) - { - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.Value.ToString()); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static RegulatoryComplianceControlData DeserializeRegulatoryComplianceControlData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional description = default; - Optional state = default; - Optional passedAssessments = default; - Optional failedAssessments = default; - Optional skippedAssessments = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("description"u8)) - { - description = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("state"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - state = new RegulatoryComplianceState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("passedAssessments"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - passedAssessments = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("failedAssessments"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - failedAssessments = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("skippedAssessments"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - skippedAssessments = property0.Value.GetInt32(); - continue; - } - } - continue; - } - } - return new RegulatoryComplianceControlData(id, name, type, systemData.Value, description.Value, Optional.ToNullable(state), Optional.ToNullable(passedAssessments), Optional.ToNullable(failedAssessments), Optional.ToNullable(skippedAssessments)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceControlList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceControlList.Serialization.cs deleted file mode 100644 index 9ba3525f4dc0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceControlList.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class RegulatoryComplianceControlList - { - internal static RegulatoryComplianceControlList DeserializeRegulatoryComplianceControlList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(RegulatoryComplianceControlData.DeserializeRegulatoryComplianceControlData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new RegulatoryComplianceControlList(value, nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceControlList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceControlList.cs deleted file mode 100644 index d1c813171e46..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceControlList.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of regulatory compliance controls response. - internal partial class RegulatoryComplianceControlList - { - /// Initializes a new instance of RegulatoryComplianceControlList. - /// List of regulatory compliance controls. - /// is null. - internal RegulatoryComplianceControlList(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of RegulatoryComplianceControlList. - /// List of regulatory compliance controls. - /// The URI to fetch the next page. - internal RegulatoryComplianceControlList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of regulatory compliance controls. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceStandardData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceStandardData.Serialization.cs deleted file mode 100644 index 42270689551b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceStandardData.Serialization.cs +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class RegulatoryComplianceStandardData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(State)) - { - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.Value.ToString()); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static RegulatoryComplianceStandardData DeserializeRegulatoryComplianceStandardData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional state = default; - Optional passedControls = default; - Optional failedControls = default; - Optional skippedControls = default; - Optional unsupportedControls = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("state"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - state = new RegulatoryComplianceState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("passedControls"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - passedControls = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("failedControls"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - failedControls = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("skippedControls"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - skippedControls = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("unsupportedControls"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - unsupportedControls = property0.Value.GetInt32(); - continue; - } - } - continue; - } - } - return new RegulatoryComplianceStandardData(id, name, type, systemData.Value, Optional.ToNullable(state), Optional.ToNullable(passedControls), Optional.ToNullable(failedControls), Optional.ToNullable(skippedControls), Optional.ToNullable(unsupportedControls)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceStandardList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceStandardList.Serialization.cs deleted file mode 100644 index 51e59c7620cb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceStandardList.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class RegulatoryComplianceStandardList - { - internal static RegulatoryComplianceStandardList DeserializeRegulatoryComplianceStandardList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(RegulatoryComplianceStandardData.DeserializeRegulatoryComplianceStandardData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new RegulatoryComplianceStandardList(value, nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceStandardList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceStandardList.cs deleted file mode 100644 index 8babd87c8880..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceStandardList.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of regulatory compliance standards response. - internal partial class RegulatoryComplianceStandardList - { - /// Initializes a new instance of RegulatoryComplianceStandardList. - /// - /// is null. - internal RegulatoryComplianceStandardList(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of RegulatoryComplianceStandardList. - /// - /// The URI to fetch the next page. - internal RegulatoryComplianceStandardList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Gets the value. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceState.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceState.cs deleted file mode 100644 index 55ca46506654..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RegulatoryComplianceState.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Aggregative state based on the standard's supported controls states. - public readonly partial struct RegulatoryComplianceState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public RegulatoryComplianceState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PassedValue = "Passed"; - private const string FailedValue = "Failed"; - private const string SkippedValue = "Skipped"; - private const string UnsupportedValue = "Unsupported"; - - /// All supported regulatory compliance controls in the given standard have a passed state. - public static RegulatoryComplianceState Passed { get; } = new RegulatoryComplianceState(PassedValue); - /// At least one supported regulatory compliance control in the given standard has a state of failed. - public static RegulatoryComplianceState Failed { get; } = new RegulatoryComplianceState(FailedValue); - /// All supported regulatory compliance controls in the given standard have a state of skipped. - public static RegulatoryComplianceState Skipped { get; } = new RegulatoryComplianceState(SkippedValue); - /// No supported regulatory compliance data for the given standard. - public static RegulatoryComplianceState Unsupported { get; } = new RegulatoryComplianceState(UnsupportedValue); - /// Determines if two values are the same. - public static bool operator ==(RegulatoryComplianceState left, RegulatoryComplianceState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(RegulatoryComplianceState left, RegulatoryComplianceState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator RegulatoryComplianceState(string value) => new RegulatoryComplianceState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is RegulatoryComplianceState other && Equals(other); - /// - public bool Equals(RegulatoryComplianceState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RemediationEta.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RemediationEta.Serialization.cs deleted file mode 100644 index f42170d6b22b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RemediationEta.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class RemediationEta : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("eta"u8); - writer.WriteStringValue(Eta, "O"); - writer.WritePropertyName("justification"u8); - writer.WriteStringValue(Justification); - writer.WriteEndObject(); - } - - internal static RemediationEta DeserializeRemediationEta(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - DateTimeOffset eta = default; - string justification = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("eta"u8)) - { - eta = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("justification"u8)) - { - justification = property.Value.GetString(); - continue; - } - } - return new RemediationEta(eta, justification); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RemediationEta.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RemediationEta.cs deleted file mode 100644 index dd0aa732a718..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RemediationEta.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The ETA (estimated time of arrival) for remediation. - public partial class RemediationEta - { - /// Initializes a new instance of RemediationEta. - /// ETA for remediation. - /// Justification for change of Eta. - /// is null. - public RemediationEta(DateTimeOffset eta, string justification) - { - Argument.AssertNotNull(justification, nameof(justification)); - - Eta = eta; - Justification = justification; - } - - /// ETA for remediation. - public DateTimeOffset Eta { get; set; } - /// Justification for change of Eta. - public string Justification { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ReportedSeverity.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ReportedSeverity.cs deleted file mode 100644 index 74d46bda487f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ReportedSeverity.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Assessed alert severity. - public readonly partial struct ReportedSeverity : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ReportedSeverity(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InformationalValue = "Informational"; - private const string LowValue = "Low"; - private const string MediumValue = "Medium"; - private const string HighValue = "High"; - - /// Informational. - public static ReportedSeverity Informational { get; } = new ReportedSeverity(InformationalValue); - /// Low. - public static ReportedSeverity Low { get; } = new ReportedSeverity(LowValue); - /// Medium. - public static ReportedSeverity Medium { get; } = new ReportedSeverity(MediumValue); - /// High. - public static ReportedSeverity High { get; } = new ReportedSeverity(HighValue); - /// Determines if two values are the same. - public static bool operator ==(ReportedSeverity left, ReportedSeverity right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ReportedSeverity left, ReportedSeverity right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ReportedSeverity(string value) => new ReportedSeverity(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ReportedSeverity other && Equals(other); - /// - public bool Equals(ReportedSeverity other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ResourceIdentifierType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ResourceIdentifierType.cs deleted file mode 100644 index 00f6aa79f251..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ResourceIdentifierType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// There can be multiple identifiers of different type per alert, this field specify the identifier type. - internal readonly partial struct ResourceIdentifierType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ResourceIdentifierType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureResourceValue = "AzureResource"; - private const string LogAnalyticsValue = "LogAnalytics"; - - /// AzureResource. - public static ResourceIdentifierType AzureResource { get; } = new ResourceIdentifierType(AzureResourceValue); - /// LogAnalytics. - public static ResourceIdentifierType LogAnalytics { get; } = new ResourceIdentifierType(LogAnalyticsValue); - /// Determines if two values are the same. - public static bool operator ==(ResourceIdentifierType left, ResourceIdentifierType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ResourceIdentifierType left, ResourceIdentifierType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ResourceIdentifierType(string value) => new ResourceIdentifierType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ResourceIdentifierType other && Equals(other); - /// - public bool Equals(ResourceIdentifierType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RuleResultsProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RuleResultsProperties.Serialization.cs deleted file mode 100644 index ba2727bff607..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RuleResultsProperties.Serialization.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class RuleResultsProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Results)) - { - writer.WritePropertyName("results"u8); - writer.WriteStartArray(); - foreach (var item in Results) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStartArray(); - foreach (var item0 in item) - { - writer.WriteStringValue(item0); - } - writer.WriteEndArray(); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static RuleResultsProperties DeserializeRuleResultsProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional>> results = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("results"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List> array = new List>(); - foreach (var item in property.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - List array0 = new List(); - foreach (var item0 in item.EnumerateArray()) - { - array0.Add(item0.GetString()); - } - array.Add(array0); - } - } - results = array; - continue; - } - } - return new RuleResultsProperties(Optional.ToList(results)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RuleResultsProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RuleResultsProperties.cs deleted file mode 100644 index ca90dd733e8a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RuleResultsProperties.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Rule results properties. - internal partial class RuleResultsProperties - { - /// Initializes a new instance of RuleResultsProperties. - public RuleResultsProperties() - { - Results = new ChangeTrackingList>(); - } - - /// Initializes a new instance of RuleResultsProperties. - /// Expected results in the baseline. - internal RuleResultsProperties(IList> results) - { - Results = results; - } - - /// Expected results in the baseline. - public IList> Results { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RuleSeverity.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RuleSeverity.cs deleted file mode 100644 index f05bcf8e75e3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RuleSeverity.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The rule severity. - public readonly partial struct RuleSeverity : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public RuleSeverity(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string HighValue = "High"; - private const string MediumValue = "Medium"; - private const string LowValue = "Low"; - private const string InformationalValue = "Informational"; - private const string ObsoleteValue = "Obsolete"; - - /// High. - public static RuleSeverity High { get; } = new RuleSeverity(HighValue); - /// Medium. - public static RuleSeverity Medium { get; } = new RuleSeverity(MediumValue); - /// Low. - public static RuleSeverity Low { get; } = new RuleSeverity(LowValue); - /// Informational. - public static RuleSeverity Informational { get; } = new RuleSeverity(InformationalValue); - /// Obsolete. - public static RuleSeverity Obsolete { get; } = new RuleSeverity(ObsoleteValue); - /// Determines if two values are the same. - public static bool operator ==(RuleSeverity left, RuleSeverity right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(RuleSeverity left, RuleSeverity right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator RuleSeverity(string value) => new RuleSeverity(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is RuleSeverity other && Equals(other); - /// - public bool Equals(RuleSeverity other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RulesResults.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RulesResults.Serialization.cs deleted file mode 100644 index c1e5f80d36ed..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RulesResults.Serialization.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class RulesResults - { - internal static RulesResults DeserializeRulesResults(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SqlVulnerabilityAssessmentBaselineRuleData.DeserializeSqlVulnerabilityAssessmentBaselineRuleData(item)); - } - value = array; - continue; - } - } - return new RulesResults(Optional.ToList(value)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RulesResults.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RulesResults.cs deleted file mode 100644 index 315a662a88a7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RulesResults.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A list of rules results. - internal partial class RulesResults - { - /// Initializes a new instance of RulesResults. - internal RulesResults() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of RulesResults. - /// List of rule results. - internal RulesResults(IReadOnlyList value) - { - Value = value; - } - - /// List of rule results. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RulesResultsContent.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RulesResultsContent.Serialization.cs deleted file mode 100644 index 923dbd0432bf..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RulesResultsContent.Serialization.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class RulesResultsContent : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(LatestScan)) - { - writer.WritePropertyName("latestScan"u8); - writer.WriteBooleanValue(LatestScan.Value); - } - if (Optional.IsCollectionDefined(Results)) - { - writer.WritePropertyName("results"u8); - writer.WriteStartObject(); - foreach (var item in Results) - { - writer.WritePropertyName(item.Key); - if (item.Value == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStartArray(); - foreach (var item0 in item.Value) - { - if (item0 == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStartArray(); - foreach (var item1 in item0) - { - writer.WriteStringValue(item1); - } - writer.WriteEndArray(); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RulesResultsContent.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RulesResultsContent.cs deleted file mode 100644 index a5c762e0d4f7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/RulesResultsContent.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Rules results input. - public partial class RulesResultsContent - { - /// Initializes a new instance of RulesResultsContent. - public RulesResultsContent() - { - Results = new ChangeTrackingDictionary>>(); - } - - /// Take results from latest scan. - public bool? LatestScan { get; set; } - /// - /// Expected results to be inserted into the baseline. - /// Leave this field empty it LatestScan == true. - /// - public IDictionary>> Results { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ScanResults.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ScanResults.Serialization.cs deleted file mode 100644 index 69fe877bc59f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ScanResults.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class ScanResults - { - internal static ScanResults DeserializeScanResults(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SqlVulnerabilityAssessmentScanResult.DeserializeSqlVulnerabilityAssessmentScanResult(item)); - } - value = array; - continue; - } - } - return new ScanResults(Optional.ToList(value)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ScanResults.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ScanResults.cs deleted file mode 100644 index 25b476182a82..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ScanResults.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A list of vulnerability assessment scan results. - internal partial class ScanResults - { - /// Initializes a new instance of ScanResults. - internal ScanResults() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of ScanResults. - /// List of vulnerability assessment scan results. - internal ScanResults(IReadOnlyList value) - { - Value = value; - } - - /// List of vulnerability assessment scan results. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/Scans.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/Scans.Serialization.cs deleted file mode 100644 index edcc8753ff6d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/Scans.Serialization.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class Scans - { - internal static Scans DeserializeScans(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SqlVulnerabilityAssessmentScanData.DeserializeSqlVulnerabilityAssessmentScanData(item)); - } - value = array; - continue; - } - } - return new Scans(Optional.ToList(value)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/Scans.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/Scans.cs deleted file mode 100644 index 9e03fd3f0ed7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/Scans.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A list of vulnerability assessment scan records. - internal partial class Scans - { - /// Initializes a new instance of Scans. - internal Scans() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of Scans. - /// List of vulnerability assessment scan records. - internal Scans(IReadOnlyList value) - { - Value = value; - } - - /// List of vulnerability assessment scan records. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionItem.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionItem.Serialization.cs deleted file mode 100644 index 34732a0e5f13..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionItem.Serialization.cs +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecureScoreControlDefinitionItem : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecureScoreControlDefinitionItem DeserializeSecureScoreControlDefinitionItem(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional displayName = default; - Optional description = default; - Optional maxScore = default; - Optional source = default; - Optional> assessmentDefinitions = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("displayName"u8)) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("description"u8)) - { - description = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("maxScore"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - maxScore = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("source"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - source = SecureScoreControlDefinitionSource.DeserializeSecureScoreControlDefinitionSource(property0.Value); - continue; - } - if (property0.NameEquals("assessmentDefinitions"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - assessmentDefinitions = array; - continue; - } - } - continue; - } - } - return new SecureScoreControlDefinitionItem(id, name, type, systemData.Value, displayName.Value, description.Value, Optional.ToNullable(maxScore), source.Value, Optional.ToList(assessmentDefinitions)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionItem.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionItem.cs deleted file mode 100644 index ca7cb356f38a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionItem.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.Resources.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Information about the security control. - public partial class SecureScoreControlDefinitionItem : ResourceData - { - /// Initializes a new instance of SecureScoreControlDefinitionItem. - public SecureScoreControlDefinitionItem() - { - AssessmentDefinitions = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecureScoreControlDefinitionItem. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// User friendly display name of the control. - /// User friendly description of the control. - /// Maximum control score (0..10). - /// Source object from which the control was created. - /// Array of assessments metadata IDs that are included in this security control. - internal SecureScoreControlDefinitionItem(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string displayName, string description, int? maxScore, SecureScoreControlDefinitionSource source, IReadOnlyList assessmentDefinitions) : base(id, name, resourceType, systemData) - { - DisplayName = displayName; - Description = description; - MaxScore = maxScore; - Source = source; - AssessmentDefinitions = assessmentDefinitions; - } - - /// User friendly display name of the control. - public string DisplayName { get; } - /// User friendly description of the control. - public string Description { get; } - /// Maximum control score (0..10). - public int? MaxScore { get; } - /// Source object from which the control was created. - internal SecureScoreControlDefinitionSource Source { get; } - /// The type of security control (for example, BuiltIn). - public SecurityControlType? SourceType - { - get => Source?.SourceType; - } - - /// Array of assessments metadata IDs that are included in this security control. - public IReadOnlyList AssessmentDefinitions { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionList.Serialization.cs deleted file mode 100644 index 6b86147b6f71..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionList.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class SecureScoreControlDefinitionList - { - internal static SecureScoreControlDefinitionList DeserializeSecureScoreControlDefinitionList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecureScoreControlDefinitionItem.DeserializeSecureScoreControlDefinitionItem(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SecureScoreControlDefinitionList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionList.cs deleted file mode 100644 index fc3e85567184..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionList.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of security controls definition. - internal partial class SecureScoreControlDefinitionList - { - /// Initializes a new instance of SecureScoreControlDefinitionList. - internal SecureScoreControlDefinitionList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecureScoreControlDefinitionList. - /// Collection of security controls definition in this page. - /// The URI to fetch the next page. - internal SecureScoreControlDefinitionList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of security controls definition in this page. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionSource.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionSource.Serialization.cs deleted file mode 100644 index 88cf15908b9c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionSource.Serialization.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class SecureScoreControlDefinitionSource - { - internal static SecureScoreControlDefinitionSource DeserializeSecureScoreControlDefinitionSource(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional sourceType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sourceType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - sourceType = new SecurityControlType(property.Value.GetString()); - continue; - } - } - return new SecureScoreControlDefinitionSource(Optional.ToNullable(sourceType)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionSource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionSource.cs deleted file mode 100644 index 8e376ee94734..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDefinitionSource.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The type of the security control (For example, BuiltIn). - internal partial class SecureScoreControlDefinitionSource - { - /// Initializes a new instance of SecureScoreControlDefinitionSource. - internal SecureScoreControlDefinitionSource() - { - } - - /// Initializes a new instance of SecureScoreControlDefinitionSource. - /// The type of security control (for example, BuiltIn). - internal SecureScoreControlDefinitionSource(SecurityControlType? sourceType) - { - SourceType = sourceType; - } - - /// The type of security control (for example, BuiltIn). - public SecurityControlType? SourceType { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDetails.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDetails.Serialization.cs deleted file mode 100644 index 32a1c50d4554..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDetails.Serialization.cs +++ /dev/null @@ -1,192 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecureScoreControlDetails : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Definition)) - { - writer.WritePropertyName("definition"u8); - writer.WriteObjectValue(Definition); - } - writer.WritePropertyName("score"u8); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecureScoreControlDetails DeserializeSecureScoreControlDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional displayName = default; - Optional healthyResourceCount = default; - Optional unhealthyResourceCount = default; - Optional notApplicableResourceCount = default; - Optional weight = default; - Optional definition = default; - Optional max = default; - Optional current = default; - Optional percentage = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("displayName"u8)) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("healthyResourceCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - healthyResourceCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("unhealthyResourceCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - unhealthyResourceCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("notApplicableResourceCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - notApplicableResourceCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("weight"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - weight = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("definition"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - definition = SecureScoreControlDefinitionItem.DeserializeSecureScoreControlDefinitionItem(property0.Value); - continue; - } - if (property0.NameEquals("score"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property1 in property0.Value.EnumerateObject()) - { - if (property1.NameEquals("max"u8)) - { - if (property1.Value.ValueKind == JsonValueKind.Null) - { - property1.ThrowNonNullablePropertyIsNull(); - continue; - } - max = property1.Value.GetInt32(); - continue; - } - if (property1.NameEquals("current"u8)) - { - if (property1.Value.ValueKind == JsonValueKind.Null) - { - property1.ThrowNonNullablePropertyIsNull(); - continue; - } - current = property1.Value.GetDouble(); - continue; - } - if (property1.NameEquals("percentage"u8)) - { - if (property1.Value.ValueKind == JsonValueKind.Null) - { - property1.ThrowNonNullablePropertyIsNull(); - continue; - } - percentage = property1.Value.GetDouble(); - continue; - } - } - continue; - } - } - continue; - } - } - return new SecureScoreControlDetails(id, name, type, systemData.Value, displayName.Value, Optional.ToNullable(healthyResourceCount), Optional.ToNullable(unhealthyResourceCount), Optional.ToNullable(notApplicableResourceCount), Optional.ToNullable(weight), definition.Value, Optional.ToNullable(max), Optional.ToNullable(current), Optional.ToNullable(percentage)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDetails.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDetails.cs deleted file mode 100644 index 372bd35dedf0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlDetails.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Details of the security control, its score, and the health status of the relevant resources. - public partial class SecureScoreControlDetails : ResourceData - { - /// Initializes a new instance of SecureScoreControlDetails. - public SecureScoreControlDetails() - { - } - - /// Initializes a new instance of SecureScoreControlDetails. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// User friendly display name of the control. - /// Number of healthy resources in the control. - /// Number of unhealthy resources in the control. - /// Number of not applicable resources in the control. - /// The relative weight for this specific control in each of your subscriptions. Used when calculating an aggregated score for this control across all of your subscriptions. - /// Information about the security control. - /// Maximum score available. - /// Current score. - /// Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point. - internal SecureScoreControlDetails(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string displayName, int? healthyResourceCount, int? unhealthyResourceCount, int? notApplicableResourceCount, long? weight, SecureScoreControlDefinitionItem definition, int? max, double? current, double? percentage) : base(id, name, resourceType, systemData) - { - DisplayName = displayName; - HealthyResourceCount = healthyResourceCount; - UnhealthyResourceCount = unhealthyResourceCount; - NotApplicableResourceCount = notApplicableResourceCount; - Weight = weight; - Definition = definition; - Max = max; - Current = current; - Percentage = percentage; - } - - /// User friendly display name of the control. - public string DisplayName { get; } - /// Number of healthy resources in the control. - public int? HealthyResourceCount { get; } - /// Number of unhealthy resources in the control. - public int? UnhealthyResourceCount { get; } - /// Number of not applicable resources in the control. - public int? NotApplicableResourceCount { get; } - /// The relative weight for this specific control in each of your subscriptions. Used when calculating an aggregated score for this control across all of your subscriptions. - public long? Weight { get; } - /// Information about the security control. - public SecureScoreControlDefinitionItem Definition { get; set; } - /// Maximum score available. - public int? Max { get; } - /// Current score. - public double? Current { get; } - /// Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point. - public double? Percentage { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlList.Serialization.cs deleted file mode 100644 index 8f83d2c9de85..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlList.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class SecureScoreControlList - { - internal static SecureScoreControlList DeserializeSecureScoreControlList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecureScoreControlDetails.DeserializeSecureScoreControlDetails(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SecureScoreControlList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlList.cs deleted file mode 100644 index 1c3d39c2a064..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreControlList.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of security controls. - internal partial class SecureScoreControlList - { - /// Initializes a new instance of SecureScoreControlList. - internal SecureScoreControlList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecureScoreControlList. - /// Collection of security controls in this page. - /// The URI to fetch the next page. - internal SecureScoreControlList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of security controls in this page. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreData.Serialization.cs deleted file mode 100644 index 841039cc3db5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoreData.Serialization.cs +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SecureScoreData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("score"u8); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecureScoreData DeserializeSecureScoreData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional displayName = default; - Optional weight = default; - Optional max = default; - Optional current = default; - Optional percentage = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("displayName"u8)) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("weight"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - weight = property0.Value.GetInt64(); - continue; - } - if (property0.NameEquals("score"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property1 in property0.Value.EnumerateObject()) - { - if (property1.NameEquals("max"u8)) - { - if (property1.Value.ValueKind == JsonValueKind.Null) - { - property1.ThrowNonNullablePropertyIsNull(); - continue; - } - max = property1.Value.GetInt32(); - continue; - } - if (property1.NameEquals("current"u8)) - { - if (property1.Value.ValueKind == JsonValueKind.Null) - { - property1.ThrowNonNullablePropertyIsNull(); - continue; - } - current = property1.Value.GetDouble(); - continue; - } - if (property1.NameEquals("percentage"u8)) - { - if (property1.Value.ValueKind == JsonValueKind.Null) - { - property1.ThrowNonNullablePropertyIsNull(); - continue; - } - percentage = property1.Value.GetDouble(); - continue; - } - } - continue; - } - } - continue; - } - } - return new SecureScoreData(id, name, type, systemData.Value, displayName.Value, Optional.ToNullable(weight), Optional.ToNullable(max), Optional.ToNullable(current), Optional.ToNullable(percentage)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoresList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoresList.Serialization.cs deleted file mode 100644 index 7bd10c32a21e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoresList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class SecureScoresList - { - internal static SecureScoresList DeserializeSecureScoresList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecureScoreData.DeserializeSecureScoreData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SecureScoresList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoresList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoresList.cs deleted file mode 100644 index ab400502c966..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecureScoresList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of secure scores. - internal partial class SecureScoresList - { - /// Initializes a new instance of SecureScoresList. - internal SecureScoresList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecureScoresList. - /// Collection of secure scores in this page. - /// The URI to fetch the next page. - internal SecureScoresList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of secure scores in this page. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertData.Serialization.cs deleted file mode 100644 index 2b990dc12e78..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertData.Serialization.cs +++ /dev/null @@ -1,391 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SecurityAlertData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(ExtendedProperties)) - { - writer.WritePropertyName("extendedProperties"u8); - writer.WriteStartObject(); - foreach (var item in ExtendedProperties) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(SupportingEvidence)) - { - writer.WritePropertyName("supportingEvidence"u8); - writer.WriteObjectValue(SupportingEvidence); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecurityAlertData DeserializeSecurityAlertData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional version = default; - Optional alertType = default; - Optional systemAlertId = default; - Optional productComponentName = default; - Optional alertDisplayName = default; - Optional description = default; - Optional severity = default; - Optional intent = default; - Optional startTimeUtc = default; - Optional endTimeUtc = default; - Optional> resourceIdentifiers = default; - Optional> remediationSteps = default; - Optional vendorName = default; - Optional status = default; - Optional>> extendedLinks = default; - Optional alertUri = default; - Optional timeGeneratedUtc = default; - Optional productName = default; - Optional processingEndTimeUtc = default; - Optional> entities = default; - Optional isIncident = default; - Optional correlationKey = default; - Optional> extendedProperties = default; - Optional compromisedEntity = default; - Optional> techniques = default; - Optional> subTechniques = default; - Optional supportingEvidence = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("version"u8)) - { - version = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("alertType"u8)) - { - alertType = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("systemAlertId"u8)) - { - systemAlertId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("productComponentName"u8)) - { - productComponentName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("alertDisplayName"u8)) - { - alertDisplayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("description"u8)) - { - description = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("severity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - severity = new SecurityAlertSeverity(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("intent"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - intent = new KillChainIntent(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("startTimeUtc"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - startTimeUtc = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("endTimeUtc"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - endTimeUtc = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("resourceIdentifiers"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(SecurityAlertResourceIdentifier.DeserializeSecurityAlertResourceIdentifier(item)); - } - resourceIdentifiers = array; - continue; - } - if (property0.NameEquals("remediationSteps"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - remediationSteps = array; - continue; - } - if (property0.NameEquals("vendorName"u8)) - { - vendorName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("status"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = new SecurityAlertStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("extendedLinks"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List> array = new List>(); - foreach (var item in property0.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - Dictionary dictionary = new Dictionary(); - foreach (var property1 in item.EnumerateObject()) - { - dictionary.Add(property1.Name, property1.Value.GetString()); - } - array.Add(dictionary); - } - } - extendedLinks = array; - continue; - } - if (property0.NameEquals("alertUri"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - alertUri = null; - continue; - } - alertUri = new Uri(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("timeGeneratedUtc"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - timeGeneratedUtc = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("productName"u8)) - { - productName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("processingEndTimeUtc"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - processingEndTimeUtc = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("entities"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(SecurityAlertEntity.DeserializeSecurityAlertEntity(item)); - } - entities = array; - continue; - } - if (property0.NameEquals("isIncident"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isIncident = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("correlationKey"u8)) - { - correlationKey = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("extendedProperties"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, property1.Value.GetString()); - } - extendedProperties = dictionary; - continue; - } - if (property0.NameEquals("compromisedEntity"u8)) - { - compromisedEntity = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("techniques"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - techniques = array; - continue; - } - if (property0.NameEquals("subTechniques"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - subTechniques = array; - continue; - } - if (property0.NameEquals("supportingEvidence"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - supportingEvidence = SecurityAlertSupportingEvidence.DeserializeSecurityAlertSupportingEvidence(property0.Value); - continue; - } - } - continue; - } - } - return new SecurityAlertData(id, name, type, systemData.Value, version.Value, alertType.Value, systemAlertId.Value, productComponentName.Value, alertDisplayName.Value, description.Value, Optional.ToNullable(severity), Optional.ToNullable(intent), Optional.ToNullable(startTimeUtc), Optional.ToNullable(endTimeUtc), Optional.ToList(resourceIdentifiers), Optional.ToList(remediationSteps), vendorName.Value, Optional.ToNullable(status), Optional.ToList(extendedLinks), alertUri.Value, Optional.ToNullable(timeGeneratedUtc), productName.Value, Optional.ToNullable(processingEndTimeUtc), Optional.ToList(entities), Optional.ToNullable(isIncident), correlationKey.Value, Optional.ToDictionary(extendedProperties), compromisedEntity.Value, Optional.ToList(techniques), Optional.ToList(subTechniques), supportingEvidence.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertEntity.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertEntity.Serialization.cs deleted file mode 100644 index 8ed05d7935a9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertEntity.Serialization.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAlertEntity - { - internal static SecurityAlertEntity DeserializeSecurityAlertEntity(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional type = default; - IReadOnlyDictionary additionalProperties = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - additionalProperties = additionalPropertiesDictionary; - return new SecurityAlertEntity(type.Value, additionalProperties); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertEntity.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertEntity.cs deleted file mode 100644 index 83aadc35763d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertEntity.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Changing set of properties depending on the entity type. - public partial class SecurityAlertEntity - { - /// Initializes a new instance of SecurityAlertEntity. - internal SecurityAlertEntity() - { - AdditionalProperties = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of SecurityAlertEntity. - /// Type of entity. - /// Additional Properties. - internal SecurityAlertEntity(string alertEntityType, IReadOnlyDictionary additionalProperties) - { - AlertEntityType = alertEntityType; - AdditionalProperties = additionalProperties; - } - - /// Type of entity. - public string AlertEntityType { get; } - /// - /// Additional Properties - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formated json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public IReadOnlyDictionary AdditionalProperties { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertMinimalSeverity.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertMinimalSeverity.cs deleted file mode 100644 index df723e986e4b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertMinimalSeverity.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Defines the minimal alert severity which will be sent as email notifications. - public readonly partial struct SecurityAlertMinimalSeverity : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityAlertMinimalSeverity(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string HighValue = "High"; - private const string MediumValue = "Medium"; - private const string LowValue = "Low"; - - /// Get notifications on new alerts with High severity. - public static SecurityAlertMinimalSeverity High { get; } = new SecurityAlertMinimalSeverity(HighValue); - /// Get notifications on new alerts with medium or high severity. - public static SecurityAlertMinimalSeverity Medium { get; } = new SecurityAlertMinimalSeverity(MediumValue); - /// Don't get notifications on new alerts with low, medium or high severity. - public static SecurityAlertMinimalSeverity Low { get; } = new SecurityAlertMinimalSeverity(LowValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityAlertMinimalSeverity left, SecurityAlertMinimalSeverity right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityAlertMinimalSeverity left, SecurityAlertMinimalSeverity right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityAlertMinimalSeverity(string value) => new SecurityAlertMinimalSeverity(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityAlertMinimalSeverity other && Equals(other); - /// - public bool Equals(SecurityAlertMinimalSeverity other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertNotificationByRoleState.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertNotificationByRoleState.cs deleted file mode 100644 index 55271e6a04eb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertNotificationByRoleState.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the subscription. - public readonly partial struct SecurityAlertNotificationByRoleState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityAlertNotificationByRoleState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string OnValue = "On"; - private const string OffValue = "Off"; - - /// Send notification on new alerts to the subscription's admins. - public static SecurityAlertNotificationByRoleState On { get; } = new SecurityAlertNotificationByRoleState(OnValue); - /// Don't send notification on new alerts to the subscription's admins. - public static SecurityAlertNotificationByRoleState Off { get; } = new SecurityAlertNotificationByRoleState(OffValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityAlertNotificationByRoleState left, SecurityAlertNotificationByRoleState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityAlertNotificationByRoleState left, SecurityAlertNotificationByRoleState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityAlertNotificationByRoleState(string value) => new SecurityAlertNotificationByRoleState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityAlertNotificationByRoleState other && Equals(other); - /// - public bool Equals(SecurityAlertNotificationByRoleState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertNotificationState.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertNotificationState.cs deleted file mode 100644 index 418521b034a1..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertNotificationState.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Defines if email notifications will be sent about new security alerts. - public readonly partial struct SecurityAlertNotificationState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityAlertNotificationState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string OnValue = "On"; - private const string OffValue = "Off"; - - /// Get notifications on new alerts. - public static SecurityAlertNotificationState On { get; } = new SecurityAlertNotificationState(OnValue); - /// Don't get notifications on new alerts. - public static SecurityAlertNotificationState Off { get; } = new SecurityAlertNotificationState(OffValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityAlertNotificationState left, SecurityAlertNotificationState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityAlertNotificationState left, SecurityAlertNotificationState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityAlertNotificationState(string value) => new SecurityAlertNotificationState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityAlertNotificationState other && Equals(other); - /// - public bool Equals(SecurityAlertNotificationState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertReceivingRole.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertReceivingRole.cs deleted file mode 100644 index 5bc88e529ff0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertReceivingRole.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A possible role to configure sending security notification alerts to. - public readonly partial struct SecurityAlertReceivingRole : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityAlertReceivingRole(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AccountAdminValue = "AccountAdmin"; - private const string ServiceAdminValue = "ServiceAdmin"; - private const string OwnerValue = "Owner"; - private const string ContributorValue = "Contributor"; - - /// If enabled, send notification on new alerts to the account admins. - public static SecurityAlertReceivingRole AccountAdmin { get; } = new SecurityAlertReceivingRole(AccountAdminValue); - /// If enabled, send notification on new alerts to the service admins. - public static SecurityAlertReceivingRole ServiceAdmin { get; } = new SecurityAlertReceivingRole(ServiceAdminValue); - /// If enabled, send notification on new alerts to the subscription owners. - public static SecurityAlertReceivingRole Owner { get; } = new SecurityAlertReceivingRole(OwnerValue); - /// If enabled, send notification on new alerts to the subscription contributors. - public static SecurityAlertReceivingRole Contributor { get; } = new SecurityAlertReceivingRole(ContributorValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityAlertReceivingRole left, SecurityAlertReceivingRole right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityAlertReceivingRole left, SecurityAlertReceivingRole right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityAlertReceivingRole(string value) => new SecurityAlertReceivingRole(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityAlertReceivingRole other && Equals(other); - /// - public bool Equals(SecurityAlertReceivingRole other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertResourceIdentifier.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertResourceIdentifier.Serialization.cs deleted file mode 100644 index b5900fa140a1..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertResourceIdentifier.Serialization.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAlertResourceIdentifier - { - internal static SecurityAlertResourceIdentifier DeserializeSecurityAlertResourceIdentifier(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("type", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "AzureResource": return AzureResourceIdentifier.DeserializeAzureResourceIdentifier(element); - case "LogAnalytics": return LogAnalyticsIdentifier.DeserializeLogAnalyticsIdentifier(element); - } - } - return UnknownAlertResourceIdentifier.DeserializeUnknownAlertResourceIdentifier(element); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertResourceIdentifier.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertResourceIdentifier.cs deleted file mode 100644 index 04a8a572a43f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertResourceIdentifier.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// - /// A resource identifier for an alert which can be used to direct the alert to the right product exposure group (tenant, workspace, subscription etc.). - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public abstract partial class SecurityAlertResourceIdentifier - { - /// Initializes a new instance of SecurityAlertResourceIdentifier. - protected SecurityAlertResourceIdentifier() - { - } - - /// Initializes a new instance of SecurityAlertResourceIdentifier. - /// There can be multiple identifiers of different type per alert, this field specify the identifier type. - internal SecurityAlertResourceIdentifier(ResourceIdentifierType resourceIdentifierType) - { - ResourceIdentifierType = resourceIdentifierType; - } - - /// There can be multiple identifiers of different type per alert, this field specify the identifier type. - internal ResourceIdentifierType ResourceIdentifierType { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSeverity.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSeverity.cs deleted file mode 100644 index 0305a65cf452..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSeverity.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The risk level of the threat that was detected. Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. - public readonly partial struct SecurityAlertSeverity : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityAlertSeverity(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InformationalValue = "Informational"; - private const string LowValue = "Low"; - private const string MediumValue = "Medium"; - private const string HighValue = "High"; - - /// Informational. - public static SecurityAlertSeverity Informational { get; } = new SecurityAlertSeverity(InformationalValue); - /// Low. - public static SecurityAlertSeverity Low { get; } = new SecurityAlertSeverity(LowValue); - /// Medium. - public static SecurityAlertSeverity Medium { get; } = new SecurityAlertSeverity(MediumValue); - /// High. - public static SecurityAlertSeverity High { get; } = new SecurityAlertSeverity(HighValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityAlertSeverity left, SecurityAlertSeverity right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityAlertSeverity left, SecurityAlertSeverity right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityAlertSeverity(string value) => new SecurityAlertSeverity(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityAlertSeverity other && Equals(other); - /// - public bool Equals(SecurityAlertSeverity other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorBundleType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorBundleType.cs deleted file mode 100644 index 2a013dff858a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorBundleType.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Alert Simulator supported bundles. - public readonly partial struct SecurityAlertSimulatorBundleType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityAlertSimulatorBundleType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AppServicesValue = "AppServices"; - private const string DnsValue = "DNS"; - private const string KeyVaultsValue = "KeyVaults"; - private const string KubernetesServiceValue = "KubernetesService"; - private const string ResourceManagerValue = "ResourceManager"; - private const string SqlServersValue = "SqlServers"; - private const string StorageAccountsValue = "StorageAccounts"; - private const string VirtualMachinesValue = "VirtualMachines"; - private const string CosmosDbsValue = "CosmosDbs"; - - /// AppServices. - public static SecurityAlertSimulatorBundleType AppServices { get; } = new SecurityAlertSimulatorBundleType(AppServicesValue); - /// DNS. - public static SecurityAlertSimulatorBundleType Dns { get; } = new SecurityAlertSimulatorBundleType(DnsValue); - /// KeyVaults. - public static SecurityAlertSimulatorBundleType KeyVaults { get; } = new SecurityAlertSimulatorBundleType(KeyVaultsValue); - /// KubernetesService. - public static SecurityAlertSimulatorBundleType KubernetesService { get; } = new SecurityAlertSimulatorBundleType(KubernetesServiceValue); - /// ResourceManager. - public static SecurityAlertSimulatorBundleType ResourceManager { get; } = new SecurityAlertSimulatorBundleType(ResourceManagerValue); - /// SqlServers. - public static SecurityAlertSimulatorBundleType SqlServers { get; } = new SecurityAlertSimulatorBundleType(SqlServersValue); - /// StorageAccounts. - public static SecurityAlertSimulatorBundleType StorageAccounts { get; } = new SecurityAlertSimulatorBundleType(StorageAccountsValue); - /// VirtualMachines. - public static SecurityAlertSimulatorBundleType VirtualMachines { get; } = new SecurityAlertSimulatorBundleType(VirtualMachinesValue); - /// CosmosDbs. - public static SecurityAlertSimulatorBundleType CosmosDbs { get; } = new SecurityAlertSimulatorBundleType(CosmosDbsValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityAlertSimulatorBundleType left, SecurityAlertSimulatorBundleType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityAlertSimulatorBundleType left, SecurityAlertSimulatorBundleType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityAlertSimulatorBundleType(string value) => new SecurityAlertSimulatorBundleType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityAlertSimulatorBundleType other && Equals(other); - /// - public bool Equals(SecurityAlertSimulatorBundleType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorBundlesRequestProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorBundlesRequestProperties.Serialization.cs deleted file mode 100644 index 398659f7bb08..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorBundlesRequestProperties.Serialization.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAlertSimulatorBundlesRequestProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Bundles)) - { - writer.WritePropertyName("bundles"u8); - writer.WriteStartArray(); - foreach (var item in Bundles) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - foreach (var item in AdditionalProperties) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorBundlesRequestProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorBundlesRequestProperties.cs deleted file mode 100644 index 475a4d9b2767..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorBundlesRequestProperties.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Simulate alerts according to this bundles. - public partial class SecurityAlertSimulatorBundlesRequestProperties : SecurityAlertSimulatorRequestProperties - { - /// Initializes a new instance of SecurityAlertSimulatorBundlesRequestProperties. - public SecurityAlertSimulatorBundlesRequestProperties() - { - Bundles = new ChangeTrackingList(); - Kind = SecurityCenterKind.Bundles; - } - - /// Bundles list. - public IList Bundles { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorContent.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorContent.Serialization.cs deleted file mode 100644 index f0b831fb8594..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorContent.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAlertSimulatorContent : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorContent.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorContent.cs deleted file mode 100644 index 0c0f5ee142e6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorContent.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Alert Simulator request body. - public partial class SecurityAlertSimulatorContent - { - /// Initializes a new instance of SecurityAlertSimulatorContent. - public SecurityAlertSimulatorContent() - { - } - - /// - /// Alert Simulator request body data. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - public SecurityAlertSimulatorRequestProperties Properties { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorRequestProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorRequestProperties.Serialization.cs deleted file mode 100644 index f8bd4f6ed21a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorRequestProperties.Serialization.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAlertSimulatorRequestProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - foreach (var item in AdditionalProperties) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorRequestProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorRequestProperties.cs deleted file mode 100644 index f8f18944c5a9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSimulatorRequestProperties.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// - /// Describes properties of an alert simulation request - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include . - /// - public partial class SecurityAlertSimulatorRequestProperties - { - /// Initializes a new instance of SecurityAlertSimulatorRequestProperties. - public SecurityAlertSimulatorRequestProperties() - { - AdditionalProperties = new ChangeTrackingDictionary(); - } - - /// The kind of alert simulation. - internal SecurityCenterKind Kind { get; set; } - /// - /// Additional Properties - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formated json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public IDictionary AdditionalProperties { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertStatus.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertStatus.cs deleted file mode 100644 index 0b8e135af20c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertStatus.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The life cycle status of the alert. - public readonly partial struct SecurityAlertStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityAlertStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ActiveValue = "Active"; - private const string InProgressValue = "InProgress"; - private const string ResolvedValue = "Resolved"; - private const string DismissedValue = "Dismissed"; - - /// An alert which doesn't specify a value is assigned the status 'Active'. - public static SecurityAlertStatus Active { get; } = new SecurityAlertStatus(ActiveValue); - /// An alert which is in handling state. - public static SecurityAlertStatus InProgress { get; } = new SecurityAlertStatus(InProgressValue); - /// Alert closed after handling. - public static SecurityAlertStatus Resolved { get; } = new SecurityAlertStatus(ResolvedValue); - /// Alert dismissed as false positive. - public static SecurityAlertStatus Dismissed { get; } = new SecurityAlertStatus(DismissedValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityAlertStatus left, SecurityAlertStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityAlertStatus left, SecurityAlertStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityAlertStatus(string value) => new SecurityAlertStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityAlertStatus other && Equals(other); - /// - public bool Equals(SecurityAlertStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSupportingEvidence.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSupportingEvidence.Serialization.cs deleted file mode 100644 index 58afc359e18e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSupportingEvidence.Serialization.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAlertSupportingEvidence : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - foreach (var item in AdditionalProperties) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - - internal static SecurityAlertSupportingEvidence DeserializeSecurityAlertSupportingEvidence(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional type = default; - IDictionary additionalProperties = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - additionalProperties = additionalPropertiesDictionary; - return new SecurityAlertSupportingEvidence(type.Value, additionalProperties); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSupportingEvidence.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSupportingEvidence.cs deleted file mode 100644 index f783346e6bf9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSupportingEvidence.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Changing set of properties depending on the supportingEvidence type. - public partial class SecurityAlertSupportingEvidence - { - /// Initializes a new instance of SecurityAlertSupportingEvidence. - public SecurityAlertSupportingEvidence() - { - AdditionalProperties = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of SecurityAlertSupportingEvidence. - /// Type of the supportingEvidence. - /// Additional Properties. - internal SecurityAlertSupportingEvidence(string securityAlertSupportingEvidenceType, IDictionary additionalProperties) - { - SecurityAlertSupportingEvidenceType = securityAlertSupportingEvidenceType; - AdditionalProperties = additionalProperties; - } - - /// Type of the supportingEvidence. - public string SecurityAlertSupportingEvidenceType { get; } - /// - /// Additional Properties - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formated json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public IDictionary AdditionalProperties { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSyncSettings.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSyncSettings.Serialization.cs deleted file mode 100644 index c449f03576e7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSyncSettings.Serialization.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAlertSyncSettings : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(IsEnabled)) - { - writer.WritePropertyName("enabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecurityAlertSyncSettings DeserializeSecurityAlertSyncSettings(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - SettingKind kind = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional enabled = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kind"u8)) - { - kind = new SettingKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("enabled"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - enabled = property0.Value.GetBoolean(); - continue; - } - } - continue; - } - } - return new SecurityAlertSyncSettings(id, name, type, systemData.Value, kind, Optional.ToNullable(enabled)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSyncSettings.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSyncSettings.cs deleted file mode 100644 index 97cf11351c15..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertSyncSettings.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Represents an alert sync setting. - public partial class SecurityAlertSyncSettings : SecuritySettingData - { - /// Initializes a new instance of SecurityAlertSyncSettings. - public SecurityAlertSyncSettings() - { - Kind = SettingKind.AlertSyncSettings; - } - - /// Initializes a new instance of SecurityAlertSyncSettings. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// the kind of the settings string. - /// Is the alert sync setting enabled. - internal SecurityAlertSyncSettings(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SettingKind kind, bool? isEnabled) : base(id, name, resourceType, systemData, kind) - { - IsEnabled = isEnabled; - Kind = kind; - } - - /// Is the alert sync setting enabled. - public bool? IsEnabled { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertsSuppressionRuleData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertsSuppressionRuleData.Serialization.cs deleted file mode 100644 index 24059c1d360a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertsSuppressionRuleData.Serialization.cs +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SecurityAlertsSuppressionRuleData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(AlertType)) - { - writer.WritePropertyName("alertType"u8); - writer.WriteStringValue(AlertType); - } - if (Optional.IsDefined(ExpireOn)) - { - writer.WritePropertyName("expirationDateUtc"u8); - writer.WriteStringValue(ExpireOn.Value, "O"); - } - if (Optional.IsDefined(Reason)) - { - writer.WritePropertyName("reason"u8); - writer.WriteStringValue(Reason); - } - if (Optional.IsDefined(State)) - { - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.Value.ToSerialString()); - } - if (Optional.IsDefined(Comment)) - { - writer.WritePropertyName("comment"u8); - writer.WriteStringValue(Comment); - } - if (Optional.IsDefined(SuppressionAlertsScope)) - { - writer.WritePropertyName("suppressionAlertsScope"u8); - writer.WriteObjectValue(SuppressionAlertsScope); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecurityAlertsSuppressionRuleData DeserializeSecurityAlertsSuppressionRuleData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional alertType = default; - Optional lastModifiedUtc = default; - Optional expirationDateUtc = default; - Optional reason = default; - Optional state = default; - Optional comment = default; - Optional suppressionAlertsScope = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("alertType"u8)) - { - alertType = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("lastModifiedUtc"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - lastModifiedUtc = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("expirationDateUtc"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - expirationDateUtc = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("reason"u8)) - { - reason = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("state"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - state = property0.Value.GetString().ToSecurityAlertsSuppressionRuleState(); - continue; - } - if (property0.NameEquals("comment"u8)) - { - comment = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("suppressionAlertsScope"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - suppressionAlertsScope = SuppressionAlertsScope.DeserializeSuppressionAlertsScope(property0.Value); - continue; - } - } - continue; - } - } - return new SecurityAlertsSuppressionRuleData(id, name, type, systemData.Value, alertType.Value, Optional.ToNullable(lastModifiedUtc), Optional.ToNullable(expirationDateUtc), reason.Value, Optional.ToNullable(state), comment.Value, suppressionAlertsScope.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertsSuppressionRuleState.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertsSuppressionRuleState.Serialization.cs deleted file mode 100644 index d979f92247e8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertsSuppressionRuleState.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal static partial class SecurityAlertsSuppressionRuleStateExtensions - { - public static string ToSerialString(this SecurityAlertsSuppressionRuleState value) => value switch - { - SecurityAlertsSuppressionRuleState.Enabled => "Enabled", - SecurityAlertsSuppressionRuleState.Disabled => "Disabled", - SecurityAlertsSuppressionRuleState.Expired => "Expired", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SecurityAlertsSuppressionRuleState value.") - }; - - public static SecurityAlertsSuppressionRuleState ToSecurityAlertsSuppressionRuleState(this string value) - { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Enabled")) return SecurityAlertsSuppressionRuleState.Enabled; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Disabled")) return SecurityAlertsSuppressionRuleState.Disabled; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Expired")) return SecurityAlertsSuppressionRuleState.Expired; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SecurityAlertsSuppressionRuleState value."); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertsSuppressionRuleState.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertsSuppressionRuleState.cs deleted file mode 100644 index 4bdb5a8fef51..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAlertsSuppressionRuleState.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Possible states of the rule. - public enum SecurityAlertsSuppressionRuleState - { - /// Enabled. - Enabled, - /// Disabled. - Disabled, - /// Expired. - Expired - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityApplicationData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityApplicationData.Serialization.cs deleted file mode 100644 index a6688b3296dd..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityApplicationData.Serialization.cs +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SecurityApplicationData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(DisplayName)) - { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (Optional.IsDefined(SourceResourceType)) - { - writer.WritePropertyName("sourceResourceType"u8); - writer.WriteStringValue(SourceResourceType.Value.ToString()); - } - if (Optional.IsCollectionDefined(ConditionSets)) - { - writer.WritePropertyName("conditionSets"u8); - writer.WriteStartArray(); - foreach (var item in ConditionSets) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } -#if NET6_0_OR_GREATER - writer.WriteRawValue(item); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.ToString()).RootElement); -#endif - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecurityApplicationData DeserializeSecurityApplicationData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional displayName = default; - Optional description = default; - Optional sourceResourceType = default; - Optional> conditionSets = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("displayName"u8)) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("description"u8)) - { - description = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("sourceResourceType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - sourceResourceType = new ApplicationSourceResourceType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("conditionSets"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(BinaryData.FromString(item.GetRawText())); - } - } - conditionSets = array; - continue; - } - } - continue; - } - } - return new SecurityApplicationData(id, name, type, systemData.Value, displayName.Value, description.Value, Optional.ToNullable(sourceResourceType), Optional.ToList(conditionSets)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentCreateOrUpdateContent.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentCreateOrUpdateContent.Serialization.cs deleted file mode 100644 index 5f13dd774864..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentCreateOrUpdateContent.Serialization.cs +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAssessmentCreateOrUpdateContent : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(ResourceDetails)) - { - writer.WritePropertyName("resourceDetails"u8); - writer.WriteObjectValue(ResourceDetails); - } - if (Optional.IsCollectionDefined(AdditionalData)) - { - writer.WritePropertyName("additionalData"u8); - writer.WriteStartObject(); - foreach (var item in AdditionalData) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(Metadata)) - { - writer.WritePropertyName("metadata"u8); - writer.WriteObjectValue(Metadata); - } - if (Optional.IsDefined(PartnersData)) - { - writer.WritePropertyName("partnersData"u8); - writer.WriteObjectValue(PartnersData); - } - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteObjectValue(Status); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecurityAssessmentCreateOrUpdateContent DeserializeSecurityAssessmentCreateOrUpdateContent(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional resourceDetails = default; - Optional displayName = default; - Optional> additionalData = default; - Optional links = default; - Optional metadata = default; - Optional partnersData = default; - Optional status = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resourceDetails"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - resourceDetails = SecurityCenterResourceDetails.DeserializeSecurityCenterResourceDetails(property0.Value); - continue; - } - if (property0.NameEquals("displayName"u8)) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("additionalData"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, property1.Value.GetString()); - } - additionalData = dictionary; - continue; - } - if (property0.NameEquals("links"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - links = AssessmentLinks.DeserializeAssessmentLinks(property0.Value); - continue; - } - if (property0.NameEquals("metadata"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - metadata = SecurityAssessmentMetadataProperties.DeserializeSecurityAssessmentMetadataProperties(property0.Value); - continue; - } - if (property0.NameEquals("partnersData"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - partnersData = SecurityAssessmentPartner.DeserializeSecurityAssessmentPartner(property0.Value); - continue; - } - if (property0.NameEquals("status"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = SecurityAssessmentStatus.DeserializeSecurityAssessmentStatus(property0.Value); - continue; - } - } - continue; - } - } - return new SecurityAssessmentCreateOrUpdateContent(id, name, type, systemData.Value, resourceDetails.Value, displayName.Value, Optional.ToDictionary(additionalData), links.Value, metadata.Value, partnersData.Value, status.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentCreateOrUpdateContent.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentCreateOrUpdateContent.cs deleted file mode 100644 index eafa1158a881..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentCreateOrUpdateContent.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Security assessment on a resource. - public partial class SecurityAssessmentCreateOrUpdateContent : ResourceData - { - /// Initializes a new instance of SecurityAssessmentCreateOrUpdateContent. - public SecurityAssessmentCreateOrUpdateContent() - { - AdditionalData = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of SecurityAssessmentCreateOrUpdateContent. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// - /// Details of the resource that was assessed - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// User friendly display name of the assessment. - /// Additional data regarding the assessment. - /// Links relevant to the assessment. - /// Describes properties of an assessment metadata. - /// Data regarding 3rd party partner integration. - /// The result of the assessment. - internal SecurityAssessmentCreateOrUpdateContent(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SecurityCenterResourceDetails resourceDetails, string displayName, IDictionary additionalData, AssessmentLinks links, SecurityAssessmentMetadataProperties metadata, SecurityAssessmentPartner partnersData, SecurityAssessmentStatus status) : base(id, name, resourceType, systemData) - { - ResourceDetails = resourceDetails; - DisplayName = displayName; - AdditionalData = additionalData; - Links = links; - Metadata = metadata; - PartnersData = partnersData; - Status = status; - } - - /// - /// Details of the resource that was assessed - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public SecurityCenterResourceDetails ResourceDetails { get; set; } - /// User friendly display name of the assessment. - public string DisplayName { get; } - /// Additional data regarding the assessment. - public IDictionary AdditionalData { get; } - /// Links relevant to the assessment. - internal AssessmentLinks Links { get; } - /// Link to assessment in Azure Portal. - public Uri LinksAzurePortalUri - { - get => Links?.AzurePortalUri; - } - - /// Describes properties of an assessment metadata. - public SecurityAssessmentMetadataProperties Metadata { get; set; } - /// Data regarding 3rd party partner integration. - public SecurityAssessmentPartner PartnersData { get; set; } - /// The result of the assessment. - public SecurityAssessmentStatus Status { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentData.Serialization.cs deleted file mode 100644 index bf3bbff43102..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentData.Serialization.cs +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SecurityAssessmentData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(ResourceDetails)) - { - writer.WritePropertyName("resourceDetails"u8); - writer.WriteObjectValue(ResourceDetails); - } - if (Optional.IsCollectionDefined(AdditionalData)) - { - writer.WritePropertyName("additionalData"u8); - writer.WriteStartObject(); - foreach (var item in AdditionalData) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(Metadata)) - { - writer.WritePropertyName("metadata"u8); - writer.WriteObjectValue(Metadata); - } - if (Optional.IsDefined(PartnersData)) - { - writer.WritePropertyName("partnersData"u8); - writer.WriteObjectValue(PartnersData); - } - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteObjectValue(Status); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecurityAssessmentData DeserializeSecurityAssessmentData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional resourceDetails = default; - Optional displayName = default; - Optional> additionalData = default; - Optional links = default; - Optional metadata = default; - Optional partnersData = default; - Optional status = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("resourceDetails"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - resourceDetails = SecurityCenterResourceDetails.DeserializeSecurityCenterResourceDetails(property0.Value); - continue; - } - if (property0.NameEquals("displayName"u8)) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("additionalData"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property1 in property0.Value.EnumerateObject()) - { - dictionary.Add(property1.Name, property1.Value.GetString()); - } - additionalData = dictionary; - continue; - } - if (property0.NameEquals("links"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - links = AssessmentLinks.DeserializeAssessmentLinks(property0.Value); - continue; - } - if (property0.NameEquals("metadata"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - metadata = SecurityAssessmentMetadataProperties.DeserializeSecurityAssessmentMetadataProperties(property0.Value); - continue; - } - if (property0.NameEquals("partnersData"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - partnersData = SecurityAssessmentPartner.DeserializeSecurityAssessmentPartner(property0.Value); - continue; - } - if (property0.NameEquals("status"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = SecurityAssessmentStatusResult.DeserializeSecurityAssessmentStatusResult(property0.Value); - continue; - } - } - continue; - } - } - return new SecurityAssessmentData(id, name, type, systemData.Value, resourceDetails.Value, displayName.Value, Optional.ToDictionary(additionalData), links.Value, metadata.Value, partnersData.Value, status.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentList.Serialization.cs deleted file mode 100644 index 54f2c9f9c436..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class SecurityAssessmentList - { - internal static SecurityAssessmentList DeserializeSecurityAssessmentList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityAssessmentData.DeserializeSecurityAssessmentData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SecurityAssessmentList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentList.cs deleted file mode 100644 index b02c73b03413..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Page of a security assessments list. - internal partial class SecurityAssessmentList - { - /// Initializes a new instance of SecurityAssessmentList. - internal SecurityAssessmentList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecurityAssessmentList. - /// Collection of security assessments in this page. - /// The URI to fetch the next page. - internal SecurityAssessmentList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Collection of security assessments in this page. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataData.Serialization.cs deleted file mode 100644 index 8252a27dc2f2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataData.Serialization.cs +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SecurityAssessmentMetadataData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(DisplayName)) - { - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (Optional.IsDefined(RemediationDescription)) - { - writer.WritePropertyName("remediationDescription"u8); - writer.WriteStringValue(RemediationDescription); - } - if (Optional.IsCollectionDefined(Categories)) - { - writer.WritePropertyName("categories"u8); - writer.WriteStartArray(); - foreach (var item in Categories) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(Severity)) - { - writer.WritePropertyName("severity"u8); - writer.WriteStringValue(Severity.Value.ToString()); - } - if (Optional.IsDefined(UserImpact)) - { - writer.WritePropertyName("userImpact"u8); - writer.WriteStringValue(UserImpact.Value.ToString()); - } - if (Optional.IsDefined(ImplementationEffort)) - { - writer.WritePropertyName("implementationEffort"u8); - writer.WriteStringValue(ImplementationEffort.Value.ToString()); - } - if (Optional.IsCollectionDefined(Threats)) - { - writer.WritePropertyName("threats"u8); - writer.WriteStartArray(); - foreach (var item in Threats) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(IsPreview)) - { - writer.WritePropertyName("preview"u8); - writer.WriteBooleanValue(IsPreview.Value); - } - if (Optional.IsDefined(AssessmentType)) - { - writer.WritePropertyName("assessmentType"u8); - writer.WriteStringValue(AssessmentType.Value.ToString()); - } - if (Optional.IsDefined(PartnerData)) - { - writer.WritePropertyName("partnerData"u8); - writer.WriteObjectValue(PartnerData); - } - if (Optional.IsDefined(PublishDates)) - { - writer.WritePropertyName("publishDates"u8); - writer.WriteObjectValue(PublishDates); - } - if (Optional.IsDefined(PlannedDeprecationDate)) - { - writer.WritePropertyName("plannedDeprecationDate"u8); - writer.WriteStringValue(PlannedDeprecationDate); - } - if (Optional.IsCollectionDefined(Tactics)) - { - writer.WritePropertyName("tactics"u8); - writer.WriteStartArray(); - foreach (var item in Tactics) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Techniques)) - { - writer.WritePropertyName("techniques"u8); - writer.WriteStartArray(); - foreach (var item in Techniques) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataPartner.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataPartner.Serialization.cs deleted file mode 100644 index fa072638d653..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataPartner.Serialization.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAssessmentMetadataPartner : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("partnerName"u8); - writer.WriteStringValue(PartnerName); - if (Optional.IsDefined(ProductName)) - { - writer.WritePropertyName("productName"u8); - writer.WriteStringValue(ProductName); - } - writer.WritePropertyName("secret"u8); - writer.WriteStringValue(Secret); - writer.WriteEndObject(); - } - - internal static SecurityAssessmentMetadataPartner DeserializeSecurityAssessmentMetadataPartner(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string partnerName = default; - Optional productName = default; - string secret = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("partnerName"u8)) - { - partnerName = property.Value.GetString(); - continue; - } - if (property.NameEquals("productName"u8)) - { - productName = property.Value.GetString(); - continue; - } - if (property.NameEquals("secret"u8)) - { - secret = property.Value.GetString(); - continue; - } - } - return new SecurityAssessmentMetadataPartner(partnerName, productName.Value, secret); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataPartner.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataPartner.cs deleted file mode 100644 index f3acdfda8f3a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataPartner.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Describes the partner that created the assessment. - public partial class SecurityAssessmentMetadataPartner - { - /// Initializes a new instance of SecurityAssessmentMetadataPartner. - /// Name of the company of the partner. - /// Secret to authenticate the partner and verify it created the assessment - write only. - /// or is null. - public SecurityAssessmentMetadataPartner(string partnerName, string secret) - { - Argument.AssertNotNull(partnerName, nameof(partnerName)); - Argument.AssertNotNull(secret, nameof(secret)); - - PartnerName = partnerName; - Secret = secret; - } - - /// Initializes a new instance of SecurityAssessmentMetadataPartner. - /// Name of the company of the partner. - /// Name of the product of the partner that created the assessment. - /// Secret to authenticate the partner and verify it created the assessment - write only. - internal SecurityAssessmentMetadataPartner(string partnerName, string productName, string secret) - { - PartnerName = partnerName; - ProductName = productName; - Secret = secret; - } - - /// Name of the company of the partner. - public string PartnerName { get; set; } - /// Name of the product of the partner that created the assessment. - public string ProductName { get; set; } - /// Secret to authenticate the partner and verify it created the assessment - write only. - public string Secret { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataProperties.Serialization.cs deleted file mode 100644 index eeae89e47261..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataProperties.Serialization.cs +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAssessmentMetadataProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("displayName"u8); - writer.WriteStringValue(DisplayName); - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (Optional.IsDefined(RemediationDescription)) - { - writer.WritePropertyName("remediationDescription"u8); - writer.WriteStringValue(RemediationDescription); - } - if (Optional.IsCollectionDefined(Categories)) - { - writer.WritePropertyName("categories"u8); - writer.WriteStartArray(); - foreach (var item in Categories) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - writer.WritePropertyName("severity"u8); - writer.WriteStringValue(Severity.ToString()); - if (Optional.IsDefined(UserImpact)) - { - writer.WritePropertyName("userImpact"u8); - writer.WriteStringValue(UserImpact.Value.ToString()); - } - if (Optional.IsDefined(ImplementationEffort)) - { - writer.WritePropertyName("implementationEffort"u8); - writer.WriteStringValue(ImplementationEffort.Value.ToString()); - } - if (Optional.IsCollectionDefined(Threats)) - { - writer.WritePropertyName("threats"u8); - writer.WriteStartArray(); - foreach (var item in Threats) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(IsPreview)) - { - writer.WritePropertyName("preview"u8); - writer.WriteBooleanValue(IsPreview.Value); - } - writer.WritePropertyName("assessmentType"u8); - writer.WriteStringValue(AssessmentType.ToString()); - if (Optional.IsDefined(PartnerData)) - { - writer.WritePropertyName("partnerData"u8); - writer.WriteObjectValue(PartnerData); - } - writer.WriteEndObject(); - } - - internal static SecurityAssessmentMetadataProperties DeserializeSecurityAssessmentMetadataProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string displayName = default; - Optional policyDefinitionId = default; - Optional description = default; - Optional remediationDescription = default; - Optional> categories = default; - SecurityAssessmentSeverity severity = default; - Optional userImpact = default; - Optional implementationEffort = default; - Optional> threats = default; - Optional preview = default; - SecurityAssessmentType assessmentType = default; - Optional partnerData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("policyDefinitionId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - policyDefinitionId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("remediationDescription"u8)) - { - remediationDescription = property.Value.GetString(); - continue; - } - if (property.NameEquals("categories"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(new SecurityAssessmentResourceCategory(item.GetString())); - } - categories = array; - continue; - } - if (property.NameEquals("severity"u8)) - { - severity = new SecurityAssessmentSeverity(property.Value.GetString()); - continue; - } - if (property.NameEquals("userImpact"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - userImpact = new SecurityAssessmentUserImpact(property.Value.GetString()); - continue; - } - if (property.NameEquals("implementationEffort"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - implementationEffort = new ImplementationEffort(property.Value.GetString()); - continue; - } - if (property.NameEquals("threats"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(new SecurityThreat(item.GetString())); - } - threats = array; - continue; - } - if (property.NameEquals("preview"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - preview = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("assessmentType"u8)) - { - assessmentType = new SecurityAssessmentType(property.Value.GetString()); - continue; - } - if (property.NameEquals("partnerData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - partnerData = SecurityAssessmentMetadataPartner.DeserializeSecurityAssessmentMetadataPartner(property.Value); - continue; - } - } - return new SecurityAssessmentMetadataProperties(displayName, policyDefinitionId.Value, description.Value, remediationDescription.Value, Optional.ToList(categories), severity, Optional.ToNullable(userImpact), Optional.ToNullable(implementationEffort), Optional.ToList(threats), Optional.ToNullable(preview), assessmentType, partnerData.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataProperties.cs deleted file mode 100644 index b31e0d897241..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataProperties.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Describes properties of an assessment metadata. - public partial class SecurityAssessmentMetadataProperties - { - /// Initializes a new instance of SecurityAssessmentMetadataProperties. - /// User friendly display name of the assessment. - /// The severity level of the assessment. - /// BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition. - /// is null. - public SecurityAssessmentMetadataProperties(string displayName, SecurityAssessmentSeverity severity, SecurityAssessmentType assessmentType) - { - Argument.AssertNotNull(displayName, nameof(displayName)); - - DisplayName = displayName; - Categories = new ChangeTrackingList(); - Severity = severity; - Threats = new ChangeTrackingList(); - AssessmentType = assessmentType; - } - - /// Initializes a new instance of SecurityAssessmentMetadataProperties. - /// User friendly display name of the assessment. - /// Azure resource ID of the policy definition that turns this assessment calculation on. - /// Human readable description of the assessment. - /// Human readable description of what you should do to mitigate this security issue. - /// - /// The severity level of the assessment. - /// The user impact of the assessment. - /// The implementation effort required to remediate this assessment. - /// - /// True if this assessment is in preview release status. - /// BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition. - /// Describes the partner that created the assessment. - internal SecurityAssessmentMetadataProperties(string displayName, ResourceIdentifier policyDefinitionId, string description, string remediationDescription, IList categories, SecurityAssessmentSeverity severity, SecurityAssessmentUserImpact? userImpact, ImplementationEffort? implementationEffort, IList threats, bool? isPreview, SecurityAssessmentType assessmentType, SecurityAssessmentMetadataPartner partnerData) - { - DisplayName = displayName; - PolicyDefinitionId = policyDefinitionId; - Description = description; - RemediationDescription = remediationDescription; - Categories = categories; - Severity = severity; - UserImpact = userImpact; - ImplementationEffort = implementationEffort; - Threats = threats; - IsPreview = isPreview; - AssessmentType = assessmentType; - PartnerData = partnerData; - } - - /// User friendly display name of the assessment. - public string DisplayName { get; set; } - /// Azure resource ID of the policy definition that turns this assessment calculation on. - public ResourceIdentifier PolicyDefinitionId { get; } - /// Human readable description of the assessment. - public string Description { get; set; } - /// Human readable description of what you should do to mitigate this security issue. - public string RemediationDescription { get; set; } - /// Gets the categories. - public IList Categories { get; } - /// The severity level of the assessment. - public SecurityAssessmentSeverity Severity { get; set; } - /// The user impact of the assessment. - public SecurityAssessmentUserImpact? UserImpact { get; set; } - /// The implementation effort required to remediate this assessment. - public ImplementationEffort? ImplementationEffort { get; set; } - /// Gets the threats. - public IList Threats { get; } - /// True if this assessment is in preview release status. - public bool? IsPreview { get; set; } - /// BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition. - public SecurityAssessmentType AssessmentType { get; set; } - /// Describes the partner that created the assessment. - public SecurityAssessmentMetadataPartner PartnerData { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataResponseList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataResponseList.Serialization.cs deleted file mode 100644 index c04a28b4a919..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataResponseList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class SecurityAssessmentMetadataResponseList - { - internal static SecurityAssessmentMetadataResponseList DeserializeSecurityAssessmentMetadataResponseList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityAssessmentMetadataData.DeserializeSecurityAssessmentMetadataData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SecurityAssessmentMetadataResponseList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataResponseList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataResponseList.cs deleted file mode 100644 index a21e500af171..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentMetadataResponseList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of security assessment metadata. - internal partial class SecurityAssessmentMetadataResponseList - { - /// Initializes a new instance of SecurityAssessmentMetadataResponseList. - internal SecurityAssessmentMetadataResponseList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecurityAssessmentMetadataResponseList. - /// - /// The URI to fetch the next page. - internal SecurityAssessmentMetadataResponseList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Gets the value. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentODataExpand.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentODataExpand.cs deleted file mode 100644 index 1c6392a6277c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentODataExpand.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The SecurityAssessmentODataExpand. - public readonly partial struct SecurityAssessmentODataExpand : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityAssessmentODataExpand(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string LinksValue = "links"; - private const string MetadataValue = "metadata"; - - /// All links associated with an assessment. - public static SecurityAssessmentODataExpand Links { get; } = new SecurityAssessmentODataExpand(LinksValue); - /// Assessment metadata. - public static SecurityAssessmentODataExpand Metadata { get; } = new SecurityAssessmentODataExpand(MetadataValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityAssessmentODataExpand left, SecurityAssessmentODataExpand right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityAssessmentODataExpand left, SecurityAssessmentODataExpand right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityAssessmentODataExpand(string value) => new SecurityAssessmentODataExpand(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityAssessmentODataExpand other && Equals(other); - /// - public bool Equals(SecurityAssessmentODataExpand other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentPartner.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentPartner.Serialization.cs deleted file mode 100644 index 1cdd625c621c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentPartner.Serialization.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAssessmentPartner : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("partnerName"u8); - writer.WriteStringValue(PartnerName); - writer.WritePropertyName("secret"u8); - writer.WriteStringValue(Secret); - writer.WriteEndObject(); - } - - internal static SecurityAssessmentPartner DeserializeSecurityAssessmentPartner(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string partnerName = default; - string secret = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("partnerName"u8)) - { - partnerName = property.Value.GetString(); - continue; - } - if (property.NameEquals("secret"u8)) - { - secret = property.Value.GetString(); - continue; - } - } - return new SecurityAssessmentPartner(partnerName, secret); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentPartner.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentPartner.cs deleted file mode 100644 index 7199a18572b3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentPartner.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Data regarding 3rd party partner integration. - public partial class SecurityAssessmentPartner - { - /// Initializes a new instance of SecurityAssessmentPartner. - /// Name of the company of the partner. - /// secret to authenticate the partner - write only. - /// or is null. - public SecurityAssessmentPartner(string partnerName, string secret) - { - Argument.AssertNotNull(partnerName, nameof(partnerName)); - Argument.AssertNotNull(secret, nameof(secret)); - - PartnerName = partnerName; - Secret = secret; - } - - /// Name of the company of the partner. - public string PartnerName { get; set; } - /// secret to authenticate the partner - write only. - public string Secret { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentPublishDates.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentPublishDates.Serialization.cs deleted file mode 100644 index b20610e93f50..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentPublishDates.Serialization.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAssessmentPublishDates : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(GA)) - { - writer.WritePropertyName("GA"u8); - writer.WriteStringValue(GA); - } - writer.WritePropertyName("public"u8); - writer.WriteStringValue(Public); - writer.WriteEndObject(); - } - - internal static SecurityAssessmentPublishDates DeserializeSecurityAssessmentPublishDates(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional ga = default; - string @public = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("GA"u8)) - { - ga = property.Value.GetString(); - continue; - } - if (property.NameEquals("public"u8)) - { - @public = property.Value.GetString(); - continue; - } - } - return new SecurityAssessmentPublishDates(ga.Value, @public); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentPublishDates.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentPublishDates.cs deleted file mode 100644 index 6aaefec7ce5a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentPublishDates.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The SecurityAssessmentPublishDates. - public partial class SecurityAssessmentPublishDates - { - /// Initializes a new instance of SecurityAssessmentPublishDates. - /// - /// is null. - public SecurityAssessmentPublishDates(string @public) - { - Argument.AssertNotNull(@public, nameof(@public)); - - Public = @public; - } - - /// Initializes a new instance of SecurityAssessmentPublishDates. - /// - /// - internal SecurityAssessmentPublishDates(string ga, string @public) - { - GA = ga; - Public = @public; - } - - /// Gets or sets the ga. - public string GA { get; set; } - /// Gets or sets the public. - public string Public { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentResourceCategory.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentResourceCategory.cs deleted file mode 100644 index e42985a988fb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentResourceCategory.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The categories of resource that is at risk when the assessment is unhealthy. - public readonly partial struct SecurityAssessmentResourceCategory : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityAssessmentResourceCategory(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ComputeValue = "Compute"; - private const string NetworkingValue = "Networking"; - private const string DataValue = "Data"; - private const string IdentityAndAccessValue = "IdentityAndAccess"; - private const string IotValue = "IoT"; - - /// Compute. - public static SecurityAssessmentResourceCategory Compute { get; } = new SecurityAssessmentResourceCategory(ComputeValue); - /// Networking. - public static SecurityAssessmentResourceCategory Networking { get; } = new SecurityAssessmentResourceCategory(NetworkingValue); - /// Data. - public static SecurityAssessmentResourceCategory Data { get; } = new SecurityAssessmentResourceCategory(DataValue); - /// IdentityAndAccess. - public static SecurityAssessmentResourceCategory IdentityAndAccess { get; } = new SecurityAssessmentResourceCategory(IdentityAndAccessValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityAssessmentResourceCategory left, SecurityAssessmentResourceCategory right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityAssessmentResourceCategory left, SecurityAssessmentResourceCategory right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityAssessmentResourceCategory(string value) => new SecurityAssessmentResourceCategory(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityAssessmentResourceCategory other && Equals(other); - /// - public bool Equals(SecurityAssessmentResourceCategory other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentResourceStatus.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentResourceStatus.cs deleted file mode 100644 index 56be55758f68..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentResourceStatus.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The status of the resource regarding a single assessment. - public readonly partial struct SecurityAssessmentResourceStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityAssessmentResourceStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string HealthyValue = "Healthy"; - private const string NotApplicableValue = "NotApplicable"; - private const string OffByPolicyValue = "OffByPolicy"; - private const string NotHealthyValue = "NotHealthy"; - - /// This assessment on the resource is healthy. - public static SecurityAssessmentResourceStatus Healthy { get; } = new SecurityAssessmentResourceStatus(HealthyValue); - /// This assessment is not applicable to this resource. - public static SecurityAssessmentResourceStatus NotApplicable { get; } = new SecurityAssessmentResourceStatus(NotApplicableValue); - /// This assessment is turned off by policy on this subscription. - public static SecurityAssessmentResourceStatus OffByPolicy { get; } = new SecurityAssessmentResourceStatus(OffByPolicyValue); - /// This assessment on the resource is not healthy. - public static SecurityAssessmentResourceStatus NotHealthy { get; } = new SecurityAssessmentResourceStatus(NotHealthyValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityAssessmentResourceStatus left, SecurityAssessmentResourceStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityAssessmentResourceStatus left, SecurityAssessmentResourceStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityAssessmentResourceStatus(string value) => new SecurityAssessmentResourceStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityAssessmentResourceStatus other && Equals(other); - /// - public bool Equals(SecurityAssessmentResourceStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentSeverity.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentSeverity.cs deleted file mode 100644 index b03a03d644e9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentSeverity.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The sub-assessment severity level. - public readonly partial struct SecurityAssessmentSeverity : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityAssessmentSeverity(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string LowValue = "Low"; - private const string MediumValue = "Medium"; - private const string HighValue = "High"; - - /// Low. - public static SecurityAssessmentSeverity Low { get; } = new SecurityAssessmentSeverity(LowValue); - /// Medium. - public static SecurityAssessmentSeverity Medium { get; } = new SecurityAssessmentSeverity(MediumValue); - /// High. - public static SecurityAssessmentSeverity High { get; } = new SecurityAssessmentSeverity(HighValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityAssessmentSeverity left, SecurityAssessmentSeverity right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityAssessmentSeverity left, SecurityAssessmentSeverity right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityAssessmentSeverity(string value) => new SecurityAssessmentSeverity(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityAssessmentSeverity other && Equals(other); - /// - public bool Equals(SecurityAssessmentSeverity other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentStatus.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentStatus.Serialization.cs deleted file mode 100644 index dc37eba74ff7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentStatus.Serialization.cs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAssessmentStatus : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code.ToString()); - if (Optional.IsDefined(Cause)) - { - writer.WritePropertyName("cause"u8); - writer.WriteStringValue(Cause); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - writer.WriteEndObject(); - } - - internal static SecurityAssessmentStatus DeserializeSecurityAssessmentStatus(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - SecurityAssessmentStatusCode code = default; - Optional cause = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = new SecurityAssessmentStatusCode(property.Value.GetString()); - continue; - } - if (property.NameEquals("cause"u8)) - { - cause = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new SecurityAssessmentStatus(code, cause.Value, description.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentStatus.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentStatus.cs deleted file mode 100644 index 21c8177de0c9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentStatus.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The result of the assessment. - public partial class SecurityAssessmentStatus - { - /// Initializes a new instance of SecurityAssessmentStatus. - /// Programmatic code for the status of the assessment. - public SecurityAssessmentStatus(SecurityAssessmentStatusCode code) - { - Code = code; - } - - /// Initializes a new instance of SecurityAssessmentStatus. - /// Programmatic code for the status of the assessment. - /// Programmatic code for the cause of the assessment status. - /// Human readable description of the assessment status. - internal SecurityAssessmentStatus(SecurityAssessmentStatusCode code, string cause, string description) - { - Code = code; - Cause = cause; - Description = description; - } - - /// Programmatic code for the status of the assessment. - public SecurityAssessmentStatusCode Code { get; set; } - /// Programmatic code for the cause of the assessment status. - public string Cause { get; set; } - /// Human readable description of the assessment status. - public string Description { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentStatusCode.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentStatusCode.cs deleted file mode 100644 index d21a90a4717f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentStatusCode.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Programmatic code for the status of the assessment. - public readonly partial struct SecurityAssessmentStatusCode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityAssessmentStatusCode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string HealthyValue = "Healthy"; - private const string UnhealthyValue = "Unhealthy"; - private const string NotApplicableValue = "NotApplicable"; - - /// The resource is healthy. - public static SecurityAssessmentStatusCode Healthy { get; } = new SecurityAssessmentStatusCode(HealthyValue); - /// The resource has a security issue that needs to be addressed. - public static SecurityAssessmentStatusCode Unhealthy { get; } = new SecurityAssessmentStatusCode(UnhealthyValue); - /// Assessment for this resource did not happen. - public static SecurityAssessmentStatusCode NotApplicable { get; } = new SecurityAssessmentStatusCode(NotApplicableValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityAssessmentStatusCode left, SecurityAssessmentStatusCode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityAssessmentStatusCode left, SecurityAssessmentStatusCode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityAssessmentStatusCode(string value) => new SecurityAssessmentStatusCode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityAssessmentStatusCode other && Equals(other); - /// - public bool Equals(SecurityAssessmentStatusCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentStatusResult.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentStatusResult.Serialization.cs deleted file mode 100644 index 75518281d8bd..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentStatusResult.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAssessmentStatusResult : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code.ToString()); - if (Optional.IsDefined(Cause)) - { - writer.WritePropertyName("cause"u8); - writer.WriteStringValue(Cause); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - writer.WriteEndObject(); - } - - internal static SecurityAssessmentStatusResult DeserializeSecurityAssessmentStatusResult(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional firstEvaluationDate = default; - Optional statusChangeDate = default; - SecurityAssessmentStatusCode code = default; - Optional cause = default; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("firstEvaluationDate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - firstEvaluationDate = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("statusChangeDate"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - statusChangeDate = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("code"u8)) - { - code = new SecurityAssessmentStatusCode(property.Value.GetString()); - continue; - } - if (property.NameEquals("cause"u8)) - { - cause = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new SecurityAssessmentStatusResult(code, cause.Value, description.Value, Optional.ToNullable(firstEvaluationDate), Optional.ToNullable(statusChangeDate)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentStatusResult.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentStatusResult.cs deleted file mode 100644 index 30923fe84712..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentStatusResult.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The result of the assessment. - public partial class SecurityAssessmentStatusResult : SecurityAssessmentStatus - { - /// Initializes a new instance of SecurityAssessmentStatusResult. - /// Programmatic code for the status of the assessment. - public SecurityAssessmentStatusResult(SecurityAssessmentStatusCode code) : base(code) - { - } - - /// Initializes a new instance of SecurityAssessmentStatusResult. - /// Programmatic code for the status of the assessment. - /// Programmatic code for the cause of the assessment status. - /// Human readable description of the assessment status. - /// The time that the assessment was created and first evaluated. Returned as UTC time in ISO 8601 format. - /// The time that the status of the assessment last changed. Returned as UTC time in ISO 8601 format. - internal SecurityAssessmentStatusResult(SecurityAssessmentStatusCode code, string cause, string description, DateTimeOffset? firstEvaluatedOn, DateTimeOffset? statusChangeOn) : base(code, cause, description) - { - FirstEvaluatedOn = firstEvaluatedOn; - StatusChangeOn = statusChangeOn; - } - - /// The time that the assessment was created and first evaluated. Returned as UTC time in ISO 8601 format. - public DateTimeOffset? FirstEvaluatedOn { get; } - /// The time that the status of the assessment last changed. Returned as UTC time in ISO 8601 format. - public DateTimeOffset? StatusChangeOn { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentTactic.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentTactic.cs deleted file mode 100644 index e54d73a850cc..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentTactic.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Tactic of the assessment. - public readonly partial struct SecurityAssessmentTactic : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityAssessmentTactic(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ReconnaissanceValue = "Reconnaissance"; - private const string ResourceDevelopmentValue = "Resource Development"; - private const string InitialAccessValue = "Initial Access"; - private const string ExecutionValue = "Execution"; - private const string PersistenceValue = "Persistence"; - private const string PrivilegeEscalationValue = "Privilege Escalation"; - private const string DefenseEvasionValue = "Defense Evasion"; - private const string CredentialAccessValue = "Credential Access"; - private const string DiscoveryValue = "Discovery"; - private const string LateralMovementValue = "Lateral Movement"; - private const string CollectionValue = "Collection"; - private const string CommandAndControlValue = "Command and Control"; - private const string ExfiltrationValue = "Exfiltration"; - private const string ImpactValue = "Impact"; - - /// Reconnaissance. - public static SecurityAssessmentTactic Reconnaissance { get; } = new SecurityAssessmentTactic(ReconnaissanceValue); - /// Resource Development. - public static SecurityAssessmentTactic ResourceDevelopment { get; } = new SecurityAssessmentTactic(ResourceDevelopmentValue); - /// Initial Access. - public static SecurityAssessmentTactic InitialAccess { get; } = new SecurityAssessmentTactic(InitialAccessValue); - /// Execution. - public static SecurityAssessmentTactic Execution { get; } = new SecurityAssessmentTactic(ExecutionValue); - /// Persistence. - public static SecurityAssessmentTactic Persistence { get; } = new SecurityAssessmentTactic(PersistenceValue); - /// Privilege Escalation. - public static SecurityAssessmentTactic PrivilegeEscalation { get; } = new SecurityAssessmentTactic(PrivilegeEscalationValue); - /// Defense Evasion. - public static SecurityAssessmentTactic DefenseEvasion { get; } = new SecurityAssessmentTactic(DefenseEvasionValue); - /// Credential Access. - public static SecurityAssessmentTactic CredentialAccess { get; } = new SecurityAssessmentTactic(CredentialAccessValue); - /// Discovery. - public static SecurityAssessmentTactic Discovery { get; } = new SecurityAssessmentTactic(DiscoveryValue); - /// Lateral Movement. - public static SecurityAssessmentTactic LateralMovement { get; } = new SecurityAssessmentTactic(LateralMovementValue); - /// Collection. - public static SecurityAssessmentTactic Collection { get; } = new SecurityAssessmentTactic(CollectionValue); - /// Command and Control. - public static SecurityAssessmentTactic CommandAndControl { get; } = new SecurityAssessmentTactic(CommandAndControlValue); - /// Exfiltration. - public static SecurityAssessmentTactic Exfiltration { get; } = new SecurityAssessmentTactic(ExfiltrationValue); - /// Impact. - public static SecurityAssessmentTactic Impact { get; } = new SecurityAssessmentTactic(ImpactValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityAssessmentTactic left, SecurityAssessmentTactic right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityAssessmentTactic left, SecurityAssessmentTactic right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityAssessmentTactic(string value) => new SecurityAssessmentTactic(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityAssessmentTactic other && Equals(other); - /// - public bool Equals(SecurityAssessmentTactic other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentTechnique.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentTechnique.cs deleted file mode 100644 index 5eb9ca5ecf0a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentTechnique.cs +++ /dev/null @@ -1,357 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Techniques of the assessment. - public readonly partial struct SecurityAssessmentTechnique : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityAssessmentTechnique(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AbuseElevationControlMechanismValue = "Abuse Elevation Control Mechanism"; - private const string AccessTokenManipulationValue = "Access Token Manipulation"; - private const string AccountDiscoveryValue = "Account Discovery"; - private const string AccountManipulationValue = "Account Manipulation"; - private const string ActiveScanningValue = "Active Scanning"; - private const string ApplicationLayerProtocolValue = "Application Layer Protocol"; - private const string AudioCaptureValue = "Audio Capture"; - private const string BootOrLogonAutostartExecutionValue = "Boot or Logon Autostart Execution"; - private const string BootOrLogonInitializationScriptsValue = "Boot or Logon Initialization Scripts"; - private const string BruteForceValue = "Brute Force"; - private const string CloudInfrastructureDiscoveryValue = "Cloud Infrastructure Discovery"; - private const string CloudServiceDashboardValue = "Cloud Service Dashboard"; - private const string CloudServiceDiscoveryValue = "Cloud Service Discovery"; - private const string CommandAndScriptingInterpreterValue = "Command and Scripting Interpreter"; - private const string CompromiseClientSoftwareBinaryValue = "Compromise Client Software Binary"; - private const string CompromiseInfrastructureValue = "Compromise Infrastructure"; - private const string ContainerAndResourceDiscoveryValue = "Container and Resource Discovery"; - private const string CreateAccountValue = "Create Account"; - private const string CreateOrModifySystemProcessValue = "Create or Modify System Process"; - private const string CredentialsFromPasswordStoresValue = "Credentials from Password Stores"; - private const string DataDestructionValue = "Data Destruction"; - private const string DataEncryptedForImpactValue = "Data Encrypted for Impact"; - private const string DataFromCloudStorageObjectValue = "Data from Cloud Storage Object"; - private const string DataFromConfigurationRepositoryValue = "Data from Configuration Repository"; - private const string DataFromInformationRepositoriesValue = "Data from Information Repositories"; - private const string DataFromLocalSystemValue = "Data from Local System"; - private const string DataManipulationValue = "Data Manipulation"; - private const string DataStagedValue = "Data Staged"; - private const string DefacementValue = "Defacement"; - private const string DeobfuscateDecodeFilesOrInformationValue = "Deobfuscate/Decode Files or Information"; - private const string DiskWipeValue = "Disk Wipe"; - private const string DomainTrustDiscoveryValue = "Domain Trust Discovery"; - private const string DriveByCompromiseValue = "Drive-by Compromise"; - private const string DynamicResolutionValue = "Dynamic Resolution"; - private const string EndpointDenialOfServiceValue = "Endpoint Denial of Service"; - private const string EventTriggeredExecutionValue = "Event Triggered Execution"; - private const string ExfiltrationOverAlternativeProtocolValue = "Exfiltration Over Alternative Protocol"; - private const string ExploitPublicFacingApplicationValue = "Exploit Public-Facing Application"; - private const string ExploitationForClientExecutionValue = "Exploitation for Client Execution"; - private const string ExploitationForCredentialAccessValue = "Exploitation for Credential Access"; - private const string ExploitationForDefenseEvasionValue = "Exploitation for Defense Evasion"; - private const string ExploitationForPrivilegeEscalationValue = "Exploitation for Privilege Escalation"; - private const string ExploitationOfRemoteServicesValue = "Exploitation of Remote Services"; - private const string ExternalRemoteServicesValue = "External Remote Services"; - private const string FallbackChannelsValue = "Fallback Channels"; - private const string FileAndDirectoryDiscoveryValue = "File and Directory Discovery"; - private const string GatherVictimNetworkInformationValue = "Gather Victim Network Information"; - private const string HideArtifactsValue = "Hide Artifacts"; - private const string HijackExecutionFlowValue = "Hijack Execution Flow"; - private const string ImpairDefensesValue = "Impair Defenses"; - private const string ImplantContainerImageValue = "Implant Container Image"; - private const string IndicatorRemovalOnHostValue = "Indicator Removal on Host"; - private const string IndirectCommandExecutionValue = "Indirect Command Execution"; - private const string IngressToolTransferValue = "Ingress Tool Transfer"; - private const string InputCaptureValue = "Input Capture"; - private const string InterProcessCommunicationValue = "Inter-Process Communication"; - private const string LateralToolTransferValue = "Lateral Tool Transfer"; - private const string ManInTheMiddleValue = "Man-in-the-Middle"; - private const string MasqueradingValue = "Masquerading"; - private const string ModifyAuthenticationProcessValue = "Modify Authentication Process"; - private const string ModifyRegistryValue = "Modify Registry"; - private const string NetworkDenialOfServiceValue = "Network Denial of Service"; - private const string NetworkServiceScanningValue = "Network Service Scanning"; - private const string NetworkSniffingValue = "Network Sniffing"; - private const string NonApplicationLayerProtocolValue = "Non-Application Layer Protocol"; - private const string NonStandardPortValue = "Non-Standard Port"; - private const string ObtainCapabilitiesValue = "Obtain Capabilities"; - private const string ObfuscatedFilesOrInformationValue = "Obfuscated Files or Information"; - private const string OfficeApplicationStartupValue = "Office Application Startup"; - private const string OSCredentialDumpingValue = "OS Credential Dumping"; - private const string PermissionGroupsDiscoveryValue = "Permission Groups Discovery"; - private const string PhishingValue = "Phishing"; - private const string PreOSBootValue = "Pre-OS Boot"; - private const string ProcessDiscoveryValue = "Process Discovery"; - private const string ProcessInjectionValue = "Process Injection"; - private const string ProtocolTunnelingValue = "Protocol Tunneling"; - private const string ProxyValue = "Proxy"; - private const string QueryRegistryValue = "Query Registry"; - private const string RemoteAccessSoftwareValue = "Remote Access Software"; - private const string RemoteServiceSessionHijackingValue = "Remote Service Session Hijacking"; - private const string RemoteServicesValue = "Remote Services"; - private const string RemoteSystemDiscoveryValue = "Remote System Discovery"; - private const string ResourceHijackingValue = "Resource Hijacking"; - private const string ScheduledTaskJobValue = "Scheduled Task/Job"; - private const string ScreenCaptureValue = "Screen Capture"; - private const string SearchVictimOwnedWebsitesValue = "Search Victim-Owned Websites"; - private const string ServerSoftwareComponentValue = "Server Software Component"; - private const string ServiceStopValue = "Service Stop"; - private const string SignedBinaryProxyExecutionValue = "Signed Binary Proxy Execution"; - private const string SoftwareDeploymentToolsValue = "Software Deployment Tools"; - private const string SQLStoredProceduresValue = "SQL Stored Procedures"; - private const string StealOrForgeKerberosTicketsValue = "Steal or Forge Kerberos Tickets"; - private const string SubvertTrustControlsValue = "Subvert Trust Controls"; - private const string SupplyChainCompromiseValue = "Supply Chain Compromise"; - private const string SystemInformationDiscoveryValue = "System Information Discovery"; - private const string TaintSharedContentValue = "Taint Shared Content"; - private const string TrafficSignalingValue = "Traffic Signaling"; - private const string TransferDataToCloudAccountValue = "Transfer Data to Cloud Account"; - private const string TrustedRelationshipValue = "Trusted Relationship"; - private const string UnsecuredCredentialsValue = "Unsecured Credentials"; - private const string UserExecutionValue = "User Execution"; - private const string ValidAccountsValue = "Valid Accounts"; - private const string WindowsManagementInstrumentationValue = "Windows Management Instrumentation"; - private const string FileAndDirectoryPermissionsModificationValue = "File and Directory Permissions Modification"; - - /// Abuse Elevation Control Mechanism. - public static SecurityAssessmentTechnique AbuseElevationControlMechanism { get; } = new SecurityAssessmentTechnique(AbuseElevationControlMechanismValue); - /// Access Token Manipulation. - public static SecurityAssessmentTechnique AccessTokenManipulation { get; } = new SecurityAssessmentTechnique(AccessTokenManipulationValue); - /// Account Discovery. - public static SecurityAssessmentTechnique AccountDiscovery { get; } = new SecurityAssessmentTechnique(AccountDiscoveryValue); - /// Account Manipulation. - public static SecurityAssessmentTechnique AccountManipulation { get; } = new SecurityAssessmentTechnique(AccountManipulationValue); - /// Active Scanning. - public static SecurityAssessmentTechnique ActiveScanning { get; } = new SecurityAssessmentTechnique(ActiveScanningValue); - /// Application Layer Protocol. - public static SecurityAssessmentTechnique ApplicationLayerProtocol { get; } = new SecurityAssessmentTechnique(ApplicationLayerProtocolValue); - /// Audio Capture. - public static SecurityAssessmentTechnique AudioCapture { get; } = new SecurityAssessmentTechnique(AudioCaptureValue); - /// Boot or Logon Autostart Execution. - public static SecurityAssessmentTechnique BootOrLogonAutostartExecution { get; } = new SecurityAssessmentTechnique(BootOrLogonAutostartExecutionValue); - /// Boot or Logon Initialization Scripts. - public static SecurityAssessmentTechnique BootOrLogonInitializationScripts { get; } = new SecurityAssessmentTechnique(BootOrLogonInitializationScriptsValue); - /// Brute Force. - public static SecurityAssessmentTechnique BruteForce { get; } = new SecurityAssessmentTechnique(BruteForceValue); - /// Cloud Infrastructure Discovery. - public static SecurityAssessmentTechnique CloudInfrastructureDiscovery { get; } = new SecurityAssessmentTechnique(CloudInfrastructureDiscoveryValue); - /// Cloud Service Dashboard. - public static SecurityAssessmentTechnique CloudServiceDashboard { get; } = new SecurityAssessmentTechnique(CloudServiceDashboardValue); - /// Cloud Service Discovery. - public static SecurityAssessmentTechnique CloudServiceDiscovery { get; } = new SecurityAssessmentTechnique(CloudServiceDiscoveryValue); - /// Command and Scripting Interpreter. - public static SecurityAssessmentTechnique CommandAndScriptingInterpreter { get; } = new SecurityAssessmentTechnique(CommandAndScriptingInterpreterValue); - /// Compromise Client Software Binary. - public static SecurityAssessmentTechnique CompromiseClientSoftwareBinary { get; } = new SecurityAssessmentTechnique(CompromiseClientSoftwareBinaryValue); - /// Compromise Infrastructure. - public static SecurityAssessmentTechnique CompromiseInfrastructure { get; } = new SecurityAssessmentTechnique(CompromiseInfrastructureValue); - /// Container and Resource Discovery. - public static SecurityAssessmentTechnique ContainerAndResourceDiscovery { get; } = new SecurityAssessmentTechnique(ContainerAndResourceDiscoveryValue); - /// Create Account. - public static SecurityAssessmentTechnique CreateAccount { get; } = new SecurityAssessmentTechnique(CreateAccountValue); - /// Create or Modify System Process. - public static SecurityAssessmentTechnique CreateOrModifySystemProcess { get; } = new SecurityAssessmentTechnique(CreateOrModifySystemProcessValue); - /// Credentials from Password Stores. - public static SecurityAssessmentTechnique CredentialsFromPasswordStores { get; } = new SecurityAssessmentTechnique(CredentialsFromPasswordStoresValue); - /// Data Destruction. - public static SecurityAssessmentTechnique DataDestruction { get; } = new SecurityAssessmentTechnique(DataDestructionValue); - /// Data Encrypted for Impact. - public static SecurityAssessmentTechnique DataEncryptedForImpact { get; } = new SecurityAssessmentTechnique(DataEncryptedForImpactValue); - /// Data from Cloud Storage Object. - public static SecurityAssessmentTechnique DataFromCloudStorageObject { get; } = new SecurityAssessmentTechnique(DataFromCloudStorageObjectValue); - /// Data from Configuration Repository. - public static SecurityAssessmentTechnique DataFromConfigurationRepository { get; } = new SecurityAssessmentTechnique(DataFromConfigurationRepositoryValue); - /// Data from Information Repositories. - public static SecurityAssessmentTechnique DataFromInformationRepositories { get; } = new SecurityAssessmentTechnique(DataFromInformationRepositoriesValue); - /// Data from Local System. - public static SecurityAssessmentTechnique DataFromLocalSystem { get; } = new SecurityAssessmentTechnique(DataFromLocalSystemValue); - /// Data Manipulation. - public static SecurityAssessmentTechnique DataManipulation { get; } = new SecurityAssessmentTechnique(DataManipulationValue); - /// Data Staged. - public static SecurityAssessmentTechnique DataStaged { get; } = new SecurityAssessmentTechnique(DataStagedValue); - /// Defacement. - public static SecurityAssessmentTechnique Defacement { get; } = new SecurityAssessmentTechnique(DefacementValue); - /// Deobfuscate/Decode Files or Information. - public static SecurityAssessmentTechnique DeobfuscateDecodeFilesOrInformation { get; } = new SecurityAssessmentTechnique(DeobfuscateDecodeFilesOrInformationValue); - /// Disk Wipe. - public static SecurityAssessmentTechnique DiskWipe { get; } = new SecurityAssessmentTechnique(DiskWipeValue); - /// Domain Trust Discovery. - public static SecurityAssessmentTechnique DomainTrustDiscovery { get; } = new SecurityAssessmentTechnique(DomainTrustDiscoveryValue); - /// Drive-by Compromise. - public static SecurityAssessmentTechnique DriveByCompromise { get; } = new SecurityAssessmentTechnique(DriveByCompromiseValue); - /// Dynamic Resolution. - public static SecurityAssessmentTechnique DynamicResolution { get; } = new SecurityAssessmentTechnique(DynamicResolutionValue); - /// Endpoint Denial of Service. - public static SecurityAssessmentTechnique EndpointDenialOfService { get; } = new SecurityAssessmentTechnique(EndpointDenialOfServiceValue); - /// Event Triggered Execution. - public static SecurityAssessmentTechnique EventTriggeredExecution { get; } = new SecurityAssessmentTechnique(EventTriggeredExecutionValue); - /// Exfiltration Over Alternative Protocol. - public static SecurityAssessmentTechnique ExfiltrationOverAlternativeProtocol { get; } = new SecurityAssessmentTechnique(ExfiltrationOverAlternativeProtocolValue); - /// Exploit Public-Facing Application. - public static SecurityAssessmentTechnique ExploitPublicFacingApplication { get; } = new SecurityAssessmentTechnique(ExploitPublicFacingApplicationValue); - /// Exploitation for Client Execution. - public static SecurityAssessmentTechnique ExploitationForClientExecution { get; } = new SecurityAssessmentTechnique(ExploitationForClientExecutionValue); - /// Exploitation for Credential Access. - public static SecurityAssessmentTechnique ExploitationForCredentialAccess { get; } = new SecurityAssessmentTechnique(ExploitationForCredentialAccessValue); - /// Exploitation for Defense Evasion. - public static SecurityAssessmentTechnique ExploitationForDefenseEvasion { get; } = new SecurityAssessmentTechnique(ExploitationForDefenseEvasionValue); - /// Exploitation for Privilege Escalation. - public static SecurityAssessmentTechnique ExploitationForPrivilegeEscalation { get; } = new SecurityAssessmentTechnique(ExploitationForPrivilegeEscalationValue); - /// Exploitation of Remote Services. - public static SecurityAssessmentTechnique ExploitationOfRemoteServices { get; } = new SecurityAssessmentTechnique(ExploitationOfRemoteServicesValue); - /// External Remote Services. - public static SecurityAssessmentTechnique ExternalRemoteServices { get; } = new SecurityAssessmentTechnique(ExternalRemoteServicesValue); - /// Fallback Channels. - public static SecurityAssessmentTechnique FallbackChannels { get; } = new SecurityAssessmentTechnique(FallbackChannelsValue); - /// File and Directory Discovery. - public static SecurityAssessmentTechnique FileAndDirectoryDiscovery { get; } = new SecurityAssessmentTechnique(FileAndDirectoryDiscoveryValue); - /// Gather Victim Network Information. - public static SecurityAssessmentTechnique GatherVictimNetworkInformation { get; } = new SecurityAssessmentTechnique(GatherVictimNetworkInformationValue); - /// Hide Artifacts. - public static SecurityAssessmentTechnique HideArtifacts { get; } = new SecurityAssessmentTechnique(HideArtifactsValue); - /// Hijack Execution Flow. - public static SecurityAssessmentTechnique HijackExecutionFlow { get; } = new SecurityAssessmentTechnique(HijackExecutionFlowValue); - /// Impair Defenses. - public static SecurityAssessmentTechnique ImpairDefenses { get; } = new SecurityAssessmentTechnique(ImpairDefensesValue); - /// Implant Container Image. - public static SecurityAssessmentTechnique ImplantContainerImage { get; } = new SecurityAssessmentTechnique(ImplantContainerImageValue); - /// Indicator Removal on Host. - public static SecurityAssessmentTechnique IndicatorRemovalOnHost { get; } = new SecurityAssessmentTechnique(IndicatorRemovalOnHostValue); - /// Indirect Command Execution. - public static SecurityAssessmentTechnique IndirectCommandExecution { get; } = new SecurityAssessmentTechnique(IndirectCommandExecutionValue); - /// Ingress Tool Transfer. - public static SecurityAssessmentTechnique IngressToolTransfer { get; } = new SecurityAssessmentTechnique(IngressToolTransferValue); - /// Input Capture. - public static SecurityAssessmentTechnique InputCapture { get; } = new SecurityAssessmentTechnique(InputCaptureValue); - /// Inter-Process Communication. - public static SecurityAssessmentTechnique InterProcessCommunication { get; } = new SecurityAssessmentTechnique(InterProcessCommunicationValue); - /// Lateral Tool Transfer. - public static SecurityAssessmentTechnique LateralToolTransfer { get; } = new SecurityAssessmentTechnique(LateralToolTransferValue); - /// Man-in-the-Middle. - public static SecurityAssessmentTechnique ManInTheMiddle { get; } = new SecurityAssessmentTechnique(ManInTheMiddleValue); - /// Masquerading. - public static SecurityAssessmentTechnique Masquerading { get; } = new SecurityAssessmentTechnique(MasqueradingValue); - /// Modify Authentication Process. - public static SecurityAssessmentTechnique ModifyAuthenticationProcess { get; } = new SecurityAssessmentTechnique(ModifyAuthenticationProcessValue); - /// Modify Registry. - public static SecurityAssessmentTechnique ModifyRegistry { get; } = new SecurityAssessmentTechnique(ModifyRegistryValue); - /// Network Denial of Service. - public static SecurityAssessmentTechnique NetworkDenialOfService { get; } = new SecurityAssessmentTechnique(NetworkDenialOfServiceValue); - /// Network Service Scanning. - public static SecurityAssessmentTechnique NetworkServiceScanning { get; } = new SecurityAssessmentTechnique(NetworkServiceScanningValue); - /// Network Sniffing. - public static SecurityAssessmentTechnique NetworkSniffing { get; } = new SecurityAssessmentTechnique(NetworkSniffingValue); - /// Non-Application Layer Protocol. - public static SecurityAssessmentTechnique NonApplicationLayerProtocol { get; } = new SecurityAssessmentTechnique(NonApplicationLayerProtocolValue); - /// Non-Standard Port. - public static SecurityAssessmentTechnique NonStandardPort { get; } = new SecurityAssessmentTechnique(NonStandardPortValue); - /// Obtain Capabilities. - public static SecurityAssessmentTechnique ObtainCapabilities { get; } = new SecurityAssessmentTechnique(ObtainCapabilitiesValue); - /// Obfuscated Files or Information. - public static SecurityAssessmentTechnique ObfuscatedFilesOrInformation { get; } = new SecurityAssessmentTechnique(ObfuscatedFilesOrInformationValue); - /// Office Application Startup. - public static SecurityAssessmentTechnique OfficeApplicationStartup { get; } = new SecurityAssessmentTechnique(OfficeApplicationStartupValue); - /// OS Credential Dumping. - public static SecurityAssessmentTechnique OSCredentialDumping { get; } = new SecurityAssessmentTechnique(OSCredentialDumpingValue); - /// Permission Groups Discovery. - public static SecurityAssessmentTechnique PermissionGroupsDiscovery { get; } = new SecurityAssessmentTechnique(PermissionGroupsDiscoveryValue); - /// Phishing. - public static SecurityAssessmentTechnique Phishing { get; } = new SecurityAssessmentTechnique(PhishingValue); - /// Pre-OS Boot. - public static SecurityAssessmentTechnique PreOSBoot { get; } = new SecurityAssessmentTechnique(PreOSBootValue); - /// Process Discovery. - public static SecurityAssessmentTechnique ProcessDiscovery { get; } = new SecurityAssessmentTechnique(ProcessDiscoveryValue); - /// Process Injection. - public static SecurityAssessmentTechnique ProcessInjection { get; } = new SecurityAssessmentTechnique(ProcessInjectionValue); - /// Protocol Tunneling. - public static SecurityAssessmentTechnique ProtocolTunneling { get; } = new SecurityAssessmentTechnique(ProtocolTunnelingValue); - /// Proxy. - public static SecurityAssessmentTechnique Proxy { get; } = new SecurityAssessmentTechnique(ProxyValue); - /// Query Registry. - public static SecurityAssessmentTechnique QueryRegistry { get; } = new SecurityAssessmentTechnique(QueryRegistryValue); - /// Remote Access Software. - public static SecurityAssessmentTechnique RemoteAccessSoftware { get; } = new SecurityAssessmentTechnique(RemoteAccessSoftwareValue); - /// Remote Service Session Hijacking. - public static SecurityAssessmentTechnique RemoteServiceSessionHijacking { get; } = new SecurityAssessmentTechnique(RemoteServiceSessionHijackingValue); - /// Remote Services. - public static SecurityAssessmentTechnique RemoteServices { get; } = new SecurityAssessmentTechnique(RemoteServicesValue); - /// Remote System Discovery. - public static SecurityAssessmentTechnique RemoteSystemDiscovery { get; } = new SecurityAssessmentTechnique(RemoteSystemDiscoveryValue); - /// Resource Hijacking. - public static SecurityAssessmentTechnique ResourceHijacking { get; } = new SecurityAssessmentTechnique(ResourceHijackingValue); - /// Scheduled Task/Job. - public static SecurityAssessmentTechnique ScheduledTaskJob { get; } = new SecurityAssessmentTechnique(ScheduledTaskJobValue); - /// Screen Capture. - public static SecurityAssessmentTechnique ScreenCapture { get; } = new SecurityAssessmentTechnique(ScreenCaptureValue); - /// Search Victim-Owned Websites. - public static SecurityAssessmentTechnique SearchVictimOwnedWebsites { get; } = new SecurityAssessmentTechnique(SearchVictimOwnedWebsitesValue); - /// Server Software Component. - public static SecurityAssessmentTechnique ServerSoftwareComponent { get; } = new SecurityAssessmentTechnique(ServerSoftwareComponentValue); - /// Service Stop. - public static SecurityAssessmentTechnique ServiceStop { get; } = new SecurityAssessmentTechnique(ServiceStopValue); - /// Signed Binary Proxy Execution. - public static SecurityAssessmentTechnique SignedBinaryProxyExecution { get; } = new SecurityAssessmentTechnique(SignedBinaryProxyExecutionValue); - /// Software Deployment Tools. - public static SecurityAssessmentTechnique SoftwareDeploymentTools { get; } = new SecurityAssessmentTechnique(SoftwareDeploymentToolsValue); - /// SQL Stored Procedures. - public static SecurityAssessmentTechnique SQLStoredProcedures { get; } = new SecurityAssessmentTechnique(SQLStoredProceduresValue); - /// Steal or Forge Kerberos Tickets. - public static SecurityAssessmentTechnique StealOrForgeKerberosTickets { get; } = new SecurityAssessmentTechnique(StealOrForgeKerberosTicketsValue); - /// Subvert Trust Controls. - public static SecurityAssessmentTechnique SubvertTrustControls { get; } = new SecurityAssessmentTechnique(SubvertTrustControlsValue); - /// Supply Chain Compromise. - public static SecurityAssessmentTechnique SupplyChainCompromise { get; } = new SecurityAssessmentTechnique(SupplyChainCompromiseValue); - /// System Information Discovery. - public static SecurityAssessmentTechnique SystemInformationDiscovery { get; } = new SecurityAssessmentTechnique(SystemInformationDiscoveryValue); - /// Taint Shared Content. - public static SecurityAssessmentTechnique TaintSharedContent { get; } = new SecurityAssessmentTechnique(TaintSharedContentValue); - /// Traffic Signaling. - public static SecurityAssessmentTechnique TrafficSignaling { get; } = new SecurityAssessmentTechnique(TrafficSignalingValue); - /// Transfer Data to Cloud Account. - public static SecurityAssessmentTechnique TransferDataToCloudAccount { get; } = new SecurityAssessmentTechnique(TransferDataToCloudAccountValue); - /// Trusted Relationship. - public static SecurityAssessmentTechnique TrustedRelationship { get; } = new SecurityAssessmentTechnique(TrustedRelationshipValue); - /// Unsecured Credentials. - public static SecurityAssessmentTechnique UnsecuredCredentials { get; } = new SecurityAssessmentTechnique(UnsecuredCredentialsValue); - /// User Execution. - public static SecurityAssessmentTechnique UserExecution { get; } = new SecurityAssessmentTechnique(UserExecutionValue); - /// Valid Accounts. - public static SecurityAssessmentTechnique ValidAccounts { get; } = new SecurityAssessmentTechnique(ValidAccountsValue); - /// Windows Management Instrumentation. - public static SecurityAssessmentTechnique WindowsManagementInstrumentation { get; } = new SecurityAssessmentTechnique(WindowsManagementInstrumentationValue); - /// File and Directory Permissions Modification. - public static SecurityAssessmentTechnique FileAndDirectoryPermissionsModification { get; } = new SecurityAssessmentTechnique(FileAndDirectoryPermissionsModificationValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityAssessmentTechnique left, SecurityAssessmentTechnique right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityAssessmentTechnique left, SecurityAssessmentTechnique right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityAssessmentTechnique(string value) => new SecurityAssessmentTechnique(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityAssessmentTechnique other && Equals(other); - /// - public bool Equals(SecurityAssessmentTechnique other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentType.cs deleted file mode 100644 index 7d9af3877949..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentType.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition. - public readonly partial struct SecurityAssessmentType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityAssessmentType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string BuiltInValue = "BuiltIn"; - private const string CustomPolicyValue = "CustomPolicy"; - private const string CustomerManagedValue = "CustomerManaged"; - private const string VerifiedPartnerValue = "VerifiedPartner"; - - /// Microsoft Defender for Cloud managed assessments. - public static SecurityAssessmentType BuiltIn { get; } = new SecurityAssessmentType(BuiltInValue); - /// User defined policies that are automatically ingested from Azure Policy to Microsoft Defender for Cloud. - public static SecurityAssessmentType CustomPolicy { get; } = new SecurityAssessmentType(CustomPolicyValue); - /// User assessments pushed directly by the user or other third party to Microsoft Defender for Cloud. - public static SecurityAssessmentType CustomerManaged { get; } = new SecurityAssessmentType(CustomerManagedValue); - /// An assessment that was created by a verified 3rd party if the user connected it to ASC. - public static SecurityAssessmentType VerifiedPartner { get; } = new SecurityAssessmentType(VerifiedPartnerValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityAssessmentType left, SecurityAssessmentType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityAssessmentType left, SecurityAssessmentType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityAssessmentType(string value) => new SecurityAssessmentType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityAssessmentType other && Equals(other); - /// - public bool Equals(SecurityAssessmentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentUserImpact.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentUserImpact.cs deleted file mode 100644 index ec8e723a2357..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAssessmentUserImpact.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The user impact of the assessment. - public readonly partial struct SecurityAssessmentUserImpact : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityAssessmentUserImpact(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string LowValue = "Low"; - private const string ModerateValue = "Moderate"; - private const string HighValue = "High"; - - /// Low. - public static SecurityAssessmentUserImpact Low { get; } = new SecurityAssessmentUserImpact(LowValue); - /// Moderate. - public static SecurityAssessmentUserImpact Moderate { get; } = new SecurityAssessmentUserImpact(ModerateValue); - /// High. - public static SecurityAssessmentUserImpact High { get; } = new SecurityAssessmentUserImpact(HighValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityAssessmentUserImpact left, SecurityAssessmentUserImpact right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityAssessmentUserImpact left, SecurityAssessmentUserImpact right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityAssessmentUserImpact(string value) => new SecurityAssessmentUserImpact(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityAssessmentUserImpact other && Equals(other); - /// - public bool Equals(SecurityAssessmentUserImpact other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationAction.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationAction.Serialization.cs deleted file mode 100644 index 03450f04577e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationAction.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAutomationAction : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("actionType"u8); - writer.WriteStringValue(ActionType.ToString()); - writer.WriteEndObject(); - } - - internal static SecurityAutomationAction DeserializeSecurityAutomationAction(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("actionType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "EventHub": return SecurityAutomationActionEventHub.DeserializeSecurityAutomationActionEventHub(element); - case "LogicApp": return SecurityAutomationActionLogicApp.DeserializeSecurityAutomationActionLogicApp(element); - case "Workspace": return SecurityAutomationActionWorkspace.DeserializeSecurityAutomationActionWorkspace(element); - } - } - return UnknownAutomationAction.DeserializeUnknownAutomationAction(element); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationAction.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationAction.cs deleted file mode 100644 index 822df3fb739e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationAction.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// - /// The action that should be triggered. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public abstract partial class SecurityAutomationAction - { - /// Initializes a new instance of SecurityAutomationAction. - protected SecurityAutomationAction() - { - } - - /// Initializes a new instance of SecurityAutomationAction. - /// The type of the action that will be triggered by the Automation. - internal SecurityAutomationAction(ActionType actionType) - { - ActionType = actionType; - } - - /// The type of the action that will be triggered by the Automation. - internal ActionType ActionType { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionEventHub.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionEventHub.Serialization.cs deleted file mode 100644 index 9982ef5d546d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionEventHub.Serialization.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAutomationActionEventHub : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(EventHubResourceId)) - { - writer.WritePropertyName("eventHubResourceId"u8); - writer.WriteStringValue(EventHubResourceId); - } - if (Optional.IsDefined(ConnectionString)) - { - writer.WritePropertyName("connectionString"u8); - writer.WriteStringValue(ConnectionString); - } - writer.WritePropertyName("actionType"u8); - writer.WriteStringValue(ActionType.ToString()); - writer.WriteEndObject(); - } - - internal static SecurityAutomationActionEventHub DeserializeSecurityAutomationActionEventHub(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional eventHubResourceId = default; - Optional sasPolicyName = default; - Optional connectionString = default; - ActionType actionType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("eventHubResourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - eventHubResourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("sasPolicyName"u8)) - { - sasPolicyName = property.Value.GetString(); - continue; - } - if (property.NameEquals("connectionString"u8)) - { - connectionString = property.Value.GetString(); - continue; - } - if (property.NameEquals("actionType"u8)) - { - actionType = new ActionType(property.Value.GetString()); - continue; - } - } - return new SecurityAutomationActionEventHub(actionType, eventHubResourceId.Value, sasPolicyName.Value, connectionString.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionEventHub.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionEventHub.cs deleted file mode 100644 index 4e12cd7036ed..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionEventHub.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The target Event Hub to which event data will be exported. To learn more about Microsoft Defender for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore. - public partial class SecurityAutomationActionEventHub : SecurityAutomationAction - { - /// Initializes a new instance of SecurityAutomationActionEventHub. - public SecurityAutomationActionEventHub() - { - ActionType = ActionType.EventHub; - } - - /// Initializes a new instance of SecurityAutomationActionEventHub. - /// The type of the action that will be triggered by the Automation. - /// The target Event Hub Azure Resource ID. - /// The target Event Hub SAS policy name. - /// The target Event Hub connection string (it will not be included in any response). - internal SecurityAutomationActionEventHub(ActionType actionType, ResourceIdentifier eventHubResourceId, string sasPolicyName, string connectionString) : base(actionType) - { - EventHubResourceId = eventHubResourceId; - SasPolicyName = sasPolicyName; - ConnectionString = connectionString; - ActionType = actionType; - } - - /// The target Event Hub Azure Resource ID. - public ResourceIdentifier EventHubResourceId { get; set; } - /// The target Event Hub SAS policy name. - public string SasPolicyName { get; } - /// The target Event Hub connection string (it will not be included in any response). - public string ConnectionString { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionLogicApp.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionLogicApp.Serialization.cs deleted file mode 100644 index 05fea2cf2f5c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionLogicApp.Serialization.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAutomationActionLogicApp : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(LogicAppResourceId)) - { - writer.WritePropertyName("logicAppResourceId"u8); - writer.WriteStringValue(LogicAppResourceId); - } - if (Optional.IsDefined(Uri)) - { - writer.WritePropertyName("uri"u8); - writer.WriteStringValue(Uri.AbsoluteUri); - } - writer.WritePropertyName("actionType"u8); - writer.WriteStringValue(ActionType.ToString()); - writer.WriteEndObject(); - } - - internal static SecurityAutomationActionLogicApp DeserializeSecurityAutomationActionLogicApp(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional logicAppResourceId = default; - Optional uri = default; - ActionType actionType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("logicAppResourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - logicAppResourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("uri"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - uri = null; - continue; - } - uri = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("actionType"u8)) - { - actionType = new ActionType(property.Value.GetString()); - continue; - } - } - return new SecurityAutomationActionLogicApp(actionType, logicAppResourceId.Value, uri.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionLogicApp.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionLogicApp.cs deleted file mode 100644 index d48679679e24..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionLogicApp.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The logic app action that should be triggered. To learn more about Microsoft Defender for Cloud's Workflow Automation capabilities, visit https://aka.ms/ASCWorkflowAutomationLearnMore. - public partial class SecurityAutomationActionLogicApp : SecurityAutomationAction - { - /// Initializes a new instance of SecurityAutomationActionLogicApp. - public SecurityAutomationActionLogicApp() - { - ActionType = ActionType.LogicApp; - } - - /// Initializes a new instance of SecurityAutomationActionLogicApp. - /// The type of the action that will be triggered by the Automation. - /// The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have permissions to trigger the Logic App. - /// The Logic App trigger URI endpoint (it will not be included in any response). - internal SecurityAutomationActionLogicApp(ActionType actionType, ResourceIdentifier logicAppResourceId, Uri uri) : base(actionType) - { - LogicAppResourceId = logicAppResourceId; - Uri = uri; - ActionType = actionType; - } - - /// The triggered Logic App Azure Resource ID. This can also reside on other subscriptions, given that you have permissions to trigger the Logic App. - public ResourceIdentifier LogicAppResourceId { get; set; } - /// The Logic App trigger URI endpoint (it will not be included in any response). - public Uri Uri { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionWorkspace.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionWorkspace.Serialization.cs deleted file mode 100644 index c3b26771e18a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionWorkspace.Serialization.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAutomationActionWorkspace : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(WorkspaceResourceId)) - { - writer.WritePropertyName("workspaceResourceId"u8); - writer.WriteStringValue(WorkspaceResourceId); - } - writer.WritePropertyName("actionType"u8); - writer.WriteStringValue(ActionType.ToString()); - writer.WriteEndObject(); - } - - internal static SecurityAutomationActionWorkspace DeserializeSecurityAutomationActionWorkspace(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional workspaceResourceId = default; - ActionType actionType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("workspaceResourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - workspaceResourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("actionType"u8)) - { - actionType = new ActionType(property.Value.GetString()); - continue; - } - } - return new SecurityAutomationActionWorkspace(actionType, workspaceResourceId.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionWorkspace.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionWorkspace.cs deleted file mode 100644 index 302e79ee65d7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationActionWorkspace.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The Log Analytics Workspace to which event data will be exported. Security alerts data will reside in the 'SecurityAlert' table and the assessments data will reside in the 'SecurityRecommendation' table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order to view the data in the workspace, the Security Center Log Analytics free/standard solution needs to be enabled on that workspace. To learn more about Microsoft Defender for Cloud continuous export capabilities, visit https://aka.ms/ASCExportLearnMore. - public partial class SecurityAutomationActionWorkspace : SecurityAutomationAction - { - /// Initializes a new instance of SecurityAutomationActionWorkspace. - public SecurityAutomationActionWorkspace() - { - ActionType = ActionType.Workspace; - } - - /// Initializes a new instance of SecurityAutomationActionWorkspace. - /// The type of the action that will be triggered by the Automation. - /// The fully qualified Log Analytics Workspace Azure Resource ID. - internal SecurityAutomationActionWorkspace(ActionType actionType, ResourceIdentifier workspaceResourceId) : base(actionType) - { - WorkspaceResourceId = workspaceResourceId; - ActionType = actionType; - } - - /// The fully qualified Log Analytics Workspace Azure Resource ID. - public ResourceIdentifier WorkspaceResourceId { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationRuleSet.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationRuleSet.Serialization.cs deleted file mode 100644 index 3077912f2814..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationRuleSet.Serialization.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAutomationRuleSet : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Rules)) - { - writer.WritePropertyName("rules"u8); - writer.WriteStartArray(); - foreach (var item in Rules) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static SecurityAutomationRuleSet DeserializeSecurityAutomationRuleSet(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> rules = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("rules"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityAutomationTriggeringRule.DeserializeSecurityAutomationTriggeringRule(item)); - } - rules = array; - continue; - } - } - return new SecurityAutomationRuleSet(Optional.ToList(rules)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationRuleSet.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationRuleSet.cs deleted file mode 100644 index d3579ef5210a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationRuleSet.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A rule set which evaluates all its rules upon an event interception. Only when all the included rules in the rule set will be evaluated as 'true', will the event trigger the defined actions. - public partial class SecurityAutomationRuleSet - { - /// Initializes a new instance of SecurityAutomationRuleSet. - public SecurityAutomationRuleSet() - { - Rules = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecurityAutomationRuleSet. - /// - internal SecurityAutomationRuleSet(IList rules) - { - Rules = rules; - } - - /// Gets the rules. - public IList Rules { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationScope.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationScope.Serialization.cs deleted file mode 100644 index eb1fe0c03cc5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationScope.Serialization.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAutomationScope : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (Optional.IsDefined(ScopePath)) - { - writer.WritePropertyName("scopePath"u8); - writer.WriteStringValue(ScopePath); - } - writer.WriteEndObject(); - } - - internal static SecurityAutomationScope DeserializeSecurityAutomationScope(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional description = default; - Optional scopePath = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("scopePath"u8)) - { - scopePath = property.Value.GetString(); - continue; - } - } - return new SecurityAutomationScope(description.Value, scopePath.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationScope.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationScope.cs deleted file mode 100644 index b12f853e7f46..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationScope.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A single automation scope. - public partial class SecurityAutomationScope - { - /// Initializes a new instance of SecurityAutomationScope. - public SecurityAutomationScope() - { - } - - /// Initializes a new instance of SecurityAutomationScope. - /// The resources scope description. - /// The resources scope path. Can be the subscription on which the automation is defined on or a resource group under that subscription (fully qualified Azure resource IDs). - internal SecurityAutomationScope(string description, string scopePath) - { - Description = description; - ScopePath = scopePath; - } - - /// The resources scope description. - public string Description { get; set; } - /// The resources scope path. Can be the subscription on which the automation is defined on or a resource group under that subscription (fully qualified Azure resource IDs). - public string ScopePath { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationSource.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationSource.Serialization.cs deleted file mode 100644 index 61cdb8403272..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationSource.Serialization.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAutomationSource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(EventSource)) - { - writer.WritePropertyName("eventSource"u8); - writer.WriteStringValue(EventSource.Value.ToString()); - } - if (Optional.IsCollectionDefined(RuleSets)) - { - writer.WritePropertyName("ruleSets"u8); - writer.WriteStartArray(); - foreach (var item in RuleSets) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static SecurityAutomationSource DeserializeSecurityAutomationSource(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional eventSource = default; - Optional> ruleSets = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("eventSource"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - eventSource = new SecurityEventSource(property.Value.GetString()); - continue; - } - if (property.NameEquals("ruleSets"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityAutomationRuleSet.DeserializeSecurityAutomationRuleSet(item)); - } - ruleSets = array; - continue; - } - } - return new SecurityAutomationSource(Optional.ToNullable(eventSource), Optional.ToList(ruleSets)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationSource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationSource.cs deleted file mode 100644 index b794a71d9402..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationSource.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The source event types which evaluate the security automation set of rules. For example - security alerts and security assessments. To learn more about the supported security events data models schemas - please visit https://aka.ms/ASCAutomationSchemas. - public partial class SecurityAutomationSource - { - /// Initializes a new instance of SecurityAutomationSource. - public SecurityAutomationSource() - { - RuleSets = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecurityAutomationSource. - /// A valid event source type. - /// A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or'). - internal SecurityAutomationSource(SecurityEventSource? eventSource, IList ruleSets) - { - EventSource = eventSource; - RuleSets = ruleSets; - } - - /// A valid event source type. - public SecurityEventSource? EventSource { get; set; } - /// A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or'). - public IList RuleSets { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationTriggeringRule.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationTriggeringRule.Serialization.cs deleted file mode 100644 index 3d8b931c23b4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationTriggeringRule.Serialization.cs +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAutomationTriggeringRule : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(PropertyJPath)) - { - writer.WritePropertyName("propertyJPath"u8); - writer.WriteStringValue(PropertyJPath); - } - if (Optional.IsDefined(PropertyType)) - { - writer.WritePropertyName("propertyType"u8); - writer.WriteStringValue(PropertyType.Value.ToString()); - } - if (Optional.IsDefined(ExpectedValue)) - { - writer.WritePropertyName("expectedValue"u8); - writer.WriteStringValue(ExpectedValue); - } - if (Optional.IsDefined(Operator)) - { - writer.WritePropertyName("operator"u8); - writer.WriteStringValue(Operator.Value.ToString()); - } - writer.WriteEndObject(); - } - - internal static SecurityAutomationTriggeringRule DeserializeSecurityAutomationTriggeringRule(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional propertyJPath = default; - Optional propertyType = default; - Optional expectedValue = default; - Optional @operator = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("propertyJPath"u8)) - { - propertyJPath = property.Value.GetString(); - continue; - } - if (property.NameEquals("propertyType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - propertyType = new AutomationTriggeringRulePropertyType(property.Value.GetString()); - continue; - } - if (property.NameEquals("expectedValue"u8)) - { - expectedValue = property.Value.GetString(); - continue; - } - if (property.NameEquals("operator"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - @operator = new AutomationTriggeringRuleOperator(property.Value.GetString()); - continue; - } - } - return new SecurityAutomationTriggeringRule(propertyJPath.Value, Optional.ToNullable(propertyType), expectedValue.Value, Optional.ToNullable(@operator)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationTriggeringRule.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationTriggeringRule.cs deleted file mode 100644 index 29bed664b0c9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationTriggeringRule.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A rule which is evaluated upon event interception. The rule is configured by comparing a specific value from the event model to an expected value. This comparison is done by using one of the supported operators set. - public partial class SecurityAutomationTriggeringRule - { - /// Initializes a new instance of SecurityAutomationTriggeringRule. - public SecurityAutomationTriggeringRule() - { - } - - /// Initializes a new instance of SecurityAutomationTriggeringRule. - /// The JPath of the entity model property that should be checked. - /// The data type of the compared operands (string, integer, floating point number or a boolean [true/false]]. - /// The expected value. - /// A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType. - internal SecurityAutomationTriggeringRule(string propertyJPath, AutomationTriggeringRulePropertyType? propertyType, string expectedValue, AutomationTriggeringRuleOperator? @operator) - { - PropertyJPath = propertyJPath; - PropertyType = propertyType; - ExpectedValue = expectedValue; - Operator = @operator; - } - - /// The JPath of the entity model property that should be checked. - public string PropertyJPath { get; set; } - /// The data type of the compared operands (string, integer, floating point number or a boolean [true/false]]. - public AutomationTriggeringRulePropertyType? PropertyType { get; set; } - /// The expected value. - public string ExpectedValue { get; set; } - /// A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType. - public AutomationTriggeringRuleOperator? Operator { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationValidationStatus.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationValidationStatus.Serialization.cs deleted file mode 100644 index e8023064dab6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationValidationStatus.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityAutomationValidationStatus - { - internal static SecurityAutomationValidationStatus DeserializeSecurityAutomationValidationStatus(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional isValid = default; - Optional message = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("isValid"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isValid = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - } - return new SecurityAutomationValidationStatus(Optional.ToNullable(isValid), message.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationValidationStatus.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationValidationStatus.cs deleted file mode 100644 index edb16df03dd4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationValidationStatus.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The security automation model state property bag. - public partial class SecurityAutomationValidationStatus - { - /// Initializes a new instance of SecurityAutomationValidationStatus. - internal SecurityAutomationValidationStatus() - { - } - - /// Initializes a new instance of SecurityAutomationValidationStatus. - /// Indicates whether the model is valid or not. - /// The validation message. - internal SecurityAutomationValidationStatus(bool? isValid, string message) - { - IsValid = isValid; - Message = message; - } - - /// Indicates whether the model is valid or not. - public bool? IsValid { get; } - /// The validation message. - public string Message { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterAllowedConnection.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterAllowedConnection.Serialization.cs deleted file mode 100644 index 31aac0157f55..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterAllowedConnection.Serialization.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityCenterAllowedConnection : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecurityCenterAllowedConnection DeserializeSecurityCenterAllowedConnection(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional calculatedDateTime = default; - Optional> connectableResources = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("calculatedDateTime"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - calculatedDateTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("connectableResources"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ConnectableResourceInfo.DeserializeConnectableResourceInfo(item)); - } - connectableResources = array; - continue; - } - } - continue; - } - } - return new SecurityCenterAllowedConnection(id, name, type, systemData.Value, Optional.ToNullable(calculatedDateTime), Optional.ToList(connectableResources), Optional.ToNullable(location)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterAllowedConnection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterAllowedConnection.cs deleted file mode 100644 index 3ac10379235f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterAllowedConnection.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The resource whose properties describes the allowed traffic between Azure resources. - public partial class SecurityCenterAllowedConnection : ResourceData - { - /// Initializes a new instance of SecurityCenterAllowedConnection. - public SecurityCenterAllowedConnection() - { - ConnectableResources = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecurityCenterAllowedConnection. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The UTC time on which the allowed connections resource was calculated. - /// List of connectable resources. - /// Location where the resource is stored. - internal SecurityCenterAllowedConnection(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DateTimeOffset? calculatedOn, IReadOnlyList connectableResources, AzureLocation? location) : base(id, name, resourceType, systemData) - { - CalculatedOn = calculatedOn; - ConnectableResources = connectableResources; - Location = location; - } - - /// The UTC time on which the allowed connections resource was calculated. - public DateTimeOffset? CalculatedOn { get; } - /// List of connectable resources. - public IReadOnlyList ConnectableResources { get; } - /// Location where the resource is stored. - public AzureLocation? Location { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterCloudName.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterCloudName.cs deleted file mode 100644 index cc7f82b25dc6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterCloudName.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The multi cloud resource's cloud name. - public readonly partial struct SecurityCenterCloudName : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityCenterCloudName(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureValue = "Azure"; - private const string AwsValue = "AWS"; - private const string GcpValue = "GCP"; - private const string GithubValue = "Github"; - private const string AzureDevOpsValue = "AzureDevOps"; - - /// Azure. - public static SecurityCenterCloudName Azure { get; } = new SecurityCenterCloudName(AzureValue); - /// AWS. - public static SecurityCenterCloudName Aws { get; } = new SecurityCenterCloudName(AwsValue); - /// GCP. - public static SecurityCenterCloudName Gcp { get; } = new SecurityCenterCloudName(GcpValue); - /// Github. - public static SecurityCenterCloudName Github { get; } = new SecurityCenterCloudName(GithubValue); - /// AzureDevOps. - public static SecurityCenterCloudName AzureDevOps { get; } = new SecurityCenterCloudName(AzureDevOpsValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityCenterCloudName left, SecurityCenterCloudName right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityCenterCloudName left, SecurityCenterCloudName right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityCenterCloudName(string value) => new SecurityCenterCloudName(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityCenterCloudName other && Equals(other); - /// - public bool Equals(SecurityCenterCloudName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterCloudOffering.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterCloudOffering.Serialization.cs deleted file mode 100644 index 962a6bba1cb2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterCloudOffering.Serialization.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityCenterCloudOffering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("offeringType"u8); - writer.WriteStringValue(OfferingType.ToString()); - writer.WriteEndObject(); - } - - internal static SecurityCenterCloudOffering DeserializeSecurityCenterCloudOffering(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("offeringType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "CspmMonitorAws": return CspmMonitorAwsOffering.DeserializeCspmMonitorAwsOffering(element); - case "CspmMonitorAzureDevOps": return CspmMonitorAzureDevOpsOffering.DeserializeCspmMonitorAzureDevOpsOffering(element); - case "CspmMonitorGcp": return CspmMonitorGcpOffering.DeserializeCspmMonitorGcpOffering(element); - case "CspmMonitorGithub": return CspmMonitorGithubOffering.DeserializeCspmMonitorGithubOffering(element); - case "DefenderCspmAws": return DefenderCspmAwsOffering.DeserializeDefenderCspmAwsOffering(element); - case "DefenderCspmGcp": return DefenderCspmGcpOffering.DeserializeDefenderCspmGcpOffering(element); - case "DefenderForContainersAws": return DefenderForContainersAwsOffering.DeserializeDefenderForContainersAwsOffering(element); - case "DefenderForContainersGcp": return DefenderForContainersGcpOffering.DeserializeDefenderForContainersGcpOffering(element); - case "DefenderForDatabasesAws": return DefenderForDatabasesAwsOffering.DeserializeDefenderForDatabasesAwsOffering(element); - case "DefenderForDatabasesGcp": return DefenderForDatabasesGcpOffering.DeserializeDefenderForDatabasesGcpOffering(element); - case "DefenderForDevOpsAzureDevOps": return DefenderForDevOpsAzureDevOpsOffering.DeserializeDefenderForDevOpsAzureDevOpsOffering(element); - case "DefenderForDevOpsGithub": return DefenderForDevOpsGithubOffering.DeserializeDefenderForDevOpsGithubOffering(element); - case "DefenderForServersAws": return DefenderForServersAwsOffering.DeserializeDefenderForServersAwsOffering(element); - case "DefenderForServersGcp": return DefenderForServersGcpOffering.DeserializeDefenderForServersGcpOffering(element); - case "InformationProtectionAws": return InformationProtectionAwsOffering.DeserializeInformationProtectionAwsOffering(element); - } - } - return UnknownCloudOffering.DeserializeUnknownCloudOffering(element); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterCloudOffering.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterCloudOffering.cs deleted file mode 100644 index a7670d8d5372..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterCloudOffering.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// - /// The security offering details - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , and . - /// - public abstract partial class SecurityCenterCloudOffering - { - /// Initializes a new instance of SecurityCenterCloudOffering. - protected SecurityCenterCloudOffering() - { - } - - /// Initializes a new instance of SecurityCenterCloudOffering. - /// The type of the security offering. - /// The offering description. - internal SecurityCenterCloudOffering(OfferingType offeringType, string description) - { - OfferingType = offeringType; - Description = description; - } - - /// The type of the security offering. - internal OfferingType OfferingType { get; set; } - /// The offering description. - public string Description { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterCloudPermission.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterCloudPermission.cs deleted file mode 100644 index 53219c769c48..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterCloudPermission.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A permission detected in the cloud account. - public readonly partial struct SecurityCenterCloudPermission : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityCenterCloudPermission(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AwsAwsSecurityHubReadOnlyAccessValue = "AWS::AWSSecurityHubReadOnlyAccess"; - private const string AwsSecurityAuditValue = "AWS::SecurityAudit"; - private const string AwsAmazonSsmAutomationRoleValue = "AWS::AmazonSSMAutomationRole"; - private const string GcpSecurityCenterAdminViewerValue = "GCP::Security Center Admin Viewer"; - - /// This permission provides read only access to AWS Security Hub resources. - public static SecurityCenterCloudPermission AwsAwsSecurityHubReadOnlyAccess { get; } = new SecurityCenterCloudPermission(AwsAwsSecurityHubReadOnlyAccessValue); - /// This permission grants access to read security configuration metadata. - public static SecurityCenterCloudPermission AwsSecurityAudit { get; } = new SecurityCenterCloudPermission(AwsSecurityAuditValue); - /// The permission provides for EC2 Automation service to execute activities defined within Automation documents. - public static SecurityCenterCloudPermission AwsAmazonSsmAutomationRole { get; } = new SecurityCenterCloudPermission(AwsAmazonSsmAutomationRoleValue); - /// This permission provides read only access to GCP Security Command Center. - public static SecurityCenterCloudPermission GcpSecurityCenterAdminViewer { get; } = new SecurityCenterCloudPermission(GcpSecurityCenterAdminViewerValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityCenterCloudPermission left, SecurityCenterCloudPermission right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityCenterCloudPermission left, SecurityCenterCloudPermission right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityCenterCloudPermission(string value) => new SecurityCenterCloudPermission(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityCenterCloudPermission other && Equals(other); - /// - public bool Equals(SecurityCenterCloudPermission other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterConfigurationStatus.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterConfigurationStatus.cs deleted file mode 100644 index 88b963ac1245..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterConfigurationStatus.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The configuration status of the machines group or machine or rule. - public readonly partial struct SecurityCenterConfigurationStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityCenterConfigurationStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string ConfiguredValue = "Configured"; - private const string NotConfiguredValue = "NotConfigured"; - private const string InProgressValue = "InProgress"; - private const string FailedValue = "Failed"; - private const string NoStatusValue = "NoStatus"; - - /// Configured. - public static SecurityCenterConfigurationStatus Configured { get; } = new SecurityCenterConfigurationStatus(ConfiguredValue); - /// NotConfigured. - public static SecurityCenterConfigurationStatus NotConfigured { get; } = new SecurityCenterConfigurationStatus(NotConfiguredValue); - /// InProgress. - public static SecurityCenterConfigurationStatus InProgress { get; } = new SecurityCenterConfigurationStatus(InProgressValue); - /// Failed. - public static SecurityCenterConfigurationStatus Failed { get; } = new SecurityCenterConfigurationStatus(FailedValue); - /// NoStatus. - public static SecurityCenterConfigurationStatus NoStatus { get; } = new SecurityCenterConfigurationStatus(NoStatusValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityCenterConfigurationStatus left, SecurityCenterConfigurationStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityCenterConfigurationStatus left, SecurityCenterConfigurationStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityCenterConfigurationStatus(string value) => new SecurityCenterConfigurationStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityCenterConfigurationStatus other && Equals(other); - /// - public bool Equals(SecurityCenterConfigurationStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterConnectionType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterConnectionType.cs deleted file mode 100644 index 9f2689253228..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterConnectionType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The SecurityCenterConnectionType. - public readonly partial struct SecurityCenterConnectionType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityCenterConnectionType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InternalValue = "Internal"; - private const string ExternalValue = "External"; - - /// Internal. - public static SecurityCenterConnectionType Internal { get; } = new SecurityCenterConnectionType(InternalValue); - /// External. - public static SecurityCenterConnectionType External { get; } = new SecurityCenterConnectionType(ExternalValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityCenterConnectionType left, SecurityCenterConnectionType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityCenterConnectionType left, SecurityCenterConnectionType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityCenterConnectionType(string value) => new SecurityCenterConnectionType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityCenterConnectionType other && Equals(other); - /// - public bool Equals(SecurityCenterConnectionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterFileProtectionMode.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterFileProtectionMode.Serialization.cs deleted file mode 100644 index 86def3c7bf76..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterFileProtectionMode.Serialization.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityCenterFileProtectionMode : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Exe)) - { - writer.WritePropertyName("exe"u8); - writer.WriteStringValue(Exe.Value.ToString()); - } - if (Optional.IsDefined(Msi)) - { - writer.WritePropertyName("msi"u8); - writer.WriteStringValue(Msi.Value.ToString()); - } - if (Optional.IsDefined(Script)) - { - writer.WritePropertyName("script"u8); - writer.WriteStringValue(Script.Value.ToString()); - } - if (Optional.IsDefined(Executable)) - { - writer.WritePropertyName("executable"u8); - writer.WriteStringValue(Executable.Value.ToString()); - } - writer.WriteEndObject(); - } - - internal static SecurityCenterFileProtectionMode DeserializeSecurityCenterFileProtectionMode(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional exe = default; - Optional msi = default; - Optional script = default; - Optional executable = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("exe"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - exe = new AdaptiveApplicationControlEnforcementMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("msi"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - msi = new AdaptiveApplicationControlEnforcementMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("script"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - script = new AdaptiveApplicationControlEnforcementMode(property.Value.GetString()); - continue; - } - if (property.NameEquals("executable"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - executable = new AdaptiveApplicationControlEnforcementMode(property.Value.GetString()); - continue; - } - } - return new SecurityCenterFileProtectionMode(Optional.ToNullable(exe), Optional.ToNullable(msi), Optional.ToNullable(script), Optional.ToNullable(executable)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterFileProtectionMode.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterFileProtectionMode.cs deleted file mode 100644 index a64f84c2f649..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterFileProtectionMode.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The protection mode of the collection/file types. Exe/Msi/Script are used for Windows, Executable is used for Linux. - public partial class SecurityCenterFileProtectionMode - { - /// Initializes a new instance of SecurityCenterFileProtectionMode. - public SecurityCenterFileProtectionMode() - { - } - - /// Initializes a new instance of SecurityCenterFileProtectionMode. - /// The application control policy enforcement/protection mode of the machine group. - /// The application control policy enforcement/protection mode of the machine group. - /// The application control policy enforcement/protection mode of the machine group. - /// The application control policy enforcement/protection mode of the machine group. - internal SecurityCenterFileProtectionMode(AdaptiveApplicationControlEnforcementMode? exe, AdaptiveApplicationControlEnforcementMode? msi, AdaptiveApplicationControlEnforcementMode? script, AdaptiveApplicationControlEnforcementMode? executable) - { - Exe = exe; - Msi = msi; - Script = script; - Executable = executable; - } - - /// The application control policy enforcement/protection mode of the machine group. - public AdaptiveApplicationControlEnforcementMode? Exe { get; set; } - /// The application control policy enforcement/protection mode of the machine group. - public AdaptiveApplicationControlEnforcementMode? Msi { get; set; } - /// The application control policy enforcement/protection mode of the machine group. - public AdaptiveApplicationControlEnforcementMode? Script { get; set; } - /// The application control policy enforcement/protection mode of the machine group. - public AdaptiveApplicationControlEnforcementMode? Executable { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterKind.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterKind.cs deleted file mode 100644 index ff48630ceb52..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterKind.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The kind of alert simulation. - internal readonly partial struct SecurityCenterKind : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityCenterKind(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string BundlesValue = "Bundles"; - - /// Simulate alerts according to bundles. - public static SecurityCenterKind Bundles { get; } = new SecurityCenterKind(BundlesValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityCenterKind left, SecurityCenterKind right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityCenterKind left, SecurityCenterKind right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityCenterKind(string value) => new SecurityCenterKind(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityCenterKind other && Equals(other); - /// - public bool Equals(SecurityCenterKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterLocationData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterLocationData.Serialization.cs deleted file mode 100644 index a78bf2f2c35b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterLocationData.Serialization.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SecurityCenterLocationData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Properties); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(Properties.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - - internal static SecurityCenterLocationData DeserializeSecurityCenterLocationData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional properties = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - properties = BinaryData.FromString(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - } - return new SecurityCenterLocationData(id, name, type, systemData.Value, properties.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPricingData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPricingData.Serialization.cs deleted file mode 100644 index 76e6e62ea55b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPricingData.Serialization.cs +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SecurityCenterPricingData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(PricingTier)) - { - writer.WritePropertyName("pricingTier"u8); - writer.WriteStringValue(PricingTier.Value.ToString()); - } - if (Optional.IsDefined(SubPlan)) - { - writer.WritePropertyName("subPlan"u8); - writer.WriteStringValue(SubPlan); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecurityCenterPricingData DeserializeSecurityCenterPricingData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional pricingTier = default; - Optional subPlan = default; - Optional freeTrialRemainingTime = default; - Optional deprecated = default; - Optional> replacedBy = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("pricingTier"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - pricingTier = new SecurityCenterPricingTier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("subPlan"u8)) - { - subPlan = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("freeTrialRemainingTime"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - freeTrialRemainingTime = property0.Value.GetTimeSpan("P"); - continue; - } - if (property0.NameEquals("deprecated"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - deprecated = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("replacedBy"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - replacedBy = array; - continue; - } - } - continue; - } - } - return new SecurityCenterPricingData(id, name, type, systemData.Value, Optional.ToNullable(pricingTier), subPlan.Value, Optional.ToNullable(freeTrialRemainingTime), Optional.ToNullable(deprecated), Optional.ToList(replacedBy)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPricingTier.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPricingTier.cs deleted file mode 100644 index 8817f44cda79..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPricingTier.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. - public readonly partial struct SecurityCenterPricingTier : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityCenterPricingTier(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string FreeValue = "Free"; - private const string StandardValue = "Standard"; - - /// Get free Microsoft Defender for Cloud experience with basic security features. - public static SecurityCenterPricingTier Free { get; } = new SecurityCenterPricingTier(FreeValue); - /// Get the standard Microsoft Defender for Cloud experience with advanced security features. - public static SecurityCenterPricingTier Standard { get; } = new SecurityCenterPricingTier(StandardValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityCenterPricingTier left, SecurityCenterPricingTier right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityCenterPricingTier left, SecurityCenterPricingTier right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityCenterPricingTier(string value) => new SecurityCenterPricingTier(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityCenterPricingTier other && Equals(other); - /// - public bool Equals(SecurityCenterPricingTier other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPublisherInfo.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPublisherInfo.Serialization.cs deleted file mode 100644 index 7e2bf4cff00f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPublisherInfo.Serialization.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityCenterPublisherInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(PublisherName)) - { - writer.WritePropertyName("publisherName"u8); - writer.WriteStringValue(PublisherName); - } - if (Optional.IsDefined(ProductName)) - { - writer.WritePropertyName("productName"u8); - writer.WriteStringValue(ProductName); - } - if (Optional.IsDefined(BinaryName)) - { - writer.WritePropertyName("binaryName"u8); - writer.WriteStringValue(BinaryName); - } - if (Optional.IsDefined(Version)) - { - writer.WritePropertyName("version"u8); - writer.WriteStringValue(Version); - } - writer.WriteEndObject(); - } - - internal static SecurityCenterPublisherInfo DeserializeSecurityCenterPublisherInfo(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional publisherName = default; - Optional productName = default; - Optional binaryName = default; - Optional version = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("publisherName"u8)) - { - publisherName = property.Value.GetString(); - continue; - } - if (property.NameEquals("productName"u8)) - { - productName = property.Value.GetString(); - continue; - } - if (property.NameEquals("binaryName"u8)) - { - binaryName = property.Value.GetString(); - continue; - } - if (property.NameEquals("version"u8)) - { - version = property.Value.GetString(); - continue; - } - } - return new SecurityCenterPublisherInfo(publisherName.Value, productName.Value, binaryName.Value, version.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPublisherInfo.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPublisherInfo.cs deleted file mode 100644 index d7bfd9da8dee..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterPublisherInfo.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Represents the publisher information of a process/rule. - public partial class SecurityCenterPublisherInfo - { - /// Initializes a new instance of SecurityCenterPublisherInfo. - public SecurityCenterPublisherInfo() - { - } - - /// Initializes a new instance of SecurityCenterPublisherInfo. - /// The Subject field of the x.509 certificate used to sign the code, using the following fields - O = Organization, L = Locality, S = State or Province, and C = Country. - /// The product name taken from the file's version resource. - /// The "OriginalName" field taken from the file's version resource. - /// The binary file version taken from the file's version resource. - internal SecurityCenterPublisherInfo(string publisherName, string productName, string binaryName, string version) - { - PublisherName = publisherName; - ProductName = productName; - BinaryName = binaryName; - Version = version; - } - - /// The Subject field of the x.509 certificate used to sign the code, using the following fields - O = Organization, L = Locality, S = State or Province, and C = Country. - public string PublisherName { get; set; } - /// The product name taken from the file's version resource. - public string ProductName { get; set; } - /// The "OriginalName" field taken from the file's version resource. - public string BinaryName { get; set; } - /// The binary file version taken from the file's version resource. - public string Version { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterResourceDetails.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterResourceDetails.Serialization.cs deleted file mode 100644 index c7d9b34d3a5f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterResourceDetails.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityCenterResourceDetails : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("source"u8); - writer.WriteStringValue(Source.ToString()); - writer.WriteEndObject(); - } - - internal static SecurityCenterResourceDetails DeserializeSecurityCenterResourceDetails(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("source", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "Azure": return AzureResourceDetails.DeserializeAzureResourceDetails(element); - case "OnPremise": return OnPremiseResourceDetails.DeserializeOnPremiseResourceDetails(element); - case "OnPremiseSql": return OnPremiseSqlResourceDetails.DeserializeOnPremiseSqlResourceDetails(element); - } - } - return UnknownResourceDetails.DeserializeUnknownResourceDetails(element); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterResourceDetails.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterResourceDetails.cs deleted file mode 100644 index 62a9cd0043f6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterResourceDetails.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// - /// Details of the resource that was assessed - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public abstract partial class SecurityCenterResourceDetails - { - /// Initializes a new instance of SecurityCenterResourceDetails. - protected SecurityCenterResourceDetails() - { - } - - /// Initializes a new instance of SecurityCenterResourceDetails. - /// The platform where the assessed resource resides. - internal SecurityCenterResourceDetails(Source source) - { - Source = source; - } - - /// The platform where the assessed resource resides. - internal Source Source { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterTagsResourceInfo.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterTagsResourceInfo.Serialization.cs deleted file mode 100644 index 7a102eec87f4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterTagsResourceInfo.Serialization.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityCenterTagsResourceInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - } - - internal static SecurityCenterTagsResourceInfo DeserializeSecurityCenterTagsResourceInfo(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> tags = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - } - return new SecurityCenterTagsResourceInfo(Optional.ToDictionary(tags)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterTagsResourceInfo.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterTagsResourceInfo.cs deleted file mode 100644 index 8ffd49250dbd..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterTagsResourceInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A container holding only the Tags for a resource, allowing the user to update the tags. - public partial class SecurityCenterTagsResourceInfo - { - /// Initializes a new instance of SecurityCenterTagsResourceInfo. - public SecurityCenterTagsResourceInfo() - { - Tags = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of SecurityCenterTagsResourceInfo. - /// Resource tags. - internal SecurityCenterTagsResourceInfo(IDictionary tags) - { - Tags = tags; - } - - /// Resource tags. - public IDictionary Tags { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterVmEnforcementSupportState.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterVmEnforcementSupportState.cs deleted file mode 100644 index 6e69107aee09..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCenterVmEnforcementSupportState.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The machine supportability of Enforce feature. - public readonly partial struct SecurityCenterVmEnforcementSupportState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityCenterVmEnforcementSupportState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SupportedValue = "Supported"; - private const string NotSupportedValue = "NotSupported"; - private const string UnknownValue = "Unknown"; - - /// Supported. - public static SecurityCenterVmEnforcementSupportState Supported { get; } = new SecurityCenterVmEnforcementSupportState(SupportedValue); - /// NotSupported. - public static SecurityCenterVmEnforcementSupportState NotSupported { get; } = new SecurityCenterVmEnforcementSupportState(NotSupportedValue); - /// Unknown. - public static SecurityCenterVmEnforcementSupportState Unknown { get; } = new SecurityCenterVmEnforcementSupportState(UnknownValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityCenterVmEnforcementSupportState left, SecurityCenterVmEnforcementSupportState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityCenterVmEnforcementSupportState left, SecurityCenterVmEnforcementSupportState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityCenterVmEnforcementSupportState(string value) => new SecurityCenterVmEnforcementSupportState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityCenterVmEnforcementSupportState other && Equals(other); - /// - public bool Equals(SecurityCenterVmEnforcementSupportState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCloudConnectorData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCloudConnectorData.Serialization.cs deleted file mode 100644 index 38bd17e4920d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCloudConnectorData.Serialization.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SecurityCloudConnectorData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(HybridComputeSettings)) - { - writer.WritePropertyName("hybridComputeSettings"u8); - writer.WriteObjectValue(HybridComputeSettings); - } - if (Optional.IsDefined(AuthenticationDetails)) - { - writer.WritePropertyName("authenticationDetails"u8); - writer.WriteObjectValue(AuthenticationDetails); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecurityCloudConnectorData DeserializeSecurityCloudConnectorData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional hybridComputeSettings = default; - Optional authenticationDetails = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("hybridComputeSettings"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - hybridComputeSettings = HybridComputeSettingsProperties.DeserializeHybridComputeSettingsProperties(property0.Value); - continue; - } - if (property0.NameEquals("authenticationDetails"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - authenticationDetails = AuthenticationDetailsProperties.DeserializeAuthenticationDetailsProperties(property0.Value); - continue; - } - } - continue; - } - } - return new SecurityCloudConnectorData(id, name, type, systemData.Value, hybridComputeSettings.Value, authenticationDetails.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityComplianceData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityComplianceData.Serialization.cs deleted file mode 100644 index e05f02680ecb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityComplianceData.Serialization.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SecurityComplianceData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecurityComplianceData DeserializeSecurityComplianceData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional assessmentTimestampUtcDate = default; - Optional resourceCount = default; - Optional> assessmentResult = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("assessmentTimestampUtcDate"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - assessmentTimestampUtcDate = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("resourceCount"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - resourceCount = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("assessmentResult"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(ComplianceSegment.DeserializeComplianceSegment(item)); - } - assessmentResult = array; - continue; - } - } - continue; - } - } - return new SecurityComplianceData(id, name, type, systemData.Value, Optional.ToNullable(assessmentTimestampUtcDate), Optional.ToNullable(resourceCount), Optional.ToList(assessmentResult)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityConnectorEnvironment.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityConnectorEnvironment.Serialization.cs deleted file mode 100644 index dbdba342a7ba..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityConnectorEnvironment.Serialization.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityConnectorEnvironment : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("environmentType"u8); - writer.WriteStringValue(EnvironmentType.ToString()); - writer.WriteEndObject(); - } - - internal static SecurityConnectorEnvironment DeserializeSecurityConnectorEnvironment(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("environmentType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "AwsAccount": return AwsEnvironment.DeserializeAwsEnvironment(element); - case "AzureDevOpsScope": return AzureDevOpsScopeEnvironment.DeserializeAzureDevOpsScopeEnvironment(element); - case "GcpProject": return GcpProjectEnvironment.DeserializeGcpProjectEnvironment(element); - case "GithubScope": return GithubScopeEnvironment.DeserializeGithubScopeEnvironment(element); - } - } - return UnknownEnvironmentData.DeserializeUnknownEnvironmentData(element); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityConnectorEnvironment.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityConnectorEnvironment.cs deleted file mode 100644 index 21a23643d076..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityConnectorEnvironment.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// - /// The security connector environment data. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . - /// - public abstract partial class SecurityConnectorEnvironment - { - /// Initializes a new instance of SecurityConnectorEnvironment. - protected SecurityConnectorEnvironment() - { - } - - /// Initializes a new instance of SecurityConnectorEnvironment. - /// The type of the environment data. - internal SecurityConnectorEnvironment(EnvironmentType environmentType) - { - EnvironmentType = environmentType; - } - - /// The type of the environment data. - internal EnvironmentType EnvironmentType { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityConnectorsList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityConnectorsList.Serialization.cs deleted file mode 100644 index 836a9bd5427a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityConnectorsList.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class SecurityConnectorsList - { - internal static SecurityConnectorsList DeserializeSecurityConnectorsList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityConnectorData.DeserializeSecurityConnectorData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SecurityConnectorsList(value, nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityConnectorsList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityConnectorsList.cs deleted file mode 100644 index 030d267f6fc5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityConnectorsList.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of security connectors response. - internal partial class SecurityConnectorsList - { - /// Initializes a new instance of SecurityConnectorsList. - /// The list of security connectors under the given scope. - /// is null. - internal SecurityConnectorsList(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of SecurityConnectorsList. - /// The list of security connectors under the given scope. - /// The URI to fetch the next page. - internal SecurityConnectorsList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// The list of security connectors under the given scope. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactData.Serialization.cs deleted file mode 100644 index 5a020b6d86a7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactData.Serialization.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SecurityContactData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Emails)) - { - writer.WritePropertyName("emails"u8); - writer.WriteStringValue(Emails); - } - if (Optional.IsDefined(Phone)) - { - writer.WritePropertyName("phone"u8); - writer.WriteStringValue(Phone); - } - if (Optional.IsDefined(AlertNotifications)) - { - writer.WritePropertyName("alertNotifications"u8); - writer.WriteObjectValue(AlertNotifications); - } - if (Optional.IsDefined(NotificationsByRole)) - { - writer.WritePropertyName("notificationsByRole"u8); - writer.WriteObjectValue(NotificationsByRole); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecurityContactData DeserializeSecurityContactData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional emails = default; - Optional phone = default; - Optional alertNotifications = default; - Optional notificationsByRole = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("emails"u8)) - { - emails = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("phone"u8)) - { - phone = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("alertNotifications"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - alertNotifications = SecurityContactPropertiesAlertNotifications.DeserializeSecurityContactPropertiesAlertNotifications(property0.Value); - continue; - } - if (property0.NameEquals("notificationsByRole"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - notificationsByRole = SecurityContactPropertiesNotificationsByRole.DeserializeSecurityContactPropertiesNotificationsByRole(property0.Value); - continue; - } - } - continue; - } - } - return new SecurityContactData(id, name, type, systemData.Value, emails.Value, phone.Value, alertNotifications.Value, notificationsByRole.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactList.Serialization.cs deleted file mode 100644 index 16b36c341356..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class SecurityContactList - { - internal static SecurityContactList DeserializeSecurityContactList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityContactData.DeserializeSecurityContactData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SecurityContactList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactList.cs deleted file mode 100644 index 8c80e4b4d479..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of security contacts response. - internal partial class SecurityContactList - { - /// Initializes a new instance of SecurityContactList. - internal SecurityContactList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecurityContactList. - /// List of security contacts. - /// The URI to fetch the next page. - internal SecurityContactList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of security contacts. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactPropertiesAlertNotifications.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactPropertiesAlertNotifications.Serialization.cs deleted file mode 100644 index cca195eb4488..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactPropertiesAlertNotifications.Serialization.cs +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityContactPropertiesAlertNotifications : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(State)) - { - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.Value.ToString()); - } - if (Optional.IsDefined(MinimalSeverity)) - { - writer.WritePropertyName("minimalSeverity"u8); - writer.WriteStringValue(MinimalSeverity.Value.ToString()); - } - writer.WriteEndObject(); - } - - internal static SecurityContactPropertiesAlertNotifications DeserializeSecurityContactPropertiesAlertNotifications(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional state = default; - Optional minimalSeverity = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("state"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - state = new SecurityAlertNotificationState(property.Value.GetString()); - continue; - } - if (property.NameEquals("minimalSeverity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - minimalSeverity = new SecurityAlertMinimalSeverity(property.Value.GetString()); - continue; - } - } - return new SecurityContactPropertiesAlertNotifications(Optional.ToNullable(state), Optional.ToNullable(minimalSeverity)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactPropertiesAlertNotifications.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactPropertiesAlertNotifications.cs deleted file mode 100644 index 1d0f6dc1dca9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactPropertiesAlertNotifications.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Defines whether to send email notifications about new security alerts. - public partial class SecurityContactPropertiesAlertNotifications - { - /// Initializes a new instance of SecurityContactPropertiesAlertNotifications. - public SecurityContactPropertiesAlertNotifications() - { - } - - /// Initializes a new instance of SecurityContactPropertiesAlertNotifications. - /// Defines if email notifications will be sent about new security alerts. - /// Defines the minimal alert severity which will be sent as email notifications. - internal SecurityContactPropertiesAlertNotifications(SecurityAlertNotificationState? state, SecurityAlertMinimalSeverity? minimalSeverity) - { - State = state; - MinimalSeverity = minimalSeverity; - } - - /// Defines if email notifications will be sent about new security alerts. - public SecurityAlertNotificationState? State { get; set; } - /// Defines the minimal alert severity which will be sent as email notifications. - public SecurityAlertMinimalSeverity? MinimalSeverity { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactPropertiesNotificationsByRole.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactPropertiesNotificationsByRole.Serialization.cs deleted file mode 100644 index 4c995ae78589..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactPropertiesNotificationsByRole.Serialization.cs +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityContactPropertiesNotificationsByRole : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(State)) - { - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.Value.ToString()); - } - if (Optional.IsCollectionDefined(Roles)) - { - writer.WritePropertyName("roles"u8); - writer.WriteStartArray(); - foreach (var item in Roles) - { - writer.WriteStringValue(item.ToString()); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static SecurityContactPropertiesNotificationsByRole DeserializeSecurityContactPropertiesNotificationsByRole(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional state = default; - Optional> roles = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("state"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - state = new SecurityAlertNotificationByRoleState(property.Value.GetString()); - continue; - } - if (property.NameEquals("roles"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(new SecurityAlertReceivingRole(item.GetString())); - } - roles = array; - continue; - } - } - return new SecurityContactPropertiesNotificationsByRole(Optional.ToNullable(state), Optional.ToList(roles)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactPropertiesNotificationsByRole.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactPropertiesNotificationsByRole.cs deleted file mode 100644 index 90097c2354e6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityContactPropertiesNotificationsByRole.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Defines whether to send email notifications from Microsoft Defender for Cloud to persons with specific RBAC roles on the subscription. - public partial class SecurityContactPropertiesNotificationsByRole - { - /// Initializes a new instance of SecurityContactPropertiesNotificationsByRole. - public SecurityContactPropertiesNotificationsByRole() - { - Roles = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecurityContactPropertiesNotificationsByRole. - /// Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the subscription. - /// Defines which RBAC roles will get email notifications from Microsoft Defender for Cloud. List of allowed RBAC roles:. - internal SecurityContactPropertiesNotificationsByRole(SecurityAlertNotificationByRoleState? state, IList roles) - { - State = state; - Roles = roles; - } - - /// Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the subscription. - public SecurityAlertNotificationByRoleState? State { get; set; } - /// Defines which RBAC roles will get email notifications from Microsoft Defender for Cloud. List of allowed RBAC roles:. - public IList Roles { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityControlType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityControlType.cs deleted file mode 100644 index e07d5933ec9b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityControlType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The type of security control (for example, BuiltIn). - public readonly partial struct SecurityControlType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityControlType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string BuiltInValue = "BuiltIn"; - private const string CustomValue = "Custom"; - - /// Microsoft Defender for Cloud managed assessments. - public static SecurityControlType BuiltIn { get; } = new SecurityControlType(BuiltInValue); - /// Non Microsoft Defender for Cloud managed assessments. - public static SecurityControlType Custom { get; } = new SecurityControlType(CustomValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityControlType left, SecurityControlType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityControlType left, SecurityControlType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityControlType(string value) => new SecurityControlType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityControlType other && Equals(other); - /// - public bool Equals(SecurityControlType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCve.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCve.Serialization.cs deleted file mode 100644 index d1b8c5e45165..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCve.Serialization.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityCve - { - internal static SecurityCve DeserializeSecurityCve(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional title = default; - Optional link = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("title"u8)) - { - title = property.Value.GetString(); - continue; - } - if (property.NameEquals("link"u8)) - { - link = property.Value.GetString(); - continue; - } - } - return new SecurityCve(title.Value, link.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCve.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCve.cs deleted file mode 100644 index aaa32a05e855..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCve.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// CVE details. - public partial class SecurityCve - { - /// Initializes a new instance of SecurityCve. - internal SecurityCve() - { - } - - /// Initializes a new instance of SecurityCve. - /// CVE title. - /// Link url. - internal SecurityCve(string title, string link) - { - Title = title; - Link = link; - } - - /// CVE title. - public string Title { get; } - /// Link url. - public string Link { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCvss.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCvss.Serialization.cs deleted file mode 100644 index 7a544942e712..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCvss.Serialization.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityCvss - { - internal static SecurityCvss DeserializeSecurityCvss(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional @base = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("base"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - @base = property.Value.GetSingle(); - continue; - } - } - return new SecurityCvss(Optional.ToNullable(@base)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCvss.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCvss.cs deleted file mode 100644 index 2dcb1fd2d65e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityCvss.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// CVSS details. - public partial class SecurityCvss - { - /// Initializes a new instance of SecurityCvss. - internal SecurityCvss() - { - } - - /// Initializes a new instance of SecurityCvss. - /// CVSS base. - internal SecurityCvss(float? @base) - { - Base = @base; - } - - /// CVSS base. - public float? Base { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityEventSource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityEventSource.cs deleted file mode 100644 index 1f65288ed488..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityEventSource.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A valid event source type. - public readonly partial struct SecurityEventSource : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityEventSource(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AssessmentsValue = "Assessments"; - private const string AssessmentsSnapshotValue = "AssessmentsSnapshot"; - private const string SubAssessmentsValue = "SubAssessments"; - private const string SubAssessmentsSnapshotValue = "SubAssessmentsSnapshot"; - private const string AlertsValue = "Alerts"; - private const string SecureScoresValue = "SecureScores"; - private const string SecureScoresSnapshotValue = "SecureScoresSnapshot"; - private const string SecureScoreControlsValue = "SecureScoreControls"; - private const string SecureScoreControlsSnapshotValue = "SecureScoreControlsSnapshot"; - private const string RegulatoryComplianceAssessmentValue = "RegulatoryComplianceAssessment"; - private const string RegulatoryComplianceAssessmentSnapshotValue = "RegulatoryComplianceAssessmentSnapshot"; - - /// Assessments. - public static SecurityEventSource Assessments { get; } = new SecurityEventSource(AssessmentsValue); - /// AssessmentsSnapshot. - public static SecurityEventSource AssessmentsSnapshot { get; } = new SecurityEventSource(AssessmentsSnapshotValue); - /// SubAssessments. - public static SecurityEventSource SubAssessments { get; } = new SecurityEventSource(SubAssessmentsValue); - /// SubAssessmentsSnapshot. - public static SecurityEventSource SubAssessmentsSnapshot { get; } = new SecurityEventSource(SubAssessmentsSnapshotValue); - /// Alerts. - public static SecurityEventSource Alerts { get; } = new SecurityEventSource(AlertsValue); - /// SecureScores. - public static SecurityEventSource SecureScores { get; } = new SecurityEventSource(SecureScoresValue); - /// SecureScoresSnapshot. - public static SecurityEventSource SecureScoresSnapshot { get; } = new SecurityEventSource(SecureScoresSnapshotValue); - /// SecureScoreControls. - public static SecurityEventSource SecureScoreControls { get; } = new SecurityEventSource(SecureScoreControlsValue); - /// SecureScoreControlsSnapshot. - public static SecurityEventSource SecureScoreControlsSnapshot { get; } = new SecurityEventSource(SecureScoreControlsSnapshotValue); - /// RegulatoryComplianceAssessment. - public static SecurityEventSource RegulatoryComplianceAssessment { get; } = new SecurityEventSource(RegulatoryComplianceAssessmentValue); - /// RegulatoryComplianceAssessmentSnapshot. - public static SecurityEventSource RegulatoryComplianceAssessmentSnapshot { get; } = new SecurityEventSource(RegulatoryComplianceAssessmentSnapshotValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityEventSource left, SecurityEventSource right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityEventSource left, SecurityEventSource right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityEventSource(string value) => new SecurityEventSource(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityEventSource other && Equals(other); - /// - public bool Equals(SecurityEventSource other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityFamily.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityFamily.cs deleted file mode 100644 index 0972c97f8814..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityFamily.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The security family of the discovered solution. - public readonly partial struct SecurityFamily : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityFamily(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string WafValue = "Waf"; - private const string NgfwValue = "Ngfw"; - private const string SaasWafValue = "SaasWaf"; - private const string VulnerabilityAssessmentValue = "Va"; - - /// Waf. - public static SecurityFamily Waf { get; } = new SecurityFamily(WafValue); - /// Ngfw. - public static SecurityFamily Ngfw { get; } = new SecurityFamily(NgfwValue); - /// SaasWaf. - public static SecurityFamily SaasWaf { get; } = new SecurityFamily(SaasWafValue); - /// Va. - public static SecurityFamily VulnerabilityAssessment { get; } = new SecurityFamily(VulnerabilityAssessmentValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityFamily left, SecurityFamily right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityFamily left, SecurityFamily right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityFamily(string value) => new SecurityFamily(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityFamily other && Equals(other); - /// - public bool Equals(SecurityFamily other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityFamilyProvisioningState.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityFamilyProvisioningState.cs deleted file mode 100644 index 20072c9f7ab2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityFamilyProvisioningState.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The security family provisioning State. - public readonly partial struct SecurityFamilyProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityFamilyProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; - private const string UpdatingValue = "Updating"; - - /// Succeeded. - public static SecurityFamilyProvisioningState Succeeded { get; } = new SecurityFamilyProvisioningState(SucceededValue); - /// Failed. - public static SecurityFamilyProvisioningState Failed { get; } = new SecurityFamilyProvisioningState(FailedValue); - /// Updating. - public static SecurityFamilyProvisioningState Updating { get; } = new SecurityFamilyProvisioningState(UpdatingValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityFamilyProvisioningState left, SecurityFamilyProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityFamilyProvisioningState left, SecurityFamilyProvisioningState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityFamilyProvisioningState(string value) => new SecurityFamilyProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityFamilyProvisioningState other && Equals(other); - /// - public bool Equals(SecurityFamilyProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityScoreODataExpand.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityScoreODataExpand.cs deleted file mode 100644 index 9952fffbef0a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityScoreODataExpand.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The SecurityScoreODataExpand. - public readonly partial struct SecurityScoreODataExpand : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityScoreODataExpand(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DefinitionValue = "definition"; - - /// Add definition object for each control. - public static SecurityScoreODataExpand Definition { get; } = new SecurityScoreODataExpand(DefinitionValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityScoreODataExpand left, SecurityScoreODataExpand right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityScoreODataExpand left, SecurityScoreODataExpand right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityScoreODataExpand(string value) => new SecurityScoreODataExpand(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityScoreODataExpand other && Equals(other); - /// - public bool Equals(SecurityScoreODataExpand other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySettingData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySettingData.Serialization.cs deleted file mode 100644 index 0dbe69fca140..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySettingData.Serialization.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SecuritySettingData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("kind"u8); - writer.WriteStringValue(Kind.ToString()); - writer.WriteEndObject(); - } - - internal static SecuritySettingData DeserializeSecuritySettingData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("kind", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "AlertSyncSettings": return SecurityAlertSyncSettings.DeserializeSecurityAlertSyncSettings(element); - case "DataExportSettings": return DataExportSettings.DeserializeDataExportSettings(element); - } - } - SettingKind kind = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("kind"u8)) - { - kind = new SettingKind(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - } - return new SecuritySettingData(id, name, type, systemData.Value, kind); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySettingName.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySettingName.cs deleted file mode 100644 index 9bf6f5d038b4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySettingName.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The SecuritySettingName. - public readonly partial struct SecuritySettingName : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecuritySettingName(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string McasValue = "MCAS"; - private const string WdatpValue = "WDATP"; - private const string WdatpExcludeLinuxPublicPreviewValue = "WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW"; - private const string WdatpUnifiedSolutionValue = "WDATP_UNIFIED_SOLUTION"; - private const string SentinelValue = "Sentinel"; - - /// MCAS. - public static SecuritySettingName Mcas { get; } = new SecuritySettingName(McasValue); - /// WDATP. - public static SecuritySettingName Wdatp { get; } = new SecuritySettingName(WdatpValue); - /// WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW. - public static SecuritySettingName WdatpExcludeLinuxPublicPreview { get; } = new SecuritySettingName(WdatpExcludeLinuxPublicPreviewValue); - /// WDATP_UNIFIED_SOLUTION. - public static SecuritySettingName WdatpUnifiedSolution { get; } = new SecuritySettingName(WdatpUnifiedSolutionValue); - /// Sentinel. - public static SecuritySettingName Sentinel { get; } = new SecuritySettingName(SentinelValue); - /// Determines if two values are the same. - public static bool operator ==(SecuritySettingName left, SecuritySettingName right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecuritySettingName left, SecuritySettingName right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecuritySettingName(string value) => new SecuritySettingName(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecuritySettingName other && Equals(other); - /// - public bool Equals(SecuritySettingName other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolution.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolution.Serialization.cs deleted file mode 100644 index ab980315a8e2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolution.Serialization.cs +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecuritySolution : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(SecurityFamily)) - { - writer.WritePropertyName("securityFamily"u8); - writer.WriteStringValue(SecurityFamily.Value.ToString()); - } - if (Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (Optional.IsDefined(Template)) - { - writer.WritePropertyName("template"u8); - writer.WriteStringValue(Template); - } - if (Optional.IsDefined(ProtectionStatus)) - { - writer.WritePropertyName("protectionStatus"u8); - writer.WriteStringValue(ProtectionStatus); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecuritySolution DeserializeSecuritySolution(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional securityFamily = default; - Optional provisioningState = default; - Optional template = default; - Optional protectionStatus = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("securityFamily"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - securityFamily = new SecurityFamily(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = new SecurityFamilyProvisioningState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("template"u8)) - { - template = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("protectionStatus"u8)) - { - protectionStatus = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new SecuritySolution(id, name, type, systemData.Value, Optional.ToNullable(securityFamily), Optional.ToNullable(provisioningState), template.Value, protectionStatus.Value, Optional.ToNullable(location)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolution.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolution.cs deleted file mode 100644 index 102f18bfb74d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolution.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The SecuritySolution. - public partial class SecuritySolution : ResourceData - { - /// Initializes a new instance of SecuritySolution. - public SecuritySolution() - { - } - - /// Initializes a new instance of SecuritySolution. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The security family of the security solution. - /// The security family provisioning State. - /// The security solutions' template. - /// The security solutions' status. - /// Location where the resource is stored. - internal SecuritySolution(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SecurityFamily? securityFamily, SecurityFamilyProvisioningState? provisioningState, string template, string protectionStatus, AzureLocation? location) : base(id, name, resourceType, systemData) - { - SecurityFamily = securityFamily; - ProvisioningState = provisioningState; - Template = template; - ProtectionStatus = protectionStatus; - Location = location; - } - - /// The security family of the security solution. - public SecurityFamily? SecurityFamily { get; set; } - /// The security family provisioning State. - public SecurityFamilyProvisioningState? ProvisioningState { get; set; } - /// The security solutions' template. - public string Template { get; set; } - /// The security solutions' status. - public string ProtectionStatus { get; set; } - /// Location where the resource is stored. - public AzureLocation? Location { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionList.Serialization.cs deleted file mode 100644 index 24e6e8ca3538..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionList.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class SecuritySolutionList - { - internal static SecuritySolutionList DeserializeSecuritySolutionList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecuritySolution.DeserializeSecuritySolution(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SecuritySolutionList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionList.cs deleted file mode 100644 index a0617b32aafa..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionList.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The SecuritySolutionList. - internal partial class SecuritySolutionList - { - /// Initializes a new instance of SecuritySolutionList. - internal SecuritySolutionList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecuritySolutionList. - /// - /// The URI to fetch the next page. - internal SecuritySolutionList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Gets the value. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionStatus.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionStatus.cs deleted file mode 100644 index d78636305a7e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionStatus.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Status of the IoT Security solution. - public readonly partial struct SecuritySolutionStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecuritySolutionStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string EnabledValue = "Enabled"; - private const string DisabledValue = "Disabled"; - - /// Enabled. - public static SecuritySolutionStatus Enabled { get; } = new SecuritySolutionStatus(EnabledValue); - /// Disabled. - public static SecuritySolutionStatus Disabled { get; } = new SecuritySolutionStatus(DisabledValue); - /// Determines if two values are the same. - public static bool operator ==(SecuritySolutionStatus left, SecuritySolutionStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecuritySolutionStatus left, SecuritySolutionStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecuritySolutionStatus(string value) => new SecuritySolutionStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecuritySolutionStatus other && Equals(other); - /// - public bool Equals(SecuritySolutionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionsReferenceData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionsReferenceData.Serialization.cs deleted file mode 100644 index cc396599112d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionsReferenceData.Serialization.cs +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecuritySolutionsReferenceData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WritePropertyName("securityFamily"u8); - writer.WriteStringValue(SecurityFamily.ToString()); - writer.WritePropertyName("alertVendorName"u8); - writer.WriteStringValue(AlertVendorName); - writer.WritePropertyName("packageInfoUrl"u8); - writer.WriteStringValue(PackageInfoUri.AbsoluteUri); - writer.WritePropertyName("productName"u8); - writer.WriteStringValue(ProductName); - writer.WritePropertyName("publisher"u8); - writer.WriteStringValue(Publisher); - writer.WritePropertyName("publisherDisplayName"u8); - writer.WriteStringValue(PublisherDisplayName); - writer.WritePropertyName("template"u8); - writer.WriteStringValue(Template); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecuritySolutionsReferenceData DeserializeSecuritySolutionsReferenceData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - SecurityFamily securityFamily = default; - string alertVendorName = default; - Uri packageInfoUrl = default; - string productName = default; - string publisher = default; - string publisherDisplayName = default; - string template = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("securityFamily"u8)) - { - securityFamily = new SecurityFamily(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("alertVendorName"u8)) - { - alertVendorName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("packageInfoUrl"u8)) - { - packageInfoUrl = new Uri(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("productName"u8)) - { - productName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("publisher"u8)) - { - publisher = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("publisherDisplayName"u8)) - { - publisherDisplayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("template"u8)) - { - template = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new SecuritySolutionsReferenceData(id, name, type, systemData.Value, securityFamily, alertVendorName, packageInfoUrl, productName, publisher, publisherDisplayName, template, Optional.ToNullable(location)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionsReferenceData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionsReferenceData.cs deleted file mode 100644 index 69ff212bae7f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionsReferenceData.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The SecuritySolutionsReferenceData. - public partial class SecuritySolutionsReferenceData : ResourceData - { - /// Initializes a new instance of SecuritySolutionsReferenceData. - /// The security family of the security solution. - /// The security solutions' vendor name. - /// The security solutions' package info url. - /// The security solutions' product name. - /// The security solutions' publisher. - /// The security solutions' publisher display name. - /// The security solutions' template. - /// , , , , or is null. - public SecuritySolutionsReferenceData(SecurityFamily securityFamily, string alertVendorName, Uri packageInfoUri, string productName, string publisher, string publisherDisplayName, string template) - { - Argument.AssertNotNull(alertVendorName, nameof(alertVendorName)); - Argument.AssertNotNull(packageInfoUri, nameof(packageInfoUri)); - Argument.AssertNotNull(productName, nameof(productName)); - Argument.AssertNotNull(publisher, nameof(publisher)); - Argument.AssertNotNull(publisherDisplayName, nameof(publisherDisplayName)); - Argument.AssertNotNull(template, nameof(template)); - - SecurityFamily = securityFamily; - AlertVendorName = alertVendorName; - PackageInfoUri = packageInfoUri; - ProductName = productName; - Publisher = publisher; - PublisherDisplayName = publisherDisplayName; - Template = template; - } - - /// Initializes a new instance of SecuritySolutionsReferenceData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The security family of the security solution. - /// The security solutions' vendor name. - /// The security solutions' package info url. - /// The security solutions' product name. - /// The security solutions' publisher. - /// The security solutions' publisher display name. - /// The security solutions' template. - /// Location where the resource is stored. - internal SecuritySolutionsReferenceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SecurityFamily securityFamily, string alertVendorName, Uri packageInfoUri, string productName, string publisher, string publisherDisplayName, string template, AzureLocation? location) : base(id, name, resourceType, systemData) - { - SecurityFamily = securityFamily; - AlertVendorName = alertVendorName; - PackageInfoUri = packageInfoUri; - ProductName = productName; - Publisher = publisher; - PublisherDisplayName = publisherDisplayName; - Template = template; - Location = location; - } - - /// The security family of the security solution. - public SecurityFamily SecurityFamily { get; set; } - /// The security solutions' vendor name. - public string AlertVendorName { get; set; } - /// The security solutions' package info url. - public Uri PackageInfoUri { get; set; } - /// The security solutions' product name. - public string ProductName { get; set; } - /// The security solutions' publisher. - public string Publisher { get; set; } - /// The security solutions' publisher display name. - public string PublisherDisplayName { get; set; } - /// The security solutions' template. - public string Template { get; set; } - /// Location where the resource is stored. - public AzureLocation? Location { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionsReferenceDataList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionsReferenceDataList.Serialization.cs deleted file mode 100644 index 360008c3b5c4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionsReferenceDataList.Serialization.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class SecuritySolutionsReferenceDataList - { - internal static SecuritySolutionsReferenceDataList DeserializeSecuritySolutionsReferenceDataList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecuritySolutionsReferenceData.DeserializeSecuritySolutionsReferenceData(item)); - } - value = array; - continue; - } - } - return new SecuritySolutionsReferenceDataList(Optional.ToList(value)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionsReferenceDataList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionsReferenceDataList.cs deleted file mode 100644 index e3c54a8b736a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySolutionsReferenceDataList.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The SecuritySolutionsReferenceDataList. - internal partial class SecuritySolutionsReferenceDataList - { - /// Initializes a new instance of SecuritySolutionsReferenceDataList. - internal SecuritySolutionsReferenceDataList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecuritySolutionsReferenceDataList. - /// - internal SecuritySolutionsReferenceDataList(IReadOnlyList value) - { - Value = value; - } - - /// Gets the value. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySubAssessmentAdditionalInfo.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySubAssessmentAdditionalInfo.Serialization.cs deleted file mode 100644 index 96b3e76f8a98..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySubAssessmentAdditionalInfo.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecuritySubAssessmentAdditionalInfo : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("assessedResourceType"u8); - writer.WriteStringValue(AssessedResourceType.ToString()); - writer.WriteEndObject(); - } - - internal static SecuritySubAssessmentAdditionalInfo DeserializeSecuritySubAssessmentAdditionalInfo(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("assessedResourceType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "ContainerRegistryVulnerability": return ContainerRegistryVulnerabilityProperties.DeserializeContainerRegistryVulnerabilityProperties(element); - case "ServerVulnerabilityAssessment": return ServerVulnerabilityProperties.DeserializeServerVulnerabilityProperties(element); - case "SqlServerVulnerability": return SqlServerVulnerabilityProperties.DeserializeSqlServerVulnerabilityProperties(element); - } - } - return UnknownAdditionalData.DeserializeUnknownAdditionalData(element); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySubAssessmentAdditionalInfo.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySubAssessmentAdditionalInfo.cs deleted file mode 100644 index ad439d0dd4ce..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySubAssessmentAdditionalInfo.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// - /// Details of the sub-assessment - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public abstract partial class SecuritySubAssessmentAdditionalInfo - { - /// Initializes a new instance of SecuritySubAssessmentAdditionalInfo. - protected SecuritySubAssessmentAdditionalInfo() - { - } - - /// Initializes a new instance of SecuritySubAssessmentAdditionalInfo. - /// Sub-assessment resource type. - internal SecuritySubAssessmentAdditionalInfo(AssessedResourceType assessedResourceType) - { - AssessedResourceType = assessedResourceType; - } - - /// Sub-assessment resource type. - internal AssessedResourceType AssessedResourceType { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySubAssessmentData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySubAssessmentData.Serialization.cs deleted file mode 100644 index cbd3961e4bbc..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySubAssessmentData.Serialization.cs +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SecuritySubAssessmentData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteObjectValue(Status); - } - if (Optional.IsDefined(ResourceDetails)) - { - writer.WritePropertyName("resourceDetails"u8); - writer.WriteObjectValue(ResourceDetails); - } - if (Optional.IsDefined(AdditionalData)) - { - writer.WritePropertyName("additionalData"u8); - writer.WriteObjectValue(AdditionalData); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecuritySubAssessmentData DeserializeSecuritySubAssessmentData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional id0 = default; - Optional displayName = default; - Optional status = default; - Optional remediation = default; - Optional impact = default; - Optional category = default; - Optional description = default; - Optional timeGenerated = default; - Optional resourceDetails = default; - Optional additionalData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("id"u8)) - { - id0 = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("displayName"u8)) - { - displayName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("status"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - status = SubAssessmentStatus.DeserializeSubAssessmentStatus(property0.Value); - continue; - } - if (property0.NameEquals("remediation"u8)) - { - remediation = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("impact"u8)) - { - impact = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("category"u8)) - { - category = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("description"u8)) - { - description = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("timeGenerated"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - timeGenerated = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("resourceDetails"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - resourceDetails = SecurityCenterResourceDetails.DeserializeSecurityCenterResourceDetails(property0.Value); - continue; - } - if (property0.NameEquals("additionalData"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - additionalData = SecuritySubAssessmentAdditionalInfo.DeserializeSecuritySubAssessmentAdditionalInfo(property0.Value); - continue; - } - } - continue; - } - } - return new SecuritySubAssessmentData(id, name, type, systemData.Value, id0.Value, displayName.Value, status.Value, remediation.Value, impact.Value, category.Value, description.Value, Optional.ToNullable(timeGenerated), resourceDetails.Value, additionalData.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySubAssessmentList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySubAssessmentList.Serialization.cs deleted file mode 100644 index f61bd0cc0f36..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySubAssessmentList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class SecuritySubAssessmentList - { - internal static SecuritySubAssessmentList DeserializeSecuritySubAssessmentList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecuritySubAssessmentData.DeserializeSecuritySubAssessmentData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SecuritySubAssessmentList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySubAssessmentList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySubAssessmentList.cs deleted file mode 100644 index 9232300c4bfa..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecuritySubAssessmentList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of security sub-assessments. - internal partial class SecuritySubAssessmentList - { - /// Initializes a new instance of SecuritySubAssessmentList. - internal SecuritySubAssessmentList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecuritySubAssessmentList. - /// - /// The URI to fetch the next page. - internal SecuritySubAssessmentList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Gets the value. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTaskData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTaskData.Serialization.cs deleted file mode 100644 index 2ff6f5c8ee62..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTaskData.Serialization.cs +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SecurityTaskData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(SecurityTaskParameters)) - { - writer.WritePropertyName("securityTaskParameters"u8); - writer.WriteObjectValue(SecurityTaskParameters); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecurityTaskData DeserializeSecurityTaskData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional state = default; - Optional creationTimeUtc = default; - Optional securityTaskParameters = default; - Optional lastStateChangeTimeUtc = default; - Optional subState = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("state"u8)) - { - state = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("creationTimeUtc"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - creationTimeUtc = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("securityTaskParameters"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - securityTaskParameters = SecurityTaskProperties.DeserializeSecurityTaskProperties(property0.Value); - continue; - } - if (property0.NameEquals("lastStateChangeTimeUtc"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - lastStateChangeTimeUtc = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("subState"u8)) - { - subState = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new SecurityTaskData(id, name, type, systemData.Value, state.Value, Optional.ToNullable(creationTimeUtc), securityTaskParameters.Value, Optional.ToNullable(lastStateChangeTimeUtc), subState.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTaskList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTaskList.Serialization.cs deleted file mode 100644 index 69199e2b477d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTaskList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class SecurityTaskList - { - internal static SecurityTaskList DeserializeSecurityTaskList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityTaskData.DeserializeSecurityTaskData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SecurityTaskList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTaskList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTaskList.cs deleted file mode 100644 index ebf824c9a58e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTaskList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of security task recommendations. - internal partial class SecurityTaskList - { - /// Initializes a new instance of SecurityTaskList. - internal SecurityTaskList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecurityTaskList. - /// - /// The URI to fetch the next page. - internal SecurityTaskList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Gets the value. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTaskProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTaskProperties.Serialization.cs deleted file mode 100644 index 5f45f96c80cd..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTaskProperties.Serialization.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityTaskProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - foreach (var item in AdditionalProperties) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - - internal static SecurityTaskProperties DeserializeSecurityTaskProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional name = default; - IDictionary additionalProperties = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - additionalProperties = additionalPropertiesDictionary; - return new SecurityTaskProperties(name.Value, additionalProperties); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTaskProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTaskProperties.cs deleted file mode 100644 index 3c2e05df0eaa..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTaskProperties.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Changing set of properties, depending on the task type that is derived from the name field. - public partial class SecurityTaskProperties - { - /// Initializes a new instance of SecurityTaskProperties. - public SecurityTaskProperties() - { - AdditionalProperties = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of SecurityTaskProperties. - /// Name of the task type. - /// Additional Properties. - internal SecurityTaskProperties(string name, IDictionary additionalProperties) - { - Name = name; - AdditionalProperties = additionalProperties; - } - - /// Name of the task type. - public string Name { get; } - /// - /// Additional Properties - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formated json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public IDictionary AdditionalProperties { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityThreat.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityThreat.cs deleted file mode 100644 index 8561e1f5b78b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityThreat.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Threats impact of the assessment. - public readonly partial struct SecurityThreat : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityThreat(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AccountBreachValue = "accountBreach"; - private const string DataExfiltrationValue = "dataExfiltration"; - private const string DataSpillageValue = "dataSpillage"; - private const string MaliciousInsiderValue = "maliciousInsider"; - private const string ElevationOfPrivilegeValue = "elevationOfPrivilege"; - private const string ThreatResistanceValue = "threatResistance"; - private const string MissingCoverageValue = "missingCoverage"; - private const string DenialOfServiceValue = "denialOfService"; - - /// accountBreach. - public static SecurityThreat AccountBreach { get; } = new SecurityThreat(AccountBreachValue); - /// dataExfiltration. - public static SecurityThreat DataExfiltration { get; } = new SecurityThreat(DataExfiltrationValue); - /// dataSpillage. - public static SecurityThreat DataSpillage { get; } = new SecurityThreat(DataSpillageValue); - /// maliciousInsider. - public static SecurityThreat MaliciousInsider { get; } = new SecurityThreat(MaliciousInsiderValue); - /// elevationOfPrivilege. - public static SecurityThreat ElevationOfPrivilege { get; } = new SecurityThreat(ElevationOfPrivilegeValue); - /// threatResistance. - public static SecurityThreat ThreatResistance { get; } = new SecurityThreat(ThreatResistanceValue); - /// missingCoverage. - public static SecurityThreat MissingCoverage { get; } = new SecurityThreat(MissingCoverageValue); - /// denialOfService. - public static SecurityThreat DenialOfService { get; } = new SecurityThreat(DenialOfServiceValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityThreat left, SecurityThreat right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityThreat left, SecurityThreat right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityThreat(string value) => new SecurityThreat(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityThreat other && Equals(other); - /// - public bool Equals(SecurityThreat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTopologyResource.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTopologyResource.Serialization.cs deleted file mode 100644 index 5bf987a325a9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTopologyResource.Serialization.cs +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SecurityTopologyResource : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecurityTopologyResource DeserializeSecurityTopologyResource(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional calculatedDateTime = default; - Optional> topologyResources = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("calculatedDateTime"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - calculatedDateTime = property0.Value.GetDateTimeOffset("O"); - continue; - } - if (property0.NameEquals("topologyResources"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(TopologySingleResource.DeserializeTopologySingleResource(item)); - } - topologyResources = array; - continue; - } - } - continue; - } - } - return new SecurityTopologyResource(id, name, type, systemData.Value, Optional.ToNullable(calculatedDateTime), Optional.ToList(topologyResources), Optional.ToNullable(location)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTopologyResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTopologyResource.cs deleted file mode 100644 index 3445d32b9ff8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTopologyResource.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The SecurityTopologyResource. - public partial class SecurityTopologyResource : ResourceData - { - /// Initializes a new instance of SecurityTopologyResource. - public SecurityTopologyResource() - { - TopologyResources = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecurityTopologyResource. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The UTC time on which the topology was calculated. - /// Azure resources which are part of this topology resource. - /// Location where the resource is stored. - internal SecurityTopologyResource(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DateTimeOffset? calculatedOn, IReadOnlyList topologyResources, AzureLocation? location) : base(id, name, resourceType, systemData) - { - CalculatedOn = calculatedOn; - TopologyResources = topologyResources; - Location = location; - } - - /// The UTC time on which the topology was calculated. - public DateTimeOffset? CalculatedOn { get; } - /// Azure resources which are part of this topology resource. - public IReadOnlyList TopologyResources { get; } - /// Location where the resource is stored. - public AzureLocation? Location { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTrafficDirection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTrafficDirection.cs deleted file mode 100644 index 2ae7b3bc37a6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTrafficDirection.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The rule's direction. - public readonly partial struct SecurityTrafficDirection : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityTrafficDirection(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string InboundValue = "Inbound"; - private const string OutboundValue = "Outbound"; - - /// Inbound. - public static SecurityTrafficDirection Inbound { get; } = new SecurityTrafficDirection(InboundValue); - /// Outbound. - public static SecurityTrafficDirection Outbound { get; } = new SecurityTrafficDirection(OutboundValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityTrafficDirection left, SecurityTrafficDirection right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityTrafficDirection left, SecurityTrafficDirection right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityTrafficDirection(string value) => new SecurityTrafficDirection(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityTrafficDirection other && Equals(other); - /// - public bool Equals(SecurityTrafficDirection other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTransportProtocol.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTransportProtocol.cs deleted file mode 100644 index 26ea071e085b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityTransportProtocol.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The SecurityTransportProtocol. - public readonly partial struct SecurityTransportProtocol : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityTransportProtocol(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string TcpValue = "TCP"; - private const string UdpValue = "UDP"; - - /// TCP. - public static SecurityTransportProtocol Tcp { get; } = new SecurityTransportProtocol(TcpValue); - /// UDP. - public static SecurityTransportProtocol Udp { get; } = new SecurityTransportProtocol(UdpValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityTransportProtocol left, SecurityTransportProtocol right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityTransportProtocol left, SecurityTransportProtocol right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityTransportProtocol(string value) => new SecurityTransportProtocol(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityTransportProtocol other && Equals(other); - /// - public bool Equals(SecurityTransportProtocol other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityValueType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityValueType.cs deleted file mode 100644 index b3fb439362f0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityValueType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The value type of the items in the list. - public readonly partial struct SecurityValueType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SecurityValueType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string IPCidrValue = "IpCidr"; - private const string StringValue = "String"; - - /// An IP range in CIDR format (e.g. '192.168.0.1/8'). - public static SecurityValueType IPCidr { get; } = new SecurityValueType(IPCidrValue); - /// Any string value. - public static SecurityValueType String { get; } = new SecurityValueType(StringValue); - /// Determines if two values are the same. - public static bool operator ==(SecurityValueType left, SecurityValueType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SecurityValueType left, SecurityValueType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SecurityValueType(string value) => new SecurityValueType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SecurityValueType other && Equals(other); - /// - public bool Equals(SecurityValueType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityWorkspaceSettingData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityWorkspaceSettingData.Serialization.cs deleted file mode 100644 index fa0f981a64fe..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityWorkspaceSettingData.Serialization.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SecurityWorkspaceSettingData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(WorkspaceId)) - { - writer.WritePropertyName("workspaceId"u8); - writer.WriteStringValue(WorkspaceId); - } - if (Optional.IsDefined(Scope)) - { - writer.WritePropertyName("scope"u8); - writer.WriteStringValue(Scope); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SecurityWorkspaceSettingData DeserializeSecurityWorkspaceSettingData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional workspaceId = default; - Optional scope = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("workspaceId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - workspaceId = new ResourceIdentifier(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("scope"u8)) - { - scope = property0.Value.GetString(); - continue; - } - } - continue; - } - } - return new SecurityWorkspaceSettingData(id, name, type, systemData.Value, workspaceId.Value, scope.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityAssessmentData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityAssessmentData.Serialization.cs deleted file mode 100644 index b567e0a9402c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityAssessmentData.Serialization.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class ServerVulnerabilityAssessmentData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static ServerVulnerabilityAssessmentData DeserializeServerVulnerabilityAssessmentData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional provisioningState = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - provisioningState = new ServerVulnerabilityAssessmentPropertiesProvisioningState(property0.Value.GetString()); - continue; - } - } - continue; - } - } - return new ServerVulnerabilityAssessmentData(id, name, type, systemData.Value, Optional.ToNullable(provisioningState)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityAssessmentPropertiesProvisioningState.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityAssessmentPropertiesProvisioningState.cs deleted file mode 100644 index f8bb4bb82dec..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityAssessmentPropertiesProvisioningState.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The provisioningState of the vulnerability assessment capability on the VM. - public readonly partial struct ServerVulnerabilityAssessmentPropertiesProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ServerVulnerabilityAssessmentPropertiesProvisioningState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string SucceededValue = "Succeeded"; - private const string FailedValue = "Failed"; - private const string CanceledValue = "Canceled"; - private const string ProvisioningValue = "Provisioning"; - private const string DeprovisioningValue = "Deprovisioning"; - - /// Succeeded. - public static ServerVulnerabilityAssessmentPropertiesProvisioningState Succeeded { get; } = new ServerVulnerabilityAssessmentPropertiesProvisioningState(SucceededValue); - /// Failed. - public static ServerVulnerabilityAssessmentPropertiesProvisioningState Failed { get; } = new ServerVulnerabilityAssessmentPropertiesProvisioningState(FailedValue); - /// Canceled. - public static ServerVulnerabilityAssessmentPropertiesProvisioningState Canceled { get; } = new ServerVulnerabilityAssessmentPropertiesProvisioningState(CanceledValue); - /// Provisioning. - public static ServerVulnerabilityAssessmentPropertiesProvisioningState Provisioning { get; } = new ServerVulnerabilityAssessmentPropertiesProvisioningState(ProvisioningValue); - /// Deprovisioning. - public static ServerVulnerabilityAssessmentPropertiesProvisioningState Deprovisioning { get; } = new ServerVulnerabilityAssessmentPropertiesProvisioningState(DeprovisioningValue); - /// Determines if two values are the same. - public static bool operator ==(ServerVulnerabilityAssessmentPropertiesProvisioningState left, ServerVulnerabilityAssessmentPropertiesProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ServerVulnerabilityAssessmentPropertiesProvisioningState left, ServerVulnerabilityAssessmentPropertiesProvisioningState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ServerVulnerabilityAssessmentPropertiesProvisioningState(string value) => new ServerVulnerabilityAssessmentPropertiesProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ServerVulnerabilityAssessmentPropertiesProvisioningState other && Equals(other); - /// - public bool Equals(ServerVulnerabilityAssessmentPropertiesProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityAssessmentsList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityAssessmentsList.Serialization.cs deleted file mode 100644 index e21f61a4e79b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityAssessmentsList.Serialization.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class ServerVulnerabilityAssessmentsList - { - internal static ServerVulnerabilityAssessmentsList DeserializeServerVulnerabilityAssessmentsList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ServerVulnerabilityAssessmentData.DeserializeServerVulnerabilityAssessmentData(item)); - } - value = array; - continue; - } - } - return new ServerVulnerabilityAssessmentsList(Optional.ToList(value)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityAssessmentsList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityAssessmentsList.cs deleted file mode 100644 index 9dc78db4f098..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityAssessmentsList.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of server vulnerability assessments. - internal partial class ServerVulnerabilityAssessmentsList - { - /// Initializes a new instance of ServerVulnerabilityAssessmentsList. - internal ServerVulnerabilityAssessmentsList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of ServerVulnerabilityAssessmentsList. - /// - internal ServerVulnerabilityAssessmentsList(IReadOnlyList value) - { - Value = value; - } - - /// Gets the value. - public IReadOnlyList Value { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityProperties.Serialization.cs deleted file mode 100644 index 941099b8e51e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityProperties.Serialization.cs +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class ServerVulnerabilityProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("assessedResourceType"u8); - writer.WriteStringValue(AssessedResourceType.ToString()); - writer.WriteEndObject(); - } - - internal static ServerVulnerabilityProperties DeserializeServerVulnerabilityProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional type = default; - Optional> cvss = default; - Optional patchable = default; - Optional> cve = default; - Optional threat = default; - Optional publishedTime = default; - Optional> vendorReferences = default; - AssessedResourceType assessedResourceType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("cvss"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, SecurityCvss.DeserializeSecurityCvss(property0.Value)); - } - cvss = dictionary; - continue; - } - if (property.NameEquals("patchable"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - patchable = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("cve"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityCve.DeserializeSecurityCve(item)); - } - cve = array; - continue; - } - if (property.NameEquals("threat"u8)) - { - threat = property.Value.GetString(); - continue; - } - if (property.NameEquals("publishedTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - publishedTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("vendorReferences"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(VendorReference.DeserializeVendorReference(item)); - } - vendorReferences = array; - continue; - } - if (property.NameEquals("assessedResourceType"u8)) - { - assessedResourceType = new AssessedResourceType(property.Value.GetString()); - continue; - } - } - return new ServerVulnerabilityProperties(assessedResourceType, type.Value, Optional.ToDictionary(cvss), Optional.ToNullable(patchable), Optional.ToList(cve), threat.Value, Optional.ToNullable(publishedTime), Optional.ToList(vendorReferences)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityProperties.cs deleted file mode 100644 index 8b6581dbbeb9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServerVulnerabilityProperties.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Additional context fields for server vulnerability assessment. - public partial class ServerVulnerabilityProperties : SecuritySubAssessmentAdditionalInfo - { - /// Initializes a new instance of ServerVulnerabilityProperties. - public ServerVulnerabilityProperties() - { - Cvss = new ChangeTrackingDictionary(); - Cve = new ChangeTrackingList(); - VendorReferences = new ChangeTrackingList(); - AssessedResourceType = new AssessedResourceType("ServerVulnerabilityAssessment"); - } - - /// Initializes a new instance of ServerVulnerabilityProperties. - /// Sub-assessment resource type. - /// Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered. - /// Dictionary from cvss version to cvss details object. - /// Indicates whether a patch is available or not. - /// List of CVEs. - /// Threat name. - /// Published time. - /// - internal ServerVulnerabilityProperties(AssessedResourceType assessedResourceType, string serverVulnerabilityType, IReadOnlyDictionary cvss, bool? isPatchable, IReadOnlyList cve, string threat, DateTimeOffset? publishedOn, IReadOnlyList vendorReferences) : base(assessedResourceType) - { - ServerVulnerabilityType = serverVulnerabilityType; - Cvss = cvss; - IsPatchable = isPatchable; - Cve = cve; - Threat = threat; - PublishedOn = publishedOn; - VendorReferences = vendorReferences; - AssessedResourceType = assessedResourceType; - } - - /// Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered. - public string ServerVulnerabilityType { get; } - /// Dictionary from cvss version to cvss details object. - public IReadOnlyDictionary Cvss { get; } - /// Indicates whether a patch is available or not. - public bool? IsPatchable { get; } - /// List of CVEs. - public IReadOnlyList Cve { get; } - /// Threat name. - public string Threat { get; } - /// Published time. - public DateTimeOffset? PublishedOn { get; } - /// Gets the vendor references. - public IReadOnlyList VendorReferences { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServicePrincipalProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServicePrincipalProperties.Serialization.cs deleted file mode 100644 index 3536a00d6152..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServicePrincipalProperties.Serialization.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class ServicePrincipalProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ApplicationId)) - { - writer.WritePropertyName("applicationId"u8); - writer.WriteStringValue(ApplicationId.Value); - } - if (Optional.IsDefined(Secret)) - { - writer.WritePropertyName("secret"u8); - writer.WriteStringValue(Secret); - } - writer.WriteEndObject(); - } - - internal static ServicePrincipalProperties DeserializeServicePrincipalProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional applicationId = default; - Optional secret = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("applicationId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - applicationId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("secret"u8)) - { - secret = property.Value.GetString(); - continue; - } - } - return new ServicePrincipalProperties(Optional.ToNullable(applicationId), secret.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServicePrincipalProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServicePrincipalProperties.cs deleted file mode 100644 index cb9160874dad..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ServicePrincipalProperties.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Details of the service principal. - public partial class ServicePrincipalProperties - { - /// Initializes a new instance of ServicePrincipalProperties. - public ServicePrincipalProperties() - { - } - - /// Initializes a new instance of ServicePrincipalProperties. - /// Application ID of service principal. - /// A secret string that the application uses to prove its identity, also can be referred to as application password (write only). - internal ServicePrincipalProperties(Guid? applicationId, string secret) - { - ApplicationId = applicationId; - Secret = secret; - } - - /// Application ID of service principal. - public Guid? ApplicationId { get; set; } - /// A secret string that the application uses to prove its identity, also can be referred to as application password (write only). - public string Secret { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SettingKind.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SettingKind.cs deleted file mode 100644 index 2557b53ac35b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SettingKind.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// the kind of the settings string. - internal readonly partial struct SettingKind : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SettingKind(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DataExportSettingsValue = "DataExportSettings"; - private const string AlertSuppressionSettingValue = "AlertSuppressionSetting"; - private const string AlertSyncSettingsValue = "AlertSyncSettings"; - - /// DataExportSettings. - public static SettingKind DataExportSettings { get; } = new SettingKind(DataExportSettingsValue); - /// AlertSuppressionSetting. - public static SettingKind AlertSuppressionSetting { get; } = new SettingKind(AlertSuppressionSettingValue); - /// AlertSyncSettings. - public static SettingKind AlertSyncSettings { get; } = new SettingKind(AlertSyncSettingsValue); - /// Determines if two values are the same. - public static bool operator ==(SettingKind left, SettingKind right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SettingKind left, SettingKind right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SettingKind(string value) => new SettingKind(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SettingKind other && Equals(other); - /// - public bool Equals(SettingKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SettingsList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SettingsList.cs deleted file mode 100644 index 7bf4ae02ebb6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SettingsList.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Subscription settings list. - internal partial class SettingsList - { - /// Initializes a new instance of SettingsList. - internal SettingsList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of SettingsList. - /// - /// The settings list. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// The URI to fetch the next page. - internal SettingsList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// - /// The settings list. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SoftwareInventoryData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SoftwareInventoryData.Serialization.cs deleted file mode 100644 index 2c18f7a075ba..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SoftwareInventoryData.Serialization.cs +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SoftwareInventoryData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(DeviceId)) - { - writer.WritePropertyName("deviceId"u8); - writer.WriteStringValue(DeviceId); - } - if (Optional.IsDefined(OSPlatform)) - { - writer.WritePropertyName("osPlatform"u8); - writer.WriteStringValue(OSPlatform); - } - if (Optional.IsDefined(Vendor)) - { - writer.WritePropertyName("vendor"u8); - writer.WriteStringValue(Vendor); - } - if (Optional.IsDefined(SoftwareName)) - { - writer.WritePropertyName("softwareName"u8); - writer.WriteStringValue(SoftwareName); - } - if (Optional.IsDefined(Version)) - { - writer.WritePropertyName("version"u8); - writer.WriteStringValue(Version); - } - if (Optional.IsDefined(EndOfSupportStatus)) - { - writer.WritePropertyName("endOfSupportStatus"u8); - writer.WriteStringValue(EndOfSupportStatus.Value.ToString()); - } - if (Optional.IsDefined(EndOfSupportDate)) - { - writer.WritePropertyName("endOfSupportDate"u8); - writer.WriteStringValue(EndOfSupportDate); - } - if (Optional.IsDefined(NumberOfKnownVulnerabilities)) - { - writer.WritePropertyName("numberOfKnownVulnerabilities"u8); - writer.WriteNumberValue(NumberOfKnownVulnerabilities.Value); - } - if (Optional.IsDefined(FirstSeenOn)) - { - writer.WritePropertyName("firstSeenAt"u8); - writer.WriteStringValue(FirstSeenOn.Value, "O"); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - internal static SoftwareInventoryData DeserializeSoftwareInventoryData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - Optional deviceId = default; - Optional osPlatform = default; - Optional vendor = default; - Optional softwareName = default; - Optional version = default; - Optional endOfSupportStatus = default; - Optional endOfSupportDate = default; - Optional numberOfKnownVulnerabilities = default; - Optional firstSeenAt = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("deviceId"u8)) - { - deviceId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("osPlatform"u8)) - { - osPlatform = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("vendor"u8)) - { - vendor = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("softwareName"u8)) - { - softwareName = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("version"u8)) - { - version = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("endOfSupportStatus"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - endOfSupportStatus = new EndOfSupportStatus(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("endOfSupportDate"u8)) - { - endOfSupportDate = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("numberOfKnownVulnerabilities"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - numberOfKnownVulnerabilities = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("firstSeenAt"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - firstSeenAt = property0.Value.GetDateTimeOffset("O"); - continue; - } - } - continue; - } - } - return new SoftwareInventoryData(id, name, type, systemData.Value, deviceId.Value, osPlatform.Value, vendor.Value, softwareName.Value, version.Value, Optional.ToNullable(endOfSupportStatus), endOfSupportDate.Value, Optional.ToNullable(numberOfKnownVulnerabilities), Optional.ToNullable(firstSeenAt)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SoftwaresList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SoftwaresList.Serialization.cs deleted file mode 100644 index 30f39822540f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SoftwaresList.Serialization.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class SoftwaresList - { - internal static SoftwaresList DeserializeSoftwaresList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SoftwareInventoryData.DeserializeSoftwareInventoryData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new SoftwaresList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SoftwaresList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SoftwaresList.cs deleted file mode 100644 index f044a318d324..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SoftwaresList.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Represents the software inventory of the virtual machine. - internal partial class SoftwaresList - { - /// Initializes a new instance of SoftwaresList. - internal SoftwaresList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of SoftwaresList. - /// - /// The URI to fetch the next page. - internal SoftwaresList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Gets the value. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/Source.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/Source.cs deleted file mode 100644 index 0770c50dcdf1..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/Source.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The platform where the assessed resource resides. - internal readonly partial struct Source : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public Source(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AzureValue = "Azure"; - private const string OnPremiseValue = "OnPremise"; - private const string OnPremiseSqlValue = "OnPremiseSql"; - - /// Resource is in Azure. - public static Source Azure { get; } = new Source(AzureValue); - /// Resource in an on premise machine connected to Azure cloud. - public static Source OnPremise { get; } = new Source(OnPremiseValue); - /// SQL Resource in an on premise machine connected to Azure cloud. - public static Source OnPremiseSql { get; } = new Source(OnPremiseSqlValue); - /// Determines if two values are the same. - public static bool operator ==(Source left, Source right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(Source left, Source right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator Source(string value) => new Source(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is Source other && Equals(other); - /// - public bool Equals(Source other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlServerVulnerabilityProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlServerVulnerabilityProperties.Serialization.cs deleted file mode 100644 index 1acb352dadb4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlServerVulnerabilityProperties.Serialization.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SqlServerVulnerabilityProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("assessedResourceType"u8); - writer.WriteStringValue(AssessedResourceType.ToString()); - writer.WriteEndObject(); - } - - internal static SqlServerVulnerabilityProperties DeserializeSqlServerVulnerabilityProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional type = default; - Optional query = default; - AssessedResourceType assessedResourceType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("query"u8)) - { - query = property.Value.GetString(); - continue; - } - if (property.NameEquals("assessedResourceType"u8)) - { - assessedResourceType = new AssessedResourceType(property.Value.GetString()); - continue; - } - } - return new SqlServerVulnerabilityProperties(assessedResourceType, type.Value, query.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlServerVulnerabilityProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlServerVulnerabilityProperties.cs deleted file mode 100644 index 48e19491e477..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlServerVulnerabilityProperties.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Details of the resource that was assessed. - public partial class SqlServerVulnerabilityProperties : SecuritySubAssessmentAdditionalInfo - { - /// Initializes a new instance of SqlServerVulnerabilityProperties. - public SqlServerVulnerabilityProperties() - { - AssessedResourceType = AssessedResourceType.SqlServerVulnerability; - } - - /// Initializes a new instance of SqlServerVulnerabilityProperties. - /// Sub-assessment resource type. - /// The resource type the sub assessment refers to in its resource details. - /// The T-SQL query that runs on your SQL database to perform the particular check. - internal SqlServerVulnerabilityProperties(AssessedResourceType assessedResourceType, string sqlServerVulnerabilityType, string query) : base(assessedResourceType) - { - SqlServerVulnerabilityType = sqlServerVulnerabilityType; - Query = query; - AssessedResourceType = assessedResourceType; - } - - /// The resource type the sub assessment refers to in its resource details. - public string SqlServerVulnerabilityType { get; } - /// The T-SQL query that runs on your SQL database to perform the particular check. - public string Query { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentBaseline.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentBaseline.Serialization.cs deleted file mode 100644 index 0d48b8bf2afe..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentBaseline.Serialization.cs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SqlVulnerabilityAssessmentBaseline : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(ExpectedResults)) - { - writer.WritePropertyName("expectedResults"u8); - writer.WriteStartArray(); - foreach (var item in ExpectedResults) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStartArray(); - foreach (var item0 in item) - { - writer.WriteStringValue(item0); - } - writer.WriteEndArray(); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(UpdatedOn)) - { - writer.WritePropertyName("updatedTime"u8); - writer.WriteStringValue(UpdatedOn.Value, "O"); - } - writer.WriteEndObject(); - } - - internal static SqlVulnerabilityAssessmentBaseline DeserializeSqlVulnerabilityAssessmentBaseline(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional>> expectedResults = default; - Optional updatedTime = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("expectedResults"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List> array = new List>(); - foreach (var item in property.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - List array0 = new List(); - foreach (var item0 in item.EnumerateArray()) - { - array0.Add(item0.GetString()); - } - array.Add(array0); - } - } - expectedResults = array; - continue; - } - if (property.NameEquals("updatedTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - updatedTime = property.Value.GetDateTimeOffset("O"); - continue; - } - } - return new SqlVulnerabilityAssessmentBaseline(Optional.ToList(expectedResults), Optional.ToNullable(updatedTime)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentBaseline.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentBaseline.cs deleted file mode 100644 index be1339bb1ff1..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentBaseline.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Baseline details. - public partial class SqlVulnerabilityAssessmentBaseline - { - /// Initializes a new instance of SqlVulnerabilityAssessmentBaseline. - public SqlVulnerabilityAssessmentBaseline() - { - ExpectedResults = new ChangeTrackingList>(); - } - - /// Initializes a new instance of SqlVulnerabilityAssessmentBaseline. - /// Expected results. - /// Baseline update time (UTC). - internal SqlVulnerabilityAssessmentBaseline(IList> expectedResults, DateTimeOffset? updatedOn) - { - ExpectedResults = expectedResults; - UpdatedOn = updatedOn; - } - - /// Expected results. - public IList> ExpectedResults { get; } - /// Baseline update time (UTC). - public DateTimeOffset? UpdatedOn { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent.Serialization.cs deleted file mode 100644 index a8db6625cb59..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(LatestScan)) - { - writer.WritePropertyName("latestScan"u8); - writer.WriteBooleanValue(LatestScan.Value); - } - if (Optional.IsCollectionDefined(Results)) - { - writer.WritePropertyName("results"u8); - writer.WriteStartArray(); - foreach (var item in Results) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStartArray(); - foreach (var item0 in item) - { - writer.WriteStringValue(item0); - } - writer.WriteEndArray(); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent.cs deleted file mode 100644 index bdb5b4589027..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Rule results input. - public partial class SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent - { - /// Initializes a new instance of SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent. - public SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent() - { - Results = new ChangeTrackingList>(); - } - - /// Take results from latest scan. - public bool? LatestScan { get; set; } - /// - /// Expected results to be inserted into the baseline. - /// Leave this field empty it LatestScan == true. - /// - public IList> Results { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentBaselineRuleData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentBaselineRuleData.Serialization.cs deleted file mode 100644 index c1aa8e889306..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentBaselineRuleData.Serialization.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SqlVulnerabilityAssessmentBaselineRuleData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties); - } - writer.WriteEndObject(); - } - - internal static SqlVulnerabilityAssessmentBaselineRuleData DeserializeSqlVulnerabilityAssessmentBaselineRuleData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional properties = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - properties = RuleResultsProperties.DeserializeRuleResultsProperties(property.Value); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - } - return new SqlVulnerabilityAssessmentBaselineRuleData(id, name, type, systemData.Value, properties.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentRemediation.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentRemediation.Serialization.cs deleted file mode 100644 index 46e0452febde..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentRemediation.Serialization.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SqlVulnerabilityAssessmentRemediation : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (Optional.IsCollectionDefined(Scripts)) - { - writer.WritePropertyName("scripts"u8); - writer.WriteStartArray(); - foreach (var item in Scripts) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(IsAutomated)) - { - writer.WritePropertyName("automated"u8); - writer.WriteBooleanValue(IsAutomated.Value); - } - if (Optional.IsDefined(PortalLink)) - { - writer.WritePropertyName("portalLink"u8); - writer.WriteStringValue(PortalLink); - } - writer.WriteEndObject(); - } - - internal static SqlVulnerabilityAssessmentRemediation DeserializeSqlVulnerabilityAssessmentRemediation(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional description = default; - Optional> scripts = default; - Optional automated = default; - Optional portalLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("scripts"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - scripts = array; - continue; - } - if (property.NameEquals("automated"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - automated = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("portalLink"u8)) - { - portalLink = property.Value.GetString(); - continue; - } - } - return new SqlVulnerabilityAssessmentRemediation(description.Value, Optional.ToList(scripts), Optional.ToNullable(automated), portalLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentRemediation.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentRemediation.cs deleted file mode 100644 index 5af0ac503999..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentRemediation.cs +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Remediation details. - public partial class SqlVulnerabilityAssessmentRemediation - { - /// Initializes a new instance of SqlVulnerabilityAssessmentRemediation. - public SqlVulnerabilityAssessmentRemediation() - { - Scripts = new ChangeTrackingList(); - } - - /// Initializes a new instance of SqlVulnerabilityAssessmentRemediation. - /// Remediation description. - /// Remediation script. - /// Is remediation automated. - /// Optional link to remediate in Azure Portal. - internal SqlVulnerabilityAssessmentRemediation(string description, IList scripts, bool? isAutomated, string portalLink) - { - Description = description; - Scripts = scripts; - IsAutomated = isAutomated; - PortalLink = portalLink; - } - - /// Remediation description. - public string Description { get; set; } - /// Remediation script. - public IList Scripts { get; } - /// Is remediation automated. - public bool? IsAutomated { get; set; } - /// Optional link to remediate in Azure Portal. - public string PortalLink { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanData.Serialization.cs deleted file mode 100644 index d3174622b67c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanData.Serialization.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - public partial class SqlVulnerabilityAssessmentScanData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties); - } - writer.WriteEndObject(); - } - - internal static SqlVulnerabilityAssessmentScanData DeserializeSqlVulnerabilityAssessmentScanData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional properties = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - properties = SqlVulnerabilityAssessmentScanProperties.DeserializeSqlVulnerabilityAssessmentScanProperties(property.Value); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - } - return new SqlVulnerabilityAssessmentScanData(id, name, type, systemData.Value, properties.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanProperties.Serialization.cs deleted file mode 100644 index 78ca8381efb8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanProperties.Serialization.cs +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SqlVulnerabilityAssessmentScanProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(TriggerType)) - { - writer.WritePropertyName("triggerType"u8); - writer.WriteStringValue(TriggerType.Value.ToString()); - } - if (Optional.IsDefined(State)) - { - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.Value.ToString()); - } - if (Optional.IsDefined(Server)) - { - writer.WritePropertyName("server"u8); - writer.WriteStringValue(Server); - } - if (Optional.IsDefined(Database)) - { - writer.WritePropertyName("database"u8); - writer.WriteStringValue(Database); - } - if (Optional.IsDefined(SqlVersion)) - { - writer.WritePropertyName("sqlVersion"u8); - writer.WriteStringValue(SqlVersion); - } - if (Optional.IsDefined(StartOn)) - { - writer.WritePropertyName("startTime"u8); - writer.WriteStringValue(StartOn.Value, "O"); - } - if (Optional.IsDefined(EndOn)) - { - writer.WritePropertyName("endTime"u8); - writer.WriteStringValue(EndOn.Value, "O"); - } - if (Optional.IsDefined(HighSeverityFailedRulesCount)) - { - writer.WritePropertyName("highSeverityFailedRulesCount"u8); - writer.WriteNumberValue(HighSeverityFailedRulesCount.Value); - } - if (Optional.IsDefined(MediumSeverityFailedRulesCount)) - { - writer.WritePropertyName("mediumSeverityFailedRulesCount"u8); - writer.WriteNumberValue(MediumSeverityFailedRulesCount.Value); - } - if (Optional.IsDefined(LowSeverityFailedRulesCount)) - { - writer.WritePropertyName("lowSeverityFailedRulesCount"u8); - writer.WriteNumberValue(LowSeverityFailedRulesCount.Value); - } - if (Optional.IsDefined(TotalPassedRulesCount)) - { - writer.WritePropertyName("totalPassedRulesCount"u8); - writer.WriteNumberValue(TotalPassedRulesCount.Value); - } - if (Optional.IsDefined(TotalFailedRulesCount)) - { - writer.WritePropertyName("totalFailedRulesCount"u8); - writer.WriteNumberValue(TotalFailedRulesCount.Value); - } - if (Optional.IsDefined(TotalRulesCount)) - { - writer.WritePropertyName("totalRulesCount"u8); - writer.WriteNumberValue(TotalRulesCount.Value); - } - if (Optional.IsDefined(IsBaselineApplied)) - { - writer.WritePropertyName("isBaselineApplied"u8); - writer.WriteBooleanValue(IsBaselineApplied.Value); - } - writer.WriteEndObject(); - } - - internal static SqlVulnerabilityAssessmentScanProperties DeserializeSqlVulnerabilityAssessmentScanProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional triggerType = default; - Optional state = default; - Optional server = default; - Optional database = default; - Optional sqlVersion = default; - Optional startTime = default; - Optional endTime = default; - Optional highSeverityFailedRulesCount = default; - Optional mediumSeverityFailedRulesCount = default; - Optional lowSeverityFailedRulesCount = default; - Optional totalPassedRulesCount = default; - Optional totalFailedRulesCount = default; - Optional totalRulesCount = default; - Optional isBaselineApplied = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("triggerType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - triggerType = new SqlVulnerabilityAssessmentScanTriggerType(property.Value.GetString()); - continue; - } - if (property.NameEquals("state"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - state = new SqlVulnerabilityAssessmentScanState(property.Value.GetString()); - continue; - } - if (property.NameEquals("server"u8)) - { - server = property.Value.GetString(); - continue; - } - if (property.NameEquals("database"u8)) - { - database = property.Value.GetString(); - continue; - } - if (property.NameEquals("sqlVersion"u8)) - { - sqlVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("startTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - startTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("endTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - endTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("highSeverityFailedRulesCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - highSeverityFailedRulesCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("mediumSeverityFailedRulesCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - mediumSeverityFailedRulesCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("lowSeverityFailedRulesCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - lowSeverityFailedRulesCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("totalPassedRulesCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - totalPassedRulesCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("totalFailedRulesCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - totalFailedRulesCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("totalRulesCount"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - totalRulesCount = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("isBaselineApplied"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isBaselineApplied = property.Value.GetBoolean(); - continue; - } - } - return new SqlVulnerabilityAssessmentScanProperties(Optional.ToNullable(triggerType), Optional.ToNullable(state), server.Value, database.Value, sqlVersion.Value, Optional.ToNullable(startTime), Optional.ToNullable(endTime), Optional.ToNullable(highSeverityFailedRulesCount), Optional.ToNullable(mediumSeverityFailedRulesCount), Optional.ToNullable(lowSeverityFailedRulesCount), Optional.ToNullable(totalPassedRulesCount), Optional.ToNullable(totalFailedRulesCount), Optional.ToNullable(totalRulesCount), Optional.ToNullable(isBaselineApplied)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanProperties.cs deleted file mode 100644 index 984e3c816e9c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanProperties.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A vulnerability assessment scan record properties. - public partial class SqlVulnerabilityAssessmentScanProperties - { - /// Initializes a new instance of SqlVulnerabilityAssessmentScanProperties. - public SqlVulnerabilityAssessmentScanProperties() - { - } - - /// Initializes a new instance of SqlVulnerabilityAssessmentScanProperties. - /// The scan trigger type. - /// The scan status. - /// The server name. - /// The database name. - /// The SQL version. - /// The scan start time (UTC). - /// Scan results are valid until end time (UTC). - /// The number of failed rules with high severity. - /// The number of failed rules with medium severity. - /// The number of failed rules with low severity. - /// The number of total passed rules. - /// The number of total failed rules. - /// The number of total rules assessed. - /// Baseline created for this database, and has one or more rules. - internal SqlVulnerabilityAssessmentScanProperties(SqlVulnerabilityAssessmentScanTriggerType? triggerType, SqlVulnerabilityAssessmentScanState? state, string server, string database, string sqlVersion, DateTimeOffset? startOn, DateTimeOffset? endOn, int? highSeverityFailedRulesCount, int? mediumSeverityFailedRulesCount, int? lowSeverityFailedRulesCount, int? totalPassedRulesCount, int? totalFailedRulesCount, int? totalRulesCount, bool? isBaselineApplied) - { - TriggerType = triggerType; - State = state; - Server = server; - Database = database; - SqlVersion = sqlVersion; - StartOn = startOn; - EndOn = endOn; - HighSeverityFailedRulesCount = highSeverityFailedRulesCount; - MediumSeverityFailedRulesCount = mediumSeverityFailedRulesCount; - LowSeverityFailedRulesCount = lowSeverityFailedRulesCount; - TotalPassedRulesCount = totalPassedRulesCount; - TotalFailedRulesCount = totalFailedRulesCount; - TotalRulesCount = totalRulesCount; - IsBaselineApplied = isBaselineApplied; - } - - /// The scan trigger type. - public SqlVulnerabilityAssessmentScanTriggerType? TriggerType { get; set; } - /// The scan status. - public SqlVulnerabilityAssessmentScanState? State { get; set; } - /// The server name. - public string Server { get; set; } - /// The database name. - public string Database { get; set; } - /// The SQL version. - public string SqlVersion { get; set; } - /// The scan start time (UTC). - public DateTimeOffset? StartOn { get; set; } - /// Scan results are valid until end time (UTC). - public DateTimeOffset? EndOn { get; set; } - /// The number of failed rules with high severity. - public int? HighSeverityFailedRulesCount { get; set; } - /// The number of failed rules with medium severity. - public int? MediumSeverityFailedRulesCount { get; set; } - /// The number of failed rules with low severity. - public int? LowSeverityFailedRulesCount { get; set; } - /// The number of total passed rules. - public int? TotalPassedRulesCount { get; set; } - /// The number of total failed rules. - public int? TotalFailedRulesCount { get; set; } - /// The number of total rules assessed. - public int? TotalRulesCount { get; set; } - /// Baseline created for this database, and has one or more rules. - public bool? IsBaselineApplied { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanResult.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanResult.Serialization.cs deleted file mode 100644 index 95be22558d8c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanResult.Serialization.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SqlVulnerabilityAssessmentScanResult : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties); - } - writer.WriteEndObject(); - } - - internal static SqlVulnerabilityAssessmentScanResult DeserializeSqlVulnerabilityAssessmentScanResult(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional properties = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - Optional systemData = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - properties = SqlVulnerabilityAssessmentScanResultProperties.DeserializeSqlVulnerabilityAssessmentScanResultProperties(property.Value); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - } - return new SqlVulnerabilityAssessmentScanResult(id, name, type, systemData.Value, properties.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanResult.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanResult.cs deleted file mode 100644 index 3cd8b40117f6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanResult.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A vulnerability assessment scan result for a single rule. - public partial class SqlVulnerabilityAssessmentScanResult : ResourceData - { - /// Initializes a new instance of SqlVulnerabilityAssessmentScanResult. - public SqlVulnerabilityAssessmentScanResult() - { - } - - /// Initializes a new instance of SqlVulnerabilityAssessmentScanResult. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// A vulnerability assessment scan result properties for a single rule. - internal SqlVulnerabilityAssessmentScanResult(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SqlVulnerabilityAssessmentScanResultProperties properties) : base(id, name, resourceType, systemData) - { - Properties = properties; - } - - /// A vulnerability assessment scan result properties for a single rule. - public SqlVulnerabilityAssessmentScanResultProperties Properties { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanResultProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanResultProperties.Serialization.cs deleted file mode 100644 index 7d4d7ed4f786..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanResultProperties.Serialization.cs +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SqlVulnerabilityAssessmentScanResultProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(RuleId)) - { - writer.WritePropertyName("ruleId"u8); - writer.WriteStringValue(RuleId); - } - if (Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } - if (Optional.IsDefined(IsTrimmed)) - { - writer.WritePropertyName("isTrimmed"u8); - writer.WriteBooleanValue(IsTrimmed.Value); - } - if (Optional.IsCollectionDefined(QueryResults)) - { - writer.WritePropertyName("queryResults"u8); - writer.WriteStartArray(); - foreach (var item in QueryResults) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStartArray(); - foreach (var item0 in item) - { - writer.WriteStringValue(item0); - } - writer.WriteEndArray(); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(Remediation)) - { - writer.WritePropertyName("remediation"u8); - writer.WriteObjectValue(Remediation); - } - if (Optional.IsDefined(BaselineAdjustedResult)) - { - writer.WritePropertyName("baselineAdjustedResult"u8); - writer.WriteObjectValue(BaselineAdjustedResult); - } - if (Optional.IsDefined(RuleMetadata)) - { - writer.WritePropertyName("ruleMetadata"u8); - writer.WriteObjectValue(RuleMetadata); - } - writer.WriteEndObject(); - } - - internal static SqlVulnerabilityAssessmentScanResultProperties DeserializeSqlVulnerabilityAssessmentScanResultProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional ruleId = default; - Optional status = default; - Optional isTrimmed = default; - Optional>> queryResults = default; - Optional remediation = default; - Optional baselineAdjustedResult = default; - Optional ruleMetadata = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("ruleId"u8)) - { - ruleId = property.Value.GetString(); - continue; - } - if (property.NameEquals("status"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - status = new SqlVulnerabilityAssessmentScanResultRuleStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("isTrimmed"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - isTrimmed = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("queryResults"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List> array = new List>(); - foreach (var item in property.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - List array0 = new List(); - foreach (var item0 in item.EnumerateArray()) - { - array0.Add(item0.GetString()); - } - array.Add(array0); - } - } - queryResults = array; - continue; - } - if (property.NameEquals("remediation"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - remediation = SqlVulnerabilityAssessmentRemediation.DeserializeSqlVulnerabilityAssessmentRemediation(property.Value); - continue; - } - if (property.NameEquals("baselineAdjustedResult"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - baselineAdjustedResult = BaselineAdjustedResult.DeserializeBaselineAdjustedResult(property.Value); - continue; - } - if (property.NameEquals("ruleMetadata"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - ruleMetadata = VulnerabilityAssessmentRule.DeserializeVulnerabilityAssessmentRule(property.Value); - continue; - } - } - return new SqlVulnerabilityAssessmentScanResultProperties(ruleId.Value, Optional.ToNullable(status), Optional.ToNullable(isTrimmed), Optional.ToList(queryResults), remediation.Value, baselineAdjustedResult.Value, ruleMetadata.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanResultProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanResultProperties.cs deleted file mode 100644 index 7cb417eec609..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanResultProperties.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A vulnerability assessment scan result properties for a single rule. - public partial class SqlVulnerabilityAssessmentScanResultProperties - { - /// Initializes a new instance of SqlVulnerabilityAssessmentScanResultProperties. - public SqlVulnerabilityAssessmentScanResultProperties() - { - QueryResults = new ChangeTrackingList>(); - } - - /// Initializes a new instance of SqlVulnerabilityAssessmentScanResultProperties. - /// The rule Id. - /// The rule result status. - /// Indicated whether the results specified here are trimmed. - /// The results of the query that was run. - /// Remediation details. - /// The rule result adjusted with baseline. - /// vulnerability assessment rule metadata details. - internal SqlVulnerabilityAssessmentScanResultProperties(string ruleId, SqlVulnerabilityAssessmentScanResultRuleStatus? status, bool? isTrimmed, IList> queryResults, SqlVulnerabilityAssessmentRemediation remediation, BaselineAdjustedResult baselineAdjustedResult, VulnerabilityAssessmentRule ruleMetadata) - { - RuleId = ruleId; - Status = status; - IsTrimmed = isTrimmed; - QueryResults = queryResults; - Remediation = remediation; - BaselineAdjustedResult = baselineAdjustedResult; - RuleMetadata = ruleMetadata; - } - - /// The rule Id. - public string RuleId { get; set; } - /// The rule result status. - public SqlVulnerabilityAssessmentScanResultRuleStatus? Status { get; set; } - /// Indicated whether the results specified here are trimmed. - public bool? IsTrimmed { get; set; } - /// The results of the query that was run. - public IList> QueryResults { get; } - /// Remediation details. - public SqlVulnerabilityAssessmentRemediation Remediation { get; set; } - /// The rule result adjusted with baseline. - public BaselineAdjustedResult BaselineAdjustedResult { get; set; } - /// vulnerability assessment rule metadata details. - public VulnerabilityAssessmentRule RuleMetadata { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanResultRuleStatus.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanResultRuleStatus.cs deleted file mode 100644 index 981103cfc0f6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanResultRuleStatus.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The rule result status. - public readonly partial struct SqlVulnerabilityAssessmentScanResultRuleStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SqlVulnerabilityAssessmentScanResultRuleStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string NonFindingValue = "NonFinding"; - private const string FindingValue = "Finding"; - private const string InternalErrorValue = "InternalError"; - - /// NonFinding. - public static SqlVulnerabilityAssessmentScanResultRuleStatus NonFinding { get; } = new SqlVulnerabilityAssessmentScanResultRuleStatus(NonFindingValue); - /// Finding. - public static SqlVulnerabilityAssessmentScanResultRuleStatus Finding { get; } = new SqlVulnerabilityAssessmentScanResultRuleStatus(FindingValue); - /// InternalError. - public static SqlVulnerabilityAssessmentScanResultRuleStatus InternalError { get; } = new SqlVulnerabilityAssessmentScanResultRuleStatus(InternalErrorValue); - /// Determines if two values are the same. - public static bool operator ==(SqlVulnerabilityAssessmentScanResultRuleStatus left, SqlVulnerabilityAssessmentScanResultRuleStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SqlVulnerabilityAssessmentScanResultRuleStatus left, SqlVulnerabilityAssessmentScanResultRuleStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SqlVulnerabilityAssessmentScanResultRuleStatus(string value) => new SqlVulnerabilityAssessmentScanResultRuleStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SqlVulnerabilityAssessmentScanResultRuleStatus other && Equals(other); - /// - public bool Equals(SqlVulnerabilityAssessmentScanResultRuleStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanState.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanState.cs deleted file mode 100644 index b19652cc18ec..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanState.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The scan status. - public readonly partial struct SqlVulnerabilityAssessmentScanState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SqlVulnerabilityAssessmentScanState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string FailedValue = "Failed"; - private const string FailedToRunValue = "FailedToRun"; - private const string InProgressValue = "InProgress"; - private const string PassedValue = "Passed"; - - /// Failed. - public static SqlVulnerabilityAssessmentScanState Failed { get; } = new SqlVulnerabilityAssessmentScanState(FailedValue); - /// FailedToRun. - public static SqlVulnerabilityAssessmentScanState FailedToRun { get; } = new SqlVulnerabilityAssessmentScanState(FailedToRunValue); - /// InProgress. - public static SqlVulnerabilityAssessmentScanState InProgress { get; } = new SqlVulnerabilityAssessmentScanState(InProgressValue); - /// Passed. - public static SqlVulnerabilityAssessmentScanState Passed { get; } = new SqlVulnerabilityAssessmentScanState(PassedValue); - /// Determines if two values are the same. - public static bool operator ==(SqlVulnerabilityAssessmentScanState left, SqlVulnerabilityAssessmentScanState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SqlVulnerabilityAssessmentScanState left, SqlVulnerabilityAssessmentScanState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SqlVulnerabilityAssessmentScanState(string value) => new SqlVulnerabilityAssessmentScanState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SqlVulnerabilityAssessmentScanState other && Equals(other); - /// - public bool Equals(SqlVulnerabilityAssessmentScanState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanTriggerType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanTriggerType.cs deleted file mode 100644 index 676a9f42bade..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SqlVulnerabilityAssessmentScanTriggerType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The scan trigger type. - public readonly partial struct SqlVulnerabilityAssessmentScanTriggerType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SqlVulnerabilityAssessmentScanTriggerType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string OnDemandValue = "OnDemand"; - private const string RecurringValue = "Recurring"; - - /// OnDemand. - public static SqlVulnerabilityAssessmentScanTriggerType OnDemand { get; } = new SqlVulnerabilityAssessmentScanTriggerType(OnDemandValue); - /// Recurring. - public static SqlVulnerabilityAssessmentScanTriggerType Recurring { get; } = new SqlVulnerabilityAssessmentScanTriggerType(RecurringValue); - /// Determines if two values are the same. - public static bool operator ==(SqlVulnerabilityAssessmentScanTriggerType left, SqlVulnerabilityAssessmentScanTriggerType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SqlVulnerabilityAssessmentScanTriggerType left, SqlVulnerabilityAssessmentScanTriggerType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SqlVulnerabilityAssessmentScanTriggerType(string value) => new SqlVulnerabilityAssessmentScanTriggerType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SqlVulnerabilityAssessmentScanTriggerType other && Equals(other); - /// - public bool Equals(SqlVulnerabilityAssessmentScanTriggerType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsDefenderForServersInfo.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardComponentProperties.Serialization.cs similarity index 56% rename from sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsDefenderForServersInfo.Serialization.cs rename to sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardComponentProperties.Serialization.cs index 25250ed94265..8960bf354aa0 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/AwsDefenderForServersInfo.Serialization.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardComponentProperties.Serialization.cs @@ -10,35 +10,35 @@ namespace Azure.ResourceManager.SecurityCenter.Models { - internal partial class AwsDefenderForServersInfo : IUtf8JsonSerializable + public partial class StandardComponentProperties : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Optional.IsDefined(CloudRoleArn)) + if (Optional.IsDefined(Key)) { - writer.WritePropertyName("cloudRoleArn"u8); - writer.WriteStringValue(CloudRoleArn); + writer.WritePropertyName("key"u8); + writer.WriteStringValue(Key); } writer.WriteEndObject(); } - internal static AwsDefenderForServersInfo DeserializeAwsDefenderForServersInfo(JsonElement element) + internal static StandardComponentProperties DeserializeStandardComponentProperties(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { return null; } - Optional cloudRoleArn = default; + Optional key = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("cloudRoleArn"u8)) + if (property.NameEquals("key"u8)) { - cloudRoleArn = property.Value.GetString(); + key = property.Value.GetString(); continue; } } - return new AwsDefenderForServersInfo(cloudRoleArn.Value); + return new StandardComponentProperties(key.Value); } } } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardComponentProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardComponentProperties.cs new file mode 100644 index 000000000000..95c5de17b6de --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardComponentProperties.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.SecurityCenter.Models +{ + /// Describes properties of an component as related to the standard. + public partial class StandardComponentProperties + { + /// Initializes a new instance of StandardComponentProperties. + public StandardComponentProperties() + { + } + + /// Initializes a new instance of StandardComponentProperties. + /// Component Key matching componentMetadata. + internal StandardComponentProperties(string key) + { + Key = key; + } + + /// Component Key matching componentMetadata. + public string Key { get; set; } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardData.Serialization.cs similarity index 67% rename from sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationData.Serialization.cs rename to sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardData.Serialization.cs index 5779eba78246..7d6b62d07538 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SecurityAutomationData.Serialization.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardData.Serialization.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.SecurityCenter { - public partial class SecurityAutomationData : IUtf8JsonSerializable + public partial class StandardData : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -44,43 +44,38 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteStringValue(Location); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); + if (Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } if (Optional.IsDefined(Description)) { writer.WritePropertyName("description"u8); writer.WriteStringValue(Description); } - if (Optional.IsDefined(IsEnabled)) + if (Optional.IsDefined(Category)) { - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled.Value); + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); } - if (Optional.IsCollectionDefined(Scopes)) + if (Optional.IsCollectionDefined(Components)) { - writer.WritePropertyName("scopes"u8); + writer.WritePropertyName("components"u8); writer.WriteStartArray(); - foreach (var item in Scopes) + foreach (var item in Components) { writer.WriteObjectValue(item); } writer.WriteEndArray(); } - if (Optional.IsCollectionDefined(Sources)) + if (Optional.IsCollectionDefined(SupportedClouds)) { - writer.WritePropertyName("sources"u8); + writer.WritePropertyName("supportedClouds"u8); writer.WriteStartArray(); - foreach (var item in Sources) + foreach (var item in SupportedClouds) { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(Actions)) - { - writer.WritePropertyName("actions"u8); - writer.WriteStartArray(); - foreach (var item in Actions) - { - writer.WriteObjectValue(item); + writer.WriteStringValue(item.ToSerialString()); } writer.WriteEndArray(); } @@ -88,7 +83,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteEndObject(); } - internal static SecurityAutomationData DeserializeSecurityAutomationData(JsonElement element) + internal static StandardData DeserializeStandardData(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { @@ -102,11 +97,12 @@ internal static SecurityAutomationData DeserializeSecurityAutomationData(JsonEle string name = default; ResourceType type = default; Optional systemData = default; + Optional displayName = default; + Optional standardType = default; Optional description = default; - Optional isEnabled = default; - Optional> scopes = default; - Optional> sources = default; - Optional> actions = default; + Optional category = default; + Optional> components = default; + Optional> supportedClouds = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("kind"u8)) @@ -178,71 +174,61 @@ internal static SecurityAutomationData DeserializeSecurityAutomationData(JsonEle } foreach (var property0 in property.Value.EnumerateObject()) { - if (property0.NameEquals("description"u8)) + if (property0.NameEquals("displayName"u8)) { - description = property0.Value.GetString(); + displayName = property0.Value.GetString(); continue; } - if (property0.NameEquals("isEnabled"u8)) + if (property0.NameEquals("standardType"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - isEnabled = property0.Value.GetBoolean(); + standardType = property0.Value.GetString(); continue; } - if (property0.NameEquals("scopes"u8)) + if (property0.NameEquals("description"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(SecurityAutomationScope.DeserializeSecurityAutomationScope(item)); - } - scopes = array; + description = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("category"u8)) + { + category = property0.Value.GetString(); continue; } - if (property0.NameEquals("sources"u8)) + if (property0.NameEquals("components"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); + List array = new List(); foreach (var item in property0.Value.EnumerateArray()) { - array.Add(SecurityAutomationSource.DeserializeSecurityAutomationSource(item)); + array.Add(StandardComponentProperties.DeserializeStandardComponentProperties(item)); } - sources = array; + components = array; continue; } - if (property0.NameEquals("actions"u8)) + if (property0.NameEquals("supportedClouds"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); + List array = new List(); foreach (var item in property0.Value.EnumerateArray()) { - array.Add(SecurityAutomationAction.DeserializeSecurityAutomationAction(item)); + array.Add(item.GetString().ToStandardSupportedCloud()); } - actions = array; + supportedClouds = array; continue; } } continue; } } - return new SecurityAutomationData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, description.Value, Optional.ToNullable(isEnabled), Optional.ToList(scopes), Optional.ToList(sources), Optional.ToList(actions), kind.Value, Optional.ToNullable(etag)); + return new StandardData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, displayName.Value, standardType.Value, description.Value, category.Value, Optional.ToList(components), Optional.ToList(supportedClouds), kind.Value, Optional.ToNullable(etag)); } } } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SettingsList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardList.Serialization.cs similarity index 75% rename from sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SettingsList.Serialization.cs rename to sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardList.Serialization.cs index 0840fc428a4e..6fbe29be03e8 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SettingsList.Serialization.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardList.Serialization.cs @@ -12,15 +12,15 @@ namespace Azure.ResourceManager.SecurityCenter.Models { - internal partial class SettingsList + internal partial class StandardList { - internal static SettingsList DeserializeSettingsList(JsonElement element) + internal static StandardList DeserializeStandardList(JsonElement element) { if (element.ValueKind == JsonValueKind.Null) { return null; } - Optional> value = default; + Optional> value = default; Optional nextLink = default; foreach (var property in element.EnumerateObject()) { @@ -31,10 +31,10 @@ internal static SettingsList DeserializeSettingsList(JsonElement element) property.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(SecuritySettingData.DeserializeSecuritySettingData(item)); + array.Add(StandardData.DeserializeStandardData(item)); } value = array; continue; @@ -45,7 +45,7 @@ internal static SettingsList DeserializeSettingsList(JsonElement element) continue; } } - return new SettingsList(Optional.ToList(value), nextLink.Value); + return new StandardList(Optional.ToList(value), nextLink.Value); } } } diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardList.cs new file mode 100644 index 000000000000..337023c017d4 --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardList.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.SecurityCenter; + +namespace Azure.ResourceManager.SecurityCenter.Models +{ + /// Page of a Standard list. + internal partial class StandardList + { + /// Initializes a new instance of StandardList. + internal StandardList() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of StandardList. + /// Collection of standards in this page. + /// The URI to fetch the next page. + internal StandardList(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// Collection of standards in this page. + public IReadOnlyList Value { get; } + /// The URI to fetch the next page. + public string NextLink { get; } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardSupportedCloud.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardSupportedCloud.Serialization.cs new file mode 100644 index 000000000000..4ddc4ddce3da --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardSupportedCloud.Serialization.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.SecurityCenter.Models +{ + internal static partial class StandardSupportedCloudExtensions + { + public static string ToSerialString(this StandardSupportedCloud value) => value switch + { + StandardSupportedCloud.Aws => "AWS", + StandardSupportedCloud.Gcp => "GCP", + _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StandardSupportedCloud value.") + }; + + public static StandardSupportedCloud ToStandardSupportedCloud(this string value) + { + if (StringComparer.OrdinalIgnoreCase.Equals(value, "AWS")) return StandardSupportedCloud.Aws; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "GCP")) return StandardSupportedCloud.Gcp; + throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown StandardSupportedCloud value."); + } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardSupportedCloud.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardSupportedCloud.cs new file mode 100644 index 000000000000..a6376ed3a45c --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/StandardSupportedCloud.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.SecurityCenter.Models +{ + /// The cloud that the standard is supported on. + public enum StandardSupportedCloud + { + /// AWS. + Aws, + /// GCP. + Gcp + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SubAssessmentStatus.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SubAssessmentStatus.Serialization.cs deleted file mode 100644 index 96c95cc76579..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SubAssessmentStatus.Serialization.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SubAssessmentStatus : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WriteEndObject(); - } - - internal static SubAssessmentStatus DeserializeSubAssessmentStatus(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional code = default; - Optional cause = default; - Optional description = default; - Optional severity = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - code = new SubAssessmentStatusCode(property.Value.GetString()); - continue; - } - if (property.NameEquals("cause"u8)) - { - cause = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("severity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - severity = new SecurityAssessmentSeverity(property.Value.GetString()); - continue; - } - } - return new SubAssessmentStatus(Optional.ToNullable(code), cause.Value, description.Value, Optional.ToNullable(severity)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SubAssessmentStatus.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SubAssessmentStatus.cs deleted file mode 100644 index 107e7bce22ec..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SubAssessmentStatus.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Status of the sub-assessment. - public partial class SubAssessmentStatus - { - /// Initializes a new instance of SubAssessmentStatus. - public SubAssessmentStatus() - { - } - - /// Initializes a new instance of SubAssessmentStatus. - /// Programmatic code for the status of the assessment. - /// Programmatic code for the cause of the assessment status. - /// Human readable description of the assessment status. - /// The sub-assessment severity level. - internal SubAssessmentStatus(SubAssessmentStatusCode? code, string cause, string description, SecurityAssessmentSeverity? severity) - { - Code = code; - Cause = cause; - Description = description; - Severity = severity; - } - - /// Programmatic code for the status of the assessment. - public SubAssessmentStatusCode? Code { get; } - /// Programmatic code for the cause of the assessment status. - public string Cause { get; } - /// Human readable description of the assessment status. - public string Description { get; } - /// The sub-assessment severity level. - public SecurityAssessmentSeverity? Severity { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SubAssessmentStatusCode.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SubAssessmentStatusCode.cs deleted file mode 100644 index 04af03690640..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SubAssessmentStatusCode.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Programmatic code for the status of the assessment. - public readonly partial struct SubAssessmentStatusCode : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SubAssessmentStatusCode(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string HealthyValue = "Healthy"; - private const string UnhealthyValue = "Unhealthy"; - private const string NotApplicableValue = "NotApplicable"; - - /// The resource is healthy. - public static SubAssessmentStatusCode Healthy { get; } = new SubAssessmentStatusCode(HealthyValue); - /// The resource has a security issue that needs to be addressed. - public static SubAssessmentStatusCode Unhealthy { get; } = new SubAssessmentStatusCode(UnhealthyValue); - /// Assessment for this resource did not happen. - public static SubAssessmentStatusCode NotApplicable { get; } = new SubAssessmentStatusCode(NotApplicableValue); - /// Determines if two values are the same. - public static bool operator ==(SubAssessmentStatusCode left, SubAssessmentStatusCode right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SubAssessmentStatusCode left, SubAssessmentStatusCode right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator SubAssessmentStatusCode(string value) => new SubAssessmentStatusCode(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SubAssessmentStatusCode other && Equals(other); - /// - public bool Equals(SubAssessmentStatusCode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SuppressionAlertsScope.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SuppressionAlertsScope.Serialization.cs deleted file mode 100644 index 76e4bace852a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SuppressionAlertsScope.Serialization.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class SuppressionAlertsScope : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("allOf"u8); - writer.WriteStartArray(); - foreach (var item in AllOf) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - writer.WriteEndObject(); - } - - internal static SuppressionAlertsScope DeserializeSuppressionAlertsScope(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IList allOf = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("allOf"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SuppressionAlertsScopeElement.DeserializeSuppressionAlertsScopeElement(item)); - } - allOf = array; - continue; - } - } - return new SuppressionAlertsScope(allOf); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SuppressionAlertsScope.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SuppressionAlertsScope.cs deleted file mode 100644 index d0f92562e203..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SuppressionAlertsScope.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The SuppressionAlertsScope. - internal partial class SuppressionAlertsScope - { - /// Initializes a new instance of SuppressionAlertsScope. - /// All the conditions inside need to be true in order to suppress the alert. - /// is null. - public SuppressionAlertsScope(IEnumerable allOf) - { - Argument.AssertNotNull(allOf, nameof(allOf)); - - AllOf = allOf.ToList(); - } - - /// Initializes a new instance of SuppressionAlertsScope. - /// All the conditions inside need to be true in order to suppress the alert. - internal SuppressionAlertsScope(IList allOf) - { - AllOf = allOf; - } - - /// All the conditions inside need to be true in order to suppress the alert. - public IList AllOf { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SuppressionAlertsScopeElement.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SuppressionAlertsScopeElement.Serialization.cs deleted file mode 100644 index 918b325d8a06..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SuppressionAlertsScopeElement.Serialization.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class SuppressionAlertsScopeElement : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Field)) - { - writer.WritePropertyName("field"u8); - writer.WriteStringValue(Field); - } - foreach (var item in AdditionalProperties) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - - internal static SuppressionAlertsScopeElement DeserializeSuppressionAlertsScopeElement(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional field = default; - IDictionary additionalProperties = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("field"u8)) - { - field = property.Value.GetString(); - continue; - } - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - additionalProperties = additionalPropertiesDictionary; - return new SuppressionAlertsScopeElement(field.Value, additionalProperties); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SuppressionAlertsScopeElement.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SuppressionAlertsScopeElement.cs deleted file mode 100644 index b44e48971076..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/SuppressionAlertsScopeElement.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// A more specific scope used to identify the alerts to suppress. - public partial class SuppressionAlertsScopeElement - { - /// Initializes a new instance of SuppressionAlertsScopeElement. - public SuppressionAlertsScopeElement() - { - AdditionalProperties = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of SuppressionAlertsScopeElement. - /// The alert entity type to suppress by. - /// Additional Properties. - internal SuppressionAlertsScopeElement(string field, IDictionary additionalProperties) - { - Field = field; - AdditionalProperties = additionalProperties; - } - - /// The alert entity type to suppress by. - public string Field { get; set; } - /// - /// Additional Properties - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formated json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public IDictionary AdditionalProperties { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ThresholdCustomAlertRule.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ThresholdCustomAlertRule.Serialization.cs deleted file mode 100644 index d6838ff43d78..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ThresholdCustomAlertRule.Serialization.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class ThresholdCustomAlertRule : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static ThresholdCustomAlertRule DeserializeThresholdCustomAlertRule(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("ruleType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "ActiveConnectionsNotInAllowedRange": return ActiveConnectionsNotInAllowedRange.DeserializeActiveConnectionsNotInAllowedRange(element); - case "AmqpC2DMessagesNotInAllowedRange": return AmqpC2DMessagesNotInAllowedRange.DeserializeAmqpC2DMessagesNotInAllowedRange(element); - case "AmqpC2DRejectedMessagesNotInAllowedRange": return AmqpC2DRejectedMessagesNotInAllowedRange.DeserializeAmqpC2DRejectedMessagesNotInAllowedRange(element); - case "AmqpD2CMessagesNotInAllowedRange": return AmqpD2CMessagesNotInAllowedRange.DeserializeAmqpD2CMessagesNotInAllowedRange(element); - case "DirectMethodInvokesNotInAllowedRange": return DirectMethodInvokesNotInAllowedRange.DeserializeDirectMethodInvokesNotInAllowedRange(element); - case "FailedLocalLoginsNotInAllowedRange": return FailedLocalLoginsNotInAllowedRange.DeserializeFailedLocalLoginsNotInAllowedRange(element); - case "FileUploadsNotInAllowedRange": return FileUploadsNotInAllowedRange.DeserializeFileUploadsNotInAllowedRange(element); - case "HttpC2DMessagesNotInAllowedRange": return HttpC2DMessagesNotInAllowedRange.DeserializeHttpC2DMessagesNotInAllowedRange(element); - case "HttpC2DRejectedMessagesNotInAllowedRange": return HttpC2DRejectedMessagesNotInAllowedRange.DeserializeHttpC2DRejectedMessagesNotInAllowedRange(element); - case "HttpD2CMessagesNotInAllowedRange": return HttpD2CMessagesNotInAllowedRange.DeserializeHttpD2CMessagesNotInAllowedRange(element); - case "MqttC2DMessagesNotInAllowedRange": return MqttC2DMessagesNotInAllowedRange.DeserializeMqttC2DMessagesNotInAllowedRange(element); - case "MqttC2DRejectedMessagesNotInAllowedRange": return MqttC2DRejectedMessagesNotInAllowedRange.DeserializeMqttC2DRejectedMessagesNotInAllowedRange(element); - case "MqttD2CMessagesNotInAllowedRange": return MqttD2CMessagesNotInAllowedRange.DeserializeMqttD2CMessagesNotInAllowedRange(element); - case "QueuePurgesNotInAllowedRange": return QueuePurgesNotInAllowedRange.DeserializeQueuePurgesNotInAllowedRange(element); - case "TimeWindowCustomAlertRule": return TimeWindowCustomAlertRule.DeserializeTimeWindowCustomAlertRule(element); - case "TwinUpdatesNotInAllowedRange": return TwinUpdatesNotInAllowedRange.DeserializeTwinUpdatesNotInAllowedRange(element); - case "UnauthorizedOperationsNotInAllowedRange": return UnauthorizedOperationsNotInAllowedRange.DeserializeUnauthorizedOperationsNotInAllowedRange(element); - } - } - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = "ThresholdCustomAlertRule"; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new ThresholdCustomAlertRule(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ThresholdCustomAlertRule.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ThresholdCustomAlertRule.cs deleted file mode 100644 index 67d8f867f075..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/ThresholdCustomAlertRule.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// - /// A custom alert rule that checks if a value (depends on the custom alert type) is within the given range. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , , , and . - /// - public partial class ThresholdCustomAlertRule : CustomAlertRule - { - /// Initializes a new instance of ThresholdCustomAlertRule. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - public ThresholdCustomAlertRule(bool isEnabled, int minThreshold, int maxThreshold) : base(isEnabled) - { - MinThreshold = minThreshold; - MaxThreshold = maxThreshold; - RuleType = "ThresholdCustomAlertRule"; - } - - /// Initializes a new instance of ThresholdCustomAlertRule. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - internal ThresholdCustomAlertRule(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold) : base(displayName, description, isEnabled, ruleType) - { - MinThreshold = minThreshold; - MaxThreshold = maxThreshold; - RuleType = ruleType ?? "ThresholdCustomAlertRule"; - } - - /// The minimum threshold. - public int MinThreshold { get; set; } - /// The maximum threshold. - public int MaxThreshold { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TimeWindowCustomAlertRule.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TimeWindowCustomAlertRule.Serialization.cs deleted file mode 100644 index 09dbc786301e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TimeWindowCustomAlertRule.Serialization.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class TimeWindowCustomAlertRule : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("timeWindowSize"u8); - writer.WriteStringValue(TimeWindowSize, "P"); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static TimeWindowCustomAlertRule DeserializeTimeWindowCustomAlertRule(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - if (element.TryGetProperty("ruleType", out JsonElement discriminator)) - { - switch (discriminator.GetString()) - { - case "ActiveConnectionsNotInAllowedRange": return ActiveConnectionsNotInAllowedRange.DeserializeActiveConnectionsNotInAllowedRange(element); - case "AmqpC2DMessagesNotInAllowedRange": return AmqpC2DMessagesNotInAllowedRange.DeserializeAmqpC2DMessagesNotInAllowedRange(element); - case "AmqpC2DRejectedMessagesNotInAllowedRange": return AmqpC2DRejectedMessagesNotInAllowedRange.DeserializeAmqpC2DRejectedMessagesNotInAllowedRange(element); - case "AmqpD2CMessagesNotInAllowedRange": return AmqpD2CMessagesNotInAllowedRange.DeserializeAmqpD2CMessagesNotInAllowedRange(element); - case "DirectMethodInvokesNotInAllowedRange": return DirectMethodInvokesNotInAllowedRange.DeserializeDirectMethodInvokesNotInAllowedRange(element); - case "FailedLocalLoginsNotInAllowedRange": return FailedLocalLoginsNotInAllowedRange.DeserializeFailedLocalLoginsNotInAllowedRange(element); - case "FileUploadsNotInAllowedRange": return FileUploadsNotInAllowedRange.DeserializeFileUploadsNotInAllowedRange(element); - case "HttpC2DMessagesNotInAllowedRange": return HttpC2DMessagesNotInAllowedRange.DeserializeHttpC2DMessagesNotInAllowedRange(element); - case "HttpC2DRejectedMessagesNotInAllowedRange": return HttpC2DRejectedMessagesNotInAllowedRange.DeserializeHttpC2DRejectedMessagesNotInAllowedRange(element); - case "HttpD2CMessagesNotInAllowedRange": return HttpD2CMessagesNotInAllowedRange.DeserializeHttpD2CMessagesNotInAllowedRange(element); - case "MqttC2DMessagesNotInAllowedRange": return MqttC2DMessagesNotInAllowedRange.DeserializeMqttC2DMessagesNotInAllowedRange(element); - case "MqttC2DRejectedMessagesNotInAllowedRange": return MqttC2DRejectedMessagesNotInAllowedRange.DeserializeMqttC2DRejectedMessagesNotInAllowedRange(element); - case "MqttD2CMessagesNotInAllowedRange": return MqttD2CMessagesNotInAllowedRange.DeserializeMqttD2CMessagesNotInAllowedRange(element); - case "QueuePurgesNotInAllowedRange": return QueuePurgesNotInAllowedRange.DeserializeQueuePurgesNotInAllowedRange(element); - case "TwinUpdatesNotInAllowedRange": return TwinUpdatesNotInAllowedRange.DeserializeTwinUpdatesNotInAllowedRange(element); - case "UnauthorizedOperationsNotInAllowedRange": return UnauthorizedOperationsNotInAllowedRange.DeserializeUnauthorizedOperationsNotInAllowedRange(element); - } - } - TimeSpan timeWindowSize = default; - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = "TimeWindowCustomAlertRule"; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeWindowSize"u8)) - { - timeWindowSize = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new TimeWindowCustomAlertRule(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TimeWindowCustomAlertRule.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TimeWindowCustomAlertRule.cs deleted file mode 100644 index 7c0f7ffcd789..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TimeWindowCustomAlertRule.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// - /// A custom alert rule that checks if the number of activities (depends on the custom alert type) in a time window is within the given range. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , , and . - /// - public partial class TimeWindowCustomAlertRule : ThresholdCustomAlertRule - { - /// Initializes a new instance of TimeWindowCustomAlertRule. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - public TimeWindowCustomAlertRule(bool isEnabled, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(isEnabled, minThreshold, maxThreshold) - { - TimeWindowSize = timeWindowSize; - RuleType = "TimeWindowCustomAlertRule"; - } - - /// Initializes a new instance of TimeWindowCustomAlertRule. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - internal TimeWindowCustomAlertRule(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(displayName, description, isEnabled, ruleType, minThreshold, maxThreshold) - { - TimeWindowSize = timeWindowSize; - RuleType = ruleType ?? "TimeWindowCustomAlertRule"; - } - - /// The time window size in iso8601 format. - public TimeSpan TimeWindowSize { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologyList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologyList.Serialization.cs deleted file mode 100644 index 9be81b28674b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologyList.Serialization.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class TopologyList - { - internal static TopologyList DeserializeTopologyList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional> value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityTopologyResource.DeserializeSecurityTopologyResource(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new TopologyList(Optional.ToList(value), nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologyList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologyList.cs deleted file mode 100644 index 4e08bfab1acd..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologyList.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The TopologyList. - internal partial class TopologyList - { - /// Initializes a new instance of TopologyList. - internal TopologyList() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of TopologyList. - /// - /// The URI to fetch the next page. - internal TopologyList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// Gets the value. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResource.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResource.Serialization.cs deleted file mode 100644 index 1df8e5c8bc00..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResource.Serialization.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class TopologySingleResource - { - internal static TopologySingleResource DeserializeTopologySingleResource(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional resourceId = default; - Optional severity = default; - Optional recommendationsExist = default; - Optional networkZones = default; - Optional topologyScore = default; - Optional location = default; - Optional> parents = default; - Optional> children = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("resourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - resourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("severity"u8)) - { - severity = property.Value.GetString(); - continue; - } - if (property.NameEquals("recommendationsExist"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - recommendationsExist = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("networkZones"u8)) - { - networkZones = property.Value.GetString(); - continue; - } - if (property.NameEquals("topologyScore"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - topologyScore = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("parents"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(TopologySingleResourceParent.DeserializeTopologySingleResourceParent(item)); - } - parents = array; - continue; - } - if (property.NameEquals("children"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(TopologySingleResourceChild.DeserializeTopologySingleResourceChild(item)); - } - children = array; - continue; - } - } - return new TopologySingleResource(resourceId.Value, severity.Value, Optional.ToNullable(recommendationsExist), networkZones.Value, Optional.ToNullable(topologyScore), Optional.ToNullable(location), Optional.ToList(parents), Optional.ToList(children)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResource.cs deleted file mode 100644 index aebaef3602cb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResource.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The TopologySingleResource. - public partial class TopologySingleResource - { - /// Initializes a new instance of TopologySingleResource. - internal TopologySingleResource() - { - Parents = new ChangeTrackingList(); - Children = new ChangeTrackingList(); - } - - /// Initializes a new instance of TopologySingleResource. - /// Azure resource id. - /// The security severity of the resource. - /// Indicates if the resource has security recommendations. - /// Indicates the resource connectivity level to the Internet (InternetFacing, Internal ,etc.). - /// Score of the resource based on its security severity. - /// The location of this resource. - /// Azure resources connected to this resource which are in higher level in the topology view. - /// Azure resources connected to this resource which are in lower level in the topology view. - internal TopologySingleResource(ResourceIdentifier resourceId, string severity, bool? recommendationsExist, string networkZones, int? topologyScore, AzureLocation? location, IReadOnlyList parents, IReadOnlyList children) - { - ResourceId = resourceId; - Severity = severity; - RecommendationsExist = recommendationsExist; - NetworkZones = networkZones; - TopologyScore = topologyScore; - Location = location; - Parents = parents; - Children = children; - } - - /// Azure resource id. - public ResourceIdentifier ResourceId { get; } - /// The security severity of the resource. - public string Severity { get; } - /// Indicates if the resource has security recommendations. - public bool? RecommendationsExist { get; } - /// Indicates the resource connectivity level to the Internet (InternetFacing, Internal ,etc.). - public string NetworkZones { get; } - /// Score of the resource based on its security severity. - public int? TopologyScore { get; } - /// The location of this resource. - public AzureLocation? Location { get; } - /// Azure resources connected to this resource which are in higher level in the topology view. - public IReadOnlyList Parents { get; } - /// Azure resources connected to this resource which are in lower level in the topology view. - public IReadOnlyList Children { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResourceChild.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResourceChild.Serialization.cs deleted file mode 100644 index 5fc42a5c0e81..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResourceChild.Serialization.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class TopologySingleResourceChild - { - internal static TopologySingleResourceChild DeserializeTopologySingleResourceChild(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional resourceId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("resourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - resourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - } - return new TopologySingleResourceChild(resourceId.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResourceChild.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResourceChild.cs deleted file mode 100644 index 2387ec811cd4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResourceChild.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The TopologySingleResourceChild. - public partial class TopologySingleResourceChild - { - /// Initializes a new instance of TopologySingleResourceChild. - internal TopologySingleResourceChild() - { - } - - /// Initializes a new instance of TopologySingleResourceChild. - /// Azure resource id which serves as child resource in topology view. - internal TopologySingleResourceChild(ResourceIdentifier resourceId) - { - ResourceId = resourceId; - } - - /// Azure resource id which serves as child resource in topology view. - public ResourceIdentifier ResourceId { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResourceParent.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResourceParent.Serialization.cs deleted file mode 100644 index b801da6c42a7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResourceParent.Serialization.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class TopologySingleResourceParent - { - internal static TopologySingleResourceParent DeserializeTopologySingleResourceParent(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional resourceId = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("resourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - resourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - } - return new TopologySingleResourceParent(resourceId.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResourceParent.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResourceParent.cs deleted file mode 100644 index 026568de7aee..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TopologySingleResourceParent.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The TopologySingleResourceParent. - public partial class TopologySingleResourceParent - { - /// Initializes a new instance of TopologySingleResourceParent. - internal TopologySingleResourceParent() - { - } - - /// Initializes a new instance of TopologySingleResourceParent. - /// Azure resource id which serves as parent resource in topology view. - internal TopologySingleResourceParent(ResourceIdentifier resourceId) - { - ResourceId = resourceId; - } - - /// Azure resource id which serves as parent resource in topology view. - public ResourceIdentifier ResourceId { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TwinUpdatesNotInAllowedRange.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TwinUpdatesNotInAllowedRange.Serialization.cs deleted file mode 100644 index 9d42257e8c1a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TwinUpdatesNotInAllowedRange.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class TwinUpdatesNotInAllowedRange : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("timeWindowSize"u8); - writer.WriteStringValue(TimeWindowSize, "P"); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static TwinUpdatesNotInAllowedRange DeserializeTwinUpdatesNotInAllowedRange(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - TimeSpan timeWindowSize = default; - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeWindowSize"u8)) - { - timeWindowSize = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new TwinUpdatesNotInAllowedRange(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TwinUpdatesNotInAllowedRange.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TwinUpdatesNotInAllowedRange.cs deleted file mode 100644 index fb017a12e7d4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/TwinUpdatesNotInAllowedRange.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Number of twin updates is not in allowed range. - public partial class TwinUpdatesNotInAllowedRange : TimeWindowCustomAlertRule - { - /// Initializes a new instance of TwinUpdatesNotInAllowedRange. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - public TwinUpdatesNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(isEnabled, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = "TwinUpdatesNotInAllowedRange"; - } - - /// Initializes a new instance of TwinUpdatesNotInAllowedRange. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - internal TwinUpdatesNotInAllowedRange(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(displayName, description, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = ruleType ?? "TwinUpdatesNotInAllowedRange"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnauthorizedOperationsNotInAllowedRange.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnauthorizedOperationsNotInAllowedRange.Serialization.cs deleted file mode 100644 index 773c76201598..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnauthorizedOperationsNotInAllowedRange.Serialization.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class UnauthorizedOperationsNotInAllowedRange : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("timeWindowSize"u8); - writer.WriteStringValue(TimeWindowSize, "P"); - writer.WritePropertyName("minThreshold"u8); - writer.WriteNumberValue(MinThreshold); - writer.WritePropertyName("maxThreshold"u8); - writer.WriteNumberValue(MaxThreshold); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static UnauthorizedOperationsNotInAllowedRange DeserializeUnauthorizedOperationsNotInAllowedRange(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - TimeSpan timeWindowSize = default; - int minThreshold = default; - int maxThreshold = default; - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("timeWindowSize"u8)) - { - timeWindowSize = property.Value.GetTimeSpan("P"); - continue; - } - if (property.NameEquals("minThreshold"u8)) - { - minThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("maxThreshold"u8)) - { - maxThreshold = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new UnauthorizedOperationsNotInAllowedRange(displayName.Value, description.Value, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnauthorizedOperationsNotInAllowedRange.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnauthorizedOperationsNotInAllowedRange.cs deleted file mode 100644 index 1372bcf8581c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnauthorizedOperationsNotInAllowedRange.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Number of unauthorized operations is not in allowed range. - public partial class UnauthorizedOperationsNotInAllowedRange : TimeWindowCustomAlertRule - { - /// Initializes a new instance of UnauthorizedOperationsNotInAllowedRange. - /// Status of the custom alert. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - public UnauthorizedOperationsNotInAllowedRange(bool isEnabled, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(isEnabled, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = "UnauthorizedOperationsNotInAllowedRange"; - } - - /// Initializes a new instance of UnauthorizedOperationsNotInAllowedRange. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - /// The minimum threshold. - /// The maximum threshold. - /// The time window size in iso8601 format. - internal UnauthorizedOperationsNotInAllowedRange(string displayName, string description, bool isEnabled, string ruleType, int minThreshold, int maxThreshold, TimeSpan timeWindowSize) : base(displayName, description, isEnabled, ruleType, minThreshold, maxThreshold, timeWindowSize) - { - RuleType = ruleType ?? "UnauthorizedOperationsNotInAllowedRange"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAdditionalData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAdditionalData.Serialization.cs deleted file mode 100644 index 7ccaff270def..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAdditionalData.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class UnknownAdditionalData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("assessedResourceType"u8); - writer.WriteStringValue(AssessedResourceType.ToString()); - writer.WriteEndObject(); - } - - internal static UnknownAdditionalData DeserializeUnknownAdditionalData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - AssessedResourceType assessedResourceType = "Unknown"; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("assessedResourceType"u8)) - { - assessedResourceType = new AssessedResourceType(property.Value.GetString()); - continue; - } - } - return new UnknownAdditionalData(assessedResourceType); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAdditionalData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAdditionalData.cs deleted file mode 100644 index 2fe7f402b3c2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAdditionalData.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The UnknownAdditionalData. - internal partial class UnknownAdditionalData : SecuritySubAssessmentAdditionalInfo - { - /// Initializes a new instance of UnknownAdditionalData. - /// Sub-assessment resource type. - internal UnknownAdditionalData(AssessedResourceType assessedResourceType) : base(assessedResourceType) - { - AssessedResourceType = assessedResourceType; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAlertResourceIdentifier.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAlertResourceIdentifier.Serialization.cs deleted file mode 100644 index cf2034962a33..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAlertResourceIdentifier.Serialization.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class UnknownAlertResourceIdentifier - { - internal static UnknownAlertResourceIdentifier DeserializeUnknownAlertResourceIdentifier(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifierType type = "Unknown"; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("type"u8)) - { - type = new ResourceIdentifierType(property.Value.GetString()); - continue; - } - } - return new UnknownAlertResourceIdentifier(type); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAlertResourceIdentifier.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAlertResourceIdentifier.cs deleted file mode 100644 index fc8c409733e3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAlertResourceIdentifier.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The UnknownAlertResourceIdentifier. - internal partial class UnknownAlertResourceIdentifier : SecurityAlertResourceIdentifier - { - /// Initializes a new instance of UnknownAlertResourceIdentifier. - /// There can be multiple identifiers of different type per alert, this field specify the identifier type. - internal UnknownAlertResourceIdentifier(ResourceIdentifierType resourceIdentifierType) : base(resourceIdentifierType) - { - ResourceIdentifierType = resourceIdentifierType; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAuthenticationDetailsProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAuthenticationDetailsProperties.Serialization.cs deleted file mode 100644 index 73a5b513ccfa..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAuthenticationDetailsProperties.Serialization.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class UnknownAuthenticationDetailsProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("authenticationType"u8); - writer.WriteStringValue(AuthenticationType.ToString()); - writer.WriteEndObject(); - } - - internal static UnknownAuthenticationDetailsProperties DeserializeUnknownAuthenticationDetailsProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional authenticationProvisioningState = default; - Optional> grantedPermissions = default; - AuthenticationType authenticationType = "Unknown"; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("authenticationProvisioningState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - authenticationProvisioningState = new AuthenticationProvisioningState(property.Value.GetString()); - continue; - } - if (property.NameEquals("grantedPermissions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(new SecurityCenterCloudPermission(item.GetString())); - } - grantedPermissions = array; - continue; - } - if (property.NameEquals("authenticationType"u8)) - { - authenticationType = new AuthenticationType(property.Value.GetString()); - continue; - } - } - return new UnknownAuthenticationDetailsProperties(Optional.ToNullable(authenticationProvisioningState), Optional.ToList(grantedPermissions), authenticationType); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAuthenticationDetailsProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAuthenticationDetailsProperties.cs deleted file mode 100644 index c552953905c0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAuthenticationDetailsProperties.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The UnknownAuthenticationDetailsProperties. - internal partial class UnknownAuthenticationDetailsProperties : AuthenticationDetailsProperties - { - /// Initializes a new instance of UnknownAuthenticationDetailsProperties. - /// State of the multi-cloud connector. - /// The permissions detected in the cloud account. - /// Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use account organization credentials. - internal UnknownAuthenticationDetailsProperties(AuthenticationProvisioningState? authenticationProvisioningState, IReadOnlyList grantedPermissions, AuthenticationType authenticationType) : base(authenticationProvisioningState, grantedPermissions, authenticationType) - { - AuthenticationType = authenticationType; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAutomationAction.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAutomationAction.Serialization.cs deleted file mode 100644 index 63b8d83a3544..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAutomationAction.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class UnknownAutomationAction : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("actionType"u8); - writer.WriteStringValue(ActionType.ToString()); - writer.WriteEndObject(); - } - - internal static UnknownAutomationAction DeserializeUnknownAutomationAction(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ActionType actionType = "Unknown"; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("actionType"u8)) - { - actionType = new ActionType(property.Value.GetString()); - continue; - } - } - return new UnknownAutomationAction(actionType); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAutomationAction.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAutomationAction.cs deleted file mode 100644 index 893a17bd339a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAutomationAction.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The UnknownAutomationAction. - internal partial class UnknownAutomationAction : SecurityAutomationAction - { - /// Initializes a new instance of UnknownAutomationAction. - /// The type of the action that will be triggered by the Automation. - internal UnknownAutomationAction(ActionType actionType) : base(actionType) - { - ActionType = actionType; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAwsOrganizationalData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAwsOrganizationalData.Serialization.cs deleted file mode 100644 index a2c6994a6c58..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAwsOrganizationalData.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class UnknownAwsOrganizationalData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("organizationMembershipType"u8); - writer.WriteStringValue(OrganizationMembershipType.ToString()); - writer.WriteEndObject(); - } - - internal static UnknownAwsOrganizationalData DeserializeUnknownAwsOrganizationalData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - OrganizationMembershipType organizationMembershipType = "Unknown"; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("organizationMembershipType"u8)) - { - organizationMembershipType = new OrganizationMembershipType(property.Value.GetString()); - continue; - } - } - return new UnknownAwsOrganizationalData(organizationMembershipType); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAwsOrganizationalData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAwsOrganizationalData.cs deleted file mode 100644 index 31214c1a7dbe..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownAwsOrganizationalData.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The UnknownAwsOrganizationalData. - internal partial class UnknownAwsOrganizationalData : AwsOrganizationalInfo - { - /// Initializes a new instance of UnknownAwsOrganizationalData. - /// The multi cloud account's membership type in the organization. - internal UnknownAwsOrganizationalData(OrganizationMembershipType organizationMembershipType) : base(organizationMembershipType) - { - OrganizationMembershipType = organizationMembershipType; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownCloudOffering.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownCloudOffering.Serialization.cs deleted file mode 100644 index dd96df7963b0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownCloudOffering.Serialization.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class UnknownCloudOffering : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("offeringType"u8); - writer.WriteStringValue(OfferingType.ToString()); - writer.WriteEndObject(); - } - - internal static UnknownCloudOffering DeserializeUnknownCloudOffering(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - OfferingType offeringType = "Unknown"; - Optional description = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("offeringType"u8)) - { - offeringType = new OfferingType(property.Value.GetString()); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - } - return new UnknownCloudOffering(offeringType, description.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownCloudOffering.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownCloudOffering.cs deleted file mode 100644 index 95f8515acc5e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownCloudOffering.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The UnknownCloudOffering. - internal partial class UnknownCloudOffering : SecurityCenterCloudOffering - { - /// Initializes a new instance of UnknownCloudOffering. - /// The type of the security offering. - /// The offering description. - internal UnknownCloudOffering(OfferingType offeringType, string description) : base(offeringType, description) - { - OfferingType = offeringType; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownCustomAlertRule.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownCustomAlertRule.Serialization.cs deleted file mode 100644 index d69667aa1f9e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownCustomAlertRule.Serialization.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class UnknownCustomAlertRule : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("isEnabled"u8); - writer.WriteBooleanValue(IsEnabled); - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType); - writer.WriteEndObject(); - } - - internal static UnknownCustomAlertRule DeserializeUnknownCustomAlertRule(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional displayName = default; - Optional description = default; - bool isEnabled = default; - string ruleType = "Unknown"; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("isEnabled"u8)) - { - isEnabled = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - ruleType = property.Value.GetString(); - continue; - } - } - return new UnknownCustomAlertRule(displayName.Value, description.Value, isEnabled, ruleType); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownCustomAlertRule.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownCustomAlertRule.cs deleted file mode 100644 index 28dffd0afe19..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownCustomAlertRule.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The UnknownCustomAlertRule. - internal partial class UnknownCustomAlertRule : CustomAlertRule - { - /// Initializes a new instance of UnknownCustomAlertRule. - /// The display name of the custom alert. - /// The description of the custom alert. - /// Status of the custom alert. - /// The type of the custom alert rule. - internal UnknownCustomAlertRule(string displayName, string description, bool isEnabled, string ruleType) : base(displayName, description, isEnabled, ruleType) - { - RuleType = ruleType ?? "Unknown"; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownEnvironmentData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownEnvironmentData.Serialization.cs deleted file mode 100644 index c39dae6dd00c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownEnvironmentData.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class UnknownEnvironmentData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("environmentType"u8); - writer.WriteStringValue(EnvironmentType.ToString()); - writer.WriteEndObject(); - } - - internal static UnknownEnvironmentData DeserializeUnknownEnvironmentData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - EnvironmentType environmentType = "Unknown"; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("environmentType"u8)) - { - environmentType = new EnvironmentType(property.Value.GetString()); - continue; - } - } - return new UnknownEnvironmentData(environmentType); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownEnvironmentData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownEnvironmentData.cs deleted file mode 100644 index c9544449f1df..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownEnvironmentData.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The UnknownEnvironmentData. - internal partial class UnknownEnvironmentData : SecurityConnectorEnvironment - { - /// Initializes a new instance of UnknownEnvironmentData. - /// The type of the environment data. - internal UnknownEnvironmentData(EnvironmentType environmentType) : base(environmentType) - { - EnvironmentType = environmentType; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownGcpOrganizationalData.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownGcpOrganizationalData.Serialization.cs deleted file mode 100644 index d9a015bc3c0c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownGcpOrganizationalData.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class UnknownGcpOrganizationalData : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("organizationMembershipType"u8); - writer.WriteStringValue(OrganizationMembershipType.ToString()); - writer.WriteEndObject(); - } - - internal static UnknownGcpOrganizationalData DeserializeUnknownGcpOrganizationalData(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - OrganizationMembershipType organizationMembershipType = "Unknown"; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("organizationMembershipType"u8)) - { - organizationMembershipType = new OrganizationMembershipType(property.Value.GetString()); - continue; - } - } - return new UnknownGcpOrganizationalData(organizationMembershipType); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownGcpOrganizationalData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownGcpOrganizationalData.cs deleted file mode 100644 index ea5444d197c4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownGcpOrganizationalData.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The UnknownGcpOrganizationalData. - internal partial class UnknownGcpOrganizationalData : GcpOrganizationalInfo - { - /// Initializes a new instance of UnknownGcpOrganizationalData. - /// The multi cloud account's membership type in the organization. - internal UnknownGcpOrganizationalData(OrganizationMembershipType organizationMembershipType) : base(organizationMembershipType) - { - OrganizationMembershipType = organizationMembershipType; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownResourceDetails.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownResourceDetails.cs deleted file mode 100644 index 262ea3ad8d68..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnknownResourceDetails.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The UnknownResourceDetails. - internal partial class UnknownResourceDetails : SecurityCenterResourceDetails - { - /// Initializes a new instance of UnknownResourceDetails. - /// The platform where the assessed resource resides. - internal UnknownResourceDetails(Source source) : base(source) - { - Source = source; - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnmaskedIPLoggingStatus.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnmaskedIPLoggingStatus.cs deleted file mode 100644 index 690bf68047b5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UnmaskedIPLoggingStatus.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Unmasked IP address logging status. - public readonly partial struct UnmaskedIPLoggingStatus : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public UnmaskedIPLoggingStatus(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string DisabledValue = "Disabled"; - private const string EnabledValue = "Enabled"; - - /// Unmasked IP logging is disabled. - public static UnmaskedIPLoggingStatus Disabled { get; } = new UnmaskedIPLoggingStatus(DisabledValue); - /// Unmasked IP logging is enabled. - public static UnmaskedIPLoggingStatus Enabled { get; } = new UnmaskedIPLoggingStatus(EnabledValue); - /// Determines if two values are the same. - public static bool operator ==(UnmaskedIPLoggingStatus left, UnmaskedIPLoggingStatus right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(UnmaskedIPLoggingStatus left, UnmaskedIPLoggingStatus right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator UnmaskedIPLoggingStatus(string value) => new UnmaskedIPLoggingStatus(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is UnmaskedIPLoggingStatus other && Equals(other); - /// - public bool Equals(UnmaskedIPLoggingStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UserDefinedResourcesProperties.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UserDefinedResourcesProperties.Serialization.cs deleted file mode 100644 index 6903ab8faace..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UserDefinedResourcesProperties.Serialization.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class UserDefinedResourcesProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Query != null) - { - writer.WritePropertyName("query"u8); - writer.WriteStringValue(Query); - } - else - { - writer.WriteNull("query"); - } - if (QuerySubscriptions != null) - { - writer.WritePropertyName("querySubscriptions"u8); - writer.WriteStartArray(); - foreach (var item in QuerySubscriptions) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - else - { - writer.WriteNull("querySubscriptions"); - } - writer.WriteEndObject(); - } - - internal static UserDefinedResourcesProperties DeserializeUserDefinedResourcesProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string query = default; - IList querySubscriptions = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("query"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - query = null; - continue; - } - query = property.Value.GetString(); - continue; - } - if (property.NameEquals("querySubscriptions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - querySubscriptions = null; - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - querySubscriptions = array; - continue; - } - } - return new UserDefinedResourcesProperties(query, querySubscriptions); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UserDefinedResourcesProperties.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UserDefinedResourcesProperties.cs deleted file mode 100644 index d93be8b4a3b8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UserDefinedResourcesProperties.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Linq; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Properties of the IoT Security solution's user defined resources. - public partial class UserDefinedResourcesProperties - { - /// Initializes a new instance of UserDefinedResourcesProperties. - /// Azure Resource Graph query which represents the security solution's user defined resources. Required to start with "where type != "Microsoft.Devices/IotHubs"". - /// List of Azure subscription ids on which the user defined resources query should be executed. - public UserDefinedResourcesProperties(string query, IEnumerable querySubscriptions) - { - Query = query; - QuerySubscriptions = querySubscriptions?.ToList(); - } - - /// Initializes a new instance of UserDefinedResourcesProperties. - /// Azure Resource Graph query which represents the security solution's user defined resources. Required to start with "where type != "Microsoft.Devices/IotHubs"". - /// List of Azure subscription ids on which the user defined resources query should be executed. - internal UserDefinedResourcesProperties(string query, IList querySubscriptions) - { - Query = query; - QuerySubscriptions = querySubscriptions; - } - - /// Azure Resource Graph query which represents the security solution's user defined resources. Required to start with "where type != "Microsoft.Devices/IotHubs"". - public string Query { get; set; } - /// List of Azure subscription ids on which the user defined resources query should be executed. - public IList QuerySubscriptions { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UserRecommendation.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UserRecommendation.Serialization.cs deleted file mode 100644 index bb96b4aa294b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UserRecommendation.Serialization.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class UserRecommendation : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Username)) - { - writer.WritePropertyName("username"u8); - writer.WriteStringValue(Username); - } - if (Optional.IsDefined(RecommendationAction)) - { - writer.WritePropertyName("recommendationAction"u8); - writer.WriteStringValue(RecommendationAction.Value.ToString()); - } - writer.WriteEndObject(); - } - - internal static UserRecommendation DeserializeUserRecommendation(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional username = default; - Optional recommendationAction = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("username"u8)) - { - username = property.Value.GetString(); - continue; - } - if (property.NameEquals("recommendationAction"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - recommendationAction = new RecommendationAction(property.Value.GetString()); - continue; - } - } - return new UserRecommendation(username.Value, Optional.ToNullable(recommendationAction)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UserRecommendation.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UserRecommendation.cs deleted file mode 100644 index 499fed38bfdf..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/UserRecommendation.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Represents a user that is recommended to be allowed for a certain rule. - public partial class UserRecommendation - { - /// Initializes a new instance of UserRecommendation. - public UserRecommendation() - { - } - - /// Initializes a new instance of UserRecommendation. - /// Represents a user that is recommended to be allowed for a certain rule. - /// The recommendation action of the machine or rule. - internal UserRecommendation(string username, RecommendationAction? recommendationAction) - { - Username = username; - RecommendationAction = recommendationAction; - } - - /// Represents a user that is recommended to be allowed for a certain rule. - public string Username { get; set; } - /// The recommendation action of the machine or rule. - public RecommendationAction? RecommendationAction { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VendorReference.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VendorReference.Serialization.cs deleted file mode 100644 index c3967a300582..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VendorReference.Serialization.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class VendorReference - { - internal static VendorReference DeserializeVendorReference(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional title = default; - Optional link = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("title"u8)) - { - title = property.Value.GetString(); - continue; - } - if (property.NameEquals("link"u8)) - { - link = property.Value.GetString(); - continue; - } - } - return new VendorReference(title.Value, link.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VendorReference.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VendorReference.cs deleted file mode 100644 index 6b7b0ba67116..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VendorReference.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Vendor reference. - public partial class VendorReference - { - /// Initializes a new instance of VendorReference. - internal VendorReference() - { - } - - /// Initializes a new instance of VendorReference. - /// Link title. - /// Link url. - internal VendorReference(string title, string link) - { - Title = title; - Link = link; - } - - /// Link title. - public string Title { get; } - /// Link url. - public string Link { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VmRecommendation.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VmRecommendation.Serialization.cs deleted file mode 100644 index 2484066ba40d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VmRecommendation.Serialization.cs +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class VmRecommendation : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ConfigurationStatus)) - { - writer.WritePropertyName("configurationStatus"u8); - writer.WriteStringValue(ConfigurationStatus.Value.ToString()); - } - if (Optional.IsDefined(RecommendationAction)) - { - writer.WritePropertyName("recommendationAction"u8); - writer.WriteStringValue(RecommendationAction.Value.ToString()); - } - if (Optional.IsDefined(ResourceId)) - { - writer.WritePropertyName("resourceId"u8); - writer.WriteStringValue(ResourceId); - } - if (Optional.IsDefined(EnforcementSupport)) - { - writer.WritePropertyName("enforcementSupport"u8); - writer.WriteStringValue(EnforcementSupport.Value.ToString()); - } - writer.WriteEndObject(); - } - - internal static VmRecommendation DeserializeVmRecommendation(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional configurationStatus = default; - Optional recommendationAction = default; - Optional resourceId = default; - Optional enforcementSupport = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("configurationStatus"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - configurationStatus = new SecurityCenterConfigurationStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("recommendationAction"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - recommendationAction = new RecommendationAction(property.Value.GetString()); - continue; - } - if (property.NameEquals("resourceId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - resourceId = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("enforcementSupport"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - enforcementSupport = new SecurityCenterVmEnforcementSupportState(property.Value.GetString()); - continue; - } - } - return new VmRecommendation(Optional.ToNullable(configurationStatus), Optional.ToNullable(recommendationAction), resourceId.Value, Optional.ToNullable(enforcementSupport)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VmRecommendation.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VmRecommendation.cs deleted file mode 100644 index 30fab915433d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VmRecommendation.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// Represents a machine that is part of a machine group. - public partial class VmRecommendation - { - /// Initializes a new instance of VmRecommendation. - public VmRecommendation() - { - } - - /// Initializes a new instance of VmRecommendation. - /// The configuration status of the machines group or machine or rule. - /// The recommendation action of the machine or rule. - /// The full resource id of the machine. - /// The machine supportability of Enforce feature. - internal VmRecommendation(SecurityCenterConfigurationStatus? configurationStatus, RecommendationAction? recommendationAction, ResourceIdentifier resourceId, SecurityCenterVmEnforcementSupportState? enforcementSupport) - { - ConfigurationStatus = configurationStatus; - RecommendationAction = recommendationAction; - ResourceId = resourceId; - EnforcementSupport = enforcementSupport; - } - - /// The configuration status of the machines group or machine or rule. - public SecurityCenterConfigurationStatus? ConfigurationStatus { get; set; } - /// The recommendation action of the machine or rule. - public RecommendationAction? RecommendationAction { get; set; } - /// The full resource id of the machine. - public ResourceIdentifier ResourceId { get; set; } - /// The machine supportability of Enforce feature. - public SecurityCenterVmEnforcementSupportState? EnforcementSupport { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentAutoProvisioningType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentAutoProvisioningType.cs deleted file mode 100644 index d2bb2c85f951..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentAutoProvisioningType.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys'. - public readonly partial struct VulnerabilityAssessmentAutoProvisioningType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public VulnerabilityAssessmentAutoProvisioningType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string QualysValue = "Qualys"; - private const string TVMValue = "TVM"; - - /// Qualys. - public static VulnerabilityAssessmentAutoProvisioningType Qualys { get; } = new VulnerabilityAssessmentAutoProvisioningType(QualysValue); - /// TVM. - public static VulnerabilityAssessmentAutoProvisioningType TVM { get; } = new VulnerabilityAssessmentAutoProvisioningType(TVMValue); - /// Determines if two values are the same. - public static bool operator ==(VulnerabilityAssessmentAutoProvisioningType left, VulnerabilityAssessmentAutoProvisioningType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(VulnerabilityAssessmentAutoProvisioningType left, VulnerabilityAssessmentAutoProvisioningType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator VulnerabilityAssessmentAutoProvisioningType(string value) => new VulnerabilityAssessmentAutoProvisioningType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is VulnerabilityAssessmentAutoProvisioningType other && Equals(other); - /// - public bool Equals(VulnerabilityAssessmentAutoProvisioningType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentRule.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentRule.Serialization.cs deleted file mode 100644 index d947246210b5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentRule.Serialization.cs +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class VulnerabilityAssessmentRule : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(RuleId)) - { - writer.WritePropertyName("ruleId"u8); - writer.WriteStringValue(RuleId); - } - if (Optional.IsDefined(Severity)) - { - writer.WritePropertyName("severity"u8); - writer.WriteStringValue(Severity.Value.ToString()); - } - if (Optional.IsDefined(Category)) - { - writer.WritePropertyName("category"u8); - writer.WriteStringValue(Category); - } - if (Optional.IsDefined(RuleType)) - { - writer.WritePropertyName("ruleType"u8); - writer.WriteStringValue(RuleType.Value.ToString()); - } - if (Optional.IsDefined(Title)) - { - writer.WritePropertyName("title"u8); - writer.WriteStringValue(Title); - } - if (Optional.IsDefined(Description)) - { - writer.WritePropertyName("description"u8); - writer.WriteStringValue(Description); - } - if (Optional.IsDefined(Rationale)) - { - writer.WritePropertyName("rationale"u8); - writer.WriteStringValue(Rationale); - } - if (Optional.IsDefined(QueryCheck)) - { - writer.WritePropertyName("queryCheck"u8); - writer.WriteObjectValue(QueryCheck); - } - if (Optional.IsCollectionDefined(BenchmarkReferences)) - { - writer.WritePropertyName("benchmarkReferences"u8); - writer.WriteStartArray(); - foreach (var item in BenchmarkReferences) - { - writer.WriteObjectValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static VulnerabilityAssessmentRule DeserializeVulnerabilityAssessmentRule(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional ruleId = default; - Optional severity = default; - Optional category = default; - Optional ruleType = default; - Optional title = default; - Optional description = default; - Optional rationale = default; - Optional queryCheck = default; - Optional> benchmarkReferences = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("ruleId"u8)) - { - ruleId = property.Value.GetString(); - continue; - } - if (property.NameEquals("severity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - severity = new RuleSeverity(property.Value.GetString()); - continue; - } - if (property.NameEquals("category"u8)) - { - category = property.Value.GetString(); - continue; - } - if (property.NameEquals("ruleType"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - ruleType = new VulnerabilityAssessmentRuleType(property.Value.GetString()); - continue; - } - if (property.NameEquals("title"u8)) - { - title = property.Value.GetString(); - continue; - } - if (property.NameEquals("description"u8)) - { - description = property.Value.GetString(); - continue; - } - if (property.NameEquals("rationale"u8)) - { - rationale = property.Value.GetString(); - continue; - } - if (property.NameEquals("queryCheck"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - queryCheck = VulnerabilityAssessmentRuleQueryCheck.DeserializeVulnerabilityAssessmentRuleQueryCheck(property.Value); - continue; - } - if (property.NameEquals("benchmarkReferences"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(BenchmarkReference.DeserializeBenchmarkReference(item)); - } - benchmarkReferences = array; - continue; - } - } - return new VulnerabilityAssessmentRule(ruleId.Value, Optional.ToNullable(severity), category.Value, Optional.ToNullable(ruleType), title.Value, description.Value, rationale.Value, queryCheck.Value, Optional.ToList(benchmarkReferences)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentRule.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentRule.cs deleted file mode 100644 index df6d5717d44c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentRule.cs +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// vulnerability assessment rule metadata details. - public partial class VulnerabilityAssessmentRule - { - /// Initializes a new instance of VulnerabilityAssessmentRule. - public VulnerabilityAssessmentRule() - { - BenchmarkReferences = new ChangeTrackingList(); - } - - /// Initializes a new instance of VulnerabilityAssessmentRule. - /// The rule Id. - /// The rule severity. - /// The rule category. - /// The rule type. - /// The rule title. - /// The rule description. - /// The rule rationale. - /// The rule query details. - /// The benchmark references. - internal VulnerabilityAssessmentRule(string ruleId, RuleSeverity? severity, string category, VulnerabilityAssessmentRuleType? ruleType, string title, string description, string rationale, VulnerabilityAssessmentRuleQueryCheck queryCheck, IList benchmarkReferences) - { - RuleId = ruleId; - Severity = severity; - Category = category; - RuleType = ruleType; - Title = title; - Description = description; - Rationale = rationale; - QueryCheck = queryCheck; - BenchmarkReferences = benchmarkReferences; - } - - /// The rule Id. - public string RuleId { get; set; } - /// The rule severity. - public RuleSeverity? Severity { get; set; } - /// The rule category. - public string Category { get; set; } - /// The rule type. - public VulnerabilityAssessmentRuleType? RuleType { get; set; } - /// The rule title. - public string Title { get; set; } - /// The rule description. - public string Description { get; set; } - /// The rule rationale. - public string Rationale { get; set; } - /// The rule query details. - public VulnerabilityAssessmentRuleQueryCheck QueryCheck { get; set; } - /// The benchmark references. - public IList BenchmarkReferences { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentRuleQueryCheck.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentRuleQueryCheck.Serialization.cs deleted file mode 100644 index e7036a5b27de..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentRuleQueryCheck.Serialization.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - public partial class VulnerabilityAssessmentRuleQueryCheck : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(Query)) - { - writer.WritePropertyName("query"u8); - writer.WriteStringValue(Query); - } - if (Optional.IsCollectionDefined(ExpectedResult)) - { - writer.WritePropertyName("expectedResult"u8); - writer.WriteStartArray(); - foreach (var item in ExpectedResult) - { - if (item == null) - { - writer.WriteNullValue(); - continue; - } - writer.WriteStartArray(); - foreach (var item0 in item) - { - writer.WriteStringValue(item0); - } - writer.WriteEndArray(); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(ColumnNames)) - { - writer.WritePropertyName("columnNames"u8); - writer.WriteStartArray(); - foreach (var item in ColumnNames) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - internal static VulnerabilityAssessmentRuleQueryCheck DeserializeVulnerabilityAssessmentRuleQueryCheck(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional query = default; - Optional>> expectedResult = default; - Optional> columnNames = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("query"u8)) - { - query = property.Value.GetString(); - continue; - } - if (property.NameEquals("expectedResult"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List> array = new List>(); - foreach (var item in property.Value.EnumerateArray()) - { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - List array0 = new List(); - foreach (var item0 in item.EnumerateArray()) - { - array0.Add(item0.GetString()); - } - array.Add(array0); - } - } - expectedResult = array; - continue; - } - if (property.NameEquals("columnNames"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - columnNames = array; - continue; - } - } - return new VulnerabilityAssessmentRuleQueryCheck(query.Value, Optional.ToList(expectedResult), Optional.ToList(columnNames)); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentRuleQueryCheck.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentRuleQueryCheck.cs deleted file mode 100644 index e30ee9319bc0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentRuleQueryCheck.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The rule query details. - public partial class VulnerabilityAssessmentRuleQueryCheck - { - /// Initializes a new instance of VulnerabilityAssessmentRuleQueryCheck. - public VulnerabilityAssessmentRuleQueryCheck() - { - ExpectedResult = new ChangeTrackingList>(); - ColumnNames = new ChangeTrackingList(); - } - - /// Initializes a new instance of VulnerabilityAssessmentRuleQueryCheck. - /// The rule query. - /// Expected result. - /// Column names of expected result. - internal VulnerabilityAssessmentRuleQueryCheck(string query, IList> expectedResult, IList columnNames) - { - Query = query; - ExpectedResult = expectedResult; - ColumnNames = columnNames; - } - - /// The rule query. - public string Query { get; set; } - /// Expected result. - public IList> ExpectedResult { get; } - /// Column names of expected result. - public IList ColumnNames { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentRuleType.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentRuleType.cs deleted file mode 100644 index 6c9342147aa3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/VulnerabilityAssessmentRuleType.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// The rule type. - public readonly partial struct VulnerabilityAssessmentRuleType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public VulnerabilityAssessmentRuleType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string BinaryValue = "Binary"; - private const string BaselineExpectedValue = "BaselineExpected"; - private const string PositiveListValue = "PositiveList"; - private const string NegativeListValue = "NegativeList"; - - /// Binary. - public static VulnerabilityAssessmentRuleType Binary { get; } = new VulnerabilityAssessmentRuleType(BinaryValue); - /// BaselineExpected. - public static VulnerabilityAssessmentRuleType BaselineExpected { get; } = new VulnerabilityAssessmentRuleType(BaselineExpectedValue); - /// PositiveList. - public static VulnerabilityAssessmentRuleType PositiveList { get; } = new VulnerabilityAssessmentRuleType(PositiveListValue); - /// NegativeList. - public static VulnerabilityAssessmentRuleType NegativeList { get; } = new VulnerabilityAssessmentRuleType(NegativeListValue); - /// Determines if two values are the same. - public static bool operator ==(VulnerabilityAssessmentRuleType left, VulnerabilityAssessmentRuleType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(VulnerabilityAssessmentRuleType left, VulnerabilityAssessmentRuleType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator VulnerabilityAssessmentRuleType(string value) => new VulnerabilityAssessmentRuleType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is VulnerabilityAssessmentRuleType other && Equals(other); - /// - public bool Equals(VulnerabilityAssessmentRuleType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; - /// - public override string ToString() => _value; - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/WorkspaceSettingList.Serialization.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/WorkspaceSettingList.Serialization.cs deleted file mode 100644 index cf4754cc7312..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/WorkspaceSettingList.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - internal partial class WorkspaceSettingList - { - internal static WorkspaceSettingList DeserializeWorkspaceSettingList(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - Optional nextLink = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SecurityWorkspaceSettingData.DeserializeSecurityWorkspaceSettingData(item)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - } - return new WorkspaceSettingList(value, nextLink.Value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/WorkspaceSettingList.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/WorkspaceSettingList.cs deleted file mode 100644 index bea5a624d519..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/Models/WorkspaceSettingList.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; -using Azure.ResourceManager.SecurityCenter; - -namespace Azure.ResourceManager.SecurityCenter.Models -{ - /// List of workspace settings response. - internal partial class WorkspaceSettingList - { - /// Initializes a new instance of WorkspaceSettingList. - /// List of workspace settings. - /// is null. - internal WorkspaceSettingList(IEnumerable value) - { - Argument.AssertNotNull(value, nameof(value)); - - Value = value.ToList(); - } - - /// Initializes a new instance of WorkspaceSettingList. - /// List of workspace settings. - /// The URI to fetch the next page. - internal WorkspaceSettingList(IReadOnlyList value, string nextLink) - { - Value = value; - NextLink = nextLink; - } - - /// List of workspace settings. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page. - public string NextLink { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceAssessmentCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceAssessmentCollection.cs deleted file mode 100644 index e4054514f8ff..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceAssessmentCollection.cs +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetRegulatoryComplianceAssessments method from an instance of . - /// - public partial class RegulatoryComplianceAssessmentCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _regulatoryComplianceAssessmentClientDiagnostics; - private readonly RegulatoryComplianceAssessmentsRestOperations _regulatoryComplianceAssessmentRestClient; - - /// Initializes a new instance of the class for mocking. - protected RegulatoryComplianceAssessmentCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal RegulatoryComplianceAssessmentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _regulatoryComplianceAssessmentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", RegulatoryComplianceAssessmentResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(RegulatoryComplianceAssessmentResource.ResourceType, out string regulatoryComplianceAssessmentApiVersion); - _regulatoryComplianceAssessmentRestClient = new RegulatoryComplianceAssessmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, regulatoryComplianceAssessmentApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != RegulatoryComplianceControlResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, RegulatoryComplianceControlResource.ResourceType), nameof(id)); - } - - /// - /// Supported regulatory compliance details and state for selected assessment - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName} - /// - /// - /// Operation Id - /// RegulatoryComplianceAssessments_Get - /// - /// - /// - /// Name of the regulatory compliance assessment object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string regulatoryComplianceAssessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(regulatoryComplianceAssessmentName, nameof(regulatoryComplianceAssessmentName)); - - using var scope = _regulatoryComplianceAssessmentClientDiagnostics.CreateScope("RegulatoryComplianceAssessmentCollection.Get"); - scope.Start(); - try - { - var response = await _regulatoryComplianceAssessmentRestClient.GetAsync(Id.SubscriptionId, Id.Parent.Name, Id.Name, regulatoryComplianceAssessmentName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new RegulatoryComplianceAssessmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Supported regulatory compliance details and state for selected assessment - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName} - /// - /// - /// Operation Id - /// RegulatoryComplianceAssessments_Get - /// - /// - /// - /// Name of the regulatory compliance assessment object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string regulatoryComplianceAssessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(regulatoryComplianceAssessmentName, nameof(regulatoryComplianceAssessmentName)); - - using var scope = _regulatoryComplianceAssessmentClientDiagnostics.CreateScope("RegulatoryComplianceAssessmentCollection.Get"); - scope.Start(); - try - { - var response = _regulatoryComplianceAssessmentRestClient.Get(Id.SubscriptionId, Id.Parent.Name, Id.Name, regulatoryComplianceAssessmentName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new RegulatoryComplianceAssessmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Details and state of assessments mapped to selected regulatory compliance control - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments - /// - /// - /// Operation Id - /// RegulatoryComplianceAssessments_List - /// - /// - /// - /// OData filter. Optional. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _regulatoryComplianceAssessmentRestClient.CreateListRequest(Id.SubscriptionId, Id.Parent.Name, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _regulatoryComplianceAssessmentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.Parent.Name, Id.Name, filter); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RegulatoryComplianceAssessmentResource(Client, RegulatoryComplianceAssessmentData.DeserializeRegulatoryComplianceAssessmentData(e)), _regulatoryComplianceAssessmentClientDiagnostics, Pipeline, "RegulatoryComplianceAssessmentCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Details and state of assessments mapped to selected regulatory compliance control - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments - /// - /// - /// Operation Id - /// RegulatoryComplianceAssessments_List - /// - /// - /// - /// OData filter. Optional. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _regulatoryComplianceAssessmentRestClient.CreateListRequest(Id.SubscriptionId, Id.Parent.Name, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _regulatoryComplianceAssessmentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.Parent.Name, Id.Name, filter); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RegulatoryComplianceAssessmentResource(Client, RegulatoryComplianceAssessmentData.DeserializeRegulatoryComplianceAssessmentData(e)), _regulatoryComplianceAssessmentClientDiagnostics, Pipeline, "RegulatoryComplianceAssessmentCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName} - /// - /// - /// Operation Id - /// RegulatoryComplianceAssessments_Get - /// - /// - /// - /// Name of the regulatory compliance assessment object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string regulatoryComplianceAssessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(regulatoryComplianceAssessmentName, nameof(regulatoryComplianceAssessmentName)); - - using var scope = _regulatoryComplianceAssessmentClientDiagnostics.CreateScope("RegulatoryComplianceAssessmentCollection.Exists"); - scope.Start(); - try - { - var response = await _regulatoryComplianceAssessmentRestClient.GetAsync(Id.SubscriptionId, Id.Parent.Name, Id.Name, regulatoryComplianceAssessmentName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName} - /// - /// - /// Operation Id - /// RegulatoryComplianceAssessments_Get - /// - /// - /// - /// Name of the regulatory compliance assessment object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string regulatoryComplianceAssessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(regulatoryComplianceAssessmentName, nameof(regulatoryComplianceAssessmentName)); - - using var scope = _regulatoryComplianceAssessmentClientDiagnostics.CreateScope("RegulatoryComplianceAssessmentCollection.Exists"); - scope.Start(); - try - { - var response = _regulatoryComplianceAssessmentRestClient.Get(Id.SubscriptionId, Id.Parent.Name, Id.Name, regulatoryComplianceAssessmentName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceAssessmentData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceAssessmentData.cs deleted file mode 100644 index c538e3103341..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceAssessmentData.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the RegulatoryComplianceAssessment data model. - /// Regulatory compliance assessment details and state - /// - public partial class RegulatoryComplianceAssessmentData : ResourceData - { - /// Initializes a new instance of RegulatoryComplianceAssessmentData. - public RegulatoryComplianceAssessmentData() - { - } - - /// Initializes a new instance of RegulatoryComplianceAssessmentData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The description of the regulatory compliance assessment. - /// The expected type of assessment contained in the AssessmentDetailsLink. - /// Link to more detailed assessment results data. The response type will be according to the assessmentType field. - /// Aggregative state based on the assessment's scanned resources states. - /// The given assessment's related resources count with passed state. - /// The given assessment's related resources count with failed state. - /// The given assessment's related resources count with skipped state. - /// The given assessment's related resources count with unsupported state. - internal RegulatoryComplianceAssessmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string description, string assessmentType, string assessmentDetailsLink, RegulatoryComplianceState? state, int? passedResources, int? failedResources, int? skippedResources, int? unsupportedResources) : base(id, name, resourceType, systemData) - { - Description = description; - AssessmentType = assessmentType; - AssessmentDetailsLink = assessmentDetailsLink; - State = state; - PassedResources = passedResources; - FailedResources = failedResources; - SkippedResources = skippedResources; - UnsupportedResources = unsupportedResources; - } - - /// The description of the regulatory compliance assessment. - public string Description { get; } - /// The expected type of assessment contained in the AssessmentDetailsLink. - public string AssessmentType { get; } - /// Link to more detailed assessment results data. The response type will be according to the assessmentType field. - public string AssessmentDetailsLink { get; } - /// Aggregative state based on the assessment's scanned resources states. - public RegulatoryComplianceState? State { get; set; } - /// The given assessment's related resources count with passed state. - public int? PassedResources { get; } - /// The given assessment's related resources count with failed state. - public int? FailedResources { get; } - /// The given assessment's related resources count with skipped state. - public int? SkippedResources { get; } - /// The given assessment's related resources count with unsupported state. - public int? UnsupportedResources { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceAssessmentResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceAssessmentResource.cs deleted file mode 100644 index cf165cfcca21..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceAssessmentResource.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a RegulatoryComplianceAssessment along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetRegulatoryComplianceAssessmentResource method. - /// Otherwise you can get one from its parent resource using the GetRegulatoryComplianceAssessment method. - /// - public partial class RegulatoryComplianceAssessmentResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string regulatoryComplianceStandardName, string regulatoryComplianceControlName, string regulatoryComplianceAssessmentName) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _regulatoryComplianceAssessmentClientDiagnostics; - private readonly RegulatoryComplianceAssessmentsRestOperations _regulatoryComplianceAssessmentRestClient; - private readonly RegulatoryComplianceAssessmentData _data; - - /// Initializes a new instance of the class for mocking. - protected RegulatoryComplianceAssessmentResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal RegulatoryComplianceAssessmentResource(ArmClient client, RegulatoryComplianceAssessmentData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal RegulatoryComplianceAssessmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _regulatoryComplianceAssessmentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string regulatoryComplianceAssessmentApiVersion); - _regulatoryComplianceAssessmentRestClient = new RegulatoryComplianceAssessmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, regulatoryComplianceAssessmentApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/regulatoryComplianceStandards/regulatoryComplianceControls/regulatoryComplianceAssessments"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual RegulatoryComplianceAssessmentData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Supported regulatory compliance details and state for selected assessment - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName} - /// - /// - /// Operation Id - /// RegulatoryComplianceAssessments_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _regulatoryComplianceAssessmentClientDiagnostics.CreateScope("RegulatoryComplianceAssessmentResource.Get"); - scope.Start(); - try - { - var response = await _regulatoryComplianceAssessmentRestClient.GetAsync(Id.SubscriptionId, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new RegulatoryComplianceAssessmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Supported regulatory compliance details and state for selected assessment - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName} - /// - /// - /// Operation Id - /// RegulatoryComplianceAssessments_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _regulatoryComplianceAssessmentClientDiagnostics.CreateScope("RegulatoryComplianceAssessmentResource.Get"); - scope.Start(); - try - { - var response = _regulatoryComplianceAssessmentRestClient.Get(Id.SubscriptionId, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new RegulatoryComplianceAssessmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceControlCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceControlCollection.cs deleted file mode 100644 index d734dbae3970..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceControlCollection.cs +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetRegulatoryComplianceControls method from an instance of . - /// - public partial class RegulatoryComplianceControlCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _regulatoryComplianceControlClientDiagnostics; - private readonly RegulatoryComplianceControlsRestOperations _regulatoryComplianceControlRestClient; - - /// Initializes a new instance of the class for mocking. - protected RegulatoryComplianceControlCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal RegulatoryComplianceControlCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _regulatoryComplianceControlClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", RegulatoryComplianceControlResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(RegulatoryComplianceControlResource.ResourceType, out string regulatoryComplianceControlApiVersion); - _regulatoryComplianceControlRestClient = new RegulatoryComplianceControlsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, regulatoryComplianceControlApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != RegulatoryComplianceStandardResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, RegulatoryComplianceStandardResource.ResourceType), nameof(id)); - } - - /// - /// Selected regulatory compliance control details and state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName} - /// - /// - /// Operation Id - /// RegulatoryComplianceControls_Get - /// - /// - /// - /// Name of the regulatory compliance control object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string regulatoryComplianceControlName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(regulatoryComplianceControlName, nameof(regulatoryComplianceControlName)); - - using var scope = _regulatoryComplianceControlClientDiagnostics.CreateScope("RegulatoryComplianceControlCollection.Get"); - scope.Start(); - try - { - var response = await _regulatoryComplianceControlRestClient.GetAsync(Id.SubscriptionId, Id.Name, regulatoryComplianceControlName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new RegulatoryComplianceControlResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Selected regulatory compliance control details and state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName} - /// - /// - /// Operation Id - /// RegulatoryComplianceControls_Get - /// - /// - /// - /// Name of the regulatory compliance control object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string regulatoryComplianceControlName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(regulatoryComplianceControlName, nameof(regulatoryComplianceControlName)); - - using var scope = _regulatoryComplianceControlClientDiagnostics.CreateScope("RegulatoryComplianceControlCollection.Get"); - scope.Start(); - try - { - var response = _regulatoryComplianceControlRestClient.Get(Id.SubscriptionId, Id.Name, regulatoryComplianceControlName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new RegulatoryComplianceControlResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// All supported regulatory compliance controls details and state for selected standard - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls - /// - /// - /// Operation Id - /// RegulatoryComplianceControls_List - /// - /// - /// - /// OData filter. Optional. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _regulatoryComplianceControlRestClient.CreateListRequest(Id.SubscriptionId, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _regulatoryComplianceControlRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.Name, filter); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RegulatoryComplianceControlResource(Client, RegulatoryComplianceControlData.DeserializeRegulatoryComplianceControlData(e)), _regulatoryComplianceControlClientDiagnostics, Pipeline, "RegulatoryComplianceControlCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// All supported regulatory compliance controls details and state for selected standard - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls - /// - /// - /// Operation Id - /// RegulatoryComplianceControls_List - /// - /// - /// - /// OData filter. Optional. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _regulatoryComplianceControlRestClient.CreateListRequest(Id.SubscriptionId, Id.Name, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _regulatoryComplianceControlRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.Name, filter); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RegulatoryComplianceControlResource(Client, RegulatoryComplianceControlData.DeserializeRegulatoryComplianceControlData(e)), _regulatoryComplianceControlClientDiagnostics, Pipeline, "RegulatoryComplianceControlCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName} - /// - /// - /// Operation Id - /// RegulatoryComplianceControls_Get - /// - /// - /// - /// Name of the regulatory compliance control object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string regulatoryComplianceControlName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(regulatoryComplianceControlName, nameof(regulatoryComplianceControlName)); - - using var scope = _regulatoryComplianceControlClientDiagnostics.CreateScope("RegulatoryComplianceControlCollection.Exists"); - scope.Start(); - try - { - var response = await _regulatoryComplianceControlRestClient.GetAsync(Id.SubscriptionId, Id.Name, regulatoryComplianceControlName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName} - /// - /// - /// Operation Id - /// RegulatoryComplianceControls_Get - /// - /// - /// - /// Name of the regulatory compliance control object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string regulatoryComplianceControlName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(regulatoryComplianceControlName, nameof(regulatoryComplianceControlName)); - - using var scope = _regulatoryComplianceControlClientDiagnostics.CreateScope("RegulatoryComplianceControlCollection.Exists"); - scope.Start(); - try - { - var response = _regulatoryComplianceControlRestClient.Get(Id.SubscriptionId, Id.Name, regulatoryComplianceControlName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceControlData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceControlData.cs deleted file mode 100644 index 57cd3ccd87d1..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceControlData.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the RegulatoryComplianceControl data model. - /// Regulatory compliance control details and state - /// - public partial class RegulatoryComplianceControlData : ResourceData - { - /// Initializes a new instance of RegulatoryComplianceControlData. - public RegulatoryComplianceControlData() - { - } - - /// Initializes a new instance of RegulatoryComplianceControlData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The description of the regulatory compliance control. - /// Aggregative state based on the control's supported assessments states. - /// The number of supported regulatory compliance assessments of the given control with a passed state. - /// The number of supported regulatory compliance assessments of the given control with a failed state. - /// The number of supported regulatory compliance assessments of the given control with a skipped state. - internal RegulatoryComplianceControlData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string description, RegulatoryComplianceState? state, int? passedAssessments, int? failedAssessments, int? skippedAssessments) : base(id, name, resourceType, systemData) - { - Description = description; - State = state; - PassedAssessments = passedAssessments; - FailedAssessments = failedAssessments; - SkippedAssessments = skippedAssessments; - } - - /// The description of the regulatory compliance control. - public string Description { get; } - /// Aggregative state based on the control's supported assessments states. - public RegulatoryComplianceState? State { get; set; } - /// The number of supported regulatory compliance assessments of the given control with a passed state. - public int? PassedAssessments { get; } - /// The number of supported regulatory compliance assessments of the given control with a failed state. - public int? FailedAssessments { get; } - /// The number of supported regulatory compliance assessments of the given control with a skipped state. - public int? SkippedAssessments { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceControlResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceControlResource.cs deleted file mode 100644 index a26741d95031..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceControlResource.cs +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a RegulatoryComplianceControl along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetRegulatoryComplianceControlResource method. - /// Otherwise you can get one from its parent resource using the GetRegulatoryComplianceControl method. - /// - public partial class RegulatoryComplianceControlResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string regulatoryComplianceStandardName, string regulatoryComplianceControlName) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _regulatoryComplianceControlClientDiagnostics; - private readonly RegulatoryComplianceControlsRestOperations _regulatoryComplianceControlRestClient; - private readonly RegulatoryComplianceControlData _data; - - /// Initializes a new instance of the class for mocking. - protected RegulatoryComplianceControlResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal RegulatoryComplianceControlResource(ArmClient client, RegulatoryComplianceControlData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal RegulatoryComplianceControlResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _regulatoryComplianceControlClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string regulatoryComplianceControlApiVersion); - _regulatoryComplianceControlRestClient = new RegulatoryComplianceControlsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, regulatoryComplianceControlApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/regulatoryComplianceStandards/regulatoryComplianceControls"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual RegulatoryComplianceControlData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets a collection of RegulatoryComplianceAssessmentResources in the RegulatoryComplianceControl. - /// An object representing collection of RegulatoryComplianceAssessmentResources and their operations over a RegulatoryComplianceAssessmentResource. - public virtual RegulatoryComplianceAssessmentCollection GetRegulatoryComplianceAssessments() - { - return GetCachedClient(Client => new RegulatoryComplianceAssessmentCollection(Client, Id)); - } - - /// - /// Supported regulatory compliance details and state for selected assessment - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName} - /// - /// - /// Operation Id - /// RegulatoryComplianceAssessments_Get - /// - /// - /// - /// Name of the regulatory compliance assessment object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetRegulatoryComplianceAssessmentAsync(string regulatoryComplianceAssessmentName, CancellationToken cancellationToken = default) - { - return await GetRegulatoryComplianceAssessments().GetAsync(regulatoryComplianceAssessmentName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Supported regulatory compliance details and state for selected assessment - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName} - /// - /// - /// Operation Id - /// RegulatoryComplianceAssessments_Get - /// - /// - /// - /// Name of the regulatory compliance assessment object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetRegulatoryComplianceAssessment(string regulatoryComplianceAssessmentName, CancellationToken cancellationToken = default) - { - return GetRegulatoryComplianceAssessments().Get(regulatoryComplianceAssessmentName, cancellationToken); - } - - /// - /// Selected regulatory compliance control details and state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName} - /// - /// - /// Operation Id - /// RegulatoryComplianceControls_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _regulatoryComplianceControlClientDiagnostics.CreateScope("RegulatoryComplianceControlResource.Get"); - scope.Start(); - try - { - var response = await _regulatoryComplianceControlRestClient.GetAsync(Id.SubscriptionId, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new RegulatoryComplianceControlResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Selected regulatory compliance control details and state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName} - /// - /// - /// Operation Id - /// RegulatoryComplianceControls_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _regulatoryComplianceControlClientDiagnostics.CreateScope("RegulatoryComplianceControlResource.Get"); - scope.Start(); - try - { - var response = _regulatoryComplianceControlRestClient.Get(Id.SubscriptionId, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new RegulatoryComplianceControlResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceStandardCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceStandardCollection.cs deleted file mode 100644 index 76db5b417503..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceStandardCollection.cs +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetRegulatoryComplianceStandards method from an instance of . - /// - public partial class RegulatoryComplianceStandardCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _regulatoryComplianceStandardClientDiagnostics; - private readonly RegulatoryComplianceStandardsRestOperations _regulatoryComplianceStandardRestClient; - - /// Initializes a new instance of the class for mocking. - protected RegulatoryComplianceStandardCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal RegulatoryComplianceStandardCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _regulatoryComplianceStandardClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", RegulatoryComplianceStandardResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(RegulatoryComplianceStandardResource.ResourceType, out string regulatoryComplianceStandardApiVersion); - _regulatoryComplianceStandardRestClient = new RegulatoryComplianceStandardsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, regulatoryComplianceStandardApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SubscriptionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); - } - - /// - /// Supported regulatory compliance details state for selected standard - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName} - /// - /// - /// Operation Id - /// RegulatoryComplianceStandards_Get - /// - /// - /// - /// Name of the regulatory compliance standard object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string regulatoryComplianceStandardName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - - using var scope = _regulatoryComplianceStandardClientDiagnostics.CreateScope("RegulatoryComplianceStandardCollection.Get"); - scope.Start(); - try - { - var response = await _regulatoryComplianceStandardRestClient.GetAsync(Id.SubscriptionId, regulatoryComplianceStandardName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new RegulatoryComplianceStandardResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Supported regulatory compliance details state for selected standard - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName} - /// - /// - /// Operation Id - /// RegulatoryComplianceStandards_Get - /// - /// - /// - /// Name of the regulatory compliance standard object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string regulatoryComplianceStandardName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - - using var scope = _regulatoryComplianceStandardClientDiagnostics.CreateScope("RegulatoryComplianceStandardCollection.Get"); - scope.Start(); - try - { - var response = _regulatoryComplianceStandardRestClient.Get(Id.SubscriptionId, regulatoryComplianceStandardName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new RegulatoryComplianceStandardResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Supported regulatory compliance standards details and state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards - /// - /// - /// Operation Id - /// RegulatoryComplianceStandards_List - /// - /// - /// - /// OData filter. Optional. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _regulatoryComplianceStandardRestClient.CreateListRequest(Id.SubscriptionId, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _regulatoryComplianceStandardRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, filter); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new RegulatoryComplianceStandardResource(Client, RegulatoryComplianceStandardData.DeserializeRegulatoryComplianceStandardData(e)), _regulatoryComplianceStandardClientDiagnostics, Pipeline, "RegulatoryComplianceStandardCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Supported regulatory compliance standards details and state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards - /// - /// - /// Operation Id - /// RegulatoryComplianceStandards_List - /// - /// - /// - /// OData filter. Optional. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _regulatoryComplianceStandardRestClient.CreateListRequest(Id.SubscriptionId, filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _regulatoryComplianceStandardRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, filter); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new RegulatoryComplianceStandardResource(Client, RegulatoryComplianceStandardData.DeserializeRegulatoryComplianceStandardData(e)), _regulatoryComplianceStandardClientDiagnostics, Pipeline, "RegulatoryComplianceStandardCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName} - /// - /// - /// Operation Id - /// RegulatoryComplianceStandards_Get - /// - /// - /// - /// Name of the regulatory compliance standard object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string regulatoryComplianceStandardName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - - using var scope = _regulatoryComplianceStandardClientDiagnostics.CreateScope("RegulatoryComplianceStandardCollection.Exists"); - scope.Start(); - try - { - var response = await _regulatoryComplianceStandardRestClient.GetAsync(Id.SubscriptionId, regulatoryComplianceStandardName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName} - /// - /// - /// Operation Id - /// RegulatoryComplianceStandards_Get - /// - /// - /// - /// Name of the regulatory compliance standard object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string regulatoryComplianceStandardName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - - using var scope = _regulatoryComplianceStandardClientDiagnostics.CreateScope("RegulatoryComplianceStandardCollection.Exists"); - scope.Start(); - try - { - var response = _regulatoryComplianceStandardRestClient.Get(Id.SubscriptionId, regulatoryComplianceStandardName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceStandardData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceStandardData.cs deleted file mode 100644 index b6f2f17db37d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceStandardData.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the RegulatoryComplianceStandard data model. - /// Regulatory compliance standard details and state - /// - public partial class RegulatoryComplianceStandardData : ResourceData - { - /// Initializes a new instance of RegulatoryComplianceStandardData. - public RegulatoryComplianceStandardData() - { - } - - /// Initializes a new instance of RegulatoryComplianceStandardData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Aggregative state based on the standard's supported controls states. - /// The number of supported regulatory compliance controls of the given standard with a passed state. - /// The number of supported regulatory compliance controls of the given standard with a failed state. - /// The number of supported regulatory compliance controls of the given standard with a skipped state. - /// The number of regulatory compliance controls of the given standard which are unsupported by automated assessments. - internal RegulatoryComplianceStandardData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RegulatoryComplianceState? state, int? passedControls, int? failedControls, int? skippedControls, int? unsupportedControls) : base(id, name, resourceType, systemData) - { - State = state; - PassedControls = passedControls; - FailedControls = failedControls; - SkippedControls = skippedControls; - UnsupportedControls = unsupportedControls; - } - - /// Aggregative state based on the standard's supported controls states. - public RegulatoryComplianceState? State { get; set; } - /// The number of supported regulatory compliance controls of the given standard with a passed state. - public int? PassedControls { get; } - /// The number of supported regulatory compliance controls of the given standard with a failed state. - public int? FailedControls { get; } - /// The number of supported regulatory compliance controls of the given standard with a skipped state. - public int? SkippedControls { get; } - /// The number of regulatory compliance controls of the given standard which are unsupported by automated assessments. - public int? UnsupportedControls { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceStandardResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceStandardResource.cs deleted file mode 100644 index f271c4a10e30..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RegulatoryComplianceStandardResource.cs +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a RegulatoryComplianceStandard along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetRegulatoryComplianceStandardResource method. - /// Otherwise you can get one from its parent resource using the GetRegulatoryComplianceStandard method. - /// - public partial class RegulatoryComplianceStandardResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string regulatoryComplianceStandardName) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _regulatoryComplianceStandardClientDiagnostics; - private readonly RegulatoryComplianceStandardsRestOperations _regulatoryComplianceStandardRestClient; - private readonly RegulatoryComplianceStandardData _data; - - /// Initializes a new instance of the class for mocking. - protected RegulatoryComplianceStandardResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal RegulatoryComplianceStandardResource(ArmClient client, RegulatoryComplianceStandardData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal RegulatoryComplianceStandardResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _regulatoryComplianceStandardClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string regulatoryComplianceStandardApiVersion); - _regulatoryComplianceStandardRestClient = new RegulatoryComplianceStandardsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, regulatoryComplianceStandardApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/regulatoryComplianceStandards"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual RegulatoryComplianceStandardData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets a collection of RegulatoryComplianceControlResources in the RegulatoryComplianceStandard. - /// An object representing collection of RegulatoryComplianceControlResources and their operations over a RegulatoryComplianceControlResource. - public virtual RegulatoryComplianceControlCollection GetRegulatoryComplianceControls() - { - return GetCachedClient(Client => new RegulatoryComplianceControlCollection(Client, Id)); - } - - /// - /// Selected regulatory compliance control details and state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName} - /// - /// - /// Operation Id - /// RegulatoryComplianceControls_Get - /// - /// - /// - /// Name of the regulatory compliance control object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetRegulatoryComplianceControlAsync(string regulatoryComplianceControlName, CancellationToken cancellationToken = default) - { - return await GetRegulatoryComplianceControls().GetAsync(regulatoryComplianceControlName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Selected regulatory compliance control details and state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName} - /// - /// - /// Operation Id - /// RegulatoryComplianceControls_Get - /// - /// - /// - /// Name of the regulatory compliance control object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetRegulatoryComplianceControl(string regulatoryComplianceControlName, CancellationToken cancellationToken = default) - { - return GetRegulatoryComplianceControls().Get(regulatoryComplianceControlName, cancellationToken); - } - - /// - /// Supported regulatory compliance details state for selected standard - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName} - /// - /// - /// Operation Id - /// RegulatoryComplianceStandards_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _regulatoryComplianceStandardClientDiagnostics.CreateScope("RegulatoryComplianceStandardResource.Get"); - scope.Start(); - try - { - var response = await _regulatoryComplianceStandardRestClient.GetAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new RegulatoryComplianceStandardResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Supported regulatory compliance details state for selected standard - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName} - /// - /// - /// Operation Id - /// RegulatoryComplianceStandards_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _regulatoryComplianceStandardClientDiagnostics.CreateScope("RegulatoryComplianceStandardResource.Get"); - scope.Start(); - try - { - var response = _regulatoryComplianceStandardRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new RegulatoryComplianceStandardResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ResourceGroupSecurityAlertCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ResourceGroupSecurityAlertCollection.cs deleted file mode 100644 index c5b1e1903257..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ResourceGroupSecurityAlertCollection.cs +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetResourceGroupSecurityAlerts method from an instance of . - /// - public partial class ResourceGroupSecurityAlertCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _resourceGroupSecurityAlertAlertsClientDiagnostics; - private readonly AlertsRestOperations _resourceGroupSecurityAlertAlertsRestClient; - private readonly AzureLocation _ascLocation; - - /// Initializes a new instance of the class for mocking. - protected ResourceGroupSecurityAlertCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - internal ResourceGroupSecurityAlertCollection(ArmClient client, ResourceIdentifier id, AzureLocation ascLocation) : base(client, id) - { - _ascLocation = ascLocation; - _resourceGroupSecurityAlertAlertsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceGroupSecurityAlertResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceGroupSecurityAlertResource.ResourceType, out string resourceGroupSecurityAlertAlertsApiVersion); - _resourceGroupSecurityAlertAlertsRestClient = new AlertsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, resourceGroupSecurityAlertAlertsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Get an alert that is associated a resource group or a resource in a resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} - /// - /// - /// Operation Id - /// Alerts_GetResourceGroupLevel - /// - /// - /// - /// Name of the alert object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var scope = _resourceGroupSecurityAlertAlertsClientDiagnostics.CreateScope("ResourceGroupSecurityAlertCollection.Get"); - scope.Start(); - try - { - var response = await _resourceGroupSecurityAlertAlertsRestClient.GetResourceGroupLevelAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), alertName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ResourceGroupSecurityAlertResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get an alert that is associated a resource group or a resource in a resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} - /// - /// - /// Operation Id - /// Alerts_GetResourceGroupLevel - /// - /// - /// - /// Name of the alert object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var scope = _resourceGroupSecurityAlertAlertsClientDiagnostics.CreateScope("ResourceGroupSecurityAlertCollection.Get"); - scope.Start(); - try - { - var response = _resourceGroupSecurityAlertAlertsRestClient.GetResourceGroupLevel(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), alertName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ResourceGroupSecurityAlertResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List all the alerts that are associated with the resource group that are stored in a specific location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts - /// - /// - /// Operation Id - /// Alerts_ListResourceGroupLevelByRegion - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _resourceGroupSecurityAlertAlertsRestClient.CreateListResourceGroupLevelByRegionRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _resourceGroupSecurityAlertAlertsRestClient.CreateListResourceGroupLevelByRegionNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation)); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ResourceGroupSecurityAlertResource(Client, SecurityAlertData.DeserializeSecurityAlertData(e)), _resourceGroupSecurityAlertAlertsClientDiagnostics, Pipeline, "ResourceGroupSecurityAlertCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List all the alerts that are associated with the resource group that are stored in a specific location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts - /// - /// - /// Operation Id - /// Alerts_ListResourceGroupLevelByRegion - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _resourceGroupSecurityAlertAlertsRestClient.CreateListResourceGroupLevelByRegionRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _resourceGroupSecurityAlertAlertsRestClient.CreateListResourceGroupLevelByRegionNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation)); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ResourceGroupSecurityAlertResource(Client, SecurityAlertData.DeserializeSecurityAlertData(e)), _resourceGroupSecurityAlertAlertsClientDiagnostics, Pipeline, "ResourceGroupSecurityAlertCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} - /// - /// - /// Operation Id - /// Alerts_GetResourceGroupLevel - /// - /// - /// - /// Name of the alert object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var scope = _resourceGroupSecurityAlertAlertsClientDiagnostics.CreateScope("ResourceGroupSecurityAlertCollection.Exists"); - scope.Start(); - try - { - var response = await _resourceGroupSecurityAlertAlertsRestClient.GetResourceGroupLevelAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), alertName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} - /// - /// - /// Operation Id - /// Alerts_GetResourceGroupLevel - /// - /// - /// - /// Name of the alert object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var scope = _resourceGroupSecurityAlertAlertsClientDiagnostics.CreateScope("ResourceGroupSecurityAlertCollection.Exists"); - scope.Start(); - try - { - var response = _resourceGroupSecurityAlertAlertsRestClient.GetResourceGroupLevel(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), alertName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ResourceGroupSecurityAlertResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ResourceGroupSecurityAlertResource.cs deleted file mode 100644 index 6f05c92cccbc..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ResourceGroupSecurityAlertResource.cs +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a ResourceGroupSecurityAlert along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetResourceGroupSecurityAlertResource method. - /// Otherwise you can get one from its parent resource using the GetResourceGroupSecurityAlert method. - /// - public partial class ResourceGroupSecurityAlertResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string alertName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _resourceGroupSecurityAlertAlertsClientDiagnostics; - private readonly AlertsRestOperations _resourceGroupSecurityAlertAlertsRestClient; - private readonly SecurityAlertData _data; - - /// Initializes a new instance of the class for mocking. - protected ResourceGroupSecurityAlertResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal ResourceGroupSecurityAlertResource(ArmClient client, SecurityAlertData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal ResourceGroupSecurityAlertResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _resourceGroupSecurityAlertAlertsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string resourceGroupSecurityAlertAlertsApiVersion); - _resourceGroupSecurityAlertAlertsRestClient = new AlertsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, resourceGroupSecurityAlertAlertsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/locations/alerts"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecurityAlertData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get an alert that is associated a resource group or a resource in a resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} - /// - /// - /// Operation Id - /// Alerts_GetResourceGroupLevel - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _resourceGroupSecurityAlertAlertsClientDiagnostics.CreateScope("ResourceGroupSecurityAlertResource.Get"); - scope.Start(); - try - { - var response = await _resourceGroupSecurityAlertAlertsRestClient.GetResourceGroupLevelAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ResourceGroupSecurityAlertResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get an alert that is associated a resource group or a resource in a resource group - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} - /// - /// - /// Operation Id - /// Alerts_GetResourceGroupLevel - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _resourceGroupSecurityAlertAlertsClientDiagnostics.CreateScope("ResourceGroupSecurityAlertResource.Get"); - scope.Start(); - try - { - var response = _resourceGroupSecurityAlertAlertsRestClient.GetResourceGroupLevel(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ResourceGroupSecurityAlertResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update the alert's state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve - /// - /// - /// Operation Id - /// Alerts_UpdateResourceGroupLevelStateToResolve - /// - /// - /// - /// The cancellation token to use. - public virtual async Task ResolveAsync(CancellationToken cancellationToken = default) - { - using var scope = _resourceGroupSecurityAlertAlertsClientDiagnostics.CreateScope("ResourceGroupSecurityAlertResource.Resolve"); - scope.Start(); - try - { - var response = await _resourceGroupSecurityAlertAlertsRestClient.UpdateResourceGroupLevelStateToResolveAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update the alert's state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve - /// - /// - /// Operation Id - /// Alerts_UpdateResourceGroupLevelStateToResolve - /// - /// - /// - /// The cancellation token to use. - public virtual Response Resolve(CancellationToken cancellationToken = default) - { - using var scope = _resourceGroupSecurityAlertAlertsClientDiagnostics.CreateScope("ResourceGroupSecurityAlertResource.Resolve"); - scope.Start(); - try - { - var response = _resourceGroupSecurityAlertAlertsRestClient.UpdateResourceGroupLevelStateToResolve(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update the alert's state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss - /// - /// - /// Operation Id - /// Alerts_UpdateResourceGroupLevelStateToDismiss - /// - /// - /// - /// The cancellation token to use. - public virtual async Task DismissAsync(CancellationToken cancellationToken = default) - { - using var scope = _resourceGroupSecurityAlertAlertsClientDiagnostics.CreateScope("ResourceGroupSecurityAlertResource.Dismiss"); - scope.Start(); - try - { - var response = await _resourceGroupSecurityAlertAlertsRestClient.UpdateResourceGroupLevelStateToDismissAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update the alert's state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss - /// - /// - /// Operation Id - /// Alerts_UpdateResourceGroupLevelStateToDismiss - /// - /// - /// - /// The cancellation token to use. - public virtual Response Dismiss(CancellationToken cancellationToken = default) - { - using var scope = _resourceGroupSecurityAlertAlertsClientDiagnostics.CreateScope("ResourceGroupSecurityAlertResource.Dismiss"); - scope.Start(); - try - { - var response = _resourceGroupSecurityAlertAlertsRestClient.UpdateResourceGroupLevelStateToDismiss(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update the alert's state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate - /// - /// - /// Operation Id - /// Alerts_UpdateResourceGroupLevelStateToActivate - /// - /// - /// - /// The cancellation token to use. - public virtual async Task ActivateAsync(CancellationToken cancellationToken = default) - { - using var scope = _resourceGroupSecurityAlertAlertsClientDiagnostics.CreateScope("ResourceGroupSecurityAlertResource.Activate"); - scope.Start(); - try - { - var response = await _resourceGroupSecurityAlertAlertsRestClient.UpdateResourceGroupLevelStateToActivateAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update the alert's state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate - /// - /// - /// Operation Id - /// Alerts_UpdateResourceGroupLevelStateToActivate - /// - /// - /// - /// The cancellation token to use. - public virtual Response Activate(CancellationToken cancellationToken = default) - { - using var scope = _resourceGroupSecurityAlertAlertsClientDiagnostics.CreateScope("ResourceGroupSecurityAlertResource.Activate"); - scope.Start(); - try - { - var response = _resourceGroupSecurityAlertAlertsRestClient.UpdateResourceGroupLevelStateToActivate(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update the alert's state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress - /// - /// - /// Operation Id - /// Alerts_UpdateResourceGroupLevelStateToInProgress - /// - /// - /// - /// The cancellation token to use. - public virtual async Task UpdateSatateToInProgressAsync(CancellationToken cancellationToken = default) - { - using var scope = _resourceGroupSecurityAlertAlertsClientDiagnostics.CreateScope("ResourceGroupSecurityAlertResource.UpdateSatateToInProgress"); - scope.Start(); - try - { - var response = await _resourceGroupSecurityAlertAlertsRestClient.UpdateResourceGroupLevelStateToInProgressAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update the alert's state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress - /// - /// - /// Operation Id - /// Alerts_UpdateResourceGroupLevelStateToInProgress - /// - /// - /// - /// The cancellation token to use. - public virtual Response UpdateSatateToInProgress(CancellationToken cancellationToken = default) - { - using var scope = _resourceGroupSecurityAlertAlertsClientDiagnostics.CreateScope("ResourceGroupSecurityAlertResource.UpdateSatateToInProgress"); - scope.Start(); - try - { - var response = _resourceGroupSecurityAlertAlertsRestClient.UpdateResourceGroupLevelStateToInProgress(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ResourceGroupSecurityTaskCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ResourceGroupSecurityTaskCollection.cs deleted file mode 100644 index c8754c419fd1..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ResourceGroupSecurityTaskCollection.cs +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetResourceGroupSecurityTasks method from an instance of . - /// - public partial class ResourceGroupSecurityTaskCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _resourceGroupSecurityTaskTasksClientDiagnostics; - private readonly TasksRestOperations _resourceGroupSecurityTaskTasksRestClient; - private readonly AzureLocation _ascLocation; - - /// Initializes a new instance of the class for mocking. - protected ResourceGroupSecurityTaskCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - internal ResourceGroupSecurityTaskCollection(ArmClient client, ResourceIdentifier id, AzureLocation ascLocation) : base(client, id) - { - _ascLocation = ascLocation; - _resourceGroupSecurityTaskTasksClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceGroupSecurityTaskResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceGroupSecurityTaskResource.ResourceType, out string resourceGroupSecurityTaskTasksApiVersion); - _resourceGroupSecurityTaskTasksRestClient = new TasksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, resourceGroupSecurityTaskTasksApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} - /// - /// - /// Operation Id - /// Tasks_GetResourceGroupLevelTask - /// - /// - /// - /// Name of the task object, will be a GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string taskName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); - - using var scope = _resourceGroupSecurityTaskTasksClientDiagnostics.CreateScope("ResourceGroupSecurityTaskCollection.Get"); - scope.Start(); - try - { - var response = await _resourceGroupSecurityTaskTasksRestClient.GetResourceGroupLevelTaskAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), taskName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ResourceGroupSecurityTaskResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} - /// - /// - /// Operation Id - /// Tasks_GetResourceGroupLevelTask - /// - /// - /// - /// Name of the task object, will be a GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string taskName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); - - using var scope = _resourceGroupSecurityTaskTasksClientDiagnostics.CreateScope("ResourceGroupSecurityTaskCollection.Get"); - scope.Start(); - try - { - var response = _resourceGroupSecurityTaskTasksRestClient.GetResourceGroupLevelTask(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), taskName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ResourceGroupSecurityTaskResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks - /// - /// - /// Operation Id - /// Tasks_ListByResourceGroup - /// - /// - /// - /// OData filter. Optional. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _resourceGroupSecurityTaskTasksRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _resourceGroupSecurityTaskTasksRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), filter); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ResourceGroupSecurityTaskResource(Client, SecurityTaskData.DeserializeSecurityTaskData(e)), _resourceGroupSecurityTaskTasksClientDiagnostics, Pipeline, "ResourceGroupSecurityTaskCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks - /// - /// - /// Operation Id - /// Tasks_ListByResourceGroup - /// - /// - /// - /// OData filter. Optional. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _resourceGroupSecurityTaskTasksRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _resourceGroupSecurityTaskTasksRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), filter); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ResourceGroupSecurityTaskResource(Client, SecurityTaskData.DeserializeSecurityTaskData(e)), _resourceGroupSecurityTaskTasksClientDiagnostics, Pipeline, "ResourceGroupSecurityTaskCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} - /// - /// - /// Operation Id - /// Tasks_GetResourceGroupLevelTask - /// - /// - /// - /// Name of the task object, will be a GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string taskName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); - - using var scope = _resourceGroupSecurityTaskTasksClientDiagnostics.CreateScope("ResourceGroupSecurityTaskCollection.Exists"); - scope.Start(); - try - { - var response = await _resourceGroupSecurityTaskTasksRestClient.GetResourceGroupLevelTaskAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), taskName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} - /// - /// - /// Operation Id - /// Tasks_GetResourceGroupLevelTask - /// - /// - /// - /// Name of the task object, will be a GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string taskName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); - - using var scope = _resourceGroupSecurityTaskTasksClientDiagnostics.CreateScope("ResourceGroupSecurityTaskCollection.Exists"); - scope.Start(); - try - { - var response = _resourceGroupSecurityTaskTasksRestClient.GetResourceGroupLevelTask(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(_ascLocation), taskName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ResourceGroupSecurityTaskResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ResourceGroupSecurityTaskResource.cs deleted file mode 100644 index 6c9b0efc9450..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ResourceGroupSecurityTaskResource.cs +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a ResourceGroupSecurityTask along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetResourceGroupSecurityTaskResource method. - /// Otherwise you can get one from its parent resource using the GetResourceGroupSecurityTask method. - /// - public partial class ResourceGroupSecurityTaskResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string taskName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _resourceGroupSecurityTaskTasksClientDiagnostics; - private readonly TasksRestOperations _resourceGroupSecurityTaskTasksRestClient; - private readonly SecurityTaskData _data; - - /// Initializes a new instance of the class for mocking. - protected ResourceGroupSecurityTaskResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal ResourceGroupSecurityTaskResource(ArmClient client, SecurityTaskData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal ResourceGroupSecurityTaskResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _resourceGroupSecurityTaskTasksClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string resourceGroupSecurityTaskTasksApiVersion); - _resourceGroupSecurityTaskTasksRestClient = new TasksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, resourceGroupSecurityTaskTasksApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/locations/tasks"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecurityTaskData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} - /// - /// - /// Operation Id - /// Tasks_GetResourceGroupLevelTask - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _resourceGroupSecurityTaskTasksClientDiagnostics.CreateScope("ResourceGroupSecurityTaskResource.Get"); - scope.Start(); - try - { - var response = await _resourceGroupSecurityTaskTasksRestClient.GetResourceGroupLevelTaskAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ResourceGroupSecurityTaskResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} - /// - /// - /// Operation Id - /// Tasks_GetResourceGroupLevelTask - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _resourceGroupSecurityTaskTasksClientDiagnostics.CreateScope("ResourceGroupSecurityTaskResource.Get"); - scope.Start(); - try - { - var response = _resourceGroupSecurityTaskTasksRestClient.GetResourceGroupLevelTask(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ResourceGroupSecurityTaskResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AdaptiveApplicationControlsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AdaptiveApplicationControlsRestOperations.cs deleted file mode 100644 index d9d35081b973..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AdaptiveApplicationControlsRestOperations.cs +++ /dev/null @@ -1,353 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class AdaptiveApplicationControlsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of AdaptiveApplicationControlsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public AdaptiveApplicationControlsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId, bool? includePathRecommendations, bool? summary) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/applicationWhitelistings", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (includePathRecommendations != null) - { - uri.AppendQuery("includePathRecommendations", includePathRecommendations.Value, true); - } - if (summary != null) - { - uri.AppendQuery("summary", summary.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of application control machine groups for the subscription. - /// Azure subscription ID. - /// Include the policy rules. - /// Return output in a summarized form. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, bool? includePathRecommendations = null, bool? summary = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId, includePathRecommendations, summary); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AdaptiveApplicationControlGroups value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AdaptiveApplicationControlGroups.DeserializeAdaptiveApplicationControlGroups(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of application control machine groups for the subscription. - /// Azure subscription ID. - /// Include the policy rules. - /// Return output in a summarized form. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, bool? includePathRecommendations = null, bool? summary = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId, includePathRecommendations, summary); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AdaptiveApplicationControlGroups value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AdaptiveApplicationControlGroups.DeserializeAdaptiveApplicationControlGroups(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation ascLocation, string groupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/applicationWhitelistings/", false); - uri.AppendPath(groupName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets an application control VM/server group. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of an application control machine group. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, AzureLocation ascLocation, string groupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); - - using var message = CreateGetRequest(subscriptionId, ascLocation, groupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AdaptiveApplicationControlGroupData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AdaptiveApplicationControlGroupData.DeserializeAdaptiveApplicationControlGroupData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((AdaptiveApplicationControlGroupData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets an application control VM/server group. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of an application control machine group. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, AzureLocation ascLocation, string groupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); - - using var message = CreateGetRequest(subscriptionId, ascLocation, groupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AdaptiveApplicationControlGroupData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AdaptiveApplicationControlGroupData.DeserializeAdaptiveApplicationControlGroupData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((AdaptiveApplicationControlGroupData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreatePutRequest(string subscriptionId, AzureLocation ascLocation, string groupName, AdaptiveApplicationControlGroupData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/applicationWhitelistings/", false); - uri.AppendPath(groupName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Update an application control machine group. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of an application control machine group. - /// The AdaptiveApplicationControlGroup to use. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> PutAsync(string subscriptionId, AzureLocation ascLocation, string groupName, AdaptiveApplicationControlGroupData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreatePutRequest(subscriptionId, ascLocation, groupName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AdaptiveApplicationControlGroupData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AdaptiveApplicationControlGroupData.DeserializeAdaptiveApplicationControlGroupData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update an application control machine group. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of an application control machine group. - /// The AdaptiveApplicationControlGroup to use. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Put(string subscriptionId, AzureLocation ascLocation, string groupName, AdaptiveApplicationControlGroupData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreatePutRequest(subscriptionId, ascLocation, groupName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AdaptiveApplicationControlGroupData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AdaptiveApplicationControlGroupData.DeserializeAdaptiveApplicationControlGroupData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, AzureLocation ascLocation, string groupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/applicationWhitelistings/", false); - uri.AppendPath(groupName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Delete an application control machine group. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of an application control machine group. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, AzureLocation ascLocation, string groupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); - - using var message = CreateDeleteRequest(subscriptionId, ascLocation, groupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete an application control machine group. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of an application control machine group. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, AzureLocation ascLocation, string groupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); - - using var message = CreateDeleteRequest(subscriptionId, ascLocation, groupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AdaptiveNetworkHardeningsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AdaptiveNetworkHardeningsRestOperations.cs deleted file mode 100644 index 128cf7bb3e64..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AdaptiveNetworkHardeningsRestOperations.cs +++ /dev/null @@ -1,413 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class AdaptiveNetworkHardeningsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of AdaptiveNetworkHardeningsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public AdaptiveNetworkHardeningsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListByExtendedResourceRequest(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/", false); - uri.AppendPath(resourceNamespace, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceType, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/providers/Microsoft.Security/adaptiveNetworkHardenings", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - /// Azure subscription ID. - /// 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 to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListByExtendedResourceAsync(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByExtendedResourceRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AdaptiveNetworkHardeningsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AdaptiveNetworkHardeningsList.DeserializeAdaptiveNetworkHardeningsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - /// Azure subscription ID. - /// 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 to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response ListByExtendedResource(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByExtendedResourceRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AdaptiveNetworkHardeningsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AdaptiveNetworkHardeningsList.DeserializeAdaptiveNetworkHardeningsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/", false); - uri.AppendPath(resourceNamespace, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceType, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/providers/Microsoft.Security/adaptiveNetworkHardenings/", false); - uri.AppendPath(adaptiveNetworkHardeningResourceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a single Adaptive Network Hardening resource. - /// Azure subscription ID. - /// 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 to use. - /// , , , , or is null. - /// , , , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(adaptiveNetworkHardeningResourceName, nameof(adaptiveNetworkHardeningResourceName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AdaptiveNetworkHardeningData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AdaptiveNetworkHardeningData.DeserializeAdaptiveNetworkHardeningData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((AdaptiveNetworkHardeningData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a single Adaptive Network Hardening resource. - /// Azure subscription ID. - /// 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 to use. - /// , , , , or is null. - /// , , , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(adaptiveNetworkHardeningResourceName, nameof(adaptiveNetworkHardeningResourceName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AdaptiveNetworkHardeningData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AdaptiveNetworkHardeningData.DeserializeAdaptiveNetworkHardeningData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((AdaptiveNetworkHardeningData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateEnforceRequest(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/", false); - uri.AppendPath(resourceNamespace, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceType, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/providers/Microsoft.Security/adaptiveNetworkHardenings/", false); - uri.AppendPath(adaptiveNetworkHardeningResourceName, true); - uri.AppendPath("/", false); - uri.AppendPath("enforce", true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Enforces the given rules on the NSG(s) listed in the request. - /// Azure subscription ID. - /// 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 AdaptiveNetworkHardeningEnforceContent to use. - /// The cancellation token to use. - /// , , , , , or is null. - /// , , , , or is an empty string, and was expected to be non-empty. - public async Task EnforceAsync(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(adaptiveNetworkHardeningResourceName, nameof(adaptiveNetworkHardeningResourceName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateEnforceRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Enforces the given rules on the NSG(s) listed in the request. - /// Azure subscription ID. - /// 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 AdaptiveNetworkHardeningEnforceContent to use. - /// The cancellation token to use. - /// , , , , , or is null. - /// , , , , or is an empty string, and was expected to be non-empty. - public Response Enforce(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string adaptiveNetworkHardeningResourceName, AdaptiveNetworkHardeningEnforceContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(adaptiveNetworkHardeningResourceName, nameof(adaptiveNetworkHardeningResourceName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateEnforceRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByExtendedResourceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - /// The URL to the next page of results. - /// Azure subscription ID. - /// 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 to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListByExtendedResourceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByExtendedResourceNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AdaptiveNetworkHardeningsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AdaptiveNetworkHardeningsList.DeserializeAdaptiveNetworkHardeningsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. - /// The URL to the next page of results. - /// Azure subscription ID. - /// 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 to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response ListByExtendedResourceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByExtendedResourceNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AdaptiveNetworkHardeningsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AdaptiveNetworkHardeningsList.DeserializeAdaptiveNetworkHardeningsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AdvancedThreatProtectionRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AdvancedThreatProtectionRestOperations.cs deleted file mode 100644 index a4f6b3938cc9..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AdvancedThreatProtectionRestOperations.cs +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class AdvancedThreatProtectionRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of AdvancedThreatProtectionRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public AdvancedThreatProtectionRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-01-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateGetRequest(string resourceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/advancedThreatProtectionSettings/", false); - uri.AppendPath("current", true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the Advanced Threat Protection settings for the specified resource. - /// The identifier of the resource. - /// The cancellation token to use. - /// is null. - public async Task> GetAsync(string resourceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - - using var message = CreateGetRequest(resourceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AdvancedThreatProtectionSettingData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AdvancedThreatProtectionSettingData.DeserializeAdvancedThreatProtectionSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((AdvancedThreatProtectionSettingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the Advanced Threat Protection settings for the specified resource. - /// The identifier of the resource. - /// The cancellation token to use. - /// is null. - public Response Get(string resourceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - - using var message = CreateGetRequest(resourceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AdvancedThreatProtectionSettingData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AdvancedThreatProtectionSettingData.DeserializeAdvancedThreatProtectionSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((AdvancedThreatProtectionSettingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateRequest(string resourceId, AdvancedThreatProtectionSettingData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/advancedThreatProtectionSettings/", false); - uri.AppendPath("current", true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or updates the Advanced Threat Protection settings on a specified resource. - /// The identifier of the resource. - /// Advanced Threat Protection Settings. - /// The cancellation token to use. - /// or is null. - public async Task> CreateAsync(string resourceId, AdvancedThreatProtectionSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(resourceId, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AdvancedThreatProtectionSettingData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AdvancedThreatProtectionSettingData.DeserializeAdvancedThreatProtectionSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates the Advanced Threat Protection settings on a specified resource. - /// The identifier of the resource. - /// Advanced Threat Protection Settings. - /// The cancellation token to use. - /// or is null. - public Response Create(string resourceId, AdvancedThreatProtectionSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(resourceId, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AdvancedThreatProtectionSettingData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AdvancedThreatProtectionSettingData.DeserializeAdvancedThreatProtectionSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AlertsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AlertsRestOperations.cs deleted file mode 100644 index 3bacdc42dc59..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AlertsRestOperations.cs +++ /dev/null @@ -1,1407 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class AlertsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of AlertsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public AlertsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-01-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/alerts", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all the alerts that are associated with the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AlertList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AlertList.DeserializeAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all the alerts that are associated with the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AlertList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AlertList.DeserializeAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/alerts", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all the alerts that are associated with the resource group. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AlertList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AlertList.DeserializeAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all the alerts that are associated with the resource group. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AlertList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AlertList.DeserializeAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSubscriptionLevelByRegionRequest(string subscriptionId, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/alerts", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all the alerts that are associated with the subscription that are stored in a specific location. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListSubscriptionLevelByRegionAsync(string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListSubscriptionLevelByRegionRequest(subscriptionId, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AlertList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AlertList.DeserializeAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all the alerts that are associated with the subscription that are stored in a specific location. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListSubscriptionLevelByRegion(string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListSubscriptionLevelByRegionRequest(subscriptionId, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AlertList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AlertList.DeserializeAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListResourceGroupLevelByRegionRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/alerts", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all the alerts that are associated with the resource group that are stored in a specific location. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListResourceGroupLevelByRegionAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListResourceGroupLevelByRegionRequest(subscriptionId, resourceGroupName, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AlertList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AlertList.DeserializeAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all the alerts that are associated with the resource group that are stored in a specific location. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListResourceGroupLevelByRegion(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListResourceGroupLevelByRegionRequest(subscriptionId, resourceGroupName, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AlertList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AlertList.DeserializeAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSubscriptionLevelRequest(string subscriptionId, AzureLocation ascLocation, string alertName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/alerts/", false); - uri.AppendPath(alertName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get an alert that is associated with a subscription. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetSubscriptionLevelAsync(string subscriptionId, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateGetSubscriptionLevelRequest(subscriptionId, ascLocation, alertName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityAlertData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAlertData.DeserializeSecurityAlertData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityAlertData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get an alert that is associated with a subscription. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response GetSubscriptionLevel(string subscriptionId, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateGetSubscriptionLevelRequest(subscriptionId, ascLocation, alertName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityAlertData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAlertData.DeserializeSecurityAlertData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityAlertData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetResourceGroupLevelRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string alertName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/alerts/", false); - uri.AppendPath(alertName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get an alert that is associated a resource group or a resource in a resource group. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetResourceGroupLevelAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateGetResourceGroupLevelRequest(subscriptionId, resourceGroupName, ascLocation, alertName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityAlertData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAlertData.DeserializeSecurityAlertData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityAlertData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get an alert that is associated a resource group or a resource in a resource group. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response GetResourceGroupLevel(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateGetResourceGroupLevelRequest(subscriptionId, resourceGroupName, ascLocation, alertName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityAlertData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAlertData.DeserializeSecurityAlertData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityAlertData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateSubscriptionLevelStateToDismissRequest(string subscriptionId, AzureLocation ascLocation, string alertName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/alerts/", false); - uri.AppendPath(alertName, true); - uri.AppendPath("/dismiss", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Update the alert's state. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task UpdateSubscriptionLevelStateToDismissAsync(string subscriptionId, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateUpdateSubscriptionLevelStateToDismissRequest(subscriptionId, ascLocation, alertName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update the alert's state. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response UpdateSubscriptionLevelStateToDismiss(string subscriptionId, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateUpdateSubscriptionLevelStateToDismissRequest(subscriptionId, ascLocation, alertName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateSubscriptionLevelStateToResolveRequest(string subscriptionId, AzureLocation ascLocation, string alertName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/alerts/", false); - uri.AppendPath(alertName, true); - uri.AppendPath("/resolve", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Update the alert's state. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task UpdateSubscriptionLevelStateToResolveAsync(string subscriptionId, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateUpdateSubscriptionLevelStateToResolveRequest(subscriptionId, ascLocation, alertName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update the alert's state. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response UpdateSubscriptionLevelStateToResolve(string subscriptionId, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateUpdateSubscriptionLevelStateToResolveRequest(subscriptionId, ascLocation, alertName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateSubscriptionLevelStateToActivateRequest(string subscriptionId, AzureLocation ascLocation, string alertName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/alerts/", false); - uri.AppendPath(alertName, true); - uri.AppendPath("/activate", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Update the alert's state. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task UpdateSubscriptionLevelStateToActivateAsync(string subscriptionId, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateUpdateSubscriptionLevelStateToActivateRequest(subscriptionId, ascLocation, alertName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update the alert's state. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response UpdateSubscriptionLevelStateToActivate(string subscriptionId, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateUpdateSubscriptionLevelStateToActivateRequest(subscriptionId, ascLocation, alertName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateSubscriptionLevelStateToInProgressRequest(string subscriptionId, AzureLocation ascLocation, string alertName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/alerts/", false); - uri.AppendPath(alertName, true); - uri.AppendPath("/inProgress", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Update the alert's state. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task UpdateSubscriptionLevelStateToInProgressAsync(string subscriptionId, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateUpdateSubscriptionLevelStateToInProgressRequest(subscriptionId, ascLocation, alertName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update the alert's state. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response UpdateSubscriptionLevelStateToInProgress(string subscriptionId, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateUpdateSubscriptionLevelStateToInProgressRequest(subscriptionId, ascLocation, alertName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateResourceGroupLevelStateToResolveRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string alertName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/alerts/", false); - uri.AppendPath(alertName, true); - uri.AppendPath("/resolve", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Update the alert's state. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateResourceGroupLevelStateToResolveAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateUpdateResourceGroupLevelStateToResolveRequest(subscriptionId, resourceGroupName, ascLocation, alertName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update the alert's state. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response UpdateResourceGroupLevelStateToResolve(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateUpdateResourceGroupLevelStateToResolveRequest(subscriptionId, resourceGroupName, ascLocation, alertName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateResourceGroupLevelStateToDismissRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string alertName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/alerts/", false); - uri.AppendPath(alertName, true); - uri.AppendPath("/dismiss", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Update the alert's state. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateResourceGroupLevelStateToDismissAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateUpdateResourceGroupLevelStateToDismissRequest(subscriptionId, resourceGroupName, ascLocation, alertName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update the alert's state. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response UpdateResourceGroupLevelStateToDismiss(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateUpdateResourceGroupLevelStateToDismissRequest(subscriptionId, resourceGroupName, ascLocation, alertName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateResourceGroupLevelStateToActivateRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string alertName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/alerts/", false); - uri.AppendPath(alertName, true); - uri.AppendPath("/activate", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Update the alert's state. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateResourceGroupLevelStateToActivateAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateUpdateResourceGroupLevelStateToActivateRequest(subscriptionId, resourceGroupName, ascLocation, alertName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update the alert's state. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response UpdateResourceGroupLevelStateToActivate(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateUpdateResourceGroupLevelStateToActivateRequest(subscriptionId, resourceGroupName, ascLocation, alertName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateResourceGroupLevelStateToInProgressRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string alertName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/alerts/", false); - uri.AppendPath(alertName, true); - uri.AppendPath("/inProgress", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Update the alert's state. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateResourceGroupLevelStateToInProgressAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateUpdateResourceGroupLevelStateToInProgressRequest(subscriptionId, resourceGroupName, ascLocation, alertName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update the alert's state. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the alert object. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response UpdateResourceGroupLevelStateToInProgress(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var message = CreateUpdateResourceGroupLevelStateToInProgressRequest(subscriptionId, resourceGroupName, ascLocation, alertName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateSimulateRequest(string subscriptionId, AzureLocation ascLocation, SecurityAlertSimulatorContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/alerts/default/simulate", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Simulate security alerts. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Alert Simulator Request Properties. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task SimulateAsync(string subscriptionId, AzureLocation ascLocation, SecurityAlertSimulatorContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateSimulateRequest(subscriptionId, ascLocation, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Simulate security alerts. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Alert Simulator Request Properties. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response Simulate(string subscriptionId, AzureLocation ascLocation, SecurityAlertSimulatorContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateSimulateRequest(subscriptionId, ascLocation, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all the alerts that are associated with the subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AlertList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AlertList.DeserializeAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all the alerts that are associated with the subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AlertList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AlertList.DeserializeAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all the alerts that are associated with the resource group. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AlertList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AlertList.DeserializeAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all the alerts that are associated with the resource group. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AlertList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AlertList.DeserializeAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListSubscriptionLevelByRegionNextPageRequest(string nextLink, string subscriptionId, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all the alerts that are associated with the subscription that are stored in a specific location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListSubscriptionLevelByRegionNextPageAsync(string nextLink, string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListSubscriptionLevelByRegionNextPageRequest(nextLink, subscriptionId, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AlertList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AlertList.DeserializeAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all the alerts that are associated with the subscription that are stored in a specific location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListSubscriptionLevelByRegionNextPage(string nextLink, string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListSubscriptionLevelByRegionNextPageRequest(nextLink, subscriptionId, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AlertList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AlertList.DeserializeAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListResourceGroupLevelByRegionNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all the alerts that are associated with the resource group that are stored in a specific location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListResourceGroupLevelByRegionNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListResourceGroupLevelByRegionNextPageRequest(nextLink, subscriptionId, resourceGroupName, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AlertList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AlertList.DeserializeAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all the alerts that are associated with the resource group that are stored in a specific location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListResourceGroupLevelByRegionNextPage(string nextLink, string subscriptionId, string resourceGroupName, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListResourceGroupLevelByRegionNextPageRequest(nextLink, subscriptionId, resourceGroupName, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AlertList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AlertList.DeserializeAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AlertsSuppressionRulesRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AlertsSuppressionRulesRestOperations.cs deleted file mode 100644 index 8fd51006c595..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AlertsSuppressionRulesRestOperations.cs +++ /dev/null @@ -1,401 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class AlertsSuppressionRulesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of AlertsSuppressionRulesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public AlertsSuppressionRulesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-01-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId, string alertType) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/alertsSuppressionRules", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (alertType != null) - { - uri.AppendQuery("AlertType", alertType, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List of all the dismiss rules for the given subscription. - /// Azure subscription ID. - /// Type of the alert to get rules for. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string alertType = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId, alertType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AlertsSuppressionRulesList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AlertsSuppressionRulesList.DeserializeAlertsSuppressionRulesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List of all the dismiss rules for the given subscription. - /// Azure subscription ID. - /// Type of the alert to get rules for. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string alertType = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId, alertType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AlertsSuppressionRulesList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AlertsSuppressionRulesList.DeserializeAlertsSuppressionRulesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string alertsSuppressionRuleName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/alertsSuppressionRules/", false); - uri.AppendPath(alertsSuppressionRuleName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - /// Azure subscription ID. - /// The unique name of the suppression alert rule. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string alertsSuppressionRuleName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(alertsSuppressionRuleName, nameof(alertsSuppressionRuleName)); - - using var message = CreateGetRequest(subscriptionId, alertsSuppressionRuleName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityAlertsSuppressionRuleData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAlertsSuppressionRuleData.DeserializeSecurityAlertsSuppressionRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityAlertsSuppressionRuleData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription. - /// Azure subscription ID. - /// The unique name of the suppression alert rule. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string alertsSuppressionRuleName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(alertsSuppressionRuleName, nameof(alertsSuppressionRuleName)); - - using var message = CreateGetRequest(subscriptionId, alertsSuppressionRuleName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityAlertsSuppressionRuleData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAlertsSuppressionRuleData.DeserializeSecurityAlertsSuppressionRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityAlertsSuppressionRuleData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string alertsSuppressionRuleName, SecurityAlertsSuppressionRuleData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/alertsSuppressionRules/", false); - uri.AppendPath(alertsSuppressionRuleName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Update existing rule or create new rule if it doesn't exist. - /// Azure subscription ID. - /// The unique name of the suppression alert rule. - /// Suppression rule object. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string alertsSuppressionRuleName, SecurityAlertsSuppressionRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(alertsSuppressionRuleName, nameof(alertsSuppressionRuleName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateRequest(subscriptionId, alertsSuppressionRuleName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityAlertsSuppressionRuleData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAlertsSuppressionRuleData.DeserializeSecurityAlertsSuppressionRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Update existing rule or create new rule if it doesn't exist. - /// Azure subscription ID. - /// The unique name of the suppression alert rule. - /// Suppression rule object. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string alertsSuppressionRuleName, SecurityAlertsSuppressionRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(alertsSuppressionRuleName, nameof(alertsSuppressionRuleName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateRequest(subscriptionId, alertsSuppressionRuleName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityAlertsSuppressionRuleData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAlertsSuppressionRuleData.DeserializeSecurityAlertsSuppressionRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string alertsSuppressionRuleName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/alertsSuppressionRules/", false); - uri.AppendPath(alertsSuppressionRuleName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Delete dismiss alert rule for this subscription. - /// Azure subscription ID. - /// The unique name of the suppression alert rule. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string alertsSuppressionRuleName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(alertsSuppressionRuleName, nameof(alertsSuppressionRuleName)); - - using var message = CreateDeleteRequest(subscriptionId, alertsSuppressionRuleName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete dismiss alert rule for this subscription. - /// Azure subscription ID. - /// The unique name of the suppression alert rule. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string alertsSuppressionRuleName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(alertsSuppressionRuleName, nameof(alertsSuppressionRuleName)); - - using var message = CreateDeleteRequest(subscriptionId, alertsSuppressionRuleName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string alertType) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List of all the dismiss rules for the given subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// Type of the alert to get rules for. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string alertType = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, alertType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AlertsSuppressionRulesList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AlertsSuppressionRulesList.DeserializeAlertsSuppressionRulesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List of all the dismiss rules for the given subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// Type of the alert to get rules for. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string alertType = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, alertType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AlertsSuppressionRulesList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AlertsSuppressionRulesList.DeserializeAlertsSuppressionRulesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AllowedConnectionsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AllowedConnectionsRestOperations.cs deleted file mode 100644 index b5c4f41a0aa0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AllowedConnectionsRestOperations.cs +++ /dev/null @@ -1,396 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class AllowedConnectionsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of AllowedConnectionsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public AllowedConnectionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/allowedConnections", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the list of all possible traffic between resources for the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AllowedConnectionsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AllowedConnectionsList.DeserializeAllowedConnectionsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the list of all possible traffic between resources for the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AllowedConnectionsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AllowedConnectionsList.DeserializeAllowedConnectionsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByHomeRegionRequest(string subscriptionId, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/allowedConnections", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the list of all possible traffic between resources for the subscription and location. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListByHomeRegionAsync(string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionRequest(subscriptionId, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AllowedConnectionsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AllowedConnectionsList.DeserializeAllowedConnectionsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the list of all possible traffic between resources for the subscription and location. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListByHomeRegion(string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionRequest(subscriptionId, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AllowedConnectionsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AllowedConnectionsList.DeserializeAllowedConnectionsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, SecurityCenterConnectionType connectionType) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/allowedConnections/", false); - uri.AppendPath(connectionType.ToString(), true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the list of all possible traffic between resources for the subscription and location, based on connection type. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The type of allowed connections (Internal, External). - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, SecurityCenterConnectionType connectionType, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, ascLocation, connectionType); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityCenterAllowedConnection value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityCenterAllowedConnection.DeserializeSecurityCenterAllowedConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the list of all possible traffic between resources for the subscription and location, based on connection type. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The type of allowed connections (Internal, External). - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, SecurityCenterConnectionType connectionType, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, ascLocation, connectionType); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityCenterAllowedConnection value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityCenterAllowedConnection.DeserializeSecurityCenterAllowedConnection(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the list of all possible traffic between resources for the subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AllowedConnectionsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AllowedConnectionsList.DeserializeAllowedConnectionsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the list of all possible traffic between resources for the subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AllowedConnectionsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AllowedConnectionsList.DeserializeAllowedConnectionsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByHomeRegionNextPageRequest(string nextLink, string subscriptionId, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the list of all possible traffic between resources for the subscription and location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListByHomeRegionNextPageAsync(string nextLink, string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionNextPageRequest(nextLink, subscriptionId, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AllowedConnectionsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AllowedConnectionsList.DeserializeAllowedConnectionsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the list of all possible traffic between resources for the subscription and location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListByHomeRegionNextPage(string nextLink, string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionNextPageRequest(nextLink, subscriptionId, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AllowedConnectionsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AllowedConnectionsList.DeserializeAllowedConnectionsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ApplicationRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ApplicationRestOperations.cs deleted file mode 100644 index 7d83eb1a268b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ApplicationRestOperations.cs +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class ApplicationRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ApplicationRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ApplicationRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-07-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string applicationId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/applications/", false); - uri.AppendPath(applicationId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a specific application for the requested scope by applicationId. - /// Azure subscription ID. - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string applicationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - - using var message = CreateGetRequest(subscriptionId, applicationId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityApplicationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityApplicationData.DeserializeSecurityApplicationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityApplicationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a specific application for the requested scope by applicationId. - /// Azure subscription ID. - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string applicationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - - using var message = CreateGetRequest(subscriptionId, applicationId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityApplicationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityApplicationData.DeserializeSecurityApplicationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityApplicationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string applicationId, SecurityApplicationData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/applications/", false); - uri.AppendPath(applicationId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or update a security application on the given subscription. - /// Azure subscription ID. - /// The security Application key - unique key for the standard application. - /// Application over a subscription scope. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string applicationId, SecurityApplicationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, applicationId, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - SecurityApplicationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityApplicationData.DeserializeSecurityApplicationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or update a security application on the given subscription. - /// Azure subscription ID. - /// The security Application key - unique key for the standard application. - /// Application over a subscription scope. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string applicationId, SecurityApplicationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, applicationId, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - SecurityApplicationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityApplicationData.DeserializeSecurityApplicationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string applicationId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/applications/", false); - uri.AppendPath(applicationId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// Delete an Application over a given scope. - /// Azure subscription ID. - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string applicationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - - using var message = CreateDeleteRequest(subscriptionId, applicationId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete an Application over a given scope. - /// Azure subscription ID. - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string applicationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - - using var message = CreateDeleteRequest(subscriptionId, applicationId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ApplicationsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ApplicationsRestOperations.cs deleted file mode 100644 index 3fbb61277fed..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ApplicationsRestOperations.cs +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class ApplicationsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ApplicationsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ApplicationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-07-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/applications", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a list of all relevant applications over a subscription level scope. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApplicationsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApplicationsList.DeserializeApplicationsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a list of all relevant applications over a subscription level scope. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApplicationsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApplicationsList.DeserializeApplicationsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a list of all relevant applications over a subscription level scope. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApplicationsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApplicationsList.DeserializeApplicationsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a list of all relevant applications over a subscription level scope. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApplicationsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApplicationsList.DeserializeApplicationsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AssessmentsMetadataRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AssessmentsMetadataRestOperations.cs deleted file mode 100644 index 418f6fc8f3a7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AssessmentsMetadataRestOperations.cs +++ /dev/null @@ -1,580 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class AssessmentsMetadataRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of AssessmentsMetadataRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public AssessmentsMetadataRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/providers/Microsoft.Security/assessmentMetadata", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get metadata information on all assessment types. - /// The cancellation token to use. - public async Task> ListAsync(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentMetadataResponseList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAssessmentMetadataResponseList.DeserializeSecurityAssessmentMetadataResponseList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get metadata information on all assessment types. - /// The cancellation token to use. - public Response List(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentMetadataResponseList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAssessmentMetadataResponseList.DeserializeSecurityAssessmentMetadataResponseList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string assessmentMetadataName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/providers/Microsoft.Security/assessmentMetadata/", false); - uri.AppendPath(assessmentMetadataName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get metadata information on an assessment type. - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string assessmentMetadataName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - - using var message = CreateGetRequest(assessmentMetadataName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentMetadataData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAssessmentMetadataData.DeserializeSecurityAssessmentMetadataData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityAssessmentMetadataData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get metadata information on an assessment type. - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response Get(string assessmentMetadataName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - - using var message = CreateGetRequest(assessmentMetadataName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentMetadataData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAssessmentMetadataData.DeserializeSecurityAssessmentMetadataData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityAssessmentMetadataData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/assessmentMetadata", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get metadata information on all assessment types in a specific subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentMetadataResponseList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAssessmentMetadataResponseList.DeserializeSecurityAssessmentMetadataResponseList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get metadata information on all assessment types in a specific subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentMetadataResponseList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAssessmentMetadataResponseList.DeserializeSecurityAssessmentMetadataResponseList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetInSubscriptionRequest(string subscriptionId, string assessmentMetadataName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/assessmentMetadata/", false); - uri.AppendPath(assessmentMetadataName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get metadata information on an assessment type in a specific subscription. - /// Azure subscription ID. - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetInSubscriptionAsync(string subscriptionId, string assessmentMetadataName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - - using var message = CreateGetInSubscriptionRequest(subscriptionId, assessmentMetadataName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentMetadataData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAssessmentMetadataData.DeserializeSecurityAssessmentMetadataData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityAssessmentMetadataData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get metadata information on an assessment type in a specific subscription. - /// Azure subscription ID. - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response GetInSubscription(string subscriptionId, string assessmentMetadataName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - - using var message = CreateGetInSubscriptionRequest(subscriptionId, assessmentMetadataName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentMetadataData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAssessmentMetadataData.DeserializeSecurityAssessmentMetadataData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityAssessmentMetadataData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateInSubscriptionRequest(string subscriptionId, string assessmentMetadataName, SecurityAssessmentMetadataData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/assessmentMetadata/", false); - uri.AppendPath(assessmentMetadataName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Create metadata information on an assessment type in a specific subscription. - /// Azure subscription ID. - /// The Assessment Key - Unique key for the assessment type. - /// AssessmentMetadata object. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> CreateInSubscriptionAsync(string subscriptionId, string assessmentMetadataName, SecurityAssessmentMetadataData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateInSubscriptionRequest(subscriptionId, assessmentMetadataName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentMetadataData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAssessmentMetadataData.DeserializeSecurityAssessmentMetadataData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create metadata information on an assessment type in a specific subscription. - /// Azure subscription ID. - /// The Assessment Key - Unique key for the assessment type. - /// AssessmentMetadata object. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response CreateInSubscription(string subscriptionId, string assessmentMetadataName, SecurityAssessmentMetadataData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateInSubscriptionRequest(subscriptionId, assessmentMetadataName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentMetadataData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAssessmentMetadataData.DeserializeSecurityAssessmentMetadataData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteInSubscriptionRequest(string subscriptionId, string assessmentMetadataName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/assessmentMetadata/", false); - uri.AppendPath(assessmentMetadataName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the assessments of that type in that subscription. - /// Azure subscription ID. - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task DeleteInSubscriptionAsync(string subscriptionId, string assessmentMetadataName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - - using var message = CreateDeleteInSubscriptionRequest(subscriptionId, assessmentMetadataName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the assessments of that type in that subscription. - /// Azure subscription ID. - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response DeleteInSubscription(string subscriptionId, string assessmentMetadataName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - - using var message = CreateDeleteInSubscriptionRequest(subscriptionId, assessmentMetadataName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get metadata information on all assessment types. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - - using var message = CreateListNextPageRequest(nextLink); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentMetadataResponseList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAssessmentMetadataResponseList.DeserializeSecurityAssessmentMetadataResponseList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get metadata information on all assessment types. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - - using var message = CreateListNextPageRequest(nextLink); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentMetadataResponseList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAssessmentMetadataResponseList.DeserializeSecurityAssessmentMetadataResponseList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get metadata information on all assessment types in a specific subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentMetadataResponseList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAssessmentMetadataResponseList.DeserializeSecurityAssessmentMetadataResponseList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get metadata information on all assessment types in a specific subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentMetadataResponseList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAssessmentMetadataResponseList.DeserializeSecurityAssessmentMetadataResponseList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AssessmentsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AssessmentsRestOperations.cs deleted file mode 100644 index d9a1d3ee7eba..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AssessmentsRestOperations.cs +++ /dev/null @@ -1,399 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class AssessmentsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of AssessmentsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public AssessmentsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-06-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string scope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(scope, false); - uri.AppendPath("/providers/Microsoft.Security/assessments", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get security assessments on all your scanned resources inside a scope. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The cancellation token to use. - /// is null. - public async Task> ListAsync(string scope, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - - using var message = CreateListRequest(scope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAssessmentList.DeserializeSecurityAssessmentList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get security assessments on all your scanned resources inside a scope. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The cancellation token to use. - /// is null. - public Response List(string scope, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - - using var message = CreateListRequest(scope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAssessmentList.DeserializeSecurityAssessmentList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string resourceId, string assessmentName, SecurityAssessmentODataExpand? expand) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/assessments/", false); - uri.AppendPath(assessmentName, true); - uri.AppendQuery("api-version", _apiVersion, true); - if (expand != null) - { - uri.AppendQuery("$expand", expand.Value.ToString(), true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a security assessment on your scanned resource. - /// The identifier of the resource. - /// The Assessment Key - Unique key for the assessment type. - /// OData expand. Optional. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string resourceId, string assessmentName, SecurityAssessmentODataExpand? expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - - using var message = CreateGetRequest(resourceId, assessmentName, expand); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAssessmentData.DeserializeSecurityAssessmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityAssessmentData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a security assessment on your scanned resource. - /// The identifier of the resource. - /// The Assessment Key - Unique key for the assessment type. - /// OData expand. Optional. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response Get(string resourceId, string assessmentName, SecurityAssessmentODataExpand? expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - - using var message = CreateGetRequest(resourceId, assessmentName, expand); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAssessmentData.DeserializeSecurityAssessmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityAssessmentData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string resourceId, string assessmentName, SecurityAssessmentCreateOrUpdateContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/assessments/", false); - uri.AppendPath(assessmentName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Create a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result. - /// The identifier of the resource. - /// The Assessment Key - Unique key for the assessment type. - /// Calculated assessment on a pre-defined assessment metadata. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string resourceId, string assessmentName, SecurityAssessmentCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateOrUpdateRequest(resourceId, assessmentName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - SecurityAssessmentData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAssessmentData.DeserializeSecurityAssessmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result. - /// The identifier of the resource. - /// The Assessment Key - Unique key for the assessment type. - /// Calculated assessment on a pre-defined assessment metadata. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string resourceId, string assessmentName, SecurityAssessmentCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateOrUpdateRequest(resourceId, assessmentName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - SecurityAssessmentData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAssessmentData.DeserializeSecurityAssessmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string resourceId, string assessmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/assessments/", false); - uri.AppendPath(assessmentName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Delete a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result. - /// The identifier of the resource. - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string resourceId, string assessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - - using var message = CreateDeleteRequest(resourceId, assessmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result. - /// The identifier of the resource. - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response Delete(string resourceId, string assessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - - using var message = CreateDeleteRequest(resourceId, assessmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string scope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get security assessments on all your scanned resources inside a scope. - /// The URL to the next page of results. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The cancellation token to use. - /// or is null. - public async Task> ListNextPageAsync(string nextLink, string scope, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(scope, nameof(scope)); - - using var message = CreateListNextPageRequest(nextLink, scope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAssessmentList.DeserializeSecurityAssessmentList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get security assessments on all your scanned resources inside a scope. - /// The URL to the next page of results. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The cancellation token to use. - /// or is null. - public Response ListNextPage(string nextLink, string scope, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(scope, nameof(scope)); - - using var message = CreateListNextPageRequest(nextLink, scope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityAssessmentList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAssessmentList.DeserializeSecurityAssessmentList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/CustomEntityStoreAssignmentsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AssignmentsRestOperations.cs similarity index 65% rename from sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/CustomEntityStoreAssignmentsRestOperations.cs rename to sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AssignmentsRestOperations.cs index a4b920c4473a..ec8666960cd7 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/CustomEntityStoreAssignmentsRestOperations.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AssignmentsRestOperations.cs @@ -16,28 +16,28 @@ namespace Azure.ResourceManager.SecurityCenter { - internal partial class CustomEntityStoreAssignmentsRestOperations + internal partial class AssignmentsRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of CustomEntityStoreAssignmentsRestOperations. + /// Initializes a new instance of AssignmentsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. /// server parameter. /// Api Version. /// or is null. - public CustomEntityStoreAssignmentsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public AssignmentsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-07-01-preview"; + _apiVersion = apiVersion ?? "2021-08-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string customEntityStoreAssignmentName) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -46,10 +46,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourcegroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/customEntityStoreAssignments/", false); - uri.AppendPath(customEntityStoreAssignmentName, true); + uri.AppendPath("/providers/Microsoft.Security/assignments", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -57,117 +54,95 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Gets a single custom entity store assignment by name for the provided subscription and resource group. + /// Get a list of all relevant standardAssignments over a subscription level scope. /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// Name of the custom entity store assignment. Generated name is GUID. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string customEntityStoreAssignmentName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(customEntityStoreAssignmentName, nameof(customEntityStoreAssignmentName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, customEntityStoreAssignmentName); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - CustomEntityStoreAssignmentData value = default; + AssignmentList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CustomEntityStoreAssignmentData.DeserializeCustomEntityStoreAssignmentData(document.RootElement); + value = AssignmentList.DeserializeAssignmentList(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((CustomEntityStoreAssignmentData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets a single custom entity store assignment by name for the provided subscription and resource group. + /// Get a list of all relevant standardAssignments over a subscription level scope. /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// Name of the custom entity store assignment. Generated name is GUID. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string customEntityStoreAssignmentName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(customEntityStoreAssignmentName, nameof(customEntityStoreAssignmentName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, customEntityStoreAssignmentName); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - CustomEntityStoreAssignmentData value = default; + AssignmentList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CustomEntityStoreAssignmentData.DeserializeCustomEntityStoreAssignmentData(document.RootElement); + value = AssignmentList.DeserializeAssignmentList(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((CustomEntityStoreAssignmentData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string customEntityStoreAssignmentName, CustomEntityStoreAssignmentCreateOrUpdateContent content) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourcegroups/", false); + uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/customEntityStoreAssignments/", false); - uri.AppendPath(customEntityStoreAssignmentName, true); + uri.AppendPath("/providers/Microsoft.Security/assignments", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content); - request.Content = content0; _userAgent.Apply(message); return message; } - /// Creates a custom entity store assignment for the provided subscription, if not already exists. + /// Get a list of all relevant standardAssignments available for scope. /// Azure subscription ID. /// The name of the resource group within the user's subscription. The name is case insensitive. - /// Name of the custom entity store assignment. Generated name is GUID. - /// Custom entity store assignment body. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string customEntityStoreAssignmentName, CustomEntityStoreAssignmentCreateOrUpdateContent content, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(customEntityStoreAssignmentName, nameof(customEntityStoreAssignmentName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, customEntityStoreAssignmentName, content); + using var message = CreateListRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: { - CustomEntityStoreAssignmentData value = default; + AssignmentList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CustomEntityStoreAssignmentData.DeserializeCustomEntityStoreAssignmentData(document.RootElement); + value = AssignmentList.DeserializeAssignmentList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -175,31 +150,26 @@ public async Task> CreateAsync(string } } - /// Creates a custom entity store assignment for the provided subscription, if not already exists. + /// Get a list of all relevant standardAssignments available for scope. /// Azure subscription ID. /// The name of the resource group within the user's subscription. The name is case insensitive. - /// Name of the custom entity store assignment. Generated name is GUID. - /// Custom entity store assignment body. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string customEntityStoreAssignmentName, CustomEntityStoreAssignmentCreateOrUpdateContent content, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(customEntityStoreAssignmentName, nameof(customEntityStoreAssignmentName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, customEntityStoreAssignmentName, content); + using var message = CreateListRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: { - CustomEntityStoreAssignmentData value = default; + AssignmentList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CustomEntityStoreAssignmentData.DeserializeCustomEntityStoreAssignmentData(document.RootElement); + value = AssignmentList.DeserializeAssignmentList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -207,19 +177,19 @@ public Response Create(string subscriptionId, s } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string customEntityStoreAssignmentName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string assignmentId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourcegroups/", false); + uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/customEntityStoreAssignments/", false); - uri.AppendPath(customEntityStoreAssignmentName, true); + uri.AppendPath("/providers/Microsoft.Security/assignments/", false); + uri.AppendPath(assignmentId, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -227,95 +197,117 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Delete a custom entity store assignment by name for a provided subscription. + /// Get a specific standard assignment for the requested scope by resourceId. /// Azure subscription ID. /// The name of the resource group within the user's subscription. The name is case insensitive. - /// Name of the custom entity store assignment. Generated name is GUID. + /// The security assignment key - unique key for the standard assignment. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string customEntityStoreAssignmentName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string assignmentId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(customEntityStoreAssignmentName, nameof(customEntityStoreAssignmentName)); + Argument.AssertNotNullOrEmpty(assignmentId, nameof(assignmentId)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, customEntityStoreAssignmentName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, assignmentId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + AssignmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AssignmentData.DeserializeAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AssignmentData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Delete a custom entity store assignment by name for a provided subscription. + /// Get a specific standard assignment for the requested scope by resourceId. /// Azure subscription ID. /// The name of the resource group within the user's subscription. The name is case insensitive. - /// Name of the custom entity store assignment. Generated name is GUID. + /// The security assignment key - unique key for the standard assignment. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string customEntityStoreAssignmentName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string assignmentId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(customEntityStoreAssignmentName, nameof(customEntityStoreAssignmentName)); + Argument.AssertNotNullOrEmpty(assignmentId, nameof(assignmentId)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, customEntityStoreAssignmentName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, assignmentId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + AssignmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AssignmentData.DeserializeAssignmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AssignmentData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string assignmentId, AssignmentData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourcegroups/", false); + uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/customEntityStoreAssignments", false); + uri.AppendPath("/providers/Microsoft.Security/assignments/", false); + uri.AppendPath(assignmentId, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; _userAgent.Apply(message); return message; } - /// List custom entity store assignments by a provided subscription and resource group. + /// Create a security assignment on the given scope. Will create/update the required standard assignment. /// Azure subscription ID. /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The security assignment key - unique key for the standard assignment. + /// Custom standard assignment over a pre-defined scope. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string assignmentId, AssignmentData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(assignmentId, nameof(assignmentId)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, assignmentId, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: + case 201: { - CustomEntityStoreAssignmentsListResult value = default; + AssignmentData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CustomEntityStoreAssignmentsListResult.DeserializeCustomEntityStoreAssignmentsListResult(document.RootElement); + value = AssignmentData.DeserializeAssignmentData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -323,26 +315,31 @@ public async Task> ListByResour } } - /// List custom entity store assignments by a provided subscription and resource group. + /// Create a security assignment on the given scope. Will create/update the required standard assignment. /// Azure subscription ID. /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The security assignment key - unique key for the standard assignment. + /// Custom standard assignment over a pre-defined scope. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string assignmentId, AssignmentData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(assignmentId, nameof(assignmentId)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, assignmentId, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: + case 201: { - CustomEntityStoreAssignmentsListResult value = default; + AssignmentData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CustomEntityStoreAssignmentsListResult.DeserializeCustomEntityStoreAssignmentsListResult(document.RootElement); + value = AssignmentData.DeserializeAssignmentData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -350,74 +347,76 @@ public Response ListByResourceGroup(stri } } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string assignmentId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/customEntityStoreAssignments", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Security/assignments/", false); + uri.AppendPath(assignmentId, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; - request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// List custom entity store assignments by provided subscription. + /// Delete a standard assignment over a given scope. /// Azure subscription ID. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The security assignment key - unique key for the standard assignment. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string assignmentId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(assignmentId, nameof(assignmentId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, assignmentId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - CustomEntityStoreAssignmentsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CustomEntityStoreAssignmentsListResult.DeserializeCustomEntityStoreAssignmentsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// List custom entity store assignments by provided subscription. + /// Delete a standard assignment over a given scope. /// Azure subscription ID. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The security assignment key - unique key for the standard assignment. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string assignmentId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(assignmentId, nameof(assignmentId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, assignmentId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - CustomEntityStoreAssignmentsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CustomEntityStoreAssignmentsListResult.DeserializeCustomEntityStoreAssignmentsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -431,28 +430,26 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// List custom entity store assignments by a provided subscription and resource group. + /// Get a list of all relevant standardAssignments over a subscription level scope. /// The URL to the next page of results. /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - CustomEntityStoreAssignmentsListResult value = default; + AssignmentList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CustomEntityStoreAssignmentsListResult.DeserializeCustomEntityStoreAssignmentsListResult(document.RootElement); + value = AssignmentList.DeserializeAssignmentList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -460,28 +457,26 @@ public async Task> ListByResour } } - /// List custom entity store assignments by a provided subscription and resource group. + /// Get a list of all relevant standardAssignments over a subscription level scope. /// The URL to the next page of results. /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - CustomEntityStoreAssignmentsListResult value = default; + AssignmentList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CustomEntityStoreAssignmentsListResult.DeserializeCustomEntityStoreAssignmentsListResult(document.RootElement); + value = AssignmentList.DeserializeAssignmentList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -489,7 +484,7 @@ public Response ListByResourceGroupNextP } } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -503,26 +498,28 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st return message; } - /// List custom entity store assignments by provided subscription. + /// Get a list of all relevant standardAssignments available for scope. /// The URL to the next page of results. /// Azure subscription ID. + /// The name of the resource group within the user's subscription. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - CustomEntityStoreAssignmentsListResult value = default; + AssignmentList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CustomEntityStoreAssignmentsListResult.DeserializeCustomEntityStoreAssignmentsListResult(document.RootElement); + value = AssignmentList.DeserializeAssignmentList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -530,26 +527,28 @@ public async Task> ListBySubscr } } - /// List custom entity store assignments by provided subscription. + /// Get a list of all relevant standardAssignments available for scope. /// The URL to the next page of results. /// Azure subscription ID. + /// The name of the resource group within the user's subscription. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - CustomEntityStoreAssignmentsListResult value = default; + AssignmentList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CustomEntityStoreAssignmentsListResult.DeserializeCustomEntityStoreAssignmentsListResult(document.RootElement); + value = AssignmentList.DeserializeAssignmentList(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AutoProvisioningSettingsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AutoProvisioningSettingsRestOperations.cs deleted file mode 100644 index 1babe5cfdff8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AutoProvisioningSettingsRestOperations.cs +++ /dev/null @@ -1,331 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class AutoProvisioningSettingsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of AutoProvisioningSettingsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public AutoProvisioningSettingsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2017-08-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/autoProvisioningSettings", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Exposes the auto provisioning settings of the subscriptions. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AutoProvisioningSettingList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AutoProvisioningSettingList.DeserializeAutoProvisioningSettingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Exposes the auto provisioning settings of the subscriptions. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AutoProvisioningSettingList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AutoProvisioningSettingList.DeserializeAutoProvisioningSettingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string settingName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/autoProvisioningSettings/", false); - uri.AppendPath(settingName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Details of a specific setting. - /// Azure subscription ID. - /// Auto provisioning setting key. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string settingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(settingName, nameof(settingName)); - - using var message = CreateGetRequest(subscriptionId, settingName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AutoProvisioningSettingData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AutoProvisioningSettingData.DeserializeAutoProvisioningSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((AutoProvisioningSettingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Details of a specific setting. - /// Azure subscription ID. - /// Auto provisioning setting key. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string settingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(settingName, nameof(settingName)); - - using var message = CreateGetRequest(subscriptionId, settingName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AutoProvisioningSettingData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AutoProvisioningSettingData.DeserializeAutoProvisioningSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((AutoProvisioningSettingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateRequest(string subscriptionId, string settingName, AutoProvisioningSettingData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/autoProvisioningSettings/", false); - uri.AppendPath(settingName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Details of a specific setting. - /// Azure subscription ID. - /// Auto provisioning setting key. - /// Auto provisioning setting key. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> CreateAsync(string subscriptionId, string settingName, AutoProvisioningSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(settingName, nameof(settingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, settingName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AutoProvisioningSettingData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AutoProvisioningSettingData.DeserializeAutoProvisioningSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Details of a specific setting. - /// Azure subscription ID. - /// Auto provisioning setting key. - /// Auto provisioning setting key. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string settingName, AutoProvisioningSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(settingName, nameof(settingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, settingName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AutoProvisioningSettingData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AutoProvisioningSettingData.DeserializeAutoProvisioningSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Exposes the auto provisioning settings of the subscriptions. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AutoProvisioningSettingList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AutoProvisioningSettingList.DeserializeAutoProvisioningSettingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Exposes the auto provisioning settings of the subscriptions. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AutoProvisioningSettingList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AutoProvisioningSettingList.DeserializeAutoProvisioningSettingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AutomationsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AutomationsRestOperations.cs deleted file mode 100644 index a162604e019b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/AutomationsRestOperations.cs +++ /dev/null @@ -1,645 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class AutomationsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of AutomationsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public AutomationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-01-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/automations", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to get the next page of security automations for the specified subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AutomationList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AutomationList.DeserializeAutomationList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to get the next page of security automations for the specified subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AutomationList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AutomationList.DeserializeAutomationList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/automations", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response to get the next page of security automations for the specified resource group. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AutomationList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AutomationList.DeserializeAutomationList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response to get the next page of security automations for the specified resource group. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AutomationList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AutomationList.DeserializeAutomationList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string automationName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/automations/", false); - uri.AppendPath(automationName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Retrieves information about the model of a security automation. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security automation name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string automationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(automationName, nameof(automationName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, automationName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityAutomationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAutomationData.DeserializeSecurityAutomationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityAutomationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieves information about the model of a security automation. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security automation name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string automationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(automationName, nameof(automationName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, automationName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityAutomationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAutomationData.DeserializeSecurityAutomationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityAutomationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string automationName, SecurityAutomationData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/automations/", false); - uri.AppendPath(automationName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or updates a security automation. If a security automation is already created and a subsequent request is issued for the same automation id, then it will be updated. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security automation name. - /// The security automation resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string automationName, SecurityAutomationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(automationName, nameof(automationName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, automationName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - SecurityAutomationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAutomationData.DeserializeSecurityAutomationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates a security automation. If a security automation is already created and a subsequent request is issued for the same automation id, then it will be updated. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security automation name. - /// The security automation resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string automationName, SecurityAutomationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(automationName, nameof(automationName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, automationName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - SecurityAutomationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAutomationData.DeserializeSecurityAutomationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string automationName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/automations/", false); - uri.AppendPath(automationName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes a security automation. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security automation name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string automationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(automationName, nameof(automationName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, automationName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes a security automation. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security automation name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string automationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(automationName, nameof(automationName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, automationName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateValidateRequest(string subscriptionId, string resourceGroupName, string automationName, SecurityAutomationData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/automations/", false); - uri.AppendPath(automationName, true); - uri.AppendPath("/validate", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Validates the security automation model before create or update. Any validation errors are returned to the client. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security automation name. - /// The security automation resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ValidateAsync(string subscriptionId, string resourceGroupName, string automationName, SecurityAutomationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(automationName, nameof(automationName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateValidateRequest(subscriptionId, resourceGroupName, automationName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityAutomationValidationStatus value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityAutomationValidationStatus.DeserializeSecurityAutomationValidationStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Validates the security automation model before create or update. Any validation errors are returned to the client. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security automation name. - /// The security automation resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Validate(string subscriptionId, string resourceGroupName, string automationName, SecurityAutomationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(automationName, nameof(automationName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateValidateRequest(subscriptionId, resourceGroupName, automationName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityAutomationValidationStatus value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityAutomationValidationStatus.DeserializeSecurityAutomationValidationStatus(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to get the next page of security automations for the specified subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AutomationList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AutomationList.DeserializeAutomationList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response to get the next page of security automations for the specified subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AutomationList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AutomationList.DeserializeAutomationList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response to get the next page of security automations for the specified resource group. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AutomationList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AutomationList.DeserializeAutomationList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response to get the next page of security automations for the specified resource group. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AutomationList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AutomationList.DeserializeAutomationList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ComplianceResultsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ComplianceResultsRestOperations.cs deleted file mode 100644 index d61fd3957a5c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ComplianceResultsRestOperations.cs +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class ComplianceResultsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ComplianceResultsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ComplianceResultsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2017-08-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string scope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(scope, false); - uri.AppendPath("/providers/Microsoft.Security/complianceResults", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Security compliance results in the subscription. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The cancellation token to use. - /// is null. - public async Task> ListAsync(string scope, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - - using var message = CreateListRequest(scope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ComplianceResultList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ComplianceResultList.DeserializeComplianceResultList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Security compliance results in the subscription. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The cancellation token to use. - /// is null. - public Response List(string scope, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - - using var message = CreateListRequest(scope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ComplianceResultList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ComplianceResultList.DeserializeComplianceResultList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string resourceId, string complianceResultName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/complianceResults/", false); - uri.AppendPath(complianceResultName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Security Compliance Result. - /// The identifier of the resource. - /// name of the desired assessment compliance result. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string resourceId, string complianceResultName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(complianceResultName, nameof(complianceResultName)); - - using var message = CreateGetRequest(resourceId, complianceResultName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ComplianceResultData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ComplianceResultData.DeserializeComplianceResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ComplianceResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Security Compliance Result. - /// The identifier of the resource. - /// name of the desired assessment compliance result. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response Get(string resourceId, string complianceResultName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(complianceResultName, nameof(complianceResultName)); - - using var message = CreateGetRequest(resourceId, complianceResultName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ComplianceResultData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ComplianceResultData.DeserializeComplianceResultData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ComplianceResultData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string scope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Security compliance results in the subscription. - /// The URL to the next page of results. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The cancellation token to use. - /// or is null. - public async Task> ListNextPageAsync(string nextLink, string scope, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(scope, nameof(scope)); - - using var message = CreateListNextPageRequest(nextLink, scope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ComplianceResultList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ComplianceResultList.DeserializeComplianceResultList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Security compliance results in the subscription. - /// The URL to the next page of results. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The cancellation token to use. - /// or is null. - public Response ListNextPage(string nextLink, string scope, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(scope, nameof(scope)); - - using var message = CreateListNextPageRequest(nextLink, scope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ComplianceResultList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ComplianceResultList.DeserializeComplianceResultList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/CompliancesRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/CompliancesRestOperations.cs deleted file mode 100644 index 781faeb4a23f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/CompliancesRestOperations.cs +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class CompliancesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of CompliancesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public CompliancesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2017-08-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string scope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(scope, false); - uri.AppendPath("/providers/Microsoft.Security/compliances", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The Compliance scores of the specific management group. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The cancellation token to use. - /// is null. - public async Task> ListAsync(string scope, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - - using var message = CreateListRequest(scope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ComplianceList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ComplianceList.DeserializeComplianceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The Compliance scores of the specific management group. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The cancellation token to use. - /// is null. - public Response List(string scope, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - - using var message = CreateListRequest(scope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ComplianceList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ComplianceList.DeserializeComplianceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string scope, string complianceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(scope, false); - uri.AppendPath("/providers/Microsoft.Security/compliances/", false); - uri.AppendPath(complianceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Details of a specific Compliance. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// name of the Compliance. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string scope, string complianceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(complianceName, nameof(complianceName)); - - using var message = CreateGetRequest(scope, complianceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityComplianceData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityComplianceData.DeserializeSecurityComplianceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityComplianceData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Details of a specific Compliance. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// name of the Compliance. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response Get(string scope, string complianceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(complianceName, nameof(complianceName)); - - using var message = CreateGetRequest(scope, complianceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityComplianceData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityComplianceData.DeserializeSecurityComplianceData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityComplianceData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string scope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The Compliance scores of the specific management group. - /// The URL to the next page of results. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The cancellation token to use. - /// or is null. - public async Task> ListNextPageAsync(string nextLink, string scope, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(scope, nameof(scope)); - - using var message = CreateListNextPageRequest(nextLink, scope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ComplianceList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ComplianceList.DeserializeComplianceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The Compliance scores of the specific management group. - /// The URL to the next page of results. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The cancellation token to use. - /// or is null. - public Response ListNextPage(string nextLink, string scope, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(scope, nameof(scope)); - - using var message = CreateListNextPageRequest(nextLink, scope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ComplianceList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ComplianceList.DeserializeComplianceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ConnectorsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ConnectorsRestOperations.cs deleted file mode 100644 index 84fa1c325f06..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ConnectorsRestOperations.cs +++ /dev/null @@ -1,395 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class ConnectorsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ConnectorsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ConnectorsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/connectors", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Cloud accounts connectors of a subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ConnectorSettingList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ConnectorSettingList.DeserializeConnectorSettingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Cloud accounts connectors of a subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ConnectorSettingList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ConnectorSettingList.DeserializeConnectorSettingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string connectorName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/connectors/", false); - uri.AppendPath(connectorName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Details of a specific cloud account connector. - /// Azure subscription ID. - /// Name of the cloud account connector. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string connectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); - - using var message = CreateGetRequest(subscriptionId, connectorName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityCloudConnectorData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityCloudConnectorData.DeserializeSecurityCloudConnectorData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityCloudConnectorData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Details of a specific cloud account connector. - /// Azure subscription ID. - /// Name of the cloud account connector. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string connectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); - - using var message = CreateGetRequest(subscriptionId, connectorName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityCloudConnectorData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityCloudConnectorData.DeserializeSecurityCloudConnectorData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityCloudConnectorData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string connectorName, SecurityCloudConnectorData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/connectors/", false); - uri.AppendPath(connectorName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either account credentials or role-based authentication. For GCP, use account organization credentials. - /// Azure subscription ID. - /// Name of the cloud account connector. - /// Settings for the cloud account connector. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string connectorName, SecurityCloudConnectorData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, connectorName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityCloudConnectorData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityCloudConnectorData.DeserializeSecurityCloudConnectorData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either account credentials or role-based authentication. For GCP, use account organization credentials. - /// Azure subscription ID. - /// Name of the cloud account connector. - /// Settings for the cloud account connector. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string connectorName, SecurityCloudConnectorData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, connectorName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityCloudConnectorData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityCloudConnectorData.DeserializeSecurityCloudConnectorData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string connectorName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/connectors/", false); - uri.AppendPath(connectorName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Delete a cloud account connector from a subscription. - /// Azure subscription ID. - /// Name of the cloud account connector. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string connectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); - - using var message = CreateDeleteRequest(subscriptionId, connectorName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete a cloud account connector from a subscription. - /// Azure subscription ID. - /// Name of the cloud account connector. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string connectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); - - using var message = CreateDeleteRequest(subscriptionId, connectorName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Cloud accounts connectors of a subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ConnectorSettingList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ConnectorSettingList.DeserializeConnectorSettingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Cloud accounts connectors of a subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ConnectorSettingList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ConnectorSettingList.DeserializeConnectorSettingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/DeviceSecurityGroupsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/DeviceSecurityGroupsRestOperations.cs deleted file mode 100644 index 522d203fd5e5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/DeviceSecurityGroupsRestOperations.cs +++ /dev/null @@ -1,393 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class DeviceSecurityGroupsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of DeviceSecurityGroupsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public DeviceSecurityGroupsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-08-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string resourceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/deviceSecurityGroups", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Use this method get the list of device security groups for the specified IoT Hub resource. - /// The identifier of the resource. - /// The cancellation token to use. - /// is null. - public async Task> ListAsync(string resourceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - - using var message = CreateListRequest(resourceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeviceSecurityGroupList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeviceSecurityGroupList.DeserializeDeviceSecurityGroupList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method get the list of device security groups for the specified IoT Hub resource. - /// The identifier of the resource. - /// The cancellation token to use. - /// is null. - public Response List(string resourceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - - using var message = CreateListRequest(resourceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeviceSecurityGroupList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeviceSecurityGroupList.DeserializeDeviceSecurityGroupList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string resourceId, string deviceSecurityGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/deviceSecurityGroups/", false); - uri.AppendPath(deviceSecurityGroupName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Use this method to get the device security group for the specified IoT Hub resource. - /// The identifier of the resource. - /// The name of the device security group. Note that the name of the device security group is case insensitive. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string resourceId, string deviceSecurityGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(deviceSecurityGroupName, nameof(deviceSecurityGroupName)); - - using var message = CreateGetRequest(resourceId, deviceSecurityGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeviceSecurityGroupData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeviceSecurityGroupData.DeserializeDeviceSecurityGroupData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DeviceSecurityGroupData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to get the device security group for the specified IoT Hub resource. - /// The identifier of the resource. - /// The name of the device security group. Note that the name of the device security group is case insensitive. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response Get(string resourceId, string deviceSecurityGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(deviceSecurityGroupName, nameof(deviceSecurityGroupName)); - - using var message = CreateGetRequest(resourceId, deviceSecurityGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeviceSecurityGroupData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeviceSecurityGroupData.DeserializeDeviceSecurityGroupData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((DeviceSecurityGroupData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string resourceId, string deviceSecurityGroupName, DeviceSecurityGroupData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/deviceSecurityGroups/", false); - uri.AppendPath(deviceSecurityGroupName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Use this method to creates or updates the device security group on a specified IoT Hub resource. - /// The identifier of the resource. - /// The name of the device security group. Note that the name of the device security group is case insensitive. - /// Security group object. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string resourceId, string deviceSecurityGroupName, DeviceSecurityGroupData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(deviceSecurityGroupName, nameof(deviceSecurityGroupName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(resourceId, deviceSecurityGroupName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - DeviceSecurityGroupData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeviceSecurityGroupData.DeserializeDeviceSecurityGroupData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to creates or updates the device security group on a specified IoT Hub resource. - /// The identifier of the resource. - /// The name of the device security group. Note that the name of the device security group is case insensitive. - /// Security group object. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string resourceId, string deviceSecurityGroupName, DeviceSecurityGroupData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(deviceSecurityGroupName, nameof(deviceSecurityGroupName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(resourceId, deviceSecurityGroupName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - DeviceSecurityGroupData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeviceSecurityGroupData.DeserializeDeviceSecurityGroupData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string resourceId, string deviceSecurityGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/deviceSecurityGroups/", false); - uri.AppendPath(deviceSecurityGroupName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// User this method to deletes the device security group. - /// The identifier of the resource. - /// The name of the device security group. Note that the name of the device security group is case insensitive. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string resourceId, string deviceSecurityGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(deviceSecurityGroupName, nameof(deviceSecurityGroupName)); - - using var message = CreateDeleteRequest(resourceId, deviceSecurityGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// User this method to deletes the device security group. - /// The identifier of the resource. - /// The name of the device security group. Note that the name of the device security group is case insensitive. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response Delete(string resourceId, string deviceSecurityGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(deviceSecurityGroupName, nameof(deviceSecurityGroupName)); - - using var message = CreateDeleteRequest(resourceId, deviceSecurityGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string resourceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Use this method get the list of device security groups for the specified IoT Hub resource. - /// The URL to the next page of results. - /// The identifier of the resource. - /// The cancellation token to use. - /// or is null. - public async Task> ListNextPageAsync(string nextLink, string resourceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(resourceId, nameof(resourceId)); - - using var message = CreateListNextPageRequest(nextLink, resourceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DeviceSecurityGroupList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DeviceSecurityGroupList.DeserializeDeviceSecurityGroupList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method get the list of device security groups for the specified IoT Hub resource. - /// The URL to the next page of results. - /// The identifier of the resource. - /// The cancellation token to use. - /// or is null. - public Response ListNextPage(string nextLink, string resourceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(resourceId, nameof(resourceId)); - - using var message = CreateListNextPageRequest(nextLink, resourceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DeviceSecurityGroupList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DeviceSecurityGroupList.DeserializeDeviceSecurityGroupList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/DiscoveredSecuritySolutionsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/DiscoveredSecuritySolutionsRestOperations.cs deleted file mode 100644 index 9d38bd19e543..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/DiscoveredSecuritySolutionsRestOperations.cs +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class DiscoveredSecuritySolutionsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of DiscoveredSecuritySolutionsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public DiscoveredSecuritySolutionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/discoveredSecuritySolutions", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of discovered Security Solutions for the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiscoveredSecuritySolutionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiscoveredSecuritySolutionList.DeserializeDiscoveredSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of discovered Security Solutions for the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiscoveredSecuritySolutionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiscoveredSecuritySolutionList.DeserializeDiscoveredSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByHomeRegionRequest(string subscriptionId, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/discoveredSecuritySolutions", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of discovered Security Solutions for the subscription and location. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListByHomeRegionAsync(string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionRequest(subscriptionId, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiscoveredSecuritySolutionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiscoveredSecuritySolutionList.DeserializeDiscoveredSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of discovered Security Solutions for the subscription and location. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListByHomeRegion(string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionRequest(subscriptionId, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiscoveredSecuritySolutionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiscoveredSecuritySolutionList.DeserializeDiscoveredSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string discoveredSecuritySolutionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/discoveredSecuritySolutions/", false); - uri.AppendPath(discoveredSecuritySolutionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a specific discovered Security Solution. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a discovered security solution. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string discoveredSecuritySolutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredSecuritySolutionName, nameof(discoveredSecuritySolutionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, ascLocation, discoveredSecuritySolutionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiscoveredSecuritySolution value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiscoveredSecuritySolution.DeserializeDiscoveredSecuritySolution(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a specific discovered Security Solution. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a discovered security solution. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string discoveredSecuritySolutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(discoveredSecuritySolutionName, nameof(discoveredSecuritySolutionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, ascLocation, discoveredSecuritySolutionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiscoveredSecuritySolution value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiscoveredSecuritySolution.DeserializeDiscoveredSecuritySolution(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of discovered Security Solutions for the subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiscoveredSecuritySolutionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiscoveredSecuritySolutionList.DeserializeDiscoveredSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of discovered Security Solutions for the subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiscoveredSecuritySolutionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiscoveredSecuritySolutionList.DeserializeDiscoveredSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByHomeRegionNextPageRequest(string nextLink, string subscriptionId, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of discovered Security Solutions for the subscription and location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListByHomeRegionNextPageAsync(string nextLink, string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionNextPageRequest(nextLink, subscriptionId, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - DiscoveredSecuritySolutionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = DiscoveredSecuritySolutionList.DeserializeDiscoveredSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of discovered Security Solutions for the subscription and location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListByHomeRegionNextPage(string nextLink, string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionNextPageRequest(nextLink, subscriptionId, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - DiscoveredSecuritySolutionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = DiscoveredSecuritySolutionList.DeserializeDiscoveredSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ExternalSecuritySolutionsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ExternalSecuritySolutionsRestOperations.cs deleted file mode 100644 index 9872037c778e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ExternalSecuritySolutionsRestOperations.cs +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class ExternalSecuritySolutionsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ExternalSecuritySolutionsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ExternalSecuritySolutionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/externalSecuritySolutions", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of external security solutions for the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ExternalSecuritySolutionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ExternalSecuritySolutionList.DeserializeExternalSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of external security solutions for the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ExternalSecuritySolutionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ExternalSecuritySolutionList.DeserializeExternalSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByHomeRegionRequest(string subscriptionId, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/ExternalSecuritySolutions", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of external Security Solutions for the subscription and location. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListByHomeRegionAsync(string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionRequest(subscriptionId, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ExternalSecuritySolutionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ExternalSecuritySolutionList.DeserializeExternalSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of external Security Solutions for the subscription and location. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListByHomeRegion(string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionRequest(subscriptionId, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ExternalSecuritySolutionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ExternalSecuritySolutionList.DeserializeExternalSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string externalSecuritySolutionsName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/ExternalSecuritySolutions/", false); - uri.AppendPath(externalSecuritySolutionsName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a specific external Security Solution. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of an external security solution. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string externalSecuritySolutionsName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(externalSecuritySolutionsName, nameof(externalSecuritySolutionsName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, ascLocation, externalSecuritySolutionsName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ExternalSecuritySolution value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ExternalSecuritySolution.DeserializeExternalSecuritySolution(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a specific external Security Solution. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of an external security solution. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string externalSecuritySolutionsName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(externalSecuritySolutionsName, nameof(externalSecuritySolutionsName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, ascLocation, externalSecuritySolutionsName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ExternalSecuritySolution value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ExternalSecuritySolution.DeserializeExternalSecuritySolution(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of external security solutions for the subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ExternalSecuritySolutionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ExternalSecuritySolutionList.DeserializeExternalSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of external security solutions for the subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ExternalSecuritySolutionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ExternalSecuritySolutionList.DeserializeExternalSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByHomeRegionNextPageRequest(string nextLink, string subscriptionId, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of external Security Solutions for the subscription and location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListByHomeRegionNextPageAsync(string nextLink, string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionNextPageRequest(nextLink, subscriptionId, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ExternalSecuritySolutionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ExternalSecuritySolutionList.DeserializeExternalSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of external Security Solutions for the subscription and location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListByHomeRegionNextPage(string nextLink, string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionNextPageRequest(nextLink, subscriptionId, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ExternalSecuritySolutionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ExternalSecuritySolutionList.DeserializeExternalSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/GovernanceAssignmentsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/GovernanceAssignmentsRestOperations.cs deleted file mode 100644 index 63f067453f9a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/GovernanceAssignmentsRestOperations.cs +++ /dev/null @@ -1,424 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class GovernanceAssignmentsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of GovernanceAssignmentsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public GovernanceAssignmentsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-01-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string scope, string assessmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(scope, false); - uri.AppendPath("/providers/Microsoft.Security/assessments/", false); - uri.AppendPath(assessmentName, true); - uri.AppendPath("/governanceAssignments", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get security governanceAssignments on all your resources inside a scope. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string scope, string assessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - - using var message = CreateListRequest(scope, assessmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GovernanceAssignmentsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GovernanceAssignmentsList.DeserializeGovernanceAssignmentsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get security governanceAssignments on all your resources inside a scope. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string scope, string assessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - - using var message = CreateListRequest(scope, assessmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GovernanceAssignmentsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GovernanceAssignmentsList.DeserializeGovernanceAssignmentsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string scope, string assessmentName, string assignmentKey) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(scope, false); - uri.AppendPath("/providers/Microsoft.Security/assessments/", false); - uri.AppendPath(assessmentName, true); - uri.AppendPath("/governanceAssignments/", false); - uri.AppendPath(assignmentKey, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a specific governanceAssignment for the requested scope by AssignmentKey. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The Assessment Key - Unique key for the assessment type. - /// The security governance assignment key - the assessment key of the required governance assignment. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string scope, string assessmentName, string assignmentKey, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - Argument.AssertNotNullOrEmpty(assignmentKey, nameof(assignmentKey)); - - using var message = CreateGetRequest(scope, assessmentName, assignmentKey); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GovernanceAssignmentData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GovernanceAssignmentData.DeserializeGovernanceAssignmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((GovernanceAssignmentData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a specific governanceAssignment for the requested scope by AssignmentKey. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The Assessment Key - Unique key for the assessment type. - /// The security governance assignment key - the assessment key of the required governance assignment. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string scope, string assessmentName, string assignmentKey, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - Argument.AssertNotNullOrEmpty(assignmentKey, nameof(assignmentKey)); - - using var message = CreateGetRequest(scope, assessmentName, assignmentKey); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GovernanceAssignmentData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GovernanceAssignmentData.DeserializeGovernanceAssignmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((GovernanceAssignmentData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string scope, string assessmentName, string assignmentKey, GovernanceAssignmentData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(scope, false); - uri.AppendPath("/providers/Microsoft.Security/assessments/", false); - uri.AppendPath(assessmentName, true); - uri.AppendPath("/governanceAssignments/", false); - uri.AppendPath(assignmentKey, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or update a security GovernanceAssignment on the given subscription. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The Assessment Key - Unique key for the assessment type. - /// The security governance assignment key - the assessment key of the required governance assignment. - /// GovernanceAssignment over a subscription scope. - /// The cancellation token to use. - /// , , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string scope, string assessmentName, string assignmentKey, GovernanceAssignmentData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - Argument.AssertNotNullOrEmpty(assignmentKey, nameof(assignmentKey)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(scope, assessmentName, assignmentKey, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - GovernanceAssignmentData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GovernanceAssignmentData.DeserializeGovernanceAssignmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or update a security GovernanceAssignment on the given subscription. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The Assessment Key - Unique key for the assessment type. - /// The security governance assignment key - the assessment key of the required governance assignment. - /// GovernanceAssignment over a subscription scope. - /// The cancellation token to use. - /// , , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string scope, string assessmentName, string assignmentKey, GovernanceAssignmentData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - Argument.AssertNotNullOrEmpty(assignmentKey, nameof(assignmentKey)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(scope, assessmentName, assignmentKey, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - GovernanceAssignmentData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GovernanceAssignmentData.DeserializeGovernanceAssignmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string scope, string assessmentName, string assignmentKey) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(scope, false); - uri.AppendPath("/providers/Microsoft.Security/assessments/", false); - uri.AppendPath(assessmentName, true); - uri.AppendPath("/governanceAssignments/", false); - uri.AppendPath(assignmentKey, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// Delete a GovernanceAssignment over a given scope. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The Assessment Key - Unique key for the assessment type. - /// The security governance assignment key - the assessment key of the required governance assignment. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string scope, string assessmentName, string assignmentKey, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - Argument.AssertNotNullOrEmpty(assignmentKey, nameof(assignmentKey)); - - using var message = CreateDeleteRequest(scope, assessmentName, assignmentKey); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete a GovernanceAssignment over a given scope. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The Assessment Key - Unique key for the assessment type. - /// The security governance assignment key - the assessment key of the required governance assignment. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Delete(string scope, string assessmentName, string assignmentKey, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - Argument.AssertNotNullOrEmpty(assignmentKey, nameof(assignmentKey)); - - using var message = CreateDeleteRequest(scope, assessmentName, assignmentKey); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string scope, string assessmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get security governanceAssignments on all your resources inside a scope. - /// The URL to the next page of results. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string scope, string assessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - - using var message = CreateListNextPageRequest(nextLink, scope, assessmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GovernanceAssignmentsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GovernanceAssignmentsList.DeserializeGovernanceAssignmentsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get security governanceAssignments on all your resources inside a scope. - /// The URL to the next page of results. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string scope, string assessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - - using var message = CreateListNextPageRequest(nextLink, scope, assessmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GovernanceAssignmentsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GovernanceAssignmentsList.DeserializeGovernanceAssignmentsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/GovernanceRuleRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/GovernanceRuleRestOperations.cs deleted file mode 100644 index 9932b728538c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/GovernanceRuleRestOperations.cs +++ /dev/null @@ -1,175 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class GovernanceRuleRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of GovernanceRuleRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public GovernanceRuleRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-01-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/governanceRules", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a list of all relevant governanceRules over a subscription level scope. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GovernanceRuleList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GovernanceRuleList.DeserializeGovernanceRuleList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a list of all relevant governanceRules over a subscription level scope. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GovernanceRuleList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GovernanceRuleList.DeserializeGovernanceRuleList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a list of all relevant governanceRules over a subscription level scope. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GovernanceRuleList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GovernanceRuleList.DeserializeGovernanceRuleList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a list of all relevant governanceRules over a subscription level scope. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GovernanceRuleList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GovernanceRuleList.DeserializeGovernanceRuleList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/GovernanceRulesRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/GovernanceRulesRestOperations.cs deleted file mode 100644 index f15e6b0cf48f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/GovernanceRulesRestOperations.cs +++ /dev/null @@ -1,417 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class GovernanceRulesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of GovernanceRulesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public GovernanceRulesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-01-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string ruleId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/governanceRules/", false); - uri.AppendPath(ruleId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a specific governanceRule for the requested scope by ruleId. - /// Azure subscription ID. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string ruleId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var message = CreateGetRequest(subscriptionId, ruleId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GovernanceRuleData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GovernanceRuleData.DeserializeGovernanceRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((GovernanceRuleData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a specific governanceRule for the requested scope by ruleId. - /// Azure subscription ID. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string ruleId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var message = CreateGetRequest(subscriptionId, ruleId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GovernanceRuleData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GovernanceRuleData.DeserializeGovernanceRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((GovernanceRuleData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string ruleId, GovernanceRuleData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/governanceRules/", false); - uri.AppendPath(ruleId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or update a security GovernanceRule on the given subscription. - /// Azure subscription ID. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string ruleId, GovernanceRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, ruleId, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - GovernanceRuleData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GovernanceRuleData.DeserializeGovernanceRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or update a security GovernanceRule on the given subscription. - /// Azure subscription ID. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string ruleId, GovernanceRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, ruleId, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - GovernanceRuleData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GovernanceRuleData.DeserializeGovernanceRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string ruleId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/governanceRules/", false); - uri.AppendPath(ruleId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// Delete a GovernanceRule over a given scope. - /// Azure subscription ID. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string ruleId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var message = CreateDeleteRequest(subscriptionId, ruleId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete a GovernanceRule over a given scope. - /// Azure subscription ID. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string ruleId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var message = CreateDeleteRequest(subscriptionId, ruleId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRuleIdExecuteSingleSubscriptionRequest(string subscriptionId, string ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/governanceRules/", false); - uri.AppendPath(ruleId, true); - uri.AppendPath("/execute", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - if (executeGovernanceRuleParams != null) - { - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(executeGovernanceRuleParams); - request.Content = content; - } - _userAgent.Apply(message); - return message; - } - - /// Execute a security GovernanceRule on the given subscription. - /// Azure subscription ID. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task RuleIdExecuteSingleSubscriptionAsync(string subscriptionId, string ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var message = CreateRuleIdExecuteSingleSubscriptionRequest(subscriptionId, ruleId, executeGovernanceRuleParams); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Execute a security GovernanceRule on the given subscription. - /// Azure subscription ID. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response RuleIdExecuteSingleSubscription(string subscriptionId, string ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var message = CreateRuleIdExecuteSingleSubscriptionRequest(subscriptionId, ruleId, executeGovernanceRuleParams); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateRuleIdExecuteSingleSecurityConnectorRequest(string subscriptionId, string resourceGroupName, string securityConnectorName, string ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/securityConnectors/", false); - uri.AppendPath(securityConnectorName, true); - uri.AppendPath("/providers/Microsoft.Security/governanceRules/", false); - uri.AppendPath(ruleId, true); - uri.AppendPath("/execute", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - if (executeGovernanceRuleParams != null) - { - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(executeGovernanceRuleParams); - request.Content = content; - } - _userAgent.Apply(message); - return message; - } - - /// Execute a security GovernanceRule on the given security connector. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task RuleIdExecuteSingleSecurityConnectorAsync(string subscriptionId, string resourceGroupName, string securityConnectorName, string ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var message = CreateRuleIdExecuteSingleSecurityConnectorRequest(subscriptionId, resourceGroupName, securityConnectorName, ruleId, executeGovernanceRuleParams); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Execute a security GovernanceRule on the given security connector. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response RuleIdExecuteSingleSecurityConnector(string subscriptionId, string resourceGroupName, string securityConnectorName, string ruleId, ExecuteGovernanceRuleParams executeGovernanceRuleParams = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var message = CreateRuleIdExecuteSingleSecurityConnectorRequest(subscriptionId, resourceGroupName, securityConnectorName, ruleId, executeGovernanceRuleParams); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/IngestionSettingsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/IngestionSettingsRestOperations.cs deleted file mode 100644 index c2e355b2f175..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/IngestionSettingsRestOperations.cs +++ /dev/null @@ -1,541 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class IngestionSettingsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of IngestionSettingsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public IngestionSettingsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-01-15-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/ingestionSettings", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Settings for ingesting security data and logs to correlate with resources associated with the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IngestionSettingList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IngestionSettingList.DeserializeIngestionSettingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Settings for ingesting security data and logs to correlate with resources associated with the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IngestionSettingList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IngestionSettingList.DeserializeIngestionSettingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string ingestionSettingName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/ingestionSettings/", false); - uri.AppendPath(ingestionSettingName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Settings for ingesting security data and logs to correlate with resources associated with the subscription. - /// Azure subscription ID. - /// Name of the ingestion setting. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string ingestionSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ingestionSettingName, nameof(ingestionSettingName)); - - using var message = CreateGetRequest(subscriptionId, ingestionSettingName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IngestionSettingData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IngestionSettingData.DeserializeIngestionSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((IngestionSettingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Settings for ingesting security data and logs to correlate with resources associated with the subscription. - /// Azure subscription ID. - /// Name of the ingestion setting. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string ingestionSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ingestionSettingName, nameof(ingestionSettingName)); - - using var message = CreateGetRequest(subscriptionId, ingestionSettingName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IngestionSettingData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IngestionSettingData.DeserializeIngestionSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((IngestionSettingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateRequest(string subscriptionId, string ingestionSettingName, IngestionSettingData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/ingestionSettings/", false); - uri.AppendPath(ingestionSettingName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - /// Azure subscription ID. - /// Name of the ingestion setting. - /// Ingestion setting object. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> CreateAsync(string subscriptionId, string ingestionSettingName, IngestionSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ingestionSettingName, nameof(ingestionSettingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, ingestionSettingName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IngestionSettingData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IngestionSettingData.DeserializeIngestionSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create setting for ingesting security data and logs to correlate with resources associated with the subscription. - /// Azure subscription ID. - /// Name of the ingestion setting. - /// Ingestion setting object. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string ingestionSettingName, IngestionSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ingestionSettingName, nameof(ingestionSettingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, ingestionSettingName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IngestionSettingData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IngestionSettingData.DeserializeIngestionSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string ingestionSettingName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/ingestionSettings/", false); - uri.AppendPath(ingestionSettingName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes the ingestion settings for this subscription. - /// Azure subscription ID. - /// Name of the ingestion setting. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string ingestionSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ingestionSettingName, nameof(ingestionSettingName)); - - using var message = CreateDeleteRequest(subscriptionId, ingestionSettingName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes the ingestion settings for this subscription. - /// Azure subscription ID. - /// Name of the ingestion setting. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string ingestionSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ingestionSettingName, nameof(ingestionSettingName)); - - using var message = CreateDeleteRequest(subscriptionId, ingestionSettingName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListTokensRequest(string subscriptionId, string ingestionSettingName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/ingestionSettings/", false); - uri.AppendPath(ingestionSettingName, true); - uri.AppendPath("/listTokens", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - /// Azure subscription ID. - /// Name of the ingestion setting. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListTokensAsync(string subscriptionId, string ingestionSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ingestionSettingName, nameof(ingestionSettingName)); - - using var message = CreateListTokensRequest(subscriptionId, ingestionSettingName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IngestionSettingToken value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IngestionSettingToken.DeserializeIngestionSettingToken(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Returns the token that is used for correlating ingested telemetry with the resources in the subscription. - /// Azure subscription ID. - /// Name of the ingestion setting. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListTokens(string subscriptionId, string ingestionSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ingestionSettingName, nameof(ingestionSettingName)); - - using var message = CreateListTokensRequest(subscriptionId, ingestionSettingName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IngestionSettingToken value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IngestionSettingToken.DeserializeIngestionSettingToken(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListConnectionStringsRequest(string subscriptionId, string ingestionSettingName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/ingestionSettings/", false); - uri.AppendPath(ingestionSettingName, true); - uri.AppendPath("/listConnectionStrings", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Connection strings for ingesting security scan logs and data. - /// Azure subscription ID. - /// Name of the ingestion setting. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListConnectionStringsAsync(string subscriptionId, string ingestionSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ingestionSettingName, nameof(ingestionSettingName)); - - using var message = CreateListConnectionStringsRequest(subscriptionId, ingestionSettingName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ConnectionStrings value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ConnectionStrings.DeserializeConnectionStrings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Connection strings for ingesting security scan logs and data. - /// Azure subscription ID. - /// Name of the ingestion setting. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListConnectionStrings(string subscriptionId, string ingestionSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ingestionSettingName, nameof(ingestionSettingName)); - - using var message = CreateListConnectionStringsRequest(subscriptionId, ingestionSettingName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ConnectionStrings value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ConnectionStrings.DeserializeConnectionStrings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Settings for ingesting security data and logs to correlate with resources associated with the subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IngestionSettingList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IngestionSettingList.DeserializeIngestionSettingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Settings for ingesting security data and logs to correlate with resources associated with the subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IngestionSettingList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IngestionSettingList.DeserializeIngestionSettingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/IotSecuritySolutionAnalyticsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/IotSecuritySolutionAnalyticsRestOperations.cs deleted file mode 100644 index b8290c96bb85..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/IotSecuritySolutionAnalyticsRestOperations.cs +++ /dev/null @@ -1,202 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class IotSecuritySolutionAnalyticsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of IotSecuritySolutionAnalyticsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public IotSecuritySolutionAnalyticsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-08-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string solutionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/iotSecuritySolutions/", false); - uri.AppendPath(solutionName, true); - uri.AppendPath("/analyticsModels", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Use this method to get IoT security Analytics metrics in an array. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string solutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, solutionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IotSecuritySolutionAnalyticsModelList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IotSecuritySolutionAnalyticsModelList.DeserializeIotSecuritySolutionAnalyticsModelList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to get IoT security Analytics metrics in an array. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string solutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, solutionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IotSecuritySolutionAnalyticsModelList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IotSecuritySolutionAnalyticsModelList.DeserializeIotSecuritySolutionAnalyticsModelList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string solutionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/iotSecuritySolutions/", false); - uri.AppendPath(solutionName, true); - uri.AppendPath("/analyticsModels/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Use this method to get IoT Security Analytics metrics. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string solutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, solutionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IotSecuritySolutionAnalyticsModelData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IotSecuritySolutionAnalyticsModelData.DeserializeIotSecuritySolutionAnalyticsModelData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((IotSecuritySolutionAnalyticsModelData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to get IoT Security Analytics metrics. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string solutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, solutionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IotSecuritySolutionAnalyticsModelData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IotSecuritySolutionAnalyticsModelData.DeserializeIotSecuritySolutionAnalyticsModelData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((IotSecuritySolutionAnalyticsModelData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/IotSecuritySolutionRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/IotSecuritySolutionRestOperations.cs deleted file mode 100644 index 15044b6f9a74..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/IotSecuritySolutionRestOperations.cs +++ /dev/null @@ -1,662 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class IotSecuritySolutionRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of IotSecuritySolutionRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public IotSecuritySolutionRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-08-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/iotSecuritySolutions", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Use this method to get the list of IoT Security solutions by subscription. - /// Azure subscription ID. - /// Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IotSecuritySolutionsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IotSecuritySolutionsList.DeserializeIotSecuritySolutionsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to get the list of IoT Security solutions by subscription. - /// Azure subscription ID. - /// Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IotSecuritySolutionsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IotSecuritySolutionsList.DeserializeIotSecuritySolutionsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/iotSecuritySolutions", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Use this method to get the list IoT Security solutions organized by resource group. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IotSecuritySolutionsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IotSecuritySolutionsList.DeserializeIotSecuritySolutionsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to get the list IoT Security solutions organized by resource group. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IotSecuritySolutionsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IotSecuritySolutionsList.DeserializeIotSecuritySolutionsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string solutionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/iotSecuritySolutions/", false); - uri.AppendPath(solutionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// User this method to get details of a specific IoT Security solution based on solution name. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string solutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, solutionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IotSecuritySolutionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IotSecuritySolutionData.DeserializeIotSecuritySolutionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((IotSecuritySolutionData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// User this method to get details of a specific IoT Security solution based on solution name. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string solutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, solutionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IotSecuritySolutionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IotSecuritySolutionData.DeserializeIotSecuritySolutionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((IotSecuritySolutionData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string solutionName, IotSecuritySolutionData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/iotSecuritySolutions/", false); - uri.AppendPath(solutionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Use this method to create or update yours IoT Security solution. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// The security solution data. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string solutionName, IotSecuritySolutionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, solutionName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - IotSecuritySolutionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IotSecuritySolutionData.DeserializeIotSecuritySolutionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to create or update yours IoT Security solution. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// The security solution data. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string solutionName, IotSecuritySolutionData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, solutionName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - IotSecuritySolutionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IotSecuritySolutionData.DeserializeIotSecuritySolutionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string solutionName, IotSecuritySolutionPatch patch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/iotSecuritySolutions/", false); - uri.AppendPath(solutionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Use this method to update existing IoT Security solution tags or user defined resources. To update other fields use the CreateOrUpdate method. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// The security solution data. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string solutionName, IotSecuritySolutionPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, solutionName, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IotSecuritySolutionData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IotSecuritySolutionData.DeserializeIotSecuritySolutionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to update existing IoT Security solution tags or user defined resources. To update other fields use the CreateOrUpdate method. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// The security solution data. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string solutionName, IotSecuritySolutionPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, solutionName, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IotSecuritySolutionData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IotSecuritySolutionData.DeserializeIotSecuritySolutionData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string solutionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/iotSecuritySolutions/", false); - uri.AppendPath(solutionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Use this method to delete yours IoT Security solution. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string solutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, solutionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to delete yours IoT Security solution. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string solutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, solutionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Use this method to get the list of IoT Security solutions by subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IotSecuritySolutionsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IotSecuritySolutionsList.DeserializeIotSecuritySolutionsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to get the list of IoT Security solutions by subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IotSecuritySolutionsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IotSecuritySolutionsList.DeserializeIotSecuritySolutionsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Use this method to get the list IoT Security solutions organized by resource group. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IotSecuritySolutionsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IotSecuritySolutionsList.DeserializeIotSecuritySolutionsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to get the list IoT Security solutions organized by resource group. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IotSecuritySolutionsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IotSecuritySolutionsList.DeserializeIotSecuritySolutionsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/IotSecuritySolutionsAnalyticsAggregatedAlertRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/IotSecuritySolutionsAnalyticsAggregatedAlertRestOperations.cs deleted file mode 100644 index ae20c0f59550..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/IotSecuritySolutionsAnalyticsAggregatedAlertRestOperations.cs +++ /dev/null @@ -1,366 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class IotSecuritySolutionsAnalyticsAggregatedAlertRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of IotSecuritySolutionsAnalyticsAggregatedAlertRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public IotSecuritySolutionsAnalyticsAggregatedAlertRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-08-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string solutionName, int? top) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/iotSecuritySolutions/", false); - uri.AppendPath(solutionName, true); - uri.AppendPath("/analyticsModels/default/aggregatedAlerts", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (top != null) - { - uri.AppendQuery("$top", top.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Use this method to get the aggregated alert list of yours IoT Security solution. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// Number of results to retrieve. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string solutionName, int? top = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, solutionName, top); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IotSecurityAggregatedAlertList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IotSecurityAggregatedAlertList.DeserializeIotSecurityAggregatedAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to get the aggregated alert list of yours IoT Security solution. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// Number of results to retrieve. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string solutionName, int? top = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, solutionName, top); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IotSecurityAggregatedAlertList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IotSecurityAggregatedAlertList.DeserializeIotSecurityAggregatedAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string solutionName, string aggregatedAlertName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/iotSecuritySolutions/", false); - uri.AppendPath(solutionName, true); - uri.AppendPath("/analyticsModels/default/aggregatedAlerts/", false); - uri.AppendPath(aggregatedAlertName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is performed by alert name. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// Identifier of the aggregated alert. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string solutionName, string aggregatedAlertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - Argument.AssertNotNullOrEmpty(aggregatedAlertName, nameof(aggregatedAlertName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, solutionName, aggregatedAlertName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IotSecurityAggregatedAlertData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IotSecurityAggregatedAlertData.DeserializeIotSecurityAggregatedAlertData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((IotSecurityAggregatedAlertData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is performed by alert name. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// Identifier of the aggregated alert. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string solutionName, string aggregatedAlertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - Argument.AssertNotNullOrEmpty(aggregatedAlertName, nameof(aggregatedAlertName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, solutionName, aggregatedAlertName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IotSecurityAggregatedAlertData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IotSecurityAggregatedAlertData.DeserializeIotSecurityAggregatedAlertData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((IotSecurityAggregatedAlertData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDismissRequest(string subscriptionId, string resourceGroupName, string solutionName, string aggregatedAlertName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/iotSecuritySolutions/", false); - uri.AppendPath(solutionName, true); - uri.AppendPath("/analyticsModels/default/aggregatedAlerts/", false); - uri.AppendPath(aggregatedAlertName, true); - uri.AppendPath("/dismiss", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Use this method to dismiss an aggregated IoT Security Solution Alert. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// Identifier of the aggregated alert. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DismissAsync(string subscriptionId, string resourceGroupName, string solutionName, string aggregatedAlertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - Argument.AssertNotNullOrEmpty(aggregatedAlertName, nameof(aggregatedAlertName)); - - using var message = CreateDismissRequest(subscriptionId, resourceGroupName, solutionName, aggregatedAlertName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to dismiss an aggregated IoT Security Solution Alert. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// Identifier of the aggregated alert. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Dismiss(string subscriptionId, string resourceGroupName, string solutionName, string aggregatedAlertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - Argument.AssertNotNullOrEmpty(aggregatedAlertName, nameof(aggregatedAlertName)); - - using var message = CreateDismissRequest(subscriptionId, resourceGroupName, solutionName, aggregatedAlertName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string solutionName, int? top) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Use this method to get the aggregated alert list of yours IoT Security solution. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// Number of results to retrieve. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string solutionName, int? top = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, solutionName, top); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IotSecurityAggregatedAlertList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IotSecurityAggregatedAlertList.DeserializeIotSecurityAggregatedAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to get the aggregated alert list of yours IoT Security solution. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// Number of results to retrieve. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string solutionName, int? top = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, solutionName, top); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IotSecurityAggregatedAlertList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IotSecurityAggregatedAlertList.DeserializeIotSecurityAggregatedAlertList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/IotSecuritySolutionsAnalyticsRecommendationRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/IotSecuritySolutionsAnalyticsRecommendationRestOperations.cs deleted file mode 100644 index a11814624ef5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/IotSecuritySolutionsAnalyticsRecommendationRestOperations.cs +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class IotSecuritySolutionsAnalyticsRecommendationRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of IotSecuritySolutionsAnalyticsRecommendationRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public IotSecuritySolutionsAnalyticsRecommendationRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-08-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string solutionName, string aggregatedRecommendationName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/iotSecuritySolutions/", false); - uri.AppendPath(solutionName, true); - uri.AppendPath("/analyticsModels/default/aggregatedRecommendations/", false); - uri.AppendPath(aggregatedRecommendationName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This aggregation is performed by recommendation name. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// Name of the recommendation aggregated for this query. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string solutionName, string aggregatedRecommendationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - Argument.AssertNotNullOrEmpty(aggregatedRecommendationName, nameof(aggregatedRecommendationName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, solutionName, aggregatedRecommendationName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IotSecurityAggregatedRecommendationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IotSecurityAggregatedRecommendationData.DeserializeIotSecurityAggregatedRecommendationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((IotSecurityAggregatedRecommendationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This aggregation is performed by recommendation name. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// Name of the recommendation aggregated for this query. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string solutionName, string aggregatedRecommendationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - Argument.AssertNotNullOrEmpty(aggregatedRecommendationName, nameof(aggregatedRecommendationName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, solutionName, aggregatedRecommendationName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IotSecurityAggregatedRecommendationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IotSecurityAggregatedRecommendationData.DeserializeIotSecurityAggregatedRecommendationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((IotSecurityAggregatedRecommendationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string solutionName, int? top) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/iotSecuritySolutions/", false); - uri.AppendPath(solutionName, true); - uri.AppendPath("/analyticsModels/default/aggregatedRecommendations", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (top != null) - { - uri.AppendQuery("$top", top.Value, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// Number of results to retrieve. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string solutionName, int? top = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, solutionName, top); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IotSecurityAggregatedRecommendationList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IotSecurityAggregatedRecommendationList.DeserializeIotSecurityAggregatedRecommendationList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// Number of results to retrieve. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string solutionName, int? top = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, solutionName, top); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IotSecurityAggregatedRecommendationList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IotSecurityAggregatedRecommendationList.DeserializeIotSecurityAggregatedRecommendationList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string solutionName, int? top) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// Number of results to retrieve. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string solutionName, int? top = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, solutionName, top); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - IotSecurityAggregatedRecommendationList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = IotSecurityAggregatedRecommendationList.DeserializeIotSecurityAggregatedRecommendationList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The name of the IoT Security solution. - /// Number of results to retrieve. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string solutionName, int? top = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(solutionName, nameof(solutionName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, solutionName, top); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - IotSecurityAggregatedRecommendationList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = IotSecurityAggregatedRecommendationList.DeserializeIotSecurityAggregatedRecommendationList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/JitNetworkAccessPoliciesRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/JitNetworkAccessPoliciesRestOperations.cs deleted file mode 100644 index 3e813f3f2cdc..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/JitNetworkAccessPoliciesRestOperations.cs +++ /dev/null @@ -1,954 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class JitNetworkAccessPoliciesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of JitNetworkAccessPoliciesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public JitNetworkAccessPoliciesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/jitNetworkAccessPolicies", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Policies for protecting resources using Just-in-Time access control. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPoliciesList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JitNetworkAccessPoliciesList.DeserializeJitNetworkAccessPoliciesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Policies for protecting resources using Just-in-Time access control. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPoliciesList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JitNetworkAccessPoliciesList.DeserializeJitNetworkAccessPoliciesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByRegionRequest(string subscriptionId, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/jitNetworkAccessPolicies", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Policies for protecting resources using Just-in-Time access control for the subscription, location. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListByRegionAsync(string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByRegionRequest(subscriptionId, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPoliciesList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JitNetworkAccessPoliciesList.DeserializeJitNetworkAccessPoliciesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Policies for protecting resources using Just-in-Time access control for the subscription, location. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListByRegion(string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByRegionRequest(subscriptionId, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPoliciesList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JitNetworkAccessPoliciesList.DeserializeJitNetworkAccessPoliciesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/jitNetworkAccessPolicies", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Policies for protecting resources using Just-in-Time access control for the subscription, location. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPoliciesList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JitNetworkAccessPoliciesList.DeserializeJitNetworkAccessPoliciesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Policies for protecting resources using Just-in-Time access control for the subscription, location. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPoliciesList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JitNetworkAccessPoliciesList.DeserializeJitNetworkAccessPoliciesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupAndRegionRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/jitNetworkAccessPolicies", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Policies for protecting resources using Just-in-Time access control for the subscription, location. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAndRegionAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupAndRegionRequest(subscriptionId, resourceGroupName, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPoliciesList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JitNetworkAccessPoliciesList.DeserializeJitNetworkAccessPoliciesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Policies for protecting resources using Just-in-Time access control for the subscription, location. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupAndRegion(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupAndRegionRequest(subscriptionId, resourceGroupName, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPoliciesList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JitNetworkAccessPoliciesList.DeserializeJitNetworkAccessPoliciesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string jitNetworkAccessPolicyName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/jitNetworkAccessPolicies/", false); - uri.AppendPath(jitNetworkAccessPolicyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Policies for protecting resources using Just-in-Time access control for the subscription, location. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a Just-in-Time access configuration policy. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string jitNetworkAccessPolicyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(jitNetworkAccessPolicyName, nameof(jitNetworkAccessPolicyName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, ascLocation, jitNetworkAccessPolicyName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPolicyData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((JitNetworkAccessPolicyData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Policies for protecting resources using Just-in-Time access control for the subscription, location. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a Just-in-Time access configuration policy. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string jitNetworkAccessPolicyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(jitNetworkAccessPolicyName, nameof(jitNetworkAccessPolicyName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, ascLocation, jitNetworkAccessPolicyName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPolicyData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((JitNetworkAccessPolicyData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string jitNetworkAccessPolicyName, JitNetworkAccessPolicyData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/jitNetworkAccessPolicies/", false); - uri.AppendPath(jitNetworkAccessPolicyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Create a policy for protecting resources using Just-in-Time access control. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a Just-in-Time access configuration policy. - /// The JitNetworkAccessPolicy to use. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string jitNetworkAccessPolicyName, JitNetworkAccessPolicyData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(jitNetworkAccessPolicyName, nameof(jitNetworkAccessPolicyName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPolicyData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create a policy for protecting resources using Just-in-Time access control. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a Just-in-Time access configuration policy. - /// The JitNetworkAccessPolicy to use. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string jitNetworkAccessPolicyName, JitNetworkAccessPolicyData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(jitNetworkAccessPolicyName, nameof(jitNetworkAccessPolicyName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPolicyData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string jitNetworkAccessPolicyName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/jitNetworkAccessPolicies/", false); - uri.AppendPath(jitNetworkAccessPolicyName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Delete a Just-in-Time access control policy. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a Just-in-Time access configuration policy. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string jitNetworkAccessPolicyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(jitNetworkAccessPolicyName, nameof(jitNetworkAccessPolicyName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, ascLocation, jitNetworkAccessPolicyName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete a Just-in-Time access control policy. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a Just-in-Time access configuration policy. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string jitNetworkAccessPolicyName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(jitNetworkAccessPolicyName, nameof(jitNetworkAccessPolicyName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, ascLocation, jitNetworkAccessPolicyName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateInitiateRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string jitNetworkAccessPolicyName, JitNetworkAccessPolicyInitiateContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/jitNetworkAccessPolicies/", false); - uri.AppendPath(jitNetworkAccessPolicyName, true); - uri.AppendPath("/", false); - uri.AppendPath("initiate", true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Initiate a JIT access from a specific Just-in-Time policy configuration. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a Just-in-Time access configuration policy. - /// The JitNetworkAccessPolicyInitiateContent to use. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> InitiateAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string jitNetworkAccessPolicyName, JitNetworkAccessPolicyInitiateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(jitNetworkAccessPolicyName, nameof(jitNetworkAccessPolicyName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateInitiateRequest(subscriptionId, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - { - JitNetworkAccessRequestInfo value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JitNetworkAccessRequestInfo.DeserializeJitNetworkAccessRequestInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Initiate a JIT access from a specific Just-in-Time policy configuration. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a Just-in-Time access configuration policy. - /// The JitNetworkAccessPolicyInitiateContent to use. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Initiate(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string jitNetworkAccessPolicyName, JitNetworkAccessPolicyInitiateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(jitNetworkAccessPolicyName, nameof(jitNetworkAccessPolicyName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateInitiateRequest(subscriptionId, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - { - JitNetworkAccessRequestInfo value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JitNetworkAccessRequestInfo.DeserializeJitNetworkAccessRequestInfo(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Policies for protecting resources using Just-in-Time access control. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPoliciesList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JitNetworkAccessPoliciesList.DeserializeJitNetworkAccessPoliciesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Policies for protecting resources using Just-in-Time access control. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPoliciesList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JitNetworkAccessPoliciesList.DeserializeJitNetworkAccessPoliciesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByRegionNextPageRequest(string nextLink, string subscriptionId, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Policies for protecting resources using Just-in-Time access control for the subscription, location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListByRegionNextPageAsync(string nextLink, string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByRegionNextPageRequest(nextLink, subscriptionId, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPoliciesList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JitNetworkAccessPoliciesList.DeserializeJitNetworkAccessPoliciesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Policies for protecting resources using Just-in-Time access control for the subscription, location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListByRegionNextPage(string nextLink, string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByRegionNextPageRequest(nextLink, subscriptionId, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPoliciesList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JitNetworkAccessPoliciesList.DeserializeJitNetworkAccessPoliciesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Policies for protecting resources using Just-in-Time access control for the subscription, location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPoliciesList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JitNetworkAccessPoliciesList.DeserializeJitNetworkAccessPoliciesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Policies for protecting resources using Just-in-Time access control for the subscription, location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPoliciesList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JitNetworkAccessPoliciesList.DeserializeJitNetworkAccessPoliciesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupAndRegionNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Policies for protecting resources using Just-in-Time access control for the subscription, location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAndRegionNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupAndRegionNextPageRequest(nextLink, subscriptionId, resourceGroupName, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPoliciesList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = JitNetworkAccessPoliciesList.DeserializeJitNetworkAccessPoliciesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Policies for protecting resources using Just-in-Time access control for the subscription, location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupAndRegionNextPage(string nextLink, string subscriptionId, string resourceGroupName, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupAndRegionNextPageRequest(nextLink, subscriptionId, resourceGroupName, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - JitNetworkAccessPoliciesList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = JitNetworkAccessPoliciesList.DeserializeJitNetworkAccessPoliciesList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/LocationsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/LocationsRestOperations.cs deleted file mode 100644 index 0112ab0341e1..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/LocationsRestOperations.cs +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class LocationsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of LocationsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public LocationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2015-06-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The location of the responsible ASC of the specific subscription (home region). For each subscription there is only one responsible location. The location in the response should be used to read or write other resources in ASC according to their ID. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AscLocationList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AscLocationList.DeserializeAscLocationList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The location of the responsible ASC of the specific subscription (home region). For each subscription there is only one responsible location. The location in the response should be used to read or write other resources in ASC according to their ID. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AscLocationList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AscLocationList.DeserializeAscLocationList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Details of a specific location. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateGetRequest(subscriptionId, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityCenterLocationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityCenterLocationData.DeserializeSecurityCenterLocationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityCenterLocationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Details of a specific location. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateGetRequest(subscriptionId, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityCenterLocationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityCenterLocationData.DeserializeSecurityCenterLocationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityCenterLocationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The location of the responsible ASC of the specific subscription (home region). For each subscription there is only one responsible location. The location in the response should be used to read or write other resources in ASC according to their ID. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AscLocationList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AscLocationList.DeserializeAscLocationList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The location of the responsible ASC of the specific subscription (home region). For each subscription there is only one responsible location. The location in the response should be used to read or write other resources in ASC according to their ID. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AscLocationList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AscLocationList.DeserializeAscLocationList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/MdeOnboardingsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/MdeOnboardingsRestOperations.cs deleted file mode 100644 index 75bf18d3c361..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/MdeOnboardingsRestOperations.cs +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class MdeOnboardingsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of MdeOnboardingsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public MdeOnboardingsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-10-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/mdeOnboardings", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The configuration or data needed to onboard the machine to MDE. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MdeOnboardingDataList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MdeOnboardingDataList.DeserializeMdeOnboardingDataList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The configuration or data needed to onboard the machine to MDE. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MdeOnboardingDataList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MdeOnboardingDataList.DeserializeMdeOnboardingDataList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/mdeOnboardings/default", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The default configuration or data needed to onboard the machine to MDE. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateGetRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - MdeOnboarding value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MdeOnboarding.DeserializeMdeOnboarding(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The default configuration or data needed to onboard the machine to MDE. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateGetRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - MdeOnboarding value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MdeOnboarding.DeserializeMdeOnboarding(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/PricingsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/PricingsRestOperations.cs deleted file mode 100644 index 3d9acc2e5274..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/PricingsRestOperations.cs +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class PricingsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of PricingsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public PricingsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-03-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/pricings", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists Microsoft Defender for Cloud pricing configurations in the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - PricingList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = PricingList.DeserializePricingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists Microsoft Defender for Cloud pricing configurations in the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - PricingList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = PricingList.DeserializePricingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string pricingName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/pricings/", false); - uri.AppendPath(pricingName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - /// Azure subscription ID. - /// name of the pricing configuration. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string pricingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(pricingName, nameof(pricingName)); - - using var message = CreateGetRequest(subscriptionId, pricingName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityCenterPricingData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityCenterPricingData.DeserializeSecurityCenterPricingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityCenterPricingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - /// Azure subscription ID. - /// name of the pricing configuration. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string pricingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(pricingName, nameof(pricingName)); - - using var message = CreateGetRequest(subscriptionId, pricingName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityCenterPricingData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityCenterPricingData.DeserializeSecurityCenterPricingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityCenterPricingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string pricingName, SecurityCenterPricingData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/pricings/", false); - uri.AppendPath(pricingName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - /// Azure subscription ID. - /// name of the pricing configuration. - /// Pricing object. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string pricingName, SecurityCenterPricingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(pricingName, nameof(pricingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateRequest(subscriptionId, pricingName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityCenterPricingData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityCenterPricingData.DeserializeSecurityCenterPricingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - /// Azure subscription ID. - /// name of the pricing configuration. - /// Pricing object. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string pricingName, SecurityCenterPricingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(pricingName, nameof(pricingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateRequest(subscriptionId, pricingName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityCenterPricingData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityCenterPricingData.DeserializeSecurityCenterPricingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/RegulatoryComplianceAssessmentsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/RegulatoryComplianceAssessmentsRestOperations.cs deleted file mode 100644 index 85ddbc7d8b12..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/RegulatoryComplianceAssessmentsRestOperations.cs +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class RegulatoryComplianceAssessmentsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of RegulatoryComplianceAssessmentsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public RegulatoryComplianceAssessmentsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-01-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId, string regulatoryComplianceStandardName, string regulatoryComplianceControlName, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/regulatoryComplianceStandards/", false); - uri.AppendPath(regulatoryComplianceStandardName, true); - uri.AppendPath("/regulatoryComplianceControls/", false); - uri.AppendPath(regulatoryComplianceControlName, true); - uri.AppendPath("/regulatoryComplianceAssessments", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Details and state of assessments mapped to selected regulatory compliance control. - /// Azure subscription ID. - /// Name of the regulatory compliance standard object. - /// Name of the regulatory compliance control object. - /// OData filter. Optional. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string regulatoryComplianceStandardName, string regulatoryComplianceControlName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceControlName, nameof(regulatoryComplianceControlName)); - - using var message = CreateListRequest(subscriptionId, regulatoryComplianceStandardName, regulatoryComplianceControlName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceAssessmentList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RegulatoryComplianceAssessmentList.DeserializeRegulatoryComplianceAssessmentList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Details and state of assessments mapped to selected regulatory compliance control. - /// Azure subscription ID. - /// Name of the regulatory compliance standard object. - /// Name of the regulatory compliance control object. - /// OData filter. Optional. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string regulatoryComplianceStandardName, string regulatoryComplianceControlName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceControlName, nameof(regulatoryComplianceControlName)); - - using var message = CreateListRequest(subscriptionId, regulatoryComplianceStandardName, regulatoryComplianceControlName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceAssessmentList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RegulatoryComplianceAssessmentList.DeserializeRegulatoryComplianceAssessmentList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string regulatoryComplianceStandardName, string regulatoryComplianceControlName, string regulatoryComplianceAssessmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/regulatoryComplianceStandards/", false); - uri.AppendPath(regulatoryComplianceStandardName, true); - uri.AppendPath("/regulatoryComplianceControls/", false); - uri.AppendPath(regulatoryComplianceControlName, true); - uri.AppendPath("/regulatoryComplianceAssessments/", false); - uri.AppendPath(regulatoryComplianceAssessmentName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Supported regulatory compliance details and state for selected assessment. - /// Azure subscription ID. - /// Name of the regulatory compliance standard object. - /// Name of the regulatory compliance control object. - /// Name of the regulatory compliance assessment object. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string regulatoryComplianceStandardName, string regulatoryComplianceControlName, string regulatoryComplianceAssessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceControlName, nameof(regulatoryComplianceControlName)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceAssessmentName, nameof(regulatoryComplianceAssessmentName)); - - using var message = CreateGetRequest(subscriptionId, regulatoryComplianceStandardName, regulatoryComplianceControlName, regulatoryComplianceAssessmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceAssessmentData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RegulatoryComplianceAssessmentData.DeserializeRegulatoryComplianceAssessmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((RegulatoryComplianceAssessmentData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Supported regulatory compliance details and state for selected assessment. - /// Azure subscription ID. - /// Name of the regulatory compliance standard object. - /// Name of the regulatory compliance control object. - /// Name of the regulatory compliance assessment object. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string regulatoryComplianceStandardName, string regulatoryComplianceControlName, string regulatoryComplianceAssessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceControlName, nameof(regulatoryComplianceControlName)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceAssessmentName, nameof(regulatoryComplianceAssessmentName)); - - using var message = CreateGetRequest(subscriptionId, regulatoryComplianceStandardName, regulatoryComplianceControlName, regulatoryComplianceAssessmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceAssessmentData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RegulatoryComplianceAssessmentData.DeserializeRegulatoryComplianceAssessmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((RegulatoryComplianceAssessmentData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string regulatoryComplianceStandardName, string regulatoryComplianceControlName, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Details and state of assessments mapped to selected regulatory compliance control. - /// The URL to the next page of results. - /// Azure subscription ID. - /// Name of the regulatory compliance standard object. - /// Name of the regulatory compliance control object. - /// OData filter. Optional. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string regulatoryComplianceStandardName, string regulatoryComplianceControlName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceControlName, nameof(regulatoryComplianceControlName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, regulatoryComplianceStandardName, regulatoryComplianceControlName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceAssessmentList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RegulatoryComplianceAssessmentList.DeserializeRegulatoryComplianceAssessmentList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Details and state of assessments mapped to selected regulatory compliance control. - /// The URL to the next page of results. - /// Azure subscription ID. - /// Name of the regulatory compliance standard object. - /// Name of the regulatory compliance control object. - /// OData filter. Optional. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string regulatoryComplianceStandardName, string regulatoryComplianceControlName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceControlName, nameof(regulatoryComplianceControlName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, regulatoryComplianceStandardName, regulatoryComplianceControlName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceAssessmentList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RegulatoryComplianceAssessmentList.DeserializeRegulatoryComplianceAssessmentList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/RegulatoryComplianceControlsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/RegulatoryComplianceControlsRestOperations.cs deleted file mode 100644 index 9b8e109ba89c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/RegulatoryComplianceControlsRestOperations.cs +++ /dev/null @@ -1,275 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class RegulatoryComplianceControlsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of RegulatoryComplianceControlsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public RegulatoryComplianceControlsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-01-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId, string regulatoryComplianceStandardName, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/regulatoryComplianceStandards/", false); - uri.AppendPath(regulatoryComplianceStandardName, true); - uri.AppendPath("/regulatoryComplianceControls", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// All supported regulatory compliance controls details and state for selected standard. - /// Azure subscription ID. - /// Name of the regulatory compliance standard object. - /// OData filter. Optional. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string regulatoryComplianceStandardName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - - using var message = CreateListRequest(subscriptionId, regulatoryComplianceStandardName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceControlList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RegulatoryComplianceControlList.DeserializeRegulatoryComplianceControlList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// All supported regulatory compliance controls details and state for selected standard. - /// Azure subscription ID. - /// Name of the regulatory compliance standard object. - /// OData filter. Optional. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string regulatoryComplianceStandardName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - - using var message = CreateListRequest(subscriptionId, regulatoryComplianceStandardName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceControlList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RegulatoryComplianceControlList.DeserializeRegulatoryComplianceControlList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string regulatoryComplianceStandardName, string regulatoryComplianceControlName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/regulatoryComplianceStandards/", false); - uri.AppendPath(regulatoryComplianceStandardName, true); - uri.AppendPath("/regulatoryComplianceControls/", false); - uri.AppendPath(regulatoryComplianceControlName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Selected regulatory compliance control details and state. - /// Azure subscription ID. - /// Name of the regulatory compliance standard object. - /// Name of the regulatory compliance control object. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string regulatoryComplianceStandardName, string regulatoryComplianceControlName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceControlName, nameof(regulatoryComplianceControlName)); - - using var message = CreateGetRequest(subscriptionId, regulatoryComplianceStandardName, regulatoryComplianceControlName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceControlData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RegulatoryComplianceControlData.DeserializeRegulatoryComplianceControlData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((RegulatoryComplianceControlData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Selected regulatory compliance control details and state. - /// Azure subscription ID. - /// Name of the regulatory compliance standard object. - /// Name of the regulatory compliance control object. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string regulatoryComplianceStandardName, string regulatoryComplianceControlName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceControlName, nameof(regulatoryComplianceControlName)); - - using var message = CreateGetRequest(subscriptionId, regulatoryComplianceStandardName, regulatoryComplianceControlName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceControlData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RegulatoryComplianceControlData.DeserializeRegulatoryComplianceControlData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((RegulatoryComplianceControlData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string regulatoryComplianceStandardName, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// All supported regulatory compliance controls details and state for selected standard. - /// The URL to the next page of results. - /// Azure subscription ID. - /// Name of the regulatory compliance standard object. - /// OData filter. Optional. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string regulatoryComplianceStandardName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, regulatoryComplianceStandardName, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceControlList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RegulatoryComplianceControlList.DeserializeRegulatoryComplianceControlList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// All supported regulatory compliance controls details and state for selected standard. - /// The URL to the next page of results. - /// Azure subscription ID. - /// Name of the regulatory compliance standard object. - /// OData filter. Optional. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string regulatoryComplianceStandardName, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, regulatoryComplianceStandardName, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceControlList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RegulatoryComplianceControlList.DeserializeRegulatoryComplianceControlList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/RegulatoryComplianceStandardsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/RegulatoryComplianceStandardsRestOperations.cs deleted file mode 100644 index 8a709a4a0fa2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/RegulatoryComplianceStandardsRestOperations.cs +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class RegulatoryComplianceStandardsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of RegulatoryComplianceStandardsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public RegulatoryComplianceStandardsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-01-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/regulatoryComplianceStandards", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Supported regulatory compliance standards details and state. - /// Azure subscription ID. - /// OData filter. Optional. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceStandardList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RegulatoryComplianceStandardList.DeserializeRegulatoryComplianceStandardList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Supported regulatory compliance standards details and state. - /// Azure subscription ID. - /// OData filter. Optional. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceStandardList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RegulatoryComplianceStandardList.DeserializeRegulatoryComplianceStandardList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string regulatoryComplianceStandardName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/regulatoryComplianceStandards/", false); - uri.AppendPath(regulatoryComplianceStandardName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Supported regulatory compliance details state for selected standard. - /// Azure subscription ID. - /// Name of the regulatory compliance standard object. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string regulatoryComplianceStandardName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - - using var message = CreateGetRequest(subscriptionId, regulatoryComplianceStandardName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceStandardData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RegulatoryComplianceStandardData.DeserializeRegulatoryComplianceStandardData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((RegulatoryComplianceStandardData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Supported regulatory compliance details state for selected standard. - /// Azure subscription ID. - /// Name of the regulatory compliance standard object. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string regulatoryComplianceStandardName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(regulatoryComplianceStandardName, nameof(regulatoryComplianceStandardName)); - - using var message = CreateGetRequest(subscriptionId, regulatoryComplianceStandardName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceStandardData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RegulatoryComplianceStandardData.DeserializeRegulatoryComplianceStandardData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((RegulatoryComplianceStandardData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Supported regulatory compliance standards details and state. - /// The URL to the next page of results. - /// Azure subscription ID. - /// OData filter. Optional. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceStandardList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RegulatoryComplianceStandardList.DeserializeRegulatoryComplianceStandardList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Supported regulatory compliance standards details and state. - /// The URL to the next page of results. - /// Azure subscription ID. - /// OData filter. Optional. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RegulatoryComplianceStandardList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RegulatoryComplianceStandardList.DeserializeRegulatoryComplianceStandardList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecureScoreControlDefinitionsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecureScoreControlDefinitionsRestOperations.cs deleted file mode 100644 index da0885a486c3..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecureScoreControlDefinitionsRestOperations.cs +++ /dev/null @@ -1,292 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class SecureScoreControlDefinitionsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SecureScoreControlDefinitionsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SecureScoreControlDefinitionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/providers/Microsoft.Security/secureScoreControlDefinitions", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List the available security controls, their assessments, and the max score. - /// The cancellation token to use. - public async Task> ListAsync(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecureScoreControlDefinitionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecureScoreControlDefinitionList.DeserializeSecureScoreControlDefinitionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List the available security controls, their assessments, and the max score. - /// The cancellation token to use. - public Response List(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecureScoreControlDefinitionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecureScoreControlDefinitionList.DeserializeSecureScoreControlDefinitionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/secureScoreControlDefinitions", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// For a specified subscription, list the available security controls, their assessments, and the max score. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecureScoreControlDefinitionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecureScoreControlDefinitionList.DeserializeSecureScoreControlDefinitionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// For a specified subscription, list the available security controls, their assessments, and the max score. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecureScoreControlDefinitionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecureScoreControlDefinitionList.DeserializeSecureScoreControlDefinitionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List the available security controls, their assessments, and the max score. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - - using var message = CreateListNextPageRequest(nextLink); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecureScoreControlDefinitionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecureScoreControlDefinitionList.DeserializeSecureScoreControlDefinitionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List the available security controls, their assessments, and the max score. - /// The URL to the next page of results. - /// The cancellation token to use. - /// is null. - public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - - using var message = CreateListNextPageRequest(nextLink); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecureScoreControlDefinitionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecureScoreControlDefinitionList.DeserializeSecureScoreControlDefinitionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// For a specified subscription, list the available security controls, their assessments, and the max score. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecureScoreControlDefinitionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecureScoreControlDefinitionList.DeserializeSecureScoreControlDefinitionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// For a specified subscription, list the available security controls, their assessments, and the max score. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecureScoreControlDefinitionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecureScoreControlDefinitionList.DeserializeSecureScoreControlDefinitionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecureScoreControlsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecureScoreControlsRestOperations.cs deleted file mode 100644 index f50335b10a5a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecureScoreControlsRestOperations.cs +++ /dev/null @@ -1,336 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class SecureScoreControlsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SecureScoreControlsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SecureScoreControlsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListBySecureScoreRequest(string subscriptionId, string secureScoreName, SecurityScoreODataExpand? expand) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/secureScores/", false); - uri.AppendPath(secureScoreName, true); - uri.AppendPath("/secureScoreControls", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (expand != null) - { - uri.AppendQuery("$expand", expand.Value.ToString(), true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get all security controls for a specific initiative within a scope. - /// Azure subscription ID. - /// The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. - /// OData expand. Optional. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListBySecureScoreAsync(string subscriptionId, string secureScoreName, SecurityScoreODataExpand? expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(secureScoreName, nameof(secureScoreName)); - - using var message = CreateListBySecureScoreRequest(subscriptionId, secureScoreName, expand); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecureScoreControlList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecureScoreControlList.DeserializeSecureScoreControlList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get all security controls for a specific initiative within a scope. - /// Azure subscription ID. - /// The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. - /// OData expand. Optional. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListBySecureScore(string subscriptionId, string secureScoreName, SecurityScoreODataExpand? expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(secureScoreName, nameof(secureScoreName)); - - using var message = CreateListBySecureScoreRequest(subscriptionId, secureScoreName, expand); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecureScoreControlList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecureScoreControlList.DeserializeSecureScoreControlList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRequest(string subscriptionId, SecurityScoreODataExpand? expand) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/secureScoreControls", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (expand != null) - { - uri.AppendQuery("$expand", expand.Value.ToString(), true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get all security controls within a scope. - /// Azure subscription ID. - /// OData expand. Optional. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, SecurityScoreODataExpand? expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId, expand); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecureScoreControlList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecureScoreControlList.DeserializeSecureScoreControlList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get all security controls within a scope. - /// Azure subscription ID. - /// OData expand. Optional. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, SecurityScoreODataExpand? expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId, expand); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecureScoreControlList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecureScoreControlList.DeserializeSecureScoreControlList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBySecureScoreNextPageRequest(string nextLink, string subscriptionId, string secureScoreName, SecurityScoreODataExpand? expand) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get all security controls for a specific initiative within a scope. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. - /// OData expand. Optional. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListBySecureScoreNextPageAsync(string nextLink, string subscriptionId, string secureScoreName, SecurityScoreODataExpand? expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(secureScoreName, nameof(secureScoreName)); - - using var message = CreateListBySecureScoreNextPageRequest(nextLink, subscriptionId, secureScoreName, expand); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecureScoreControlList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecureScoreControlList.DeserializeSecureScoreControlList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get all security controls for a specific initiative within a scope. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. - /// OData expand. Optional. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListBySecureScoreNextPage(string nextLink, string subscriptionId, string secureScoreName, SecurityScoreODataExpand? expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(secureScoreName, nameof(secureScoreName)); - - using var message = CreateListBySecureScoreNextPageRequest(nextLink, subscriptionId, secureScoreName, expand); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecureScoreControlList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecureScoreControlList.DeserializeSecureScoreControlList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, SecurityScoreODataExpand? expand) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get all security controls within a scope. - /// The URL to the next page of results. - /// Azure subscription ID. - /// OData expand. Optional. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, SecurityScoreODataExpand? expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, expand); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecureScoreControlList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecureScoreControlList.DeserializeSecureScoreControlList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get all security controls within a scope. - /// The URL to the next page of results. - /// Azure subscription ID. - /// OData expand. Optional. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, SecurityScoreODataExpand? expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, expand); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecureScoreControlList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecureScoreControlList.DeserializeSecureScoreControlList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecureScoresRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecureScoresRestOperations.cs deleted file mode 100644 index a6c9c5a927aa..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecureScoresRestOperations.cs +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class SecureScoresRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SecureScoresRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SecureScoresRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/secureScores", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecureScoresList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecureScoresList.DeserializeSecureScoresList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecureScoresList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecureScoresList.DeserializeSecureScoresList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string secureScoreName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/secureScores/", false); - uri.AppendPath(secureScoreName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC Default initiative, use 'ascScore'. - /// Azure subscription ID. - /// The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string secureScoreName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(secureScoreName, nameof(secureScoreName)); - - using var message = CreateGetRequest(subscriptionId, secureScoreName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecureScoreData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecureScoreData.DeserializeSecureScoreData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecureScoreData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC Default initiative, use 'ascScore'. - /// Azure subscription ID. - /// The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string secureScoreName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(secureScoreName, nameof(secureScoreName)); - - using var message = CreateGetRequest(subscriptionId, secureScoreName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecureScoreData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecureScoreData.DeserializeSecureScoreData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecureScoreData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecureScoresList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecureScoresList.DeserializeSecureScoresList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecureScoresList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecureScoresList.DeserializeSecureScoresList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecurityConnectorApplicationsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecurityConnectorApplicationsRestOperations.cs deleted file mode 100644 index fca28a48d98a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecurityConnectorApplicationsRestOperations.cs +++ /dev/null @@ -1,452 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class SecurityConnectorApplicationsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SecurityConnectorApplicationsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SecurityConnectorApplicationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-07-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string securityConnectorName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/securityConnectors/", false); - uri.AppendPath(securityConnectorName, true); - uri.AppendPath("/providers/Microsoft.Security/applications", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a list of all relevant applications over a security connector level scope. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string securityConnectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, securityConnectorName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApplicationsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApplicationsList.DeserializeApplicationsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a list of all relevant applications over a security connector level scope. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string securityConnectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, securityConnectorName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApplicationsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApplicationsList.DeserializeApplicationsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string securityConnectorName, string applicationId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/securityConnectors/", false); - uri.AppendPath(securityConnectorName, true); - uri.AppendPath("/providers/Microsoft.Security/applications/", false); - uri.AppendPath(applicationId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a specific application for the requested scope by applicationId. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string securityConnectorName, string applicationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, securityConnectorName, applicationId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityApplicationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityApplicationData.DeserializeSecurityApplicationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityApplicationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a specific application for the requested scope by applicationId. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string securityConnectorName, string applicationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, securityConnectorName, applicationId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityApplicationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityApplicationData.DeserializeSecurityApplicationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityApplicationData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string securityConnectorName, string applicationId, SecurityApplicationData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/securityConnectors/", false); - uri.AppendPath(securityConnectorName, true); - uri.AppendPath("/providers/Microsoft.Security/applications/", false); - uri.AppendPath(applicationId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or update a security Application on the given security connector. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security Application key - unique key for the standard application. - /// Application over a subscription scope. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string securityConnectorName, string applicationId, SecurityApplicationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, securityConnectorName, applicationId, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - SecurityApplicationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityApplicationData.DeserializeSecurityApplicationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or update a security Application on the given security connector. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security Application key - unique key for the standard application. - /// Application over a subscription scope. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string securityConnectorName, string applicationId, SecurityApplicationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, securityConnectorName, applicationId, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - SecurityApplicationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityApplicationData.DeserializeSecurityApplicationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string securityConnectorName, string applicationId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/securityConnectors/", false); - uri.AppendPath(securityConnectorName, true); - uri.AppendPath("/providers/Microsoft.Security/applications/", false); - uri.AppendPath(applicationId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// Delete an Application over a given scope. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string securityConnectorName, string applicationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, securityConnectorName, applicationId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete an Application over a given scope. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string securityConnectorName, string applicationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, securityConnectorName, applicationId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string securityConnectorName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a list of all relevant applications over a security connector level scope. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string securityConnectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, securityConnectorName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ApplicationsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ApplicationsList.DeserializeApplicationsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a list of all relevant applications over a security connector level scope. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string securityConnectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, securityConnectorName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ApplicationsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ApplicationsList.DeserializeApplicationsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecurityConnectorGovernanceRulesExecuteStatusRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecurityConnectorGovernanceRulesExecuteStatusRestOperations.cs deleted file mode 100644 index 12a3586fea66..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecurityConnectorGovernanceRulesExecuteStatusRestOperations.cs +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class SecurityConnectorGovernanceRulesExecuteStatusRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SecurityConnectorGovernanceRulesExecuteStatusRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SecurityConnectorGovernanceRulesExecuteStatusRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-01-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string securityConnectorName, string ruleId, string operationId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/securityConnectors/", false); - uri.AppendPath(securityConnectorName, true); - uri.AppendPath("/providers/Microsoft.Security/governanceRules/", false); - uri.AppendPath(ruleId, true); - uri.AppendPath("/operationResults/", false); - uri.AppendPath(operationId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task GetAsync(string subscriptionId, string resourceGroupName, string securityConnectorName, string ruleId, string operationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, securityConnectorName, ruleId, operationId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string securityConnectorName, string ruleId, string operationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, securityConnectorName, ruleId, operationId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecurityConnectorGovernanceRulesRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecurityConnectorGovernanceRulesRestOperations.cs deleted file mode 100644 index 743ee4e47850..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecurityConnectorGovernanceRulesRestOperations.cs +++ /dev/null @@ -1,452 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class SecurityConnectorGovernanceRulesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SecurityConnectorGovernanceRulesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SecurityConnectorGovernanceRulesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-01-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string securityConnectorName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/securityConnectors/", false); - uri.AppendPath(securityConnectorName, true); - uri.AppendPath("/providers/Microsoft.Security/governanceRules", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a list of all relevant governanceRules over a security connector level scope. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string securityConnectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, securityConnectorName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GovernanceRuleList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GovernanceRuleList.DeserializeGovernanceRuleList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a list of all relevant governanceRules over a security connector level scope. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string securityConnectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, securityConnectorName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GovernanceRuleList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GovernanceRuleList.DeserializeGovernanceRuleList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string securityConnectorName, string ruleId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/securityConnectors/", false); - uri.AppendPath(securityConnectorName, true); - uri.AppendPath("/providers/Microsoft.Security/governanceRules/", false); - uri.AppendPath(ruleId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a specific governanceRule for the requested scope by ruleId. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string securityConnectorName, string ruleId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, securityConnectorName, ruleId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GovernanceRuleData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GovernanceRuleData.DeserializeGovernanceRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((GovernanceRuleData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a specific governanceRule for the requested scope by ruleId. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string securityConnectorName, string ruleId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, securityConnectorName, ruleId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GovernanceRuleData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GovernanceRuleData.DeserializeGovernanceRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((GovernanceRuleData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string securityConnectorName, string ruleId, GovernanceRuleData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/securityConnectors/", false); - uri.AppendPath(securityConnectorName, true); - uri.AppendPath("/providers/Microsoft.Security/governanceRules/", false); - uri.AppendPath(ruleId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or update a security GovernanceRule on the given security connector. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string securityConnectorName, string ruleId, GovernanceRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, securityConnectorName, ruleId, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - GovernanceRuleData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GovernanceRuleData.DeserializeGovernanceRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or update a security GovernanceRule on the given security connector. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string securityConnectorName, string ruleId, GovernanceRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, securityConnectorName, ruleId, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - GovernanceRuleData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GovernanceRuleData.DeserializeGovernanceRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string securityConnectorName, string ruleId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/securityConnectors/", false); - uri.AppendPath(securityConnectorName, true); - uri.AppendPath("/providers/Microsoft.Security/governanceRules/", false); - uri.AppendPath(ruleId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - _userAgent.Apply(message); - return message; - } - - /// Delete a GovernanceRule over a given scope. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string securityConnectorName, string ruleId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, securityConnectorName, ruleId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete a GovernanceRule over a given scope. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string securityConnectorName, string ruleId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, securityConnectorName, ruleId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string securityConnectorName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a list of all relevant governanceRules over a security connector level scope. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string securityConnectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, securityConnectorName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GovernanceRuleList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GovernanceRuleList.DeserializeGovernanceRuleList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a list of all relevant governanceRules over a security connector level scope. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string securityConnectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, securityConnectorName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GovernanceRuleList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GovernanceRuleList.DeserializeGovernanceRuleList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecurityConnectorsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecurityConnectorsRestOperations.cs deleted file mode 100644 index f7f2758eb128..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecurityConnectorsRestOperations.cs +++ /dev/null @@ -1,646 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class SecurityConnectorsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SecurityConnectorsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SecurityConnectorsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-08-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/securityConnectors", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to get the next page of security connectors for the specified subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityConnectorsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityConnectorsList.DeserializeSecurityConnectorsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to get the next page of security connectors for the specified subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityConnectorsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityConnectorsList.DeserializeSecurityConnectorsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/securityConnectors", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to get the next page of security connectors for the specified resource group. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityConnectorsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityConnectorsList.DeserializeSecurityConnectorsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to get the next page of security connectors for the specified resource group. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityConnectorsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityConnectorsList.DeserializeSecurityConnectorsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string securityConnectorName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/securityConnectors/", false); - uri.AppendPath(securityConnectorName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Retrieves details of a specific security connector. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string securityConnectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, securityConnectorName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityConnectorData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityConnectorData.DeserializeSecurityConnectorData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityConnectorData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieves details of a specific security connector. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string securityConnectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, securityConnectorName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityConnectorData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityConnectorData.DeserializeSecurityConnectorData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityConnectorData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string securityConnectorName, SecurityConnectorData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/securityConnectors/", false); - uri.AppendPath(securityConnectorName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates or updates a security connector. If a security connector is already created and a subsequent request is issued for the same security connector id, then it will be updated. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security connector resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string securityConnectorName, SecurityConnectorData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, securityConnectorName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - SecurityConnectorData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityConnectorData.DeserializeSecurityConnectorData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates or updates a security connector. If a security connector is already created and a subsequent request is issued for the same security connector id, then it will be updated. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security connector resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string securityConnectorName, SecurityConnectorData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, securityConnectorName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - SecurityConnectorData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityConnectorData.DeserializeSecurityConnectorData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string securityConnectorName, SecurityConnectorData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/securityConnectors/", false); - uri.AppendPath(securityConnectorName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Updates a security connector. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security connector resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string securityConnectorName, SecurityConnectorData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, securityConnectorName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityConnectorData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityConnectorData.DeserializeSecurityConnectorData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Updates a security connector. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The security connector resource. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string securityConnectorName, SecurityConnectorData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, securityConnectorName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityConnectorData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityConnectorData.DeserializeSecurityConnectorData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string securityConnectorName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/securityConnectors/", false); - uri.AppendPath(securityConnectorName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes a security connector. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string securityConnectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, securityConnectorName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes a security connector. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The security connector name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string securityConnectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, securityConnectorName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to get the next page of security connectors for the specified subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityConnectorsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityConnectorsList.DeserializeSecurityConnectorsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response to get the next page of security connectors for the specified subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityConnectorsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityConnectorsList.DeserializeSecurityConnectorsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to get the next page of security connectors for the specified resource group. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityConnectorsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityConnectorsList.DeserializeSecurityConnectorsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to get the next page of security connectors for the specified resource group. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityConnectorsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityConnectorsList.DeserializeSecurityConnectorsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecurityContactsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecurityContactsRestOperations.cs deleted file mode 100644 index 2f46033e6ef7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecurityContactsRestOperations.cs +++ /dev/null @@ -1,397 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class SecurityContactsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SecurityContactsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SecurityContactsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/securityContacts", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all security contact configurations for the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityContactList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityContactList.DeserializeSecurityContactList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all security contact configurations for the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityContactList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityContactList.DeserializeSecurityContactList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string securityContactName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/securityContacts/", false); - uri.AppendPath(securityContactName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get Default Security contact configurations for the subscription. - /// Azure subscription ID. - /// Name of the security contact object. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string securityContactName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(securityContactName, nameof(securityContactName)); - - using var message = CreateGetRequest(subscriptionId, securityContactName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityContactData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityContactData.DeserializeSecurityContactData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityContactData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get Default Security contact configurations for the subscription. - /// Azure subscription ID. - /// Name of the security contact object. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string securityContactName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(securityContactName, nameof(securityContactName)); - - using var message = CreateGetRequest(subscriptionId, securityContactName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityContactData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityContactData.DeserializeSecurityContactData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityContactData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateRequest(string subscriptionId, string securityContactName, SecurityContactData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/securityContacts/", false); - uri.AppendPath(securityContactName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Create security contact configurations for the subscription. - /// Azure subscription ID. - /// Name of the security contact object. - /// Security contact object. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> CreateAsync(string subscriptionId, string securityContactName, SecurityContactData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(securityContactName, nameof(securityContactName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, securityContactName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - SecurityContactData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityContactData.DeserializeSecurityContactData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Create security contact configurations for the subscription. - /// Azure subscription ID. - /// Name of the security contact object. - /// Security contact object. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string securityContactName, SecurityContactData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(securityContactName, nameof(securityContactName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, securityContactName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - SecurityContactData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityContactData.DeserializeSecurityContactData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string securityContactName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/securityContacts/", false); - uri.AppendPath(securityContactName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Delete security contact configurations for the subscription. - /// Azure subscription ID. - /// Name of the security contact object. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string securityContactName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(securityContactName, nameof(securityContactName)); - - using var message = CreateDeleteRequest(subscriptionId, securityContactName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete security contact configurations for the subscription. - /// Azure subscription ID. - /// Name of the security contact object. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string securityContactName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(securityContactName, nameof(securityContactName)); - - using var message = CreateDeleteRequest(subscriptionId, securityContactName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// List all security contact configurations for the subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityContactList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityContactList.DeserializeSecurityContactList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// List all security contact configurations for the subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityContactList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityContactList.DeserializeSecurityContactList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecuritySolutionsReferenceDataRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecuritySolutionsReferenceDataRestOperations.cs deleted file mode 100644 index 6cee58abd735..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecuritySolutionsReferenceDataRestOperations.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class SecuritySolutionsReferenceDataRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SecuritySolutionsReferenceDataRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SecuritySolutionsReferenceDataRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/securitySolutionsReferenceData", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of all supported Security Solutions for the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecuritySolutionsReferenceDataList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecuritySolutionsReferenceDataList.DeserializeSecuritySolutionsReferenceDataList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of all supported Security Solutions for the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecuritySolutionsReferenceDataList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecuritySolutionsReferenceDataList.DeserializeSecuritySolutionsReferenceDataList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByHomeRegionRequest(string subscriptionId, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/securitySolutionsReferenceData", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets list of all supported Security Solutions for subscription and location. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListByHomeRegionAsync(string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionRequest(subscriptionId, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecuritySolutionsReferenceDataList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecuritySolutionsReferenceDataList.DeserializeSecuritySolutionsReferenceDataList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets list of all supported Security Solutions for subscription and location. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListByHomeRegion(string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionRequest(subscriptionId, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecuritySolutionsReferenceDataList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecuritySolutionsReferenceDataList.DeserializeSecuritySolutionsReferenceDataList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecuritySolutionsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecuritySolutionsRestOperations.cs deleted file mode 100644 index fa2e8f27a2f0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SecuritySolutionsRestOperations.cs +++ /dev/null @@ -1,257 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class SecuritySolutionsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SecuritySolutionsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SecuritySolutionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/securitySolutions", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of Security Solutions for the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecuritySolutionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecuritySolutionList.DeserializeSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of Security Solutions for the subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecuritySolutionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecuritySolutionList.DeserializeSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string securitySolutionName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/securitySolutions/", false); - uri.AppendPath(securitySolutionName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a specific Security Solution. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of security solution. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string securitySolutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securitySolutionName, nameof(securitySolutionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, ascLocation, securitySolutionName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecuritySolution value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecuritySolution.DeserializeSecuritySolution(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a specific Security Solution. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of security solution. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string securitySolutionName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(securitySolutionName, nameof(securitySolutionName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, ascLocation, securitySolutionName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecuritySolution value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecuritySolution.DeserializeSecuritySolution(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of Security Solutions for the subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecuritySolutionList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecuritySolutionList.DeserializeSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of Security Solutions for the subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecuritySolutionList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecuritySolutionList.DeserializeSecuritySolutionList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ServerVulnerabilityAssessmentRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ServerVulnerabilityAssessmentRestOperations.cs deleted file mode 100644 index be643f0c9578..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/ServerVulnerabilityAssessmentRestOperations.cs +++ /dev/null @@ -1,405 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class ServerVulnerabilityAssessmentRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ServerVulnerabilityAssessmentRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public ServerVulnerabilityAssessmentRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListByExtendedResourceRequest(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/", false); - uri.AppendPath(resourceNamespace, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceType, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/providers/Microsoft.Security/serverVulnerabilityAssessments", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of server vulnerability assessment onboarding statuses on a given resource. - /// Azure subscription ID. - /// 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 to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListByExtendedResourceAsync(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByExtendedResourceRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ServerVulnerabilityAssessmentsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ServerVulnerabilityAssessmentsList.DeserializeServerVulnerabilityAssessmentsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of server vulnerability assessment onboarding statuses on a given resource. - /// Azure subscription ID. - /// 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 to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response ListByExtendedResource(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByExtendedResourceRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ServerVulnerabilityAssessmentsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ServerVulnerabilityAssessmentsList.DeserializeServerVulnerabilityAssessmentsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/", false); - uri.AppendPath(resourceNamespace, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceType, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/providers/Microsoft.Security/serverVulnerabilityAssessments/", false); - uri.AppendPath("default", true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a server vulnerability assessment onboarding statuses on a given resource. - /// Azure subscription ID. - /// 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 to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ServerVulnerabilityAssessmentData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ServerVulnerabilityAssessmentData.DeserializeServerVulnerabilityAssessmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ServerVulnerabilityAssessmentData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a server vulnerability assessment onboarding statuses on a given resource. - /// Azure subscription ID. - /// 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 to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ServerVulnerabilityAssessmentData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ServerVulnerabilityAssessmentData.DeserializeServerVulnerabilityAssessmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ServerVulnerabilityAssessmentData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/", false); - uri.AppendPath(resourceNamespace, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceType, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/providers/Microsoft.Security/serverVulnerabilityAssessments/", false); - uri.AppendPath("default", true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Creating a server vulnerability assessment on a resource, which will onboard a resource for having a vulnerability assessment on it. - /// Azure subscription ID. - /// 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 to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - { - ServerVulnerabilityAssessmentData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ServerVulnerabilityAssessmentData.DeserializeServerVulnerabilityAssessmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creating a server vulnerability assessment on a resource, which will onboard a resource for having a vulnerability assessment on it. - /// Azure subscription ID. - /// 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 to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - { - ServerVulnerabilityAssessmentData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ServerVulnerabilityAssessmentData.DeserializeServerVulnerabilityAssessmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/", false); - uri.AppendPath(resourceNamespace, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceType, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/providers/Microsoft.Security/serverVulnerabilityAssessments/", false); - uri.AppendPath("default", true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Removing server vulnerability assessment from a resource. - /// Azure subscription ID. - /// 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 to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Removing server vulnerability assessment from a resource. - /// Azure subscription ID. - /// 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 to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SettingsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SettingsRestOperations.cs deleted file mode 100644 index d9f6d1b96386..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SettingsRestOperations.cs +++ /dev/null @@ -1,327 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class SettingsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SettingsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SettingsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-05-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/settings", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Settings about different configurations in Microsoft Defender for Cloud. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SettingsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SettingsList.DeserializeSettingsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Settings about different configurations in Microsoft Defender for Cloud. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SettingsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SettingsList.DeserializeSettingsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, SecuritySettingName settingName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/settings/", false); - uri.AppendPath(settingName.ToString(), true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Settings of different configurations in Microsoft Defender for Cloud. - /// Azure subscription ID. - /// The name of the setting. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, SecuritySettingName settingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateGetRequest(subscriptionId, settingName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecuritySettingData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecuritySettingData.DeserializeSecuritySettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecuritySettingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Settings of different configurations in Microsoft Defender for Cloud. - /// Azure subscription ID. - /// The name of the setting. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, SecuritySettingName settingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateGetRequest(subscriptionId, settingName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecuritySettingData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecuritySettingData.DeserializeSecuritySettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecuritySettingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, SecuritySettingName settingName, SecuritySettingData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/settings/", false); - uri.AppendPath(settingName.ToString(), true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// updating settings about different configurations in Microsoft Defender for Cloud. - /// Azure subscription ID. - /// The name of the setting. - /// Setting object. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, SecuritySettingName settingName, SecuritySettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateRequest(subscriptionId, settingName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecuritySettingData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecuritySettingData.DeserializeSecuritySettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// updating settings about different configurations in Microsoft Defender for Cloud. - /// Azure subscription ID. - /// The name of the setting. - /// Setting object. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, SecuritySettingName settingName, SecuritySettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateRequest(subscriptionId, settingName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecuritySettingData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecuritySettingData.DeserializeSecuritySettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Settings about different configurations in Microsoft Defender for Cloud. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SettingsList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SettingsList.DeserializeSettingsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Settings about different configurations in Microsoft Defender for Cloud. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SettingsList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SettingsList.DeserializeSettingsList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SoftwareInventoriesRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SoftwareInventoriesRestOperations.cs deleted file mode 100644 index 318b0b41c024..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SoftwareInventoriesRestOperations.cs +++ /dev/null @@ -1,450 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class SoftwareInventoriesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SoftwareInventoriesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SoftwareInventoriesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-05-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListByExtendedResourceRequest(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/", false); - uri.AppendPath(resourceNamespace, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceType, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/providers/Microsoft.Security/softwareInventories", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the software inventory of the virtual machine. - /// Azure subscription ID. - /// 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 to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListByExtendedResourceAsync(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByExtendedResourceRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SoftwaresList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SoftwaresList.DeserializeSoftwaresList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the software inventory of the virtual machine. - /// Azure subscription ID. - /// 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 to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response ListByExtendedResource(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByExtendedResourceRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SoftwaresList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SoftwaresList.DeserializeSoftwaresList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/softwareInventories", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the software inventory of all virtual machines in the subscriptions. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SoftwaresList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SoftwaresList.DeserializeSoftwaresList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the software inventory of all virtual machines in the subscriptions. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SoftwaresList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SoftwaresList.DeserializeSoftwaresList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string softwareName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/", false); - uri.AppendPath(resourceNamespace, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceType, true); - uri.AppendPath("/", false); - uri.AppendPath(resourceName, true); - uri.AppendPath("/providers/Microsoft.Security/softwareInventories/", false); - uri.AppendPath(softwareName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a single software data of the virtual machine. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// Name of the installed software. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string softwareName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(softwareName, nameof(softwareName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SoftwareInventoryData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SoftwareInventoryData.DeserializeSoftwareInventoryData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SoftwareInventoryData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a single software data of the virtual machine. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// Name of the installed software. - /// The cancellation token to use. - /// , , , , or is null. - /// , , , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string softwareName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - Argument.AssertNotNullOrEmpty(softwareName, nameof(softwareName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SoftwareInventoryData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SoftwareInventoryData.DeserializeSoftwareInventoryData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SoftwareInventoryData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByExtendedResourceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the software inventory of the virtual machine. - /// The URL to the next page of results. - /// Azure subscription ID. - /// 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 to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListByExtendedResourceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByExtendedResourceNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SoftwaresList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SoftwaresList.DeserializeSoftwaresList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the software inventory of the virtual machine. - /// The URL to the next page of results. - /// Azure subscription ID. - /// 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 to use. - /// , , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response ListByExtendedResourceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(resourceNamespace, nameof(resourceNamespace)); - Argument.AssertNotNullOrEmpty(resourceType, nameof(resourceType)); - Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName)); - - using var message = CreateListByExtendedResourceNextPageRequest(nextLink, subscriptionId, resourceGroupName, resourceNamespace, resourceType, resourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SoftwaresList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SoftwaresList.DeserializeSoftwaresList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the software inventory of all virtual machines in the subscriptions. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SoftwaresList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SoftwaresList.DeserializeSoftwaresList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the software inventory of all virtual machines in the subscriptions. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SoftwaresList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SoftwaresList.DeserializeSoftwaresList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SqlVulnerabilityAssessmentBaselineRulesRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SqlVulnerabilityAssessmentBaselineRulesRestOperations.cs deleted file mode 100644 index 1b8c10ee2412..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SqlVulnerabilityAssessmentBaselineRulesRestOperations.cs +++ /dev/null @@ -1,414 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class SqlVulnerabilityAssessmentBaselineRulesRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SqlVulnerabilityAssessmentBaselineRulesRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SqlVulnerabilityAssessmentBaselineRulesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-07-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateCreateOrUpdateRequest(string resourceId, string ruleId, Guid workspaceId, SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/", false); - uri.AppendPath(ruleId, true); - uri.AppendQuery("workspaceId", workspaceId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - /// The identifier of the resource. - /// The rule Id. - /// The workspace Id. - /// The baseline results for this rule. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string resourceId, string ruleId, Guid workspaceId, SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateOrUpdateRequest(resourceId, ruleId, workspaceId, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SqlVulnerabilityAssessmentBaselineRuleData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SqlVulnerabilityAssessmentBaselineRuleData.DeserializeSqlVulnerabilityAssessmentBaselineRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - /// The identifier of the resource. - /// The rule Id. - /// The workspace Id. - /// The baseline results for this rule. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string resourceId, string ruleId, Guid workspaceId, SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateCreateOrUpdateRequest(resourceId, ruleId, workspaceId, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SqlVulnerabilityAssessmentBaselineRuleData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SqlVulnerabilityAssessmentBaselineRuleData.DeserializeSqlVulnerabilityAssessmentBaselineRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string resourceId, string ruleId, Guid workspaceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/", false); - uri.AppendPath(ruleId, true); - uri.AppendQuery("workspaceId", workspaceId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the results for a given rule in the Baseline. - /// The identifier of the resource. - /// The rule Id. - /// The workspace Id. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string resourceId, string ruleId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var message = CreateGetRequest(resourceId, ruleId, workspaceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SqlVulnerabilityAssessmentBaselineRuleData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SqlVulnerabilityAssessmentBaselineRuleData.DeserializeSqlVulnerabilityAssessmentBaselineRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SqlVulnerabilityAssessmentBaselineRuleData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the results for a given rule in the Baseline. - /// The identifier of the resource. - /// The rule Id. - /// The workspace Id. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response Get(string resourceId, string ruleId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var message = CreateGetRequest(resourceId, ruleId, workspaceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SqlVulnerabilityAssessmentBaselineRuleData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SqlVulnerabilityAssessmentBaselineRuleData.DeserializeSqlVulnerabilityAssessmentBaselineRuleData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SqlVulnerabilityAssessmentBaselineRuleData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string resourceId, string ruleId, Guid workspaceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/", false); - uri.AppendPath(ruleId, true); - uri.AppendQuery("workspaceId", workspaceId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes a rule from the Baseline of a given database. - /// The identifier of the resource. - /// The rule Id. - /// The workspace Id. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string resourceId, string ruleId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var message = CreateDeleteRequest(resourceId, ruleId, workspaceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes a rule from the Baseline of a given database. - /// The identifier of the resource. - /// The rule Id. - /// The workspace Id. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response Delete(string resourceId, string ruleId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var message = CreateDeleteRequest(resourceId, ruleId, workspaceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRequest(string resourceId, Guid workspaceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules", false); - uri.AppendQuery("workspaceId", workspaceId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the results for all rules in the Baseline. - /// The identifier of the resource. - /// The workspace Id. - /// The cancellation token to use. - /// is null. - public async Task> ListAsync(string resourceId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - - using var message = CreateListRequest(resourceId, workspaceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RulesResults value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RulesResults.DeserializeRulesResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the results for all rules in the Baseline. - /// The identifier of the resource. - /// The workspace Id. - /// The cancellation token to use. - /// is null. - public Response List(string resourceId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - - using var message = CreateListRequest(resourceId, workspaceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RulesResults value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RulesResults.DeserializeRulesResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateAddRequest(string resourceId, Guid workspaceId, RulesResultsContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules", false); - uri.AppendQuery("workspaceId", workspaceId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - if (content != null) - { - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content); - request.Content = content0; - } - _userAgent.Apply(message); - return message; - } - - /// Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - /// The identifier of the resource. - /// The workspace Id. - /// The baseline rules. - /// The cancellation token to use. - /// is null. - public async Task> AddAsync(string resourceId, Guid workspaceId, RulesResultsContent content = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - - using var message = CreateAddRequest(resourceId, workspaceId, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - RulesResults value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = RulesResults.DeserializeRulesResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Add a list of baseline rules. Will overwrite any previously existing results (for all rules). - /// The identifier of the resource. - /// The workspace Id. - /// The baseline rules. - /// The cancellation token to use. - /// is null. - public Response Add(string resourceId, Guid workspaceId, RulesResultsContent content = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - - using var message = CreateAddRequest(resourceId, workspaceId, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - RulesResults value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = RulesResults.DeserializeRulesResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SqlVulnerabilityAssessmentScanResultsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SqlVulnerabilityAssessmentScanResultsRestOperations.cs deleted file mode 100644 index 8acd83f590ca..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SqlVulnerabilityAssessmentScanResultsRestOperations.cs +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class SqlVulnerabilityAssessmentScanResultsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SqlVulnerabilityAssessmentScanResultsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SqlVulnerabilityAssessmentScanResultsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-07-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateGetRequest(string resourceId, string scanId, string scanResultId, Guid workspaceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/", false); - uri.AppendPath(scanId, true); - uri.AppendPath("/scanResults/", false); - uri.AppendPath(scanResultId, true); - uri.AppendQuery("workspaceId", workspaceId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the scan results of a single rule in a scan record. - /// The identifier of the resource. - /// The scan Id. Type 'latest' to get the scan results for the latest scan. - /// The rule Id of the results. - /// The workspace Id. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string resourceId, string scanId, string scanResultId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(scanId, nameof(scanId)); - Argument.AssertNotNullOrEmpty(scanResultId, nameof(scanResultId)); - - using var message = CreateGetRequest(resourceId, scanId, scanResultId, workspaceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SqlVulnerabilityAssessmentScanResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SqlVulnerabilityAssessmentScanResult.DeserializeSqlVulnerabilityAssessmentScanResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the scan results of a single rule in a scan record. - /// The identifier of the resource. - /// The scan Id. Type 'latest' to get the scan results for the latest scan. - /// The rule Id of the results. - /// The workspace Id. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string resourceId, string scanId, string scanResultId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(scanId, nameof(scanId)); - Argument.AssertNotNullOrEmpty(scanResultId, nameof(scanResultId)); - - using var message = CreateGetRequest(resourceId, scanId, scanResultId, workspaceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SqlVulnerabilityAssessmentScanResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SqlVulnerabilityAssessmentScanResult.DeserializeSqlVulnerabilityAssessmentScanResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRequest(string resourceId, string scanId, Guid workspaceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/", false); - uri.AppendPath(scanId, true); - uri.AppendPath("/scanResults", false); - uri.AppendQuery("workspaceId", workspaceId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of scan results for a single scan record. - /// The identifier of the resource. - /// The scan Id. Type 'latest' to get the scan results for the latest scan. - /// The workspace Id. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string resourceId, string scanId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(scanId, nameof(scanId)); - - using var message = CreateListRequest(resourceId, scanId, workspaceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ScanResults value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ScanResults.DeserializeScanResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of scan results for a single scan record. - /// The identifier of the resource. - /// The scan Id. Type 'latest' to get the scan results for the latest scan. - /// The workspace Id. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string resourceId, string scanId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(scanId, nameof(scanId)); - - using var message = CreateListRequest(resourceId, scanId, workspaceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ScanResults value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ScanResults.DeserializeScanResults(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SqlVulnerabilityAssessmentScansRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SqlVulnerabilityAssessmentScansRestOperations.cs deleted file mode 100644 index ba75debf732e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SqlVulnerabilityAssessmentScansRestOperations.cs +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class SqlVulnerabilityAssessmentScansRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SqlVulnerabilityAssessmentScansRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SqlVulnerabilityAssessmentScansRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-07-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateGetRequest(string resourceId, string scanId, Guid workspaceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/", false); - uri.AppendPath(scanId, true); - uri.AppendQuery("workspaceId", workspaceId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets the scan details of a single scan record. - /// The identifier of the resource. - /// The scan Id. Type 'latest' to get the scan record for the latest scan. - /// The workspace Id. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string resourceId, string scanId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(scanId, nameof(scanId)); - - using var message = CreateGetRequest(resourceId, scanId, workspaceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SqlVulnerabilityAssessmentScanData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SqlVulnerabilityAssessmentScanData.DeserializeSqlVulnerabilityAssessmentScanData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SqlVulnerabilityAssessmentScanData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets the scan details of a single scan record. - /// The identifier of the resource. - /// The scan Id. Type 'latest' to get the scan record for the latest scan. - /// The workspace Id. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response Get(string resourceId, string scanId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - Argument.AssertNotNullOrEmpty(scanId, nameof(scanId)); - - using var message = CreateGetRequest(resourceId, scanId, workspaceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SqlVulnerabilityAssessmentScanData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SqlVulnerabilityAssessmentScanData.DeserializeSqlVulnerabilityAssessmentScanData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SqlVulnerabilityAssessmentScanData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRequest(string resourceId, Guid workspaceId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(resourceId, false); - uri.AppendPath("/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans", false); - uri.AppendQuery("workspaceId", workspaceId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list of scan records. - /// The identifier of the resource. - /// The workspace Id. - /// The cancellation token to use. - /// is null. - public async Task> ListAsync(string resourceId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - - using var message = CreateListRequest(resourceId, workspaceId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - Scans value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Scans.DeserializeScans(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list of scan records. - /// The identifier of the resource. - /// The workspace Id. - /// The cancellation token to use. - /// is null. - public Response List(string resourceId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceId, nameof(resourceId)); - - using var message = CreateListRequest(resourceId, workspaceId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - Scans value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Scans.DeserializeScans(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/CustomAssessmentAutomationsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/StandardsRestOperations.cs similarity index 65% rename from sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/CustomAssessmentAutomationsRestOperations.cs rename to sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/StandardsRestOperations.cs index ee7ce246cd7a..03f3a757fbdc 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/CustomAssessmentAutomationsRestOperations.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/StandardsRestOperations.cs @@ -16,28 +16,28 @@ namespace Azure.ResourceManager.SecurityCenter { - internal partial class CustomAssessmentAutomationsRestOperations + internal partial class StandardsRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of CustomAssessmentAutomationsRestOperations. + /// Initializes a new instance of StandardsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. /// server parameter. /// Api Version. /// or is null. - public CustomAssessmentAutomationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public StandardsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-07-01-preview"; + _apiVersion = apiVersion ?? "2021-08-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string customAssessmentAutomationName) + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -46,10 +46,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourcegroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/customAssessmentAutomations/", false); - uri.AppendPath(customAssessmentAutomationName, true); + uri.AppendPath("/providers/Microsoft.Security/standards", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -57,117 +54,95 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Gets a single custom assessment automation by name for the provided subscription and resource group. + /// Get a list of all relevant security standards over a subscription level scope. /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// Name of the Custom Assessment Automation. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string customAssessmentAutomationName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(customAssessmentAutomationName, nameof(customAssessmentAutomationName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, customAssessmentAutomationName); + using var message = CreateListBySubscriptionRequest(subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - CustomAssessmentAutomationData value = default; + StandardList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CustomAssessmentAutomationData.DeserializeCustomAssessmentAutomationData(document.RootElement); + value = StandardList.DeserializeStandardList(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((CustomAssessmentAutomationData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets a single custom assessment automation by name for the provided subscription and resource group. + /// Get a list of all relevant security standards over a subscription level scope. /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// Name of the Custom Assessment Automation. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string customAssessmentAutomationName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(customAssessmentAutomationName, nameof(customAssessmentAutomationName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, customAssessmentAutomationName); + using var message = CreateListBySubscriptionRequest(subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - CustomAssessmentAutomationData value = default; + StandardList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CustomAssessmentAutomationData.DeserializeCustomAssessmentAutomationData(document.RootElement); + value = StandardList.DeserializeStandardList(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((CustomAssessmentAutomationData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string customAssessmentAutomationName, CustomAssessmentAutomationCreateOrUpdateContent content) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourcegroups/", false); + uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/customAssessmentAutomations/", false); - uri.AppendPath(customAssessmentAutomationName, true); + uri.AppendPath("/providers/Microsoft.Security/standards", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content); - request.Content = content0; _userAgent.Apply(message); return message; } - /// Creates or updates a custom assessment automation for the provided subscription. Please note that providing an existing custom assessment automation will replace the existing record. + /// Get security standards on all your resources inside a scope. /// Azure subscription ID. /// The name of the resource group within the user's subscription. The name is case insensitive. - /// Name of the Custom Assessment Automation. - /// Custom Assessment Automation body. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string customAssessmentAutomationName, CustomAssessmentAutomationCreateOrUpdateContent content, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(customAssessmentAutomationName, nameof(customAssessmentAutomationName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, customAssessmentAutomationName, content); + using var message = CreateListRequest(subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 201: { - CustomAssessmentAutomationData value = default; + StandardList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CustomAssessmentAutomationData.DeserializeCustomAssessmentAutomationData(document.RootElement); + value = StandardList.DeserializeStandardList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -175,31 +150,26 @@ public async Task> CreateAsync(string s } } - /// Creates or updates a custom assessment automation for the provided subscription. Please note that providing an existing custom assessment automation will replace the existing record. + /// Get security standards on all your resources inside a scope. /// Azure subscription ID. /// The name of the resource group within the user's subscription. The name is case insensitive. - /// Name of the Custom Assessment Automation. - /// Custom Assessment Automation body. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string resourceGroupName, string customAssessmentAutomationName, CustomAssessmentAutomationCreateOrUpdateContent content, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(customAssessmentAutomationName, nameof(customAssessmentAutomationName)); - Argument.AssertNotNull(content, nameof(content)); - using var message = CreateCreateRequest(subscriptionId, resourceGroupName, customAssessmentAutomationName, content); + using var message = CreateListRequest(subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 201: { - CustomAssessmentAutomationData value = default; + StandardList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CustomAssessmentAutomationData.DeserializeCustomAssessmentAutomationData(document.RootElement); + value = StandardList.DeserializeStandardList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -207,19 +177,19 @@ public Response Create(string subscriptionId, st } } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string customAssessmentAutomationName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string standardId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourcegroups/", false); + uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/customAssessmentAutomations/", false); - uri.AppendPath(customAssessmentAutomationName, true); + uri.AppendPath("/providers/Microsoft.Security/standards/", false); + uri.AppendPath(standardId, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -227,95 +197,117 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Deletes a custom assessment automation by name for a provided subscription. + /// Get a specific security standard for the requested scope. /// Azure subscription ID. /// The name of the resource group within the user's subscription. The name is case insensitive. - /// Name of the Custom Assessment Automation. + /// The Security Standard key - unique key for the standard type. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string customAssessmentAutomationName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string standardId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(customAssessmentAutomationName, nameof(customAssessmentAutomationName)); + Argument.AssertNotNullOrEmpty(standardId, nameof(standardId)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, customAssessmentAutomationName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, standardId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + StandardData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = StandardData.DeserializeStandardData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((StandardData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Deletes a custom assessment automation by name for a provided subscription. + /// Get a specific security standard for the requested scope. /// Azure subscription ID. /// The name of the resource group within the user's subscription. The name is case insensitive. - /// Name of the Custom Assessment Automation. + /// The Security Standard key - unique key for the standard type. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string customAssessmentAutomationName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string standardId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(customAssessmentAutomationName, nameof(customAssessmentAutomationName)); + Argument.AssertNotNullOrEmpty(standardId, nameof(standardId)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, customAssessmentAutomationName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, standardId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 204: - return message.Response; + { + StandardData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = StandardData.DeserializeStandardData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((StandardData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string standardId, StandardData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourcegroups/", false); + uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/customAssessmentAutomations", false); + uri.AppendPath("/providers/Microsoft.Security/standards/", false); + uri.AppendPath(standardId, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; _userAgent.Apply(message); return message; } - /// List custom assessment automations by provided subscription and resource group. + /// Create a security standard on the given scope. Available only for custom standards. Will create/update the required standard definitions. /// Azure subscription ID. /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The Security Standard key - unique key for the standard type. + /// Custom security standard over a pre-defined scope. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string standardId, StandardData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(standardId, nameof(standardId)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, standardId, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: + case 201: { - CustomAssessmentAutomationsListResult value = default; + StandardData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CustomAssessmentAutomationsListResult.DeserializeCustomAssessmentAutomationsListResult(document.RootElement); + value = StandardData.DeserializeStandardData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -323,26 +315,31 @@ public async Task> ListByResourc } } - /// List custom assessment automations by provided subscription and resource group. + /// Create a security standard on the given scope. Available only for custom standards. Will create/update the required standard definitions. /// Azure subscription ID. /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The Security Standard key - unique key for the standard type. + /// Custom security standard over a pre-defined scope. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string standardId, StandardData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(standardId, nameof(standardId)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, standardId, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: + case 201: { - CustomAssessmentAutomationsListResult value = default; + StandardData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CustomAssessmentAutomationsListResult.DeserializeCustomAssessmentAutomationsListResult(document.RootElement); + value = StandardData.DeserializeStandardData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -350,16 +347,19 @@ public Response ListByResourceGroup(strin } } - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string standardId) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/customAssessmentAutomations", false); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Security/standards/", false); + uri.AppendPath(standardId, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -367,57 +367,57 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) return message; } - /// List custom assessment automations by provided subscription. + /// Delete a security standard on a scope. /// Azure subscription ID. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The Security Standard key - unique key for the standard type. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string standardId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(standardId, nameof(standardId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, standardId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - { - CustomAssessmentAutomationsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CustomAssessmentAutomationsListResult.DeserializeCustomAssessmentAutomationsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// List custom assessment automations by provided subscription. + /// Delete a security standard on a scope. /// Azure subscription ID. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The Security Standard key - unique key for the standard type. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string standardId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(standardId, nameof(standardId)); - using var message = CreateListBySubscriptionRequest(subscriptionId); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, standardId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - { - CustomAssessmentAutomationsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CustomAssessmentAutomationsListResult.DeserializeCustomAssessmentAutomationsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -431,28 +431,26 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s return message; } - /// List custom assessment automations by provided subscription and resource group. + /// Get a list of all relevant security standards over a subscription level scope. /// The URL to the next page of results. /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - CustomAssessmentAutomationsListResult value = default; + StandardList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CustomAssessmentAutomationsListResult.DeserializeCustomAssessmentAutomationsListResult(document.RootElement); + value = StandardList.DeserializeStandardList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -460,28 +458,26 @@ public async Task> ListByResourc } } - /// List custom assessment automations by provided subscription and resource group. + /// Get a list of all relevant security standards over a subscription level scope. /// The URL to the next page of results. /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - CustomAssessmentAutomationsListResult value = default; + StandardList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CustomAssessmentAutomationsListResult.DeserializeCustomAssessmentAutomationsListResult(document.RootElement); + value = StandardList.DeserializeStandardList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -489,7 +485,7 @@ public Response ListByResourceGroupNextPa } } - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -503,26 +499,28 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st return message; } - /// List custom assessment automations by provided subscription. + /// Get security standards on all your resources inside a scope. /// The URL to the next page of results. /// Azure subscription ID. + /// The name of the resource group within the user's subscription. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - CustomAssessmentAutomationsListResult value = default; + StandardList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = CustomAssessmentAutomationsListResult.DeserializeCustomAssessmentAutomationsListResult(document.RootElement); + value = StandardList.DeserializeStandardList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -530,26 +528,28 @@ public async Task> ListBySubscri } } - /// List custom assessment automations by provided subscription. + /// Get security standards on all your resources inside a scope. /// The URL to the next page of results. /// Azure subscription ID. + /// The name of the resource group within the user's subscription. The name is case insensitive. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - CustomAssessmentAutomationsListResult value = default; + StandardList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = CustomAssessmentAutomationsListResult.DeserializeCustomAssessmentAutomationsListResult(document.RootElement); + value = StandardList.DeserializeStandardList(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SubAssessmentsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SubAssessmentsRestOperations.cs deleted file mode 100644 index f1cabebb3f25..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SubAssessmentsRestOperations.cs +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class SubAssessmentsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SubAssessmentsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SubAssessmentsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2019-01-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListAllRequest(string scope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(scope, false); - uri.AppendPath("/providers/Microsoft.Security/subAssessments", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get security sub-assessments on all your scanned resources inside a subscription scope. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The cancellation token to use. - /// is null. - public async Task> ListAllAsync(string scope, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - - using var message = CreateListAllRequest(scope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecuritySubAssessmentList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecuritySubAssessmentList.DeserializeSecuritySubAssessmentList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get security sub-assessments on all your scanned resources inside a subscription scope. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The cancellation token to use. - /// is null. - public Response ListAll(string scope, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - - using var message = CreateListAllRequest(scope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecuritySubAssessmentList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecuritySubAssessmentList.DeserializeSecuritySubAssessmentList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListRequest(string scope, string assessmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(scope, false); - uri.AppendPath("/providers/Microsoft.Security/assessments/", false); - uri.AppendPath(assessmentName, true); - uri.AppendPath("/subAssessments", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get security sub-assessments on all your scanned resources inside a scope. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string scope, string assessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - - using var message = CreateListRequest(scope, assessmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecuritySubAssessmentList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecuritySubAssessmentList.DeserializeSecuritySubAssessmentList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get security sub-assessments on all your scanned resources inside a scope. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string scope, string assessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - - using var message = CreateListRequest(scope, assessmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecuritySubAssessmentList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecuritySubAssessmentList.DeserializeSecuritySubAssessmentList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string scope, string assessmentName, string subAssessmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/", false); - uri.AppendPath(scope, false); - uri.AppendPath("/providers/Microsoft.Security/assessments/", false); - uri.AppendPath(assessmentName, true); - uri.AppendPath("/subAssessments/", false); - uri.AppendPath(subAssessmentName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a security sub-assessment on your scanned resource. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The Assessment Key - Unique key for the assessment type. - /// The Sub-Assessment Key - Unique key for the sub-assessment type. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string scope, string assessmentName, string subAssessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - Argument.AssertNotNullOrEmpty(subAssessmentName, nameof(subAssessmentName)); - - using var message = CreateGetRequest(scope, assessmentName, subAssessmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecuritySubAssessmentData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecuritySubAssessmentData.DeserializeSecuritySubAssessmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecuritySubAssessmentData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a security sub-assessment on your scanned resource. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The Assessment Key - Unique key for the assessment type. - /// The Sub-Assessment Key - Unique key for the sub-assessment type. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string scope, string assessmentName, string subAssessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - Argument.AssertNotNullOrEmpty(subAssessmentName, nameof(subAssessmentName)); - - using var message = CreateGetRequest(scope, assessmentName, subAssessmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecuritySubAssessmentData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecuritySubAssessmentData.DeserializeSecuritySubAssessmentData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecuritySubAssessmentData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListAllNextPageRequest(string nextLink, string scope) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get security sub-assessments on all your scanned resources inside a subscription scope. - /// The URL to the next page of results. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The cancellation token to use. - /// or is null. - public async Task> ListAllNextPageAsync(string nextLink, string scope, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(scope, nameof(scope)); - - using var message = CreateListAllNextPageRequest(nextLink, scope); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecuritySubAssessmentList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecuritySubAssessmentList.DeserializeSecuritySubAssessmentList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get security sub-assessments on all your scanned resources inside a subscription scope. - /// The URL to the next page of results. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The cancellation token to use. - /// or is null. - public Response ListAllNextPage(string nextLink, string scope, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(scope, nameof(scope)); - - using var message = CreateListAllNextPageRequest(nextLink, scope); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecuritySubAssessmentList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecuritySubAssessmentList.DeserializeSecuritySubAssessmentList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string scope, string assessmentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get security sub-assessments on all your scanned resources inside a scope. - /// The URL to the next page of results. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string scope, string assessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - - using var message = CreateListNextPageRequest(nextLink, scope, assessmentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecuritySubAssessmentList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecuritySubAssessmentList.DeserializeSecuritySubAssessmentList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get security sub-assessments on all your scanned resources inside a scope. - /// The URL to the next page of results. - /// Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group (/providers/Microsoft.Management/managementGroups/mgName). - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string scope, string assessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNull(scope, nameof(scope)); - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - - using var message = CreateListNextPageRequest(nextLink, scope, assessmentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecuritySubAssessmentList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecuritySubAssessmentList.DeserializeSecuritySubAssessmentList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SubscriptionGovernanceRulesExecuteStatusRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SubscriptionGovernanceRulesExecuteStatusRestOperations.cs deleted file mode 100644 index 7c1577f0903d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/SubscriptionGovernanceRulesExecuteStatusRestOperations.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class SubscriptionGovernanceRulesExecuteStatusRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SubscriptionGovernanceRulesExecuteStatusRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SubscriptionGovernanceRulesExecuteStatusRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-01-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string ruleId, string operationId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/governanceRules/", false); - uri.AppendPath(ruleId, true); - uri.AppendPath("/operationResults/", false); - uri.AppendPath(operationId, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - /// Azure subscription ID. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task GetAsync(string subscriptionId, string ruleId, string operationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); - - using var message = CreateGetRequest(subscriptionId, ruleId, operationId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a specific governanceRule execution status for the requested scope by ruleId and operationId. - /// Azure subscription ID. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string ruleId, string operationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); - - using var message = CreateGetRequest(subscriptionId, ruleId, operationId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/TasksRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/TasksRestOperations.cs deleted file mode 100644 index 494530a5c8e6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/TasksRestOperations.cs +++ /dev/null @@ -1,657 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class TasksRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of TasksRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public TasksRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2015-06-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/tasks", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Recommended tasks that will help improve the security of the subscription proactively. - /// Azure subscription ID. - /// OData filter. Optional. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityTaskList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityTaskList.DeserializeSecurityTaskList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Recommended tasks that will help improve the security of the subscription proactively. - /// Azure subscription ID. - /// OData filter. Optional. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityTaskList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityTaskList.DeserializeSecurityTaskList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByHomeRegionRequest(string subscriptionId, AzureLocation ascLocation, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/tasks", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Recommended tasks that will help improve the security of the subscription proactively. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// OData filter. Optional. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListByHomeRegionAsync(string subscriptionId, AzureLocation ascLocation, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionRequest(subscriptionId, ascLocation, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityTaskList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityTaskList.DeserializeSecurityTaskList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Recommended tasks that will help improve the security of the subscription proactively. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// OData filter. Optional. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListByHomeRegion(string subscriptionId, AzureLocation ascLocation, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionRequest(subscriptionId, ascLocation, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityTaskList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityTaskList.DeserializeSecurityTaskList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetSubscriptionLevelTaskRequest(string subscriptionId, AzureLocation ascLocation, string taskName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/tasks/", false); - uri.AppendPath(taskName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Recommended tasks that will help improve the security of the subscription proactively. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the task object, will be a GUID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetSubscriptionLevelTaskAsync(string subscriptionId, AzureLocation ascLocation, string taskName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); - - using var message = CreateGetSubscriptionLevelTaskRequest(subscriptionId, ascLocation, taskName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityTaskData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityTaskData.DeserializeSecurityTaskData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityTaskData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Recommended tasks that will help improve the security of the subscription proactively. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the task object, will be a GUID. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response GetSubscriptionLevelTask(string subscriptionId, AzureLocation ascLocation, string taskName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); - - using var message = CreateGetSubscriptionLevelTaskRequest(subscriptionId, ascLocation, taskName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityTaskData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityTaskData.DeserializeSecurityTaskData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityTaskData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/tasks", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Recommended tasks that will help improve the security of the subscription proactively. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// OData filter. Optional. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, ascLocation, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityTaskList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityTaskList.DeserializeSecurityTaskList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Recommended tasks that will help improve the security of the subscription proactively. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// OData filter. Optional. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, ascLocation, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityTaskList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityTaskList.DeserializeSecurityTaskList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetResourceGroupLevelTaskRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string taskName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/tasks/", false); - uri.AppendPath(taskName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Recommended tasks that will help improve the security of the subscription proactively. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the task object, will be a GUID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetResourceGroupLevelTaskAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string taskName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); - - using var message = CreateGetResourceGroupLevelTaskRequest(subscriptionId, resourceGroupName, ascLocation, taskName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityTaskData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityTaskData.DeserializeSecurityTaskData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityTaskData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Recommended tasks that will help improve the security of the subscription proactively. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of the task object, will be a GUID. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response GetResourceGroupLevelTask(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string taskName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); - - using var message = CreateGetResourceGroupLevelTaskRequest(subscriptionId, resourceGroupName, ascLocation, taskName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityTaskData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityTaskData.DeserializeSecurityTaskData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityTaskData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Recommended tasks that will help improve the security of the subscription proactively. - /// The URL to the next page of results. - /// Azure subscription ID. - /// OData filter. Optional. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityTaskList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityTaskList.DeserializeSecurityTaskList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Recommended tasks that will help improve the security of the subscription proactively. - /// The URL to the next page of results. - /// Azure subscription ID. - /// OData filter. Optional. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityTaskList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityTaskList.DeserializeSecurityTaskList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByHomeRegionNextPageRequest(string nextLink, string subscriptionId, AzureLocation ascLocation, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Recommended tasks that will help improve the security of the subscription proactively. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// OData filter. Optional. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListByHomeRegionNextPageAsync(string nextLink, string subscriptionId, AzureLocation ascLocation, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionNextPageRequest(nextLink, subscriptionId, ascLocation, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityTaskList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityTaskList.DeserializeSecurityTaskList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Recommended tasks that will help improve the security of the subscription proactively. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// OData filter. Optional. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListByHomeRegionNextPage(string nextLink, string subscriptionId, AzureLocation ascLocation, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionNextPageRequest(nextLink, subscriptionId, ascLocation, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityTaskList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityTaskList.DeserializeSecurityTaskList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string filter) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Recommended tasks that will help improve the security of the subscription proactively. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// OData filter. Optional. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, ascLocation, filter); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityTaskList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityTaskList.DeserializeSecurityTaskList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Recommended tasks that will help improve the security of the subscription proactively. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// OData filter. Optional. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string filter = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, ascLocation, filter); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityTaskList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityTaskList.DeserializeSecurityTaskList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/TopologyRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/TopologyRestOperations.cs deleted file mode 100644 index f36fcab90351..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/TopologyRestOperations.cs +++ /dev/null @@ -1,398 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class TopologyRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of TopologyRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public TopologyRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2020-01-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/topologies", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list that allows to build a topology view of a subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TopologyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TopologyList.DeserializeTopologyList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list that allows to build a topology view of a subscription. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TopologyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TopologyList.DeserializeTopologyList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByHomeRegionRequest(string subscriptionId, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/topologies", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list that allows to build a topology view of a subscription and location. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListByHomeRegionAsync(string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionRequest(subscriptionId, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TopologyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TopologyList.DeserializeTopologyList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list that allows to build a topology view of a subscription and location. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListByHomeRegion(string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionRequest(subscriptionId, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TopologyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TopologyList.DeserializeTopologyList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string topologyResourceName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Security/locations/", false); - uri.AppendPath(ascLocation, true); - uri.AppendPath("/topologies/", false); - uri.AppendPath(topologyResourceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a specific topology component. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a topology resources collection. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string topologyResourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(topologyResourceName, nameof(topologyResourceName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, ascLocation, topologyResourceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityTopologyResource value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityTopologyResource.DeserializeSecurityTopologyResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a specific topology component. - /// Azure subscription ID. - /// The name of the resource group within the user's subscription. The name is case insensitive. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// Name of a topology resources collection. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, AzureLocation ascLocation, string topologyResourceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(topologyResourceName, nameof(topologyResourceName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, ascLocation, topologyResourceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityTopologyResource value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityTopologyResource.DeserializeSecurityTopologyResource(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list that allows to build a topology view of a subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TopologyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TopologyList.DeserializeTopologyList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list that allows to build a topology view of a subscription. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TopologyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TopologyList.DeserializeTopologyList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListByHomeRegionNextPageRequest(string nextLink, string subscriptionId, AzureLocation ascLocation) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets a list that allows to build a topology view of a subscription and location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListByHomeRegionNextPageAsync(string nextLink, string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionNextPageRequest(nextLink, subscriptionId, ascLocation); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - TopologyList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = TopologyList.DeserializeTopologyList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets a list that allows to build a topology view of a subscription and location. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListByHomeRegionNextPage(string nextLink, string subscriptionId, AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListByHomeRegionNextPageRequest(nextLink, subscriptionId, ascLocation); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - TopologyList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = TopologyList.DeserializeTopologyList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/WorkspaceSettingsRestOperations.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/WorkspaceSettingsRestOperations.cs deleted file mode 100644 index 4b8e09fee5c4..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/RestOperations/WorkspaceSettingsRestOperations.cs +++ /dev/null @@ -1,473 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - internal partial class WorkspaceSettingsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of WorkspaceSettingsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public WorkspaceSettingsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2017-08-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/workspaceSettings", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WorkspaceSettingList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WorkspaceSettingList.DeserializeWorkspaceSettingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set. - /// Azure subscription ID. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WorkspaceSettingList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WorkspaceSettingList.DeserializeWorkspaceSettingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string workspaceSettingName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/workspaceSettings/", false); - uri.AppendPath(workspaceSettingName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set. - /// Azure subscription ID. - /// Name of the security setting. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string workspaceSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(workspaceSettingName, nameof(workspaceSettingName)); - - using var message = CreateGetRequest(subscriptionId, workspaceSettingName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityWorkspaceSettingData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityWorkspaceSettingData.DeserializeSecurityWorkspaceSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityWorkspaceSettingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set. - /// Azure subscription ID. - /// Name of the security setting. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string workspaceSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(workspaceSettingName, nameof(workspaceSettingName)); - - using var message = CreateGetRequest(subscriptionId, workspaceSettingName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityWorkspaceSettingData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityWorkspaceSettingData.DeserializeSecurityWorkspaceSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((SecurityWorkspaceSettingData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateRequest(string subscriptionId, string workspaceSettingName, SecurityWorkspaceSettingData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/workspaceSettings/", false); - uri.AppendPath(workspaceSettingName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// creating settings about where we should store your security data and logs. - /// Azure subscription ID. - /// Name of the security setting. - /// Security data setting object. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> CreateAsync(string subscriptionId, string workspaceSettingName, SecurityWorkspaceSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(workspaceSettingName, nameof(workspaceSettingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, workspaceSettingName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityWorkspaceSettingData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityWorkspaceSettingData.DeserializeSecurityWorkspaceSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// creating settings about where we should store your security data and logs. - /// Azure subscription ID. - /// Name of the security setting. - /// Security data setting object. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Create(string subscriptionId, string workspaceSettingName, SecurityWorkspaceSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(workspaceSettingName, nameof(workspaceSettingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateRequest(subscriptionId, workspaceSettingName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityWorkspaceSettingData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityWorkspaceSettingData.DeserializeSecurityWorkspaceSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string workspaceSettingName, SecurityWorkspaceSettingData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/workspaceSettings/", false); - uri.AppendPath(workspaceSettingName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Settings about where we should store your security data and logs. - /// Azure subscription ID. - /// Name of the security setting. - /// Security data setting object. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string workspaceSettingName, SecurityWorkspaceSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(workspaceSettingName, nameof(workspaceSettingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateRequest(subscriptionId, workspaceSettingName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - SecurityWorkspaceSettingData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = SecurityWorkspaceSettingData.DeserializeSecurityWorkspaceSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Settings about where we should store your security data and logs. - /// Azure subscription ID. - /// Name of the security setting. - /// Security data setting object. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string workspaceSettingName, SecurityWorkspaceSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(workspaceSettingName, nameof(workspaceSettingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateUpdateRequest(subscriptionId, workspaceSettingName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - SecurityWorkspaceSettingData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = SecurityWorkspaceSettingData.DeserializeSecurityWorkspaceSettingData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string workspaceSettingName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Security/workspaceSettings/", false); - uri.AppendPath(workspaceSettingName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - /// Azure subscription ID. - /// Name of the security setting. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string workspaceSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(workspaceSettingName, nameof(workspaceSettingName)); - - using var message = CreateDeleteRequest(subscriptionId, workspaceSettingName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace. - /// Azure subscription ID. - /// Name of the security setting. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string workspaceSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(workspaceSettingName, nameof(workspaceSettingName)); - - using var message = CreateDeleteRequest(subscriptionId, workspaceSettingName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - WorkspaceSettingList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = WorkspaceSettingList.DeserializeWorkspaceSettingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set. - /// The URL to the next page of results. - /// Azure subscription ID. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - WorkspaceSettingList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = WorkspaceSettingList.DeserializeWorkspaceSettingList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecureScoreCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecureScoreCollection.cs deleted file mode 100644 index 4c84014cd059..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecureScoreCollection.cs +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSecureScores method from an instance of . - /// - public partial class SecureScoreCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _secureScoreClientDiagnostics; - private readonly SecureScoresRestOperations _secureScoreRestClient; - - /// Initializes a new instance of the class for mocking. - protected SecureScoreCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SecureScoreCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _secureScoreClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecureScoreResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SecureScoreResource.ResourceType, out string secureScoreApiVersion); - _secureScoreRestClient = new SecureScoresRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, secureScoreApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SubscriptionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); - } - - /// - /// Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC Default initiative, use 'ascScore'. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName} - /// - /// - /// Operation Id - /// SecureScores_Get - /// - /// - /// - /// The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string secureScoreName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(secureScoreName, nameof(secureScoreName)); - - using var scope = _secureScoreClientDiagnostics.CreateScope("SecureScoreCollection.Get"); - scope.Start(); - try - { - var response = await _secureScoreRestClient.GetAsync(Id.SubscriptionId, secureScoreName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecureScoreResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC Default initiative, use 'ascScore'. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName} - /// - /// - /// Operation Id - /// SecureScores_Get - /// - /// - /// - /// The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string secureScoreName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(secureScoreName, nameof(secureScoreName)); - - using var scope = _secureScoreClientDiagnostics.CreateScope("SecureScoreCollection.Get"); - scope.Start(); - try - { - var response = _secureScoreRestClient.Get(Id.SubscriptionId, secureScoreName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecureScoreResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores - /// - /// - /// Operation Id - /// SecureScores_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _secureScoreRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _secureScoreRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecureScoreResource(Client, SecureScoreData.DeserializeSecureScoreData(e)), _secureScoreClientDiagnostics, Pipeline, "SecureScoreCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores - /// - /// - /// Operation Id - /// SecureScores_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _secureScoreRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _secureScoreRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecureScoreResource(Client, SecureScoreData.DeserializeSecureScoreData(e)), _secureScoreClientDiagnostics, Pipeline, "SecureScoreCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName} - /// - /// - /// Operation Id - /// SecureScores_Get - /// - /// - /// - /// The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string secureScoreName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(secureScoreName, nameof(secureScoreName)); - - using var scope = _secureScoreClientDiagnostics.CreateScope("SecureScoreCollection.Exists"); - scope.Start(); - try - { - var response = await _secureScoreRestClient.GetAsync(Id.SubscriptionId, secureScoreName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName} - /// - /// - /// Operation Id - /// SecureScores_Get - /// - /// - /// - /// The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string secureScoreName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(secureScoreName, nameof(secureScoreName)); - - using var scope = _secureScoreClientDiagnostics.CreateScope("SecureScoreCollection.Exists"); - scope.Start(); - try - { - var response = _secureScoreRestClient.Get(Id.SubscriptionId, secureScoreName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecureScoreData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecureScoreData.cs deleted file mode 100644 index 726c92f68c62..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecureScoreData.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SecureScore data model. - /// Secure score item data model - /// - public partial class SecureScoreData : ResourceData - { - /// Initializes a new instance of SecureScoreData. - public SecureScoreData() - { - } - - /// Initializes a new instance of SecureScoreData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The initiative’s name. - /// The relative weight for each subscription. Used when calculating an aggregated secure score for multiple subscriptions. - /// Maximum score available. - /// Current score. - /// Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point. - internal SecureScoreData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string displayName, long? weight, int? max, double? current, double? percentage) : base(id, name, resourceType, systemData) - { - DisplayName = displayName; - Weight = weight; - Max = max; - Current = current; - Percentage = percentage; - } - - /// The initiative’s name. - public string DisplayName { get; } - /// The relative weight for each subscription. Used when calculating an aggregated secure score for multiple subscriptions. - public long? Weight { get; } - /// Maximum score available. - public int? Max { get; } - /// Current score. - public double? Current { get; } - /// Ratio of the current score divided by the maximum. Rounded to 4 digits after the decimal point. - public double? Percentage { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecureScoreResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecureScoreResource.cs deleted file mode 100644 index d09ab1380bfb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecureScoreResource.cs +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SecureScore along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSecureScoreResource method. - /// Otherwise you can get one from its parent resource using the GetSecureScore method. - /// - public partial class SecureScoreResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string secureScoreName) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _secureScoreClientDiagnostics; - private readonly SecureScoresRestOperations _secureScoreRestClient; - private readonly ClientDiagnostics _secureScoreControlsClientDiagnostics; - private readonly SecureScoreControlsRestOperations _secureScoreControlsRestClient; - private readonly SecureScoreData _data; - - /// Initializes a new instance of the class for mocking. - protected SecureScoreResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SecureScoreResource(ArmClient client, SecureScoreData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SecureScoreResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _secureScoreClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string secureScoreApiVersion); - _secureScoreRestClient = new SecureScoresRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, secureScoreApiVersion); - _secureScoreControlsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _secureScoreControlsRestClient = new SecureScoreControlsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/secureScores"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecureScoreData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC Default initiative, use 'ascScore'. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName} - /// - /// - /// Operation Id - /// SecureScores_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _secureScoreClientDiagnostics.CreateScope("SecureScoreResource.Get"); - scope.Start(); - try - { - var response = await _secureScoreRestClient.GetAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecureScoreResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC Default initiative, use 'ascScore'. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName} - /// - /// - /// Operation Id - /// SecureScores_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _secureScoreClientDiagnostics.CreateScope("SecureScoreResource.Get"); - scope.Start(); - try - { - var response = _secureScoreRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecureScoreResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get all security controls for a specific initiative within a scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}/secureScoreControls - /// - /// - /// Operation Id - /// SecureScoreControls_ListBySecureScore - /// - /// - /// - /// OData expand. Optional. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetSecureScoreControlsAsync(SecurityScoreODataExpand? expand = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _secureScoreControlsRestClient.CreateListBySecureScoreRequest(Id.SubscriptionId, Id.Name, expand); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _secureScoreControlsRestClient.CreateListBySecureScoreNextPageRequest(nextLink, Id.SubscriptionId, Id.Name, expand); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecureScoreControlDetails.DeserializeSecureScoreControlDetails, _secureScoreControlsClientDiagnostics, Pipeline, "SecureScoreResource.GetSecureScoreControls", "value", "nextLink", cancellationToken); - } - - /// - /// Get all security controls for a specific initiative within a scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}/secureScoreControls - /// - /// - /// Operation Id - /// SecureScoreControls_ListBySecureScore - /// - /// - /// - /// OData expand. Optional. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetSecureScoreControls(SecurityScoreODataExpand? expand = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _secureScoreControlsRestClient.CreateListBySecureScoreRequest(Id.SubscriptionId, Id.Name, expand); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _secureScoreControlsRestClient.CreateListBySecureScoreNextPageRequest(nextLink, Id.SubscriptionId, Id.Name, expand); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecureScoreControlDetails.DeserializeSecureScoreControlDetails, _secureScoreControlsClientDiagnostics, Pipeline, "SecureScoreResource.GetSecureScoreControls", "value", "nextLink", cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAlertData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAlertData.cs deleted file mode 100644 index 1f696bc20e83..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAlertData.cs +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SecurityAlert data model. - /// Security alert - /// - public partial class SecurityAlertData : ResourceData - { - /// Initializes a new instance of SecurityAlertData. - public SecurityAlertData() - { - ResourceIdentifiers = new ChangeTrackingList(); - RemediationSteps = new ChangeTrackingList(); - ExtendedLinks = new ChangeTrackingList>(); - Entities = new ChangeTrackingList(); - ExtendedProperties = new ChangeTrackingDictionary(); - Techniques = new ChangeTrackingList(); - SubTechniques = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecurityAlertData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Schema version. - /// Unique identifier for the detection logic (all alert instances from the same detection logic will have the same alertType). - /// Unique identifier for the alert. - /// The name of Azure Security Center pricing tier which powering this alert. Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing. - /// The display name of the alert. - /// Description of the suspicious activity that was detected. - /// The risk level of the threat that was detected. Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. - /// The kill chain related intent behind the alert. For list of supported values, and explanations of Azure Security Center's supported kill chain intents. - /// The UTC time of the first event or activity included in the alert in ISO8601 format. - /// The UTC time of the last event or activity included in the alert in ISO8601 format. - /// - /// The resource identifiers that can be used to direct the alert to the right product exposure group (tenant, workspace, subscription etc.). There can be multiple identifiers of different type per alert. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - /// Manual action items to take to remediate the alert. - /// The name of the vendor that raises the alert. - /// The life cycle status of the alert. - /// Links related to the alert. - /// A direct link to the alert page in Azure Portal. - /// The UTC time the alert was generated in ISO8601 format. - /// The name of the product which published this alert (Azure Security Center, Azure ATP, Microsoft Defender ATP, O365 ATP, MCAS, and so on). - /// The UTC processing end time of the alert in ISO8601 format. - /// A list of entities related to the alert. - /// This field determines whether the alert is an incident (a compound grouping of several alerts) or a single alert. - /// Key for corelating related alerts. Alerts with the same correlation key considered to be related. - /// Custom properties for the alert. - /// The display name of the resource most related to this alert. - /// kill chain related techniques behind the alert. - /// Kill chain related sub-techniques behind the alert. - /// Changing set of properties depending on the supportingEvidence type. - internal SecurityAlertData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string version, string alertType, string systemAlertId, string productComponentName, string alertDisplayName, string description, SecurityAlertSeverity? severity, KillChainIntent? intent, DateTimeOffset? startOn, DateTimeOffset? endOn, IReadOnlyList resourceIdentifiers, IReadOnlyList remediationSteps, string vendorName, SecurityAlertStatus? status, IReadOnlyList> extendedLinks, Uri alertUri, DateTimeOffset? generatedOn, string productName, DateTimeOffset? processingEndOn, IReadOnlyList entities, bool? isIncident, string correlationKey, IDictionary extendedProperties, string compromisedEntity, IReadOnlyList techniques, IReadOnlyList subTechniques, SecurityAlertSupportingEvidence supportingEvidence) : base(id, name, resourceType, systemData) - { - Version = version; - AlertType = alertType; - SystemAlertId = systemAlertId; - ProductComponentName = productComponentName; - AlertDisplayName = alertDisplayName; - Description = description; - Severity = severity; - Intent = intent; - StartOn = startOn; - EndOn = endOn; - ResourceIdentifiers = resourceIdentifiers; - RemediationSteps = remediationSteps; - VendorName = vendorName; - Status = status; - ExtendedLinks = extendedLinks; - AlertUri = alertUri; - GeneratedOn = generatedOn; - ProductName = productName; - ProcessingEndOn = processingEndOn; - Entities = entities; - IsIncident = isIncident; - CorrelationKey = correlationKey; - ExtendedProperties = extendedProperties; - CompromisedEntity = compromisedEntity; - Techniques = techniques; - SubTechniques = subTechniques; - SupportingEvidence = supportingEvidence; - } - - /// Schema version. - public string Version { get; } - /// Unique identifier for the detection logic (all alert instances from the same detection logic will have the same alertType). - public string AlertType { get; } - /// Unique identifier for the alert. - public string SystemAlertId { get; } - /// The name of Azure Security Center pricing tier which powering this alert. Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing. - public string ProductComponentName { get; } - /// The display name of the alert. - public string AlertDisplayName { get; } - /// Description of the suspicious activity that was detected. - public string Description { get; } - /// The risk level of the threat that was detected. Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. - public SecurityAlertSeverity? Severity { get; } - /// The kill chain related intent behind the alert. For list of supported values, and explanations of Azure Security Center's supported kill chain intents. - public KillChainIntent? Intent { get; } - /// The UTC time of the first event or activity included in the alert in ISO8601 format. - public DateTimeOffset? StartOn { get; } - /// The UTC time of the last event or activity included in the alert in ISO8601 format. - public DateTimeOffset? EndOn { get; } - /// - /// The resource identifiers that can be used to direct the alert to the right product exposure group (tenant, workspace, subscription etc.). There can be multiple identifiers of different type per alert. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public IReadOnlyList ResourceIdentifiers { get; } - /// Manual action items to take to remediate the alert. - public IReadOnlyList RemediationSteps { get; } - /// The name of the vendor that raises the alert. - public string VendorName { get; } - /// The life cycle status of the alert. - public SecurityAlertStatus? Status { get; } - /// Links related to the alert. - public IReadOnlyList> ExtendedLinks { get; } - /// A direct link to the alert page in Azure Portal. - public Uri AlertUri { get; } - /// The UTC time the alert was generated in ISO8601 format. - public DateTimeOffset? GeneratedOn { get; } - /// The name of the product which published this alert (Azure Security Center, Azure ATP, Microsoft Defender ATP, O365 ATP, MCAS, and so on). - public string ProductName { get; } - /// The UTC processing end time of the alert in ISO8601 format. - public DateTimeOffset? ProcessingEndOn { get; } - /// A list of entities related to the alert. - public IReadOnlyList Entities { get; } - /// This field determines whether the alert is an incident (a compound grouping of several alerts) or a single alert. - public bool? IsIncident { get; } - /// Key for corelating related alerts. Alerts with the same correlation key considered to be related. - public string CorrelationKey { get; } - /// Custom properties for the alert. - public IDictionary ExtendedProperties { get; } - /// The display name of the resource most related to this alert. - public string CompromisedEntity { get; } - /// kill chain related techniques behind the alert. - public IReadOnlyList Techniques { get; } - /// Kill chain related sub-techniques behind the alert. - public IReadOnlyList SubTechniques { get; } - /// Changing set of properties depending on the supportingEvidence type. - public SecurityAlertSupportingEvidence SupportingEvidence { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAlertsSuppressionRuleCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAlertsSuppressionRuleCollection.cs deleted file mode 100644 index edf22389457e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAlertsSuppressionRuleCollection.cs +++ /dev/null @@ -1,343 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSecurityAlertsSuppressionRules method from an instance of . - /// - public partial class SecurityAlertsSuppressionRuleCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics; - private readonly AlertsSuppressionRulesRestOperations _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient; - - /// Initializes a new instance of the class for mocking. - protected SecurityAlertsSuppressionRuleCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SecurityAlertsSuppressionRuleCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecurityAlertsSuppressionRuleResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SecurityAlertsSuppressionRuleResource.ResourceType, out string securityAlertsSuppressionRuleAlertsSuppressionRulesApiVersion); - _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient = new AlertsSuppressionRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityAlertsSuppressionRuleAlertsSuppressionRulesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SubscriptionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); - } - - /// - /// Update existing rule or create new rule if it doesn't exist - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName} - /// - /// - /// Operation Id - /// AlertsSuppressionRules_Update - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The unique name of the suppression alert rule. - /// Suppression rule object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string alertsSuppressionRuleName, SecurityAlertsSuppressionRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(alertsSuppressionRuleName, nameof(alertsSuppressionRuleName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics.CreateScope("SecurityAlertsSuppressionRuleCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient.UpdateAsync(Id.SubscriptionId, alertsSuppressionRuleName, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityAlertsSuppressionRuleResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update existing rule or create new rule if it doesn't exist - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName} - /// - /// - /// Operation Id - /// AlertsSuppressionRules_Update - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The unique name of the suppression alert rule. - /// Suppression rule object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string alertsSuppressionRuleName, SecurityAlertsSuppressionRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(alertsSuppressionRuleName, nameof(alertsSuppressionRuleName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics.CreateScope("SecurityAlertsSuppressionRuleCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient.Update(Id.SubscriptionId, alertsSuppressionRuleName, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityAlertsSuppressionRuleResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName} - /// - /// - /// Operation Id - /// AlertsSuppressionRules_Get - /// - /// - /// - /// The unique name of the suppression alert rule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string alertsSuppressionRuleName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(alertsSuppressionRuleName, nameof(alertsSuppressionRuleName)); - - using var scope = _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics.CreateScope("SecurityAlertsSuppressionRuleCollection.Get"); - scope.Start(); - try - { - var response = await _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient.GetAsync(Id.SubscriptionId, alertsSuppressionRuleName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityAlertsSuppressionRuleResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName} - /// - /// - /// Operation Id - /// AlertsSuppressionRules_Get - /// - /// - /// - /// The unique name of the suppression alert rule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string alertsSuppressionRuleName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(alertsSuppressionRuleName, nameof(alertsSuppressionRuleName)); - - using var scope = _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics.CreateScope("SecurityAlertsSuppressionRuleCollection.Get"); - scope.Start(); - try - { - var response = _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient.Get(Id.SubscriptionId, alertsSuppressionRuleName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityAlertsSuppressionRuleResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List of all the dismiss rules for the given subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules - /// - /// - /// Operation Id - /// AlertsSuppressionRules_List - /// - /// - /// - /// Type of the alert to get rules for. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string alertType = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient.CreateListRequest(Id.SubscriptionId, alertType); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, alertType); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityAlertsSuppressionRuleResource(Client, SecurityAlertsSuppressionRuleData.DeserializeSecurityAlertsSuppressionRuleData(e)), _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics, Pipeline, "SecurityAlertsSuppressionRuleCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List of all the dismiss rules for the given subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules - /// - /// - /// Operation Id - /// AlertsSuppressionRules_List - /// - /// - /// - /// Type of the alert to get rules for. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string alertType = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient.CreateListRequest(Id.SubscriptionId, alertType); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, alertType); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityAlertsSuppressionRuleResource(Client, SecurityAlertsSuppressionRuleData.DeserializeSecurityAlertsSuppressionRuleData(e)), _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics, Pipeline, "SecurityAlertsSuppressionRuleCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName} - /// - /// - /// Operation Id - /// AlertsSuppressionRules_Get - /// - /// - /// - /// The unique name of the suppression alert rule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string alertsSuppressionRuleName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(alertsSuppressionRuleName, nameof(alertsSuppressionRuleName)); - - using var scope = _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics.CreateScope("SecurityAlertsSuppressionRuleCollection.Exists"); - scope.Start(); - try - { - var response = await _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient.GetAsync(Id.SubscriptionId, alertsSuppressionRuleName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName} - /// - /// - /// Operation Id - /// AlertsSuppressionRules_Get - /// - /// - /// - /// The unique name of the suppression alert rule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string alertsSuppressionRuleName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(alertsSuppressionRuleName, nameof(alertsSuppressionRuleName)); - - using var scope = _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics.CreateScope("SecurityAlertsSuppressionRuleCollection.Exists"); - scope.Start(); - try - { - var response = _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient.Get(Id.SubscriptionId, alertsSuppressionRuleName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAlertsSuppressionRuleData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAlertsSuppressionRuleData.cs deleted file mode 100644 index e3f39a42693d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAlertsSuppressionRuleData.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SecurityAlertsSuppressionRule data model. - /// Describes the suppression rule - /// - public partial class SecurityAlertsSuppressionRuleData : ResourceData - { - /// Initializes a new instance of SecurityAlertsSuppressionRuleData. - public SecurityAlertsSuppressionRuleData() - { - } - - /// Initializes a new instance of SecurityAlertsSuppressionRuleData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Type of the alert to automatically suppress. For all alert types, use '*'. - /// The last time this rule was modified. - /// Expiration date of the rule, if value is not provided or provided as null this field will default to the maximum allowed expiration date. - /// The reason for dismissing the alert. - /// Possible states of the rule. - /// Any comment regarding the rule. - /// The suppression conditions. - internal SecurityAlertsSuppressionRuleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string alertType, DateTimeOffset? lastModifiedOn, DateTimeOffset? expireOn, string reason, SecurityAlertsSuppressionRuleState? state, string comment, SuppressionAlertsScope suppressionAlertsScope) : base(id, name, resourceType, systemData) - { - AlertType = alertType; - LastModifiedOn = lastModifiedOn; - ExpireOn = expireOn; - Reason = reason; - State = state; - Comment = comment; - SuppressionAlertsScope = suppressionAlertsScope; - } - - /// Type of the alert to automatically suppress. For all alert types, use '*'. - public string AlertType { get; set; } - /// The last time this rule was modified. - public DateTimeOffset? LastModifiedOn { get; } - /// Expiration date of the rule, if value is not provided or provided as null this field will default to the maximum allowed expiration date. - public DateTimeOffset? ExpireOn { get; set; } - /// The reason for dismissing the alert. - public string Reason { get; set; } - /// Possible states of the rule. - public SecurityAlertsSuppressionRuleState? State { get; set; } - /// Any comment regarding the rule. - public string Comment { get; set; } - /// The suppression conditions. - internal SuppressionAlertsScope SuppressionAlertsScope { get; set; } - /// All the conditions inside need to be true in order to suppress the alert. - public IList SuppressionAlertsScopeAllOf - { - get => SuppressionAlertsScope is null ? default : SuppressionAlertsScope.AllOf; - set => SuppressionAlertsScope = new SuppressionAlertsScope(value); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAlertsSuppressionRuleResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAlertsSuppressionRuleResource.cs deleted file mode 100644 index eb9de33dcf1f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAlertsSuppressionRuleResource.cs +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SecurityAlertsSuppressionRule along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSecurityAlertsSuppressionRuleResource method. - /// Otherwise you can get one from its parent resource using the GetSecurityAlertsSuppressionRule method. - /// - public partial class SecurityAlertsSuppressionRuleResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string alertsSuppressionRuleName) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics; - private readonly AlertsSuppressionRulesRestOperations _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient; - private readonly SecurityAlertsSuppressionRuleData _data; - - /// Initializes a new instance of the class for mocking. - protected SecurityAlertsSuppressionRuleResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SecurityAlertsSuppressionRuleResource(ArmClient client, SecurityAlertsSuppressionRuleData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SecurityAlertsSuppressionRuleResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string securityAlertsSuppressionRuleAlertsSuppressionRulesApiVersion); - _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient = new AlertsSuppressionRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityAlertsSuppressionRuleAlertsSuppressionRulesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/alertsSuppressionRules"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecurityAlertsSuppressionRuleData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName} - /// - /// - /// Operation Id - /// AlertsSuppressionRules_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics.CreateScope("SecurityAlertsSuppressionRuleResource.Get"); - scope.Start(); - try - { - var response = await _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient.GetAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityAlertsSuppressionRuleResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName} - /// - /// - /// Operation Id - /// AlertsSuppressionRules_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics.CreateScope("SecurityAlertsSuppressionRuleResource.Get"); - scope.Start(); - try - { - var response = _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityAlertsSuppressionRuleResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete dismiss alert rule for this subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName} - /// - /// - /// Operation Id - /// AlertsSuppressionRules_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics.CreateScope("SecurityAlertsSuppressionRuleResource.Delete"); - scope.Start(); - try - { - var response = await _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient.DeleteAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete dismiss alert rule for this subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName} - /// - /// - /// Operation Id - /// AlertsSuppressionRules_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics.CreateScope("SecurityAlertsSuppressionRuleResource.Delete"); - scope.Start(); - try - { - var response = _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient.Delete(Id.SubscriptionId, Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update existing rule or create new rule if it doesn't exist - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName} - /// - /// - /// Operation Id - /// AlertsSuppressionRules_Update - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Suppression rule object. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, SecurityAlertsSuppressionRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics.CreateScope("SecurityAlertsSuppressionRuleResource.Update"); - scope.Start(); - try - { - var response = await _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient.UpdateAsync(Id.SubscriptionId, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityAlertsSuppressionRuleResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update existing rule or create new rule if it doesn't exist - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName} - /// - /// - /// Operation Id - /// AlertsSuppressionRules_Update - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Suppression rule object. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, SecurityAlertsSuppressionRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityAlertsSuppressionRuleAlertsSuppressionRulesClientDiagnostics.CreateScope("SecurityAlertsSuppressionRuleResource.Update"); - scope.Start(); - try - { - var response = _securityAlertsSuppressionRuleAlertsSuppressionRulesRestClient.Update(Id.SubscriptionId, Id.Name, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityAlertsSuppressionRuleResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityApplicationData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityApplicationData.cs deleted file mode 100644 index 118142305c12..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityApplicationData.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SecurityApplication data model. - /// Security Application over a given scope - /// - public partial class SecurityApplicationData : ResourceData - { - /// Initializes a new instance of SecurityApplicationData. - public SecurityApplicationData() - { - ConditionSets = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecurityApplicationData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// display name of the application. - /// description of the application. - /// The application source, what it affects, e.g. Assessments. - /// The application conditionSets - see examples. - internal SecurityApplicationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string displayName, string description, ApplicationSourceResourceType? sourceResourceType, IList conditionSets) : base(id, name, resourceType, systemData) - { - DisplayName = displayName; - Description = description; - SourceResourceType = sourceResourceType; - ConditionSets = conditionSets; - } - - /// display name of the application. - public string DisplayName { get; set; } - /// description of the application. - public string Description { get; set; } - /// The application source, what it affects, e.g. Assessments. - public ApplicationSourceResourceType? SourceResourceType { get; set; } - /// - /// The application conditionSets - see examples - /// - /// To assign an object to the element of this property use . - /// - /// - /// To assign an already formated json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public IList ConditionSets { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAssessmentCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAssessmentCollection.cs deleted file mode 100644 index 3012e38909b0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAssessmentCollection.cs +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSecurityAssessments method from an instance of . - /// - public partial class SecurityAssessmentCollection : ArmCollection - { - private readonly ClientDiagnostics _securityAssessmentAssessmentsClientDiagnostics; - private readonly AssessmentsRestOperations _securityAssessmentAssessmentsRestClient; - - /// Initializes a new instance of the class for mocking. - protected SecurityAssessmentCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SecurityAssessmentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityAssessmentAssessmentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecurityAssessmentResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SecurityAssessmentResource.ResourceType, out string securityAssessmentAssessmentsApiVersion); - _securityAssessmentAssessmentsRestClient = new AssessmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityAssessmentAssessmentsApiVersion); - } - - /// - /// Create a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} - /// - /// - /// Operation Id - /// Assessments_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The Assessment Key - Unique key for the assessment type. - /// Calculated assessment on a pre-defined assessment metadata. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string assessmentName, SecurityAssessmentCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _securityAssessmentAssessmentsClientDiagnostics.CreateScope("SecurityAssessmentCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _securityAssessmentAssessmentsRestClient.CreateOrUpdateAsync(Id, assessmentName, content, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityAssessmentResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} - /// - /// - /// Operation Id - /// Assessments_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The Assessment Key - Unique key for the assessment type. - /// Calculated assessment on a pre-defined assessment metadata. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string assessmentName, SecurityAssessmentCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _securityAssessmentAssessmentsClientDiagnostics.CreateScope("SecurityAssessmentCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _securityAssessmentAssessmentsRestClient.CreateOrUpdate(Id, assessmentName, content, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityAssessmentResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a security assessment on your scanned resource - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} - /// - /// - /// Operation Id - /// Assessments_Get - /// - /// - /// - /// The Assessment Key - Unique key for the assessment type. - /// OData expand. Optional. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string assessmentName, SecurityAssessmentODataExpand? expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - - using var scope = _securityAssessmentAssessmentsClientDiagnostics.CreateScope("SecurityAssessmentCollection.Get"); - scope.Start(); - try - { - var response = await _securityAssessmentAssessmentsRestClient.GetAsync(Id, assessmentName, expand, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityAssessmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a security assessment on your scanned resource - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} - /// - /// - /// Operation Id - /// Assessments_Get - /// - /// - /// - /// The Assessment Key - Unique key for the assessment type. - /// OData expand. Optional. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string assessmentName, SecurityAssessmentODataExpand? expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - - using var scope = _securityAssessmentAssessmentsClientDiagnostics.CreateScope("SecurityAssessmentCollection.Get"); - scope.Start(); - try - { - var response = _securityAssessmentAssessmentsRestClient.Get(Id, assessmentName, expand, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityAssessmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} - /// - /// - /// Operation Id - /// Assessments_Get - /// - /// - /// - /// The Assessment Key - Unique key for the assessment type. - /// OData expand. Optional. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string assessmentName, SecurityAssessmentODataExpand? expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - - using var scope = _securityAssessmentAssessmentsClientDiagnostics.CreateScope("SecurityAssessmentCollection.Exists"); - scope.Start(); - try - { - var response = await _securityAssessmentAssessmentsRestClient.GetAsync(Id, assessmentName, expand, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} - /// - /// - /// Operation Id - /// Assessments_Get - /// - /// - /// - /// The Assessment Key - Unique key for the assessment type. - /// OData expand. Optional. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string assessmentName, SecurityAssessmentODataExpand? expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentName, nameof(assessmentName)); - - using var scope = _securityAssessmentAssessmentsClientDiagnostics.CreateScope("SecurityAssessmentCollection.Exists"); - scope.Start(); - try - { - var response = _securityAssessmentAssessmentsRestClient.Get(Id, assessmentName, expand, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAssessmentData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAssessmentData.cs deleted file mode 100644 index 845f9a206477..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAssessmentData.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SecurityAssessment data model. - /// Security assessment on a resource - response format - /// - public partial class SecurityAssessmentData : ResourceData - { - /// Initializes a new instance of SecurityAssessmentData. - public SecurityAssessmentData() - { - AdditionalData = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of SecurityAssessmentData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// - /// Details of the resource that was assessed - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// User friendly display name of the assessment. - /// Additional data regarding the assessment. - /// Links relevant to the assessment. - /// Describes properties of an assessment metadata. - /// Data regarding 3rd party partner integration. - /// The result of the assessment. - internal SecurityAssessmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SecurityCenterResourceDetails resourceDetails, string displayName, IDictionary additionalData, AssessmentLinks links, SecurityAssessmentMetadataProperties metadata, SecurityAssessmentPartner partnersData, SecurityAssessmentStatusResult status) : base(id, name, resourceType, systemData) - { - ResourceDetails = resourceDetails; - DisplayName = displayName; - AdditionalData = additionalData; - Links = links; - Metadata = metadata; - PartnersData = partnersData; - Status = status; - } - - /// - /// Details of the resource that was assessed - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public SecurityCenterResourceDetails ResourceDetails { get; set; } - /// User friendly display name of the assessment. - public string DisplayName { get; } - /// Additional data regarding the assessment. - public IDictionary AdditionalData { get; } - /// Links relevant to the assessment. - internal AssessmentLinks Links { get; } - - /// Describes properties of an assessment metadata. - public SecurityAssessmentMetadataProperties Metadata { get; set; } - /// Data regarding 3rd party partner integration. - public SecurityAssessmentPartner PartnersData { get; set; } - /// The result of the assessment. - public SecurityAssessmentStatusResult Status { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAssessmentMetadataData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAssessmentMetadataData.cs deleted file mode 100644 index 610bcba6024f..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAssessmentMetadataData.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SecurityAssessmentMetadata data model. - /// Security assessment metadata response - /// - public partial class SecurityAssessmentMetadataData : ResourceData - { - /// Initializes a new instance of SecurityAssessmentMetadataData. - public SecurityAssessmentMetadataData() - { - Categories = new ChangeTrackingList(); - Threats = new ChangeTrackingList(); - Tactics = new ChangeTrackingList(); - Techniques = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecurityAssessmentMetadataData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// User friendly display name of the assessment. - /// Azure resource ID of the policy definition that turns this assessment calculation on. - /// Human readable description of the assessment. - /// Human readable description of what you should do to mitigate this security issue. - /// - /// The severity level of the assessment. - /// The user impact of the assessment. - /// The implementation effort required to remediate this assessment. - /// - /// True if this assessment is in preview release status. - /// BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition. - /// Describes the partner that created the assessment. - /// - /// - /// - /// - internal SecurityAssessmentMetadataData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string displayName, ResourceIdentifier policyDefinitionId, string description, string remediationDescription, IList categories, SecurityAssessmentSeverity? severity, SecurityAssessmentUserImpact? userImpact, ImplementationEffort? implementationEffort, IList threats, bool? isPreview, SecurityAssessmentType? assessmentType, SecurityAssessmentMetadataPartner partnerData, SecurityAssessmentPublishDates publishDates, string plannedDeprecationDate, IList tactics, IList techniques) : base(id, name, resourceType, systemData) - { - DisplayName = displayName; - PolicyDefinitionId = policyDefinitionId; - Description = description; - RemediationDescription = remediationDescription; - Categories = categories; - Severity = severity; - UserImpact = userImpact; - ImplementationEffort = implementationEffort; - Threats = threats; - IsPreview = isPreview; - AssessmentType = assessmentType; - PartnerData = partnerData; - PublishDates = publishDates; - PlannedDeprecationDate = plannedDeprecationDate; - Tactics = tactics; - Techniques = techniques; - } - - /// User friendly display name of the assessment. - public string DisplayName { get; set; } - /// Azure resource ID of the policy definition that turns this assessment calculation on. - public ResourceIdentifier PolicyDefinitionId { get; } - /// Human readable description of the assessment. - public string Description { get; set; } - /// Human readable description of what you should do to mitigate this security issue. - public string RemediationDescription { get; set; } - /// Gets the categories. - public IList Categories { get; } - /// The severity level of the assessment. - public SecurityAssessmentSeverity? Severity { get; set; } - /// The user impact of the assessment. - public SecurityAssessmentUserImpact? UserImpact { get; set; } - /// The implementation effort required to remediate this assessment. - public ImplementationEffort? ImplementationEffort { get; set; } - /// Gets the threats. - public IList Threats { get; } - /// True if this assessment is in preview release status. - public bool? IsPreview { get; set; } - /// BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition. - public SecurityAssessmentType? AssessmentType { get; set; } - /// Describes the partner that created the assessment. - public SecurityAssessmentMetadataPartner PartnerData { get; set; } - /// Gets or sets the publish dates. - public SecurityAssessmentPublishDates PublishDates { get; set; } - /// Gets or sets the planned deprecation date. - public string PlannedDeprecationDate { get; set; } - /// Gets the tactics. - public IList Tactics { get; } - /// Gets the techniques. - public IList Techniques { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAssessmentResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAssessmentResource.cs deleted file mode 100644 index 44e92a9b351a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAssessmentResource.cs +++ /dev/null @@ -1,406 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SecurityAssessment along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSecurityAssessmentResource method. - /// Otherwise you can get one from its parent resource using the GetSecurityAssessment method. - /// - public partial class SecurityAssessmentResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string resourceId, string assessmentName) - { - var resourceId0 = $"{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}"; - return new ResourceIdentifier(resourceId0); - } - - private readonly ClientDiagnostics _securityAssessmentAssessmentsClientDiagnostics; - private readonly AssessmentsRestOperations _securityAssessmentAssessmentsRestClient; - private readonly SecurityAssessmentData _data; - - /// Initializes a new instance of the class for mocking. - protected SecurityAssessmentResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SecurityAssessmentResource(ArmClient client, SecurityAssessmentData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SecurityAssessmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityAssessmentAssessmentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string securityAssessmentAssessmentsApiVersion); - _securityAssessmentAssessmentsRestClient = new AssessmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityAssessmentAssessmentsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/assessments"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecurityAssessmentData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets a collection of SecuritySubAssessmentResources in the SecurityAssessment. - /// An object representing collection of SecuritySubAssessmentResources and their operations over a SecuritySubAssessmentResource. - public virtual SecuritySubAssessmentCollection GetSecuritySubAssessments() - { - return GetCachedClient(Client => new SecuritySubAssessmentCollection(Client, Id)); - } - - /// - /// Get a security sub-assessment on your scanned resource - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName} - /// - /// - /// Operation Id - /// SubAssessments_Get - /// - /// - /// - /// The Sub-Assessment Key - Unique key for the sub-assessment type. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetSecuritySubAssessmentAsync(string subAssessmentName, CancellationToken cancellationToken = default) - { - return await GetSecuritySubAssessments().GetAsync(subAssessmentName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a security sub-assessment on your scanned resource - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName} - /// - /// - /// Operation Id - /// SubAssessments_Get - /// - /// - /// - /// The Sub-Assessment Key - Unique key for the sub-assessment type. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetSecuritySubAssessment(string subAssessmentName, CancellationToken cancellationToken = default) - { - return GetSecuritySubAssessments().Get(subAssessmentName, cancellationToken); - } - - /// Gets a collection of GovernanceAssignmentResources in the SecurityAssessment. - /// An object representing collection of GovernanceAssignmentResources and their operations over a GovernanceAssignmentResource. - public virtual GovernanceAssignmentCollection GetGovernanceAssignments() - { - return GetCachedClient(Client => new GovernanceAssignmentCollection(Client, Id)); - } - - /// - /// Get a specific governanceAssignment for the requested scope by AssignmentKey - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey} - /// - /// - /// Operation Id - /// GovernanceAssignments_Get - /// - /// - /// - /// The security governance assignment key - the assessment key of the required governance assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetGovernanceAssignmentAsync(string assignmentKey, CancellationToken cancellationToken = default) - { - return await GetGovernanceAssignments().GetAsync(assignmentKey, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a specific governanceAssignment for the requested scope by AssignmentKey - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey} - /// - /// - /// Operation Id - /// GovernanceAssignments_Get - /// - /// - /// - /// The security governance assignment key - the assessment key of the required governance assignment. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetGovernanceAssignment(string assignmentKey, CancellationToken cancellationToken = default) - { - return GetGovernanceAssignments().Get(assignmentKey, cancellationToken); - } - - /// - /// Get a security assessment on your scanned resource - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} - /// - /// - /// Operation Id - /// Assessments_Get - /// - /// - /// - /// OData expand. Optional. - /// The cancellation token to use. - public virtual async Task> GetAsync(SecurityAssessmentODataExpand? expand = null, CancellationToken cancellationToken = default) - { - using var scope = _securityAssessmentAssessmentsClientDiagnostics.CreateScope("SecurityAssessmentResource.Get"); - scope.Start(); - try - { - var response = await _securityAssessmentAssessmentsRestClient.GetAsync(Id.Parent, Id.Name, expand, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityAssessmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a security assessment on your scanned resource - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} - /// - /// - /// Operation Id - /// Assessments_Get - /// - /// - /// - /// OData expand. Optional. - /// The cancellation token to use. - public virtual Response Get(SecurityAssessmentODataExpand? expand = null, CancellationToken cancellationToken = default) - { - using var scope = _securityAssessmentAssessmentsClientDiagnostics.CreateScope("SecurityAssessmentResource.Get"); - scope.Start(); - try - { - var response = _securityAssessmentAssessmentsRestClient.Get(Id.Parent, Id.Name, expand, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityAssessmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} - /// - /// - /// Operation Id - /// Assessments_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _securityAssessmentAssessmentsClientDiagnostics.CreateScope("SecurityAssessmentResource.Delete"); - scope.Start(); - try - { - var response = await _securityAssessmentAssessmentsRestClient.DeleteAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} - /// - /// - /// Operation Id - /// Assessments_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _securityAssessmentAssessmentsClientDiagnostics.CreateScope("SecurityAssessmentResource.Delete"); - scope.Start(); - try - { - var response = _securityAssessmentAssessmentsRestClient.Delete(Id.Parent, Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} - /// - /// - /// Operation Id - /// Assessments_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Calculated assessment on a pre-defined assessment metadata. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, SecurityAssessmentCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _securityAssessmentAssessmentsClientDiagnostics.CreateScope("SecurityAssessmentResource.Update"); - scope.Start(); - try - { - var response = await _securityAssessmentAssessmentsRestClient.CreateOrUpdateAsync(Id.Parent, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityAssessmentResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a security assessment on your resource. An assessment metadata that describes this assessment must be predefined with the same name before inserting the assessment result - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/assessments/{assessmentName} - /// - /// - /// Operation Id - /// Assessments_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Calculated assessment on a pre-defined assessment metadata. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, SecurityAssessmentCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _securityAssessmentAssessmentsClientDiagnostics.CreateScope("SecurityAssessmentResource.Update"); - scope.Start(); - try - { - var response = _securityAssessmentAssessmentsRestClient.CreateOrUpdate(Id.Parent, Id.Name, content, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityAssessmentResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAutomationCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAutomationCollection.cs deleted file mode 100644 index 122ade5d1f03..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAutomationCollection.cs +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSecurityAutomations method from an instance of . - /// - public partial class SecurityAutomationCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _securityAutomationAutomationsClientDiagnostics; - private readonly AutomationsRestOperations _securityAutomationAutomationsRestClient; - - /// Initializes a new instance of the class for mocking. - protected SecurityAutomationCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SecurityAutomationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityAutomationAutomationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecurityAutomationResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SecurityAutomationResource.ResourceType, out string securityAutomationAutomationsApiVersion); - _securityAutomationAutomationsRestClient = new AutomationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityAutomationAutomationsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates a security automation. If a security automation is already created and a subsequent request is issued for the same automation id, then it will be updated. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} - /// - /// - /// Operation Id - /// Automations_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security automation name. - /// The security automation resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string automationName, SecurityAutomationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(automationName, nameof(automationName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _securityAutomationAutomationsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, automationName, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityAutomationResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a security automation. If a security automation is already created and a subsequent request is issued for the same automation id, then it will be updated. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} - /// - /// - /// Operation Id - /// Automations_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security automation name. - /// The security automation resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string automationName, SecurityAutomationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(automationName, nameof(automationName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _securityAutomationAutomationsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, automationName, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityAutomationResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves information about the model of a security automation. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} - /// - /// - /// Operation Id - /// Automations_Get - /// - /// - /// - /// The security automation name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string automationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(automationName, nameof(automationName)); - - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationCollection.Get"); - scope.Start(); - try - { - var response = await _securityAutomationAutomationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, automationName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityAutomationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves information about the model of a security automation. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} - /// - /// - /// Operation Id - /// Automations_Get - /// - /// - /// - /// The security automation name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string automationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(automationName, nameof(automationName)); - - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationCollection.Get"); - scope.Start(); - try - { - var response = _securityAutomationAutomationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, automationName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityAutomationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response to get the next page of security automations for the specified resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations - /// - /// - /// Operation Id - /// Automations_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityAutomationAutomationsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityAutomationAutomationsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityAutomationResource(Client, SecurityAutomationData.DeserializeSecurityAutomationData(e)), _securityAutomationAutomationsClientDiagnostics, Pipeline, "SecurityAutomationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Lists all the security automations in the specified resource group. Use the 'nextLink' property in the response to get the next page of security automations for the specified resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations - /// - /// - /// Operation Id - /// Automations_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityAutomationAutomationsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityAutomationAutomationsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityAutomationResource(Client, SecurityAutomationData.DeserializeSecurityAutomationData(e)), _securityAutomationAutomationsClientDiagnostics, Pipeline, "SecurityAutomationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} - /// - /// - /// Operation Id - /// Automations_Get - /// - /// - /// - /// The security automation name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string automationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(automationName, nameof(automationName)); - - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationCollection.Exists"); - scope.Start(); - try - { - var response = await _securityAutomationAutomationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, automationName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} - /// - /// - /// Operation Id - /// Automations_Get - /// - /// - /// - /// The security automation name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string automationName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(automationName, nameof(automationName)); - - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationCollection.Exists"); - scope.Start(); - try - { - var response = _securityAutomationAutomationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, automationName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAutomationData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAutomationData.cs deleted file mode 100644 index f418d4c926fa..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAutomationData.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SecurityAutomation data model. - /// The security automation resource. - /// - public partial class SecurityAutomationData : TrackedResourceData - { - /// Initializes a new instance of SecurityAutomationData. - /// The location. - public SecurityAutomationData(AzureLocation location) : base(location) - { - Scopes = new ChangeTrackingList(); - Sources = new ChangeTrackingList(); - Actions = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecurityAutomationData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The security automation description. - /// Indicates whether the security automation is enabled. - /// A collection of scopes on which the security automations logic is applied. Supported scopes are the subscription itself or a resource group under that subscription. The automation will only apply on defined scopes. - /// A collection of the source event types which evaluate the security automation set of rules. - /// - /// A collection of the actions which are triggered if all the configured rules evaluations, within at least one rule set, are true. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// Kind of the resource. - /// Entity tag is used for comparing two or more entities from the same requested resource. - internal SecurityAutomationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string description, bool? isEnabled, IList scopes, IList sources, IList actions, string kind, ETag? eTag) : base(id, name, resourceType, systemData, tags, location) - { - Description = description; - IsEnabled = isEnabled; - Scopes = scopes; - Sources = sources; - Actions = actions; - Kind = kind; - ETag = eTag; - } - - /// The security automation description. - public string Description { get; set; } - /// Indicates whether the security automation is enabled. - public bool? IsEnabled { get; set; } - /// A collection of scopes on which the security automations logic is applied. Supported scopes are the subscription itself or a resource group under that subscription. The automation will only apply on defined scopes. - public IList Scopes { get; } - /// A collection of the source event types which evaluate the security automation set of rules. - public IList Sources { get; } - /// - /// A collection of the actions which are triggered if all the configured rules evaluations, within at least one rule set, are true. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public IList Actions { get; } - /// Kind of the resource. - public string Kind { get; set; } - /// Entity tag is used for comparing two or more entities from the same requested resource. - public ETag? ETag { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterLocationCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterLocationCollection.cs deleted file mode 100644 index f4ba56d1ba62..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterLocationCollection.cs +++ /dev/null @@ -1,243 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSecurityCenterLocations method from an instance of . - /// - public partial class SecurityCenterLocationCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _securityCenterLocationLocationsClientDiagnostics; - private readonly LocationsRestOperations _securityCenterLocationLocationsRestClient; - - /// Initializes a new instance of the class for mocking. - protected SecurityCenterLocationCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SecurityCenterLocationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityCenterLocationLocationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecurityCenterLocationResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SecurityCenterLocationResource.ResourceType, out string securityCenterLocationLocationsApiVersion); - _securityCenterLocationLocationsRestClient = new LocationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityCenterLocationLocationsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SubscriptionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); - } - - /// - /// Details of a specific location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation} - /// - /// - /// Operation Id - /// Locations_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - public virtual async Task> GetAsync(AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - using var scope = _securityCenterLocationLocationsClientDiagnostics.CreateScope("SecurityCenterLocationCollection.Get"); - scope.Start(); - try - { - var response = await _securityCenterLocationLocationsRestClient.GetAsync(Id.SubscriptionId, ascLocation, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityCenterLocationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Details of a specific location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation} - /// - /// - /// Operation Id - /// Locations_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - public virtual Response Get(AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - using var scope = _securityCenterLocationLocationsClientDiagnostics.CreateScope("SecurityCenterLocationCollection.Get"); - scope.Start(); - try - { - var response = _securityCenterLocationLocationsRestClient.Get(Id.SubscriptionId, ascLocation, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityCenterLocationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// The location of the responsible ASC of the specific subscription (home region). For each subscription there is only one responsible location. The location in the response should be used to read or write other resources in ASC according to their ID. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations - /// - /// - /// Operation Id - /// Locations_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityCenterLocationLocationsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityCenterLocationLocationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityCenterLocationResource(Client, SecurityCenterLocationData.DeserializeSecurityCenterLocationData(e)), _securityCenterLocationLocationsClientDiagnostics, Pipeline, "SecurityCenterLocationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// The location of the responsible ASC of the specific subscription (home region). For each subscription there is only one responsible location. The location in the response should be used to read or write other resources in ASC according to their ID. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations - /// - /// - /// Operation Id - /// Locations_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityCenterLocationLocationsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityCenterLocationLocationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityCenterLocationResource(Client, SecurityCenterLocationData.DeserializeSecurityCenterLocationData(e)), _securityCenterLocationLocationsClientDiagnostics, Pipeline, "SecurityCenterLocationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation} - /// - /// - /// Operation Id - /// Locations_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - public virtual async Task> ExistsAsync(AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - using var scope = _securityCenterLocationLocationsClientDiagnostics.CreateScope("SecurityCenterLocationCollection.Exists"); - scope.Start(); - try - { - var response = await _securityCenterLocationLocationsRestClient.GetAsync(Id.SubscriptionId, ascLocation, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation} - /// - /// - /// Operation Id - /// Locations_Get - /// - /// - /// - /// The location where ASC stores the data of the subscription. can be retrieved from Get locations. - /// The cancellation token to use. - public virtual Response Exists(AzureLocation ascLocation, CancellationToken cancellationToken = default) - { - using var scope = _securityCenterLocationLocationsClientDiagnostics.CreateScope("SecurityCenterLocationCollection.Exists"); - scope.Start(); - try - { - var response = _securityCenterLocationLocationsRestClient.Get(Id.SubscriptionId, ascLocation, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterLocationData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterLocationData.cs deleted file mode 100644 index 7c2a7e848b61..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterLocationData.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SecurityCenterLocation data model. - /// The ASC location of the subscription is in the "name" field - /// - public partial class SecurityCenterLocationData : ResourceData - { - /// Initializes a new instance of SecurityCenterLocationData. - public SecurityCenterLocationData() - { - } - - /// Initializes a new instance of SecurityCenterLocationData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// An empty set of properties. - internal SecurityCenterLocationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, BinaryData properties) : base(id, name, resourceType, systemData) - { - Properties = properties; - } - - /// - /// An empty set of properties - /// - /// To assign an object to this property use . - /// - /// - /// To assign an already formated json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public BinaryData Properties { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterLocationResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterLocationResource.cs deleted file mode 100644 index a78ae8e0d39e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterLocationResource.cs +++ /dev/null @@ -1,601 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SecurityCenterLocation along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSecurityCenterLocationResource method. - /// Otherwise you can get one from its parent resource using the GetSecurityCenterLocation method. - /// - public partial class SecurityCenterLocationResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation ascLocation) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _securityCenterLocationLocationsClientDiagnostics; - private readonly LocationsRestOperations _securityCenterLocationLocationsRestClient; - private readonly ClientDiagnostics _allowedConnectionsClientDiagnostics; - private readonly AllowedConnectionsRestOperations _allowedConnectionsRestClient; - private readonly ClientDiagnostics _topologyClientDiagnostics; - private readonly TopologyRestOperations _topologyRestClient; - private readonly ClientDiagnostics _jitNetworkAccessPolicyClientDiagnostics; - private readonly JitNetworkAccessPoliciesRestOperations _jitNetworkAccessPolicyRestClient; - private readonly ClientDiagnostics _discoveredSecuritySolutionsClientDiagnostics; - private readonly DiscoveredSecuritySolutionsRestOperations _discoveredSecuritySolutionsRestClient; - private readonly ClientDiagnostics _securitySolutionsReferenceDataClientDiagnostics; - private readonly SecuritySolutionsReferenceDataRestOperations _securitySolutionsReferenceDataRestClient; - private readonly ClientDiagnostics _externalSecuritySolutionsClientDiagnostics; - private readonly ExternalSecuritySolutionsRestOperations _externalSecuritySolutionsRestClient; - private readonly SecurityCenterLocationData _data; - - /// Initializes a new instance of the class for mocking. - protected SecurityCenterLocationResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SecurityCenterLocationResource(ArmClient client, SecurityCenterLocationData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SecurityCenterLocationResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityCenterLocationLocationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string securityCenterLocationLocationsApiVersion); - _securityCenterLocationLocationsRestClient = new LocationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityCenterLocationLocationsApiVersion); - _allowedConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _allowedConnectionsRestClient = new AllowedConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _topologyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _topologyRestClient = new TopologyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _jitNetworkAccessPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", JitNetworkAccessPolicyResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(JitNetworkAccessPolicyResource.ResourceType, out string jitNetworkAccessPolicyApiVersion); - _jitNetworkAccessPolicyRestClient = new JitNetworkAccessPoliciesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, jitNetworkAccessPolicyApiVersion); - _discoveredSecuritySolutionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _discoveredSecuritySolutionsRestClient = new DiscoveredSecuritySolutionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _securitySolutionsReferenceDataClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _securitySolutionsReferenceDataRestClient = new SecuritySolutionsReferenceDataRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _externalSecuritySolutionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _externalSecuritySolutionsRestClient = new ExternalSecuritySolutionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/locations"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecurityCenterLocationData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets a collection of SubscriptionSecurityTaskResources in the SecurityCenterLocation. - /// An object representing collection of SubscriptionSecurityTaskResources and their operations over a SubscriptionSecurityTaskResource. - public virtual SubscriptionSecurityTaskCollection GetSubscriptionSecurityTasks() - { - return GetCachedClient(Client => new SubscriptionSecurityTaskCollection(Client, Id)); - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} - /// - /// - /// Operation Id - /// Tasks_GetSubscriptionLevelTask - /// - /// - /// - /// Name of the task object, will be a GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetSubscriptionSecurityTaskAsync(string taskName, CancellationToken cancellationToken = default) - { - return await GetSubscriptionSecurityTasks().GetAsync(taskName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} - /// - /// - /// Operation Id - /// Tasks_GetSubscriptionLevelTask - /// - /// - /// - /// Name of the task object, will be a GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetSubscriptionSecurityTask(string taskName, CancellationToken cancellationToken = default) - { - return GetSubscriptionSecurityTasks().Get(taskName, cancellationToken); - } - - /// Gets a collection of AdaptiveApplicationControlGroupResources in the SecurityCenterLocation. - /// An object representing collection of AdaptiveApplicationControlGroupResources and their operations over a AdaptiveApplicationControlGroupResource. - public virtual AdaptiveApplicationControlGroupCollection GetAdaptiveApplicationControlGroups() - { - return GetCachedClient(Client => new AdaptiveApplicationControlGroupCollection(Client, Id)); - } - - /// - /// Gets an application control VM/server group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName} - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_Get - /// - /// - /// - /// Name of an application control machine group. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetAdaptiveApplicationControlGroupAsync(string groupName, CancellationToken cancellationToken = default) - { - return await GetAdaptiveApplicationControlGroups().GetAsync(groupName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Gets an application control VM/server group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName} - /// - /// - /// Operation Id - /// AdaptiveApplicationControls_Get - /// - /// - /// - /// Name of an application control machine group. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetAdaptiveApplicationControlGroup(string groupName, CancellationToken cancellationToken = default) - { - return GetAdaptiveApplicationControlGroups().Get(groupName, cancellationToken); - } - - /// Gets a collection of SubscriptionSecurityAlertResources in the SecurityCenterLocation. - /// An object representing collection of SubscriptionSecurityAlertResources and their operations over a SubscriptionSecurityAlertResource. - public virtual SubscriptionSecurityAlertCollection GetSubscriptionSecurityAlerts() - { - return GetCachedClient(Client => new SubscriptionSecurityAlertCollection(Client, Id)); - } - - /// - /// Get an alert that is associated with a subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} - /// - /// - /// Operation Id - /// Alerts_GetSubscriptionLevel - /// - /// - /// - /// Name of the alert object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetSubscriptionSecurityAlertAsync(string alertName, CancellationToken cancellationToken = default) - { - return await GetSubscriptionSecurityAlerts().GetAsync(alertName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get an alert that is associated with a subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} - /// - /// - /// Operation Id - /// Alerts_GetSubscriptionLevel - /// - /// - /// - /// Name of the alert object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetSubscriptionSecurityAlert(string alertName, CancellationToken cancellationToken = default) - { - return GetSubscriptionSecurityAlerts().Get(alertName, cancellationToken); - } - - /// - /// Details of a specific location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation} - /// - /// - /// Operation Id - /// Locations_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _securityCenterLocationLocationsClientDiagnostics.CreateScope("SecurityCenterLocationResource.Get"); - scope.Start(); - try - { - var response = await _securityCenterLocationLocationsRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Name), cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityCenterLocationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Details of a specific location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation} - /// - /// - /// Operation Id - /// Locations_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _securityCenterLocationLocationsClientDiagnostics.CreateScope("SecurityCenterLocationResource.Get"); - scope.Start(); - try - { - var response = _securityCenterLocationLocationsRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Name), cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityCenterLocationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the list of all possible traffic between resources for the subscription and location. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections - /// - /// - /// Operation Id - /// AllowedConnections_ListByHomeRegion - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllowedConnectionsByHomeRegionAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _allowedConnectionsRestClient.CreateListByHomeRegionRequest(Id.SubscriptionId, new AzureLocation(Id.Name)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _allowedConnectionsRestClient.CreateListByHomeRegionNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Name)); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecurityCenterAllowedConnection.DeserializeSecurityCenterAllowedConnection, _allowedConnectionsClientDiagnostics, Pipeline, "SecurityCenterLocationResource.GetAllowedConnectionsByHomeRegion", "value", "nextLink", cancellationToken); - } - - /// - /// Gets the list of all possible traffic between resources for the subscription and location. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections - /// - /// - /// Operation Id - /// AllowedConnections_ListByHomeRegion - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAllowedConnectionsByHomeRegion(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _allowedConnectionsRestClient.CreateListByHomeRegionRequest(Id.SubscriptionId, new AzureLocation(Id.Name)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _allowedConnectionsRestClient.CreateListByHomeRegionNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Name)); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecurityCenterAllowedConnection.DeserializeSecurityCenterAllowedConnection, _allowedConnectionsClientDiagnostics, Pipeline, "SecurityCenterLocationResource.GetAllowedConnectionsByHomeRegion", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list that allows to build a topology view of a subscription and location. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/topologies - /// - /// - /// Operation Id - /// Topology_ListByHomeRegion - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetTopologiesByHomeRegionAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _topologyRestClient.CreateListByHomeRegionRequest(Id.SubscriptionId, new AzureLocation(Id.Name)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _topologyRestClient.CreateListByHomeRegionNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Name)); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, SecurityTopologyResource.DeserializeSecurityTopologyResource, _topologyClientDiagnostics, Pipeline, "SecurityCenterLocationResource.GetTopologiesByHomeRegion", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list that allows to build a topology view of a subscription and location. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/topologies - /// - /// - /// Operation Id - /// Topology_ListByHomeRegion - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetTopologiesByHomeRegion(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _topologyRestClient.CreateListByHomeRegionRequest(Id.SubscriptionId, new AzureLocation(Id.Name)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _topologyRestClient.CreateListByHomeRegionNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Name)); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, SecurityTopologyResource.DeserializeSecurityTopologyResource, _topologyClientDiagnostics, Pipeline, "SecurityCenterLocationResource.GetTopologiesByHomeRegion", "value", "nextLink", cancellationToken); - } - - /// - /// Policies for protecting resources using Just-in-Time access control for the subscription, location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_ListByRegion - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetJitNetworkAccessPoliciesByRegionAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _jitNetworkAccessPolicyRestClient.CreateListByRegionRequest(Id.SubscriptionId, new AzureLocation(Id.Name)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _jitNetworkAccessPolicyRestClient.CreateListByRegionNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Name)); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new JitNetworkAccessPolicyResource(Client, JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(e)), _jitNetworkAccessPolicyClientDiagnostics, Pipeline, "SecurityCenterLocationResource.GetJitNetworkAccessPoliciesByRegion", "value", "nextLink", cancellationToken); - } - - /// - /// Policies for protecting resources using Just-in-Time access control for the subscription, location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies - /// - /// - /// Operation Id - /// JitNetworkAccessPolicies_ListByRegion - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetJitNetworkAccessPoliciesByRegion(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _jitNetworkAccessPolicyRestClient.CreateListByRegionRequest(Id.SubscriptionId, new AzureLocation(Id.Name)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _jitNetworkAccessPolicyRestClient.CreateListByRegionNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Name)); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new JitNetworkAccessPolicyResource(Client, JitNetworkAccessPolicyData.DeserializeJitNetworkAccessPolicyData(e)), _jitNetworkAccessPolicyClientDiagnostics, Pipeline, "SecurityCenterLocationResource.GetJitNetworkAccessPoliciesByRegion", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of discovered Security Solutions for the subscription and location. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions - /// - /// - /// Operation Id - /// DiscoveredSecuritySolutions_ListByHomeRegion - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetDiscoveredSecuritySolutionsByHomeRegionAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _discoveredSecuritySolutionsRestClient.CreateListByHomeRegionRequest(Id.SubscriptionId, new AzureLocation(Id.Name)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _discoveredSecuritySolutionsRestClient.CreateListByHomeRegionNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Name)); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, DiscoveredSecuritySolution.DeserializeDiscoveredSecuritySolution, _discoveredSecuritySolutionsClientDiagnostics, Pipeline, "SecurityCenterLocationResource.GetDiscoveredSecuritySolutionsByHomeRegion", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of discovered Security Solutions for the subscription and location. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions - /// - /// - /// Operation Id - /// DiscoveredSecuritySolutions_ListByHomeRegion - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetDiscoveredSecuritySolutionsByHomeRegion(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _discoveredSecuritySolutionsRestClient.CreateListByHomeRegionRequest(Id.SubscriptionId, new AzureLocation(Id.Name)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _discoveredSecuritySolutionsRestClient.CreateListByHomeRegionNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Name)); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, DiscoveredSecuritySolution.DeserializeDiscoveredSecuritySolution, _discoveredSecuritySolutionsClientDiagnostics, Pipeline, "SecurityCenterLocationResource.GetDiscoveredSecuritySolutionsByHomeRegion", "value", "nextLink", cancellationToken); - } - - /// - /// Gets list of all supported Security Solutions for subscription and location. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutionsReferenceData - /// - /// - /// Operation Id - /// SecuritySolutionsReferenceData_ListByHomeRegion - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllSecuritySolutionsReferenceDataByHomeRegionAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securitySolutionsReferenceDataRestClient.CreateListByHomeRegionRequest(Id.SubscriptionId, new AzureLocation(Id.Name)); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, SecuritySolutionsReferenceData.DeserializeSecuritySolutionsReferenceData, _securitySolutionsReferenceDataClientDiagnostics, Pipeline, "SecurityCenterLocationResource.GetAllSecuritySolutionsReferenceDataByHomeRegion", "value", null, cancellationToken); - } - - /// - /// Gets list of all supported Security Solutions for subscription and location. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutionsReferenceData - /// - /// - /// Operation Id - /// SecuritySolutionsReferenceData_ListByHomeRegion - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAllSecuritySolutionsReferenceDataByHomeRegion(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securitySolutionsReferenceDataRestClient.CreateListByHomeRegionRequest(Id.SubscriptionId, new AzureLocation(Id.Name)); - return PageableHelpers.CreatePageable(FirstPageRequest, null, SecuritySolutionsReferenceData.DeserializeSecuritySolutionsReferenceData, _securitySolutionsReferenceDataClientDiagnostics, Pipeline, "SecurityCenterLocationResource.GetAllSecuritySolutionsReferenceDataByHomeRegion", "value", null, cancellationToken); - } - - /// - /// Gets a list of external Security Solutions for the subscription and location. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions - /// - /// - /// Operation Id - /// ExternalSecuritySolutions_ListByHomeRegion - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetExternalSecuritySolutionsByHomeRegionAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _externalSecuritySolutionsRestClient.CreateListByHomeRegionRequest(Id.SubscriptionId, new AzureLocation(Id.Name)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _externalSecuritySolutionsRestClient.CreateListByHomeRegionNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Name)); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ExternalSecuritySolution.DeserializeExternalSecuritySolution, _externalSecuritySolutionsClientDiagnostics, Pipeline, "SecurityCenterLocationResource.GetExternalSecuritySolutionsByHomeRegion", "value", "nextLink", cancellationToken); - } - - /// - /// Gets a list of external Security Solutions for the subscription and location. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions - /// - /// - /// Operation Id - /// ExternalSecuritySolutions_ListByHomeRegion - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetExternalSecuritySolutionsByHomeRegion(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _externalSecuritySolutionsRestClient.CreateListByHomeRegionRequest(Id.SubscriptionId, new AzureLocation(Id.Name)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _externalSecuritySolutionsRestClient.CreateListByHomeRegionNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Name)); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ExternalSecuritySolution.DeserializeExternalSecuritySolution, _externalSecuritySolutionsClientDiagnostics, Pipeline, "SecurityCenterLocationResource.GetExternalSecuritySolutionsByHomeRegion", "value", "nextLink", cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterPricingCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterPricingCollection.cs deleted file mode 100644 index 0b917a89d8b5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterPricingCollection.cs +++ /dev/null @@ -1,339 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSecurityCenterPricings method from an instance of . - /// - public partial class SecurityCenterPricingCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _securityCenterPricingPricingsClientDiagnostics; - private readonly PricingsRestOperations _securityCenterPricingPricingsRestClient; - - /// Initializes a new instance of the class for mocking. - protected SecurityCenterPricingCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SecurityCenterPricingCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityCenterPricingPricingsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecurityCenterPricingResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SecurityCenterPricingResource.ResourceType, out string securityCenterPricingPricingsApiVersion); - _securityCenterPricingPricingsRestClient = new PricingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityCenterPricingPricingsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SubscriptionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); - } - - /// - /// Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName} - /// - /// - /// Operation Id - /// Pricings_Update - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// name of the pricing configuration. - /// Pricing object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string pricingName, SecurityCenterPricingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(pricingName, nameof(pricingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityCenterPricingPricingsClientDiagnostics.CreateScope("SecurityCenterPricingCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _securityCenterPricingPricingsRestClient.UpdateAsync(Id.SubscriptionId, pricingName, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityCenterPricingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName} - /// - /// - /// Operation Id - /// Pricings_Update - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// name of the pricing configuration. - /// Pricing object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string pricingName, SecurityCenterPricingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(pricingName, nameof(pricingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityCenterPricingPricingsClientDiagnostics.CreateScope("SecurityCenterPricingCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _securityCenterPricingPricingsRestClient.Update(Id.SubscriptionId, pricingName, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityCenterPricingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName} - /// - /// - /// Operation Id - /// Pricings_Get - /// - /// - /// - /// name of the pricing configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string pricingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(pricingName, nameof(pricingName)); - - using var scope = _securityCenterPricingPricingsClientDiagnostics.CreateScope("SecurityCenterPricingCollection.Get"); - scope.Start(); - try - { - var response = await _securityCenterPricingPricingsRestClient.GetAsync(Id.SubscriptionId, pricingName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityCenterPricingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName} - /// - /// - /// Operation Id - /// Pricings_Get - /// - /// - /// - /// name of the pricing configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string pricingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(pricingName, nameof(pricingName)); - - using var scope = _securityCenterPricingPricingsClientDiagnostics.CreateScope("SecurityCenterPricingCollection.Get"); - scope.Start(); - try - { - var response = _securityCenterPricingPricingsRestClient.Get(Id.SubscriptionId, pricingName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityCenterPricingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists Microsoft Defender for Cloud pricing configurations in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings - /// - /// - /// Operation Id - /// Pricings_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityCenterPricingPricingsRestClient.CreateListRequest(Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new SecurityCenterPricingResource(Client, SecurityCenterPricingData.DeserializeSecurityCenterPricingData(e)), _securityCenterPricingPricingsClientDiagnostics, Pipeline, "SecurityCenterPricingCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Lists Microsoft Defender for Cloud pricing configurations in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings - /// - /// - /// Operation Id - /// Pricings_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityCenterPricingPricingsRestClient.CreateListRequest(Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, null, e => new SecurityCenterPricingResource(Client, SecurityCenterPricingData.DeserializeSecurityCenterPricingData(e)), _securityCenterPricingPricingsClientDiagnostics, Pipeline, "SecurityCenterPricingCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName} - /// - /// - /// Operation Id - /// Pricings_Get - /// - /// - /// - /// name of the pricing configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string pricingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(pricingName, nameof(pricingName)); - - using var scope = _securityCenterPricingPricingsClientDiagnostics.CreateScope("SecurityCenterPricingCollection.Exists"); - scope.Start(); - try - { - var response = await _securityCenterPricingPricingsRestClient.GetAsync(Id.SubscriptionId, pricingName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName} - /// - /// - /// Operation Id - /// Pricings_Get - /// - /// - /// - /// name of the pricing configuration. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string pricingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(pricingName, nameof(pricingName)); - - using var scope = _securityCenterPricingPricingsClientDiagnostics.CreateScope("SecurityCenterPricingCollection.Exists"); - scope.Start(); - try - { - var response = _securityCenterPricingPricingsRestClient.Get(Id.SubscriptionId, pricingName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterPricingData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterPricingData.cs deleted file mode 100644 index 97e6187e6282..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterPricingData.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SecurityCenterPricing data model. - /// Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. - /// - public partial class SecurityCenterPricingData : ResourceData - { - /// Initializes a new instance of SecurityCenterPricingData. - public SecurityCenterPricingData() - { - ReplacedBy = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecurityCenterPricingData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. - /// The sub-plan selected for a Standard pricing configuration, when more than one sub-plan is available. Each sub-plan enables a set of security features. When not specified, full plan is applied. - /// The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S). - /// Optional. True if the plan is deprecated. If there are replacing plans they will appear in `replacedBy` property. - /// Optional. List of plans that replace this plan. This property exists only if this plan is deprecated. - internal SecurityCenterPricingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SecurityCenterPricingTier? pricingTier, string subPlan, TimeSpan? freeTrialRemainingTime, bool? isDeprecated, IReadOnlyList replacedBy) : base(id, name, resourceType, systemData) - { - PricingTier = pricingTier; - SubPlan = subPlan; - FreeTrialRemainingTime = freeTrialRemainingTime; - IsDeprecated = isDeprecated; - ReplacedBy = replacedBy; - } - - /// The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. - public SecurityCenterPricingTier? PricingTier { get; set; } - /// The sub-plan selected for a Standard pricing configuration, when more than one sub-plan is available. Each sub-plan enables a set of security features. When not specified, full plan is applied. - public string SubPlan { get; set; } - /// The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S). - public TimeSpan? FreeTrialRemainingTime { get; } - /// Optional. True if the plan is deprecated. If there are replacing plans they will appear in `replacedBy` property. - public bool? IsDeprecated { get; } - /// Optional. List of plans that replace this plan. This property exists only if this plan is deprecated. - public IReadOnlyList ReplacedBy { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterPricingResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterPricingResource.cs deleted file mode 100644 index 50ee349aa4e2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCenterPricingResource.cs +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SecurityCenterPricing along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSecurityCenterPricingResource method. - /// Otherwise you can get one from its parent resource using the GetSecurityCenterPricing method. - /// - public partial class SecurityCenterPricingResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string pricingName) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _securityCenterPricingPricingsClientDiagnostics; - private readonly PricingsRestOperations _securityCenterPricingPricingsRestClient; - private readonly SecurityCenterPricingData _data; - - /// Initializes a new instance of the class for mocking. - protected SecurityCenterPricingResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SecurityCenterPricingResource(ArmClient client, SecurityCenterPricingData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SecurityCenterPricingResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityCenterPricingPricingsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string securityCenterPricingPricingsApiVersion); - _securityCenterPricingPricingsRestClient = new PricingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityCenterPricingPricingsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/pricings"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecurityCenterPricingData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName} - /// - /// - /// Operation Id - /// Pricings_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _securityCenterPricingPricingsClientDiagnostics.CreateScope("SecurityCenterPricingResource.Get"); - scope.Start(); - try - { - var response = await _securityCenterPricingPricingsRestClient.GetAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityCenterPricingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName} - /// - /// - /// Operation Id - /// Pricings_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _securityCenterPricingPricingsClientDiagnostics.CreateScope("SecurityCenterPricingResource.Get"); - scope.Start(); - try - { - var response = _securityCenterPricingPricingsRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityCenterPricingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName} - /// - /// - /// Operation Id - /// Pricings_Update - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Pricing object. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, SecurityCenterPricingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityCenterPricingPricingsClientDiagnostics.CreateScope("SecurityCenterPricingResource.Update"); - scope.Start(); - try - { - var response = await _securityCenterPricingPricingsRestClient.UpdateAsync(Id.SubscriptionId, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityCenterPricingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName} - /// - /// - /// Operation Id - /// Pricings_Update - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Pricing object. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, SecurityCenterPricingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityCenterPricingPricingsClientDiagnostics.CreateScope("SecurityCenterPricingResource.Update"); - scope.Start(); - try - { - var response = _securityCenterPricingPricingsRestClient.Update(Id.SubscriptionId, Id.Name, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityCenterPricingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCloudConnectorCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCloudConnectorCollection.cs deleted file mode 100644 index 1f006a5cdb09..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCloudConnectorCollection.cs +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSecurityCloudConnectors method from an instance of . - /// - public partial class SecurityCloudConnectorCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _securityCloudConnectorConnectorsClientDiagnostics; - private readonly ConnectorsRestOperations _securityCloudConnectorConnectorsRestClient; - - /// Initializes a new instance of the class for mocking. - protected SecurityCloudConnectorCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SecurityCloudConnectorCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityCloudConnectorConnectorsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecurityCloudConnectorResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SecurityCloudConnectorResource.ResourceType, out string securityCloudConnectorConnectorsApiVersion); - _securityCloudConnectorConnectorsRestClient = new ConnectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityCloudConnectorConnectorsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SubscriptionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); - } - - /// - /// Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either account credentials or role-based authentication. For GCP, use account organization credentials. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName} - /// - /// - /// Operation Id - /// Connectors_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the cloud account connector. - /// Settings for the cloud account connector. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string connectorName, SecurityCloudConnectorData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityCloudConnectorConnectorsClientDiagnostics.CreateScope("SecurityCloudConnectorCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _securityCloudConnectorConnectorsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, connectorName, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityCloudConnectorResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either account credentials or role-based authentication. For GCP, use account organization credentials. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName} - /// - /// - /// Operation Id - /// Connectors_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the cloud account connector. - /// Settings for the cloud account connector. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string connectorName, SecurityCloudConnectorData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityCloudConnectorConnectorsClientDiagnostics.CreateScope("SecurityCloudConnectorCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _securityCloudConnectorConnectorsRestClient.CreateOrUpdate(Id.SubscriptionId, connectorName, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityCloudConnectorResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Details of a specific cloud account connector - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName} - /// - /// - /// Operation Id - /// Connectors_Get - /// - /// - /// - /// Name of the cloud account connector. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string connectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); - - using var scope = _securityCloudConnectorConnectorsClientDiagnostics.CreateScope("SecurityCloudConnectorCollection.Get"); - scope.Start(); - try - { - var response = await _securityCloudConnectorConnectorsRestClient.GetAsync(Id.SubscriptionId, connectorName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityCloudConnectorResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Details of a specific cloud account connector - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName} - /// - /// - /// Operation Id - /// Connectors_Get - /// - /// - /// - /// Name of the cloud account connector. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string connectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); - - using var scope = _securityCloudConnectorConnectorsClientDiagnostics.CreateScope("SecurityCloudConnectorCollection.Get"); - scope.Start(); - try - { - var response = _securityCloudConnectorConnectorsRestClient.Get(Id.SubscriptionId, connectorName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityCloudConnectorResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Cloud accounts connectors of a subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors - /// - /// - /// Operation Id - /// Connectors_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityCloudConnectorConnectorsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityCloudConnectorConnectorsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityCloudConnectorResource(Client, SecurityCloudConnectorData.DeserializeSecurityCloudConnectorData(e)), _securityCloudConnectorConnectorsClientDiagnostics, Pipeline, "SecurityCloudConnectorCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Cloud accounts connectors of a subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors - /// - /// - /// Operation Id - /// Connectors_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityCloudConnectorConnectorsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityCloudConnectorConnectorsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityCloudConnectorResource(Client, SecurityCloudConnectorData.DeserializeSecurityCloudConnectorData(e)), _securityCloudConnectorConnectorsClientDiagnostics, Pipeline, "SecurityCloudConnectorCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName} - /// - /// - /// Operation Id - /// Connectors_Get - /// - /// - /// - /// Name of the cloud account connector. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string connectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); - - using var scope = _securityCloudConnectorConnectorsClientDiagnostics.CreateScope("SecurityCloudConnectorCollection.Exists"); - scope.Start(); - try - { - var response = await _securityCloudConnectorConnectorsRestClient.GetAsync(Id.SubscriptionId, connectorName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName} - /// - /// - /// Operation Id - /// Connectors_Get - /// - /// - /// - /// Name of the cloud account connector. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string connectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(connectorName, nameof(connectorName)); - - using var scope = _securityCloudConnectorConnectorsClientDiagnostics.CreateScope("SecurityCloudConnectorCollection.Exists"); - scope.Start(); - try - { - var response = _securityCloudConnectorConnectorsRestClient.Get(Id.SubscriptionId, connectorName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCloudConnectorData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCloudConnectorData.cs deleted file mode 100644 index 1d7fd01b02a6..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCloudConnectorData.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SecurityCloudConnector data model. - /// The connector setting - /// - public partial class SecurityCloudConnectorData : ResourceData - { - /// Initializes a new instance of SecurityCloudConnectorData. - public SecurityCloudConnectorData() - { - } - - /// Initializes a new instance of SecurityCloudConnectorData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Settings for hybrid compute management. These settings are relevant only for Arc autoProvision (Hybrid Compute). - /// - /// Settings for authentication management, these settings are relevant only for the cloud connector. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - internal SecurityCloudConnectorData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, HybridComputeSettingsProperties hybridComputeSettings, AuthenticationDetailsProperties authenticationDetails) : base(id, name, resourceType, systemData) - { - HybridComputeSettings = hybridComputeSettings; - AuthenticationDetails = authenticationDetails; - } - - /// Settings for hybrid compute management. These settings are relevant only for Arc autoProvision (Hybrid Compute). - public HybridComputeSettingsProperties HybridComputeSettings { get; set; } - /// - /// Settings for authentication management, these settings are relevant only for the cloud connector. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public AuthenticationDetailsProperties AuthenticationDetails { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCloudConnectorResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCloudConnectorResource.cs deleted file mode 100644 index cf5493e3d76d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityCloudConnectorResource.cs +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SecurityCloudConnector along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSecurityCloudConnectorResource method. - /// Otherwise you can get one from its parent resource using the GetSecurityCloudConnector method. - /// - public partial class SecurityCloudConnectorResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string connectorName) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _securityCloudConnectorConnectorsClientDiagnostics; - private readonly ConnectorsRestOperations _securityCloudConnectorConnectorsRestClient; - private readonly SecurityCloudConnectorData _data; - - /// Initializes a new instance of the class for mocking. - protected SecurityCloudConnectorResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SecurityCloudConnectorResource(ArmClient client, SecurityCloudConnectorData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SecurityCloudConnectorResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityCloudConnectorConnectorsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string securityCloudConnectorConnectorsApiVersion); - _securityCloudConnectorConnectorsRestClient = new ConnectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityCloudConnectorConnectorsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/connectors"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecurityCloudConnectorData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Details of a specific cloud account connector - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName} - /// - /// - /// Operation Id - /// Connectors_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _securityCloudConnectorConnectorsClientDiagnostics.CreateScope("SecurityCloudConnectorResource.Get"); - scope.Start(); - try - { - var response = await _securityCloudConnectorConnectorsRestClient.GetAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityCloudConnectorResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Details of a specific cloud account connector - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName} - /// - /// - /// Operation Id - /// Connectors_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _securityCloudConnectorConnectorsClientDiagnostics.CreateScope("SecurityCloudConnectorResource.Get"); - scope.Start(); - try - { - var response = _securityCloudConnectorConnectorsRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityCloudConnectorResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a cloud account connector from a subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName} - /// - /// - /// Operation Id - /// Connectors_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _securityCloudConnectorConnectorsClientDiagnostics.CreateScope("SecurityCloudConnectorResource.Delete"); - scope.Start(); - try - { - var response = await _securityCloudConnectorConnectorsRestClient.DeleteAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a cloud account connector from a subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName} - /// - /// - /// Operation Id - /// Connectors_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _securityCloudConnectorConnectorsClientDiagnostics.CreateScope("SecurityCloudConnectorResource.Delete"); - scope.Start(); - try - { - var response = _securityCloudConnectorConnectorsRestClient.Delete(Id.SubscriptionId, Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either account credentials or role-based authentication. For GCP, use account organization credentials. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName} - /// - /// - /// Operation Id - /// Connectors_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Settings for the cloud account connector. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, SecurityCloudConnectorData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityCloudConnectorConnectorsClientDiagnostics.CreateScope("SecurityCloudConnectorResource.Update"); - scope.Start(); - try - { - var response = await _securityCloudConnectorConnectorsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityCloudConnectorResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, use either account credentials or role-based authentication. For GCP, use account organization credentials. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName} - /// - /// - /// Operation Id - /// Connectors_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Settings for the cloud account connector. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, SecurityCloudConnectorData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityCloudConnectorConnectorsClientDiagnostics.CreateScope("SecurityCloudConnectorResource.Update"); - scope.Start(); - try - { - var response = _securityCloudConnectorConnectorsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.Name, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityCloudConnectorResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityComplianceCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityComplianceCollection.cs deleted file mode 100644 index 24a01212febc..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityComplianceCollection.cs +++ /dev/null @@ -1,248 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSecurityCompliances method from an instance of . - /// - public partial class SecurityComplianceCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _securityComplianceCompliancesClientDiagnostics; - private readonly CompliancesRestOperations _securityComplianceCompliancesRestClient; - - /// Initializes a new instance of the class for mocking. - protected SecurityComplianceCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SecurityComplianceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityComplianceCompliancesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecurityComplianceResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SecurityComplianceResource.ResourceType, out string securityComplianceCompliancesApiVersion); - _securityComplianceCompliancesRestClient = new CompliancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityComplianceCompliancesApiVersion); - } - - /// - /// Details of a specific Compliance. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/compliances/{complianceName} - /// - /// - /// Operation Id - /// Compliances_Get - /// - /// - /// - /// name of the Compliance. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string complianceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(complianceName, nameof(complianceName)); - - using var scope = _securityComplianceCompliancesClientDiagnostics.CreateScope("SecurityComplianceCollection.Get"); - scope.Start(); - try - { - var response = await _securityComplianceCompliancesRestClient.GetAsync(Id, complianceName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityComplianceResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Details of a specific Compliance. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/compliances/{complianceName} - /// - /// - /// Operation Id - /// Compliances_Get - /// - /// - /// - /// name of the Compliance. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string complianceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(complianceName, nameof(complianceName)); - - using var scope = _securityComplianceCompliancesClientDiagnostics.CreateScope("SecurityComplianceCollection.Get"); - scope.Start(); - try - { - var response = _securityComplianceCompliancesRestClient.Get(Id, complianceName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityComplianceResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// The Compliance scores of the specific management group. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/compliances - /// - /// - /// Operation Id - /// Compliances_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityComplianceCompliancesRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityComplianceCompliancesRestClient.CreateListNextPageRequest(nextLink, Id); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityComplianceResource(Client, SecurityComplianceData.DeserializeSecurityComplianceData(e)), _securityComplianceCompliancesClientDiagnostics, Pipeline, "SecurityComplianceCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// The Compliance scores of the specific management group. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/compliances - /// - /// - /// Operation Id - /// Compliances_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityComplianceCompliancesRestClient.CreateListRequest(Id); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityComplianceCompliancesRestClient.CreateListNextPageRequest(nextLink, Id); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityComplianceResource(Client, SecurityComplianceData.DeserializeSecurityComplianceData(e)), _securityComplianceCompliancesClientDiagnostics, Pipeline, "SecurityComplianceCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/compliances/{complianceName} - /// - /// - /// Operation Id - /// Compliances_Get - /// - /// - /// - /// name of the Compliance. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string complianceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(complianceName, nameof(complianceName)); - - using var scope = _securityComplianceCompliancesClientDiagnostics.CreateScope("SecurityComplianceCollection.Exists"); - scope.Start(); - try - { - var response = await _securityComplianceCompliancesRestClient.GetAsync(Id, complianceName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/compliances/{complianceName} - /// - /// - /// Operation Id - /// Compliances_Get - /// - /// - /// - /// name of the Compliance. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string complianceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(complianceName, nameof(complianceName)); - - using var scope = _securityComplianceCompliancesClientDiagnostics.CreateScope("SecurityComplianceCollection.Exists"); - scope.Start(); - try - { - var response = _securityComplianceCompliancesRestClient.Get(Id, complianceName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityComplianceData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityComplianceData.cs deleted file mode 100644 index 264cd313e1ae..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityComplianceData.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SecurityCompliance data model. - /// Compliance of a scope - /// - public partial class SecurityComplianceData : ResourceData - { - /// Initializes a new instance of SecurityComplianceData. - public SecurityComplianceData() - { - AssessmentResult = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecurityComplianceData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The timestamp when the Compliance calculation was conducted. - /// The resource count of the given subscription for which the Compliance calculation was conducted (needed for Management Group Compliance calculation). - /// An array of segment, which is the actually the compliance assessment. - internal SecurityComplianceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DateTimeOffset? assessedOn, int? resourceCount, IReadOnlyList assessmentResult) : base(id, name, resourceType, systemData) - { - AssessedOn = assessedOn; - ResourceCount = resourceCount; - AssessmentResult = assessmentResult; - } - - /// The timestamp when the Compliance calculation was conducted. - public DateTimeOffset? AssessedOn { get; } - /// The resource count of the given subscription for which the Compliance calculation was conducted (needed for Management Group Compliance calculation). - public int? ResourceCount { get; } - /// An array of segment, which is the actually the compliance assessment. - public IReadOnlyList AssessmentResult { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityComplianceResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityComplianceResource.cs deleted file mode 100644 index 95c661118d21..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityComplianceResource.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SecurityCompliance along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSecurityComplianceResource method. - /// Otherwise you can get one from its parent resource using the GetSecurityCompliance method. - /// - public partial class SecurityComplianceResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string scope, string complianceName) - { - var resourceId = $"{scope}/providers/Microsoft.Security/compliances/{complianceName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _securityComplianceCompliancesClientDiagnostics; - private readonly CompliancesRestOperations _securityComplianceCompliancesRestClient; - private readonly SecurityComplianceData _data; - - /// Initializes a new instance of the class for mocking. - protected SecurityComplianceResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SecurityComplianceResource(ArmClient client, SecurityComplianceData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SecurityComplianceResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityComplianceCompliancesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string securityComplianceCompliancesApiVersion); - _securityComplianceCompliancesRestClient = new CompliancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityComplianceCompliancesApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/compliances"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecurityComplianceData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Details of a specific Compliance. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/compliances/{complianceName} - /// - /// - /// Operation Id - /// Compliances_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _securityComplianceCompliancesClientDiagnostics.CreateScope("SecurityComplianceResource.Get"); - scope.Start(); - try - { - var response = await _securityComplianceCompliancesRestClient.GetAsync(Id.Parent, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityComplianceResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Details of a specific Compliance. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/compliances/{complianceName} - /// - /// - /// Operation Id - /// Compliances_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _securityComplianceCompliancesClientDiagnostics.CreateScope("SecurityComplianceResource.Get"); - scope.Start(); - try - { - var response = _securityComplianceCompliancesRestClient.Get(Id.Parent, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityComplianceResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorApplicationCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorApplicationCollection.cs deleted file mode 100644 index 4337808104ac..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorApplicationCollection.cs +++ /dev/null @@ -1,340 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSecurityConnectorApplications method from an instance of . - /// - public partial class SecurityConnectorApplicationCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _securityConnectorApplicationClientDiagnostics; - private readonly SecurityConnectorApplicationsRestOperations _securityConnectorApplicationRestClient; - - /// Initializes a new instance of the class for mocking. - protected SecurityConnectorApplicationCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SecurityConnectorApplicationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityConnectorApplicationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecurityConnectorApplicationResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SecurityConnectorApplicationResource.ResourceType, out string securityConnectorApplicationApiVersion); - _securityConnectorApplicationRestClient = new SecurityConnectorApplicationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityConnectorApplicationApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SecurityConnectorResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SecurityConnectorResource.ResourceType), nameof(id)); - } - - /// - /// Creates or update a security Application on the given security connector. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// SecurityConnectorApplications_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security Application key - unique key for the standard application. - /// Application over a subscription scope. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string applicationId, SecurityApplicationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityConnectorApplicationClientDiagnostics.CreateScope("SecurityConnectorApplicationCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _securityConnectorApplicationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationId, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityConnectorApplicationResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or update a security Application on the given security connector. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// SecurityConnectorApplications_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security Application key - unique key for the standard application. - /// Application over a subscription scope. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string applicationId, SecurityApplicationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityConnectorApplicationClientDiagnostics.CreateScope("SecurityConnectorApplicationCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _securityConnectorApplicationRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationId, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityConnectorApplicationResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific application for the requested scope by applicationId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// SecurityConnectorApplications_Get - /// - /// - /// - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string applicationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - - using var scope = _securityConnectorApplicationClientDiagnostics.CreateScope("SecurityConnectorApplicationCollection.Get"); - scope.Start(); - try - { - var response = await _securityConnectorApplicationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationId, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityConnectorApplicationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific application for the requested scope by applicationId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// SecurityConnectorApplications_Get - /// - /// - /// - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string applicationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - - using var scope = _securityConnectorApplicationClientDiagnostics.CreateScope("SecurityConnectorApplicationCollection.Get"); - scope.Start(); - try - { - var response = _securityConnectorApplicationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationId, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityConnectorApplicationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a list of all relevant applications over a security connector level scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications - /// - /// - /// Operation Id - /// SecurityConnectorApplications_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityConnectorApplicationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityConnectorApplicationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityConnectorApplicationResource(Client, SecurityApplicationData.DeserializeSecurityApplicationData(e)), _securityConnectorApplicationClientDiagnostics, Pipeline, "SecurityConnectorApplicationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Get a list of all relevant applications over a security connector level scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications - /// - /// - /// Operation Id - /// SecurityConnectorApplications_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityConnectorApplicationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityConnectorApplicationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityConnectorApplicationResource(Client, SecurityApplicationData.DeserializeSecurityApplicationData(e)), _securityConnectorApplicationClientDiagnostics, Pipeline, "SecurityConnectorApplicationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// SecurityConnectorApplications_Get - /// - /// - /// - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string applicationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - - using var scope = _securityConnectorApplicationClientDiagnostics.CreateScope("SecurityConnectorApplicationCollection.Exists"); - scope.Start(); - try - { - var response = await _securityConnectorApplicationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationId, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// SecurityConnectorApplications_Get - /// - /// - /// - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string applicationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - - using var scope = _securityConnectorApplicationClientDiagnostics.CreateScope("SecurityConnectorApplicationCollection.Exists"); - scope.Start(); - try - { - var response = _securityConnectorApplicationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationId, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorApplicationResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorApplicationResource.cs deleted file mode 100644 index d6c0693cbbd7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorApplicationResource.cs +++ /dev/null @@ -1,297 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SecurityConnectorApplication along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSecurityConnectorApplicationResource method. - /// Otherwise you can get one from its parent resource using the GetSecurityConnectorApplication method. - /// - public partial class SecurityConnectorApplicationResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string securityConnectorName, string applicationId) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _securityConnectorApplicationClientDiagnostics; - private readonly SecurityConnectorApplicationsRestOperations _securityConnectorApplicationRestClient; - private readonly SecurityApplicationData _data; - - /// Initializes a new instance of the class for mocking. - protected SecurityConnectorApplicationResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SecurityConnectorApplicationResource(ArmClient client, SecurityApplicationData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SecurityConnectorApplicationResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityConnectorApplicationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string securityConnectorApplicationApiVersion); - _securityConnectorApplicationRestClient = new SecurityConnectorApplicationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityConnectorApplicationApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/applications"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecurityApplicationData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get a specific application for the requested scope by applicationId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// SecurityConnectorApplications_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _securityConnectorApplicationClientDiagnostics.CreateScope("SecurityConnectorApplicationResource.Get"); - scope.Start(); - try - { - var response = await _securityConnectorApplicationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityConnectorApplicationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific application for the requested scope by applicationId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// SecurityConnectorApplications_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _securityConnectorApplicationClientDiagnostics.CreateScope("SecurityConnectorApplicationResource.Get"); - scope.Start(); - try - { - var response = _securityConnectorApplicationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityConnectorApplicationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete an Application over a given scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// SecurityConnectorApplications_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _securityConnectorApplicationClientDiagnostics.CreateScope("SecurityConnectorApplicationResource.Delete"); - scope.Start(); - try - { - var response = await _securityConnectorApplicationRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete an Application over a given scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// SecurityConnectorApplications_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _securityConnectorApplicationClientDiagnostics.CreateScope("SecurityConnectorApplicationResource.Delete"); - scope.Start(); - try - { - var response = _securityConnectorApplicationRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or update a security Application on the given security connector. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// SecurityConnectorApplications_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Application over a subscription scope. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, SecurityApplicationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityConnectorApplicationClientDiagnostics.CreateScope("SecurityConnectorApplicationResource.Update"); - scope.Start(); - try - { - var response = await _securityConnectorApplicationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityConnectorApplicationResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or update a security Application on the given security connector. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// SecurityConnectorApplications_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Application over a subscription scope. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, SecurityApplicationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityConnectorApplicationClientDiagnostics.CreateScope("SecurityConnectorApplicationResource.Update"); - scope.Start(); - try - { - var response = _securityConnectorApplicationRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityConnectorApplicationResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorCollection.cs deleted file mode 100644 index fc271b9a1b1e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorCollection.cs +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSecurityConnectors method from an instance of . - /// - public partial class SecurityConnectorCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _securityConnectorClientDiagnostics; - private readonly SecurityConnectorsRestOperations _securityConnectorRestClient; - - /// Initializes a new instance of the class for mocking. - protected SecurityConnectorCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SecurityConnectorCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityConnectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecurityConnectorResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SecurityConnectorResource.ResourceType, out string securityConnectorApiVersion); - _securityConnectorRestClient = new SecurityConnectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityConnectorApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Creates or updates a security connector. If a security connector is already created and a subsequent request is issued for the same security connector id, then it will be updated. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security connector name. - /// The security connector resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string securityConnectorName, SecurityConnectorData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _securityConnectorRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, securityConnectorName, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityConnectorResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or updates a security connector. If a security connector is already created and a subsequent request is issued for the same security connector id, then it will be updated. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security connector name. - /// The security connector resource. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string securityConnectorName, SecurityConnectorData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _securityConnectorRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, securityConnectorName, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityConnectorResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves details of a specific security connector - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Get - /// - /// - /// - /// The security connector name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string securityConnectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorCollection.Get"); - scope.Start(); - try - { - var response = await _securityConnectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, securityConnectorName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityConnectorResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves details of a specific security connector - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Get - /// - /// - /// - /// The security connector name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string securityConnectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorCollection.Get"); - scope.Start(); - try - { - var response = _securityConnectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, securityConnectorName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityConnectorResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to get the next page of security connectors for the specified resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors - /// - /// - /// Operation Id - /// SecurityConnectors_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityConnectorRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityConnectorRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityConnectorResource(Client, SecurityConnectorData.DeserializeSecurityConnectorData(e)), _securityConnectorClientDiagnostics, Pipeline, "SecurityConnectorCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Lists all the security connectors in the specified resource group. Use the 'nextLink' property in the response to get the next page of security connectors for the specified resource group. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors - /// - /// - /// Operation Id - /// SecurityConnectors_ListByResourceGroup - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityConnectorRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityConnectorRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityConnectorResource(Client, SecurityConnectorData.DeserializeSecurityConnectorData(e)), _securityConnectorClientDiagnostics, Pipeline, "SecurityConnectorCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Get - /// - /// - /// - /// The security connector name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string securityConnectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorCollection.Exists"); - scope.Start(); - try - { - var response = await _securityConnectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, securityConnectorName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Get - /// - /// - /// - /// The security connector name. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string securityConnectorName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(securityConnectorName, nameof(securityConnectorName)); - - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorCollection.Exists"); - scope.Start(); - try - { - var response = _securityConnectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, securityConnectorName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorData.cs deleted file mode 100644 index c21fd2faf426..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorData.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SecurityConnector data model. - /// The security connector resource. - /// - public partial class SecurityConnectorData : TrackedResourceData - { - /// Initializes a new instance of SecurityConnectorData. - /// The location. - public SecurityConnectorData(AzureLocation location) : base(location) - { - Offerings = new ChangeTrackingList(); - } - - /// Initializes a new instance of SecurityConnectorData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The multi cloud resource identifier (account id in case of AWS connector, project number in case of GCP connector). - /// The date on which the trial period will end, if applicable. Trial period exists for 30 days after upgrading to payed offerings. - /// The multi cloud resource's cloud name. - /// - /// A collection of offerings for the security connector. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , and . - /// - /// - /// The security connector environment data. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . - /// - /// Kind of the resource. - /// Entity tag is used for comparing two or more entities from the same requested resource. - internal SecurityConnectorData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string hierarchyIdentifier, DateTimeOffset? hierarchyIdentifierTrialEndOn, SecurityCenterCloudName? environmentName, IList offerings, SecurityConnectorEnvironment environmentData, string kind, ETag? eTag) : base(id, name, resourceType, systemData, tags, location) - { - HierarchyIdentifier = hierarchyIdentifier; - HierarchyIdentifierTrialEndOn = hierarchyIdentifierTrialEndOn; - EnvironmentName = environmentName; - Offerings = offerings; - EnvironmentData = environmentData; - Kind = kind; - ETag = eTag; - } - - /// The multi cloud resource identifier (account id in case of AWS connector, project number in case of GCP connector). - public string HierarchyIdentifier { get; set; } - /// The date on which the trial period will end, if applicable. Trial period exists for 30 days after upgrading to payed offerings. - public DateTimeOffset? HierarchyIdentifierTrialEndOn { get; } - /// The multi cloud resource's cloud name. - public SecurityCenterCloudName? EnvironmentName { get; set; } - /// - /// A collection of offerings for the security connector. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , , , , , , , , , , , , and . - /// - public IList Offerings { get; } - /// - /// The security connector environment data. - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , , and . - /// - public SecurityConnectorEnvironment EnvironmentData { get; set; } - /// Kind of the resource. - public string Kind { get; set; } - /// Entity tag is used for comparing two or more entities from the same requested resource. - public ETag? ETag { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorGovernanceRuleCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorGovernanceRuleCollection.cs deleted file mode 100644 index 780102fd30ca..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorGovernanceRuleCollection.cs +++ /dev/null @@ -1,340 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSecurityConnectorGovernanceRules method from an instance of . - /// - public partial class SecurityConnectorGovernanceRuleCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _securityConnectorGovernanceRuleClientDiagnostics; - private readonly SecurityConnectorGovernanceRulesRestOperations _securityConnectorGovernanceRuleRestClient; - - /// Initializes a new instance of the class for mocking. - protected SecurityConnectorGovernanceRuleCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SecurityConnectorGovernanceRuleCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityConnectorGovernanceRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecurityConnectorGovernanceRuleResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SecurityConnectorGovernanceRuleResource.ResourceType, out string securityConnectorGovernanceRuleApiVersion); - _securityConnectorGovernanceRuleRestClient = new SecurityConnectorGovernanceRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityConnectorGovernanceRuleApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SecurityConnectorResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SecurityConnectorResource.ResourceType), nameof(id)); - } - - /// - /// Creates or update a security GovernanceRule on the given security connector. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRules_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string ruleId, GovernanceRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityConnectorGovernanceRuleClientDiagnostics.CreateScope("SecurityConnectorGovernanceRuleCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _securityConnectorGovernanceRuleRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ruleId, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityConnectorGovernanceRuleResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or update a security GovernanceRule on the given security connector. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRules_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string ruleId, GovernanceRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityConnectorGovernanceRuleClientDiagnostics.CreateScope("SecurityConnectorGovernanceRuleCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _securityConnectorGovernanceRuleRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ruleId, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityConnectorGovernanceRuleResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific governanceRule for the requested scope by ruleId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRules_Get - /// - /// - /// - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string ruleId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var scope = _securityConnectorGovernanceRuleClientDiagnostics.CreateScope("SecurityConnectorGovernanceRuleCollection.Get"); - scope.Start(); - try - { - var response = await _securityConnectorGovernanceRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ruleId, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityConnectorGovernanceRuleResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific governanceRule for the requested scope by ruleId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRules_Get - /// - /// - /// - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string ruleId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var scope = _securityConnectorGovernanceRuleClientDiagnostics.CreateScope("SecurityConnectorGovernanceRuleCollection.Get"); - scope.Start(); - try - { - var response = _securityConnectorGovernanceRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ruleId, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityConnectorGovernanceRuleResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a list of all relevant governanceRules over a security connector level scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRules_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityConnectorGovernanceRuleRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityConnectorGovernanceRuleRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityConnectorGovernanceRuleResource(Client, GovernanceRuleData.DeserializeGovernanceRuleData(e)), _securityConnectorGovernanceRuleClientDiagnostics, Pipeline, "SecurityConnectorGovernanceRuleCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Get a list of all relevant governanceRules over a security connector level scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRules_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityConnectorGovernanceRuleRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityConnectorGovernanceRuleRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityConnectorGovernanceRuleResource(Client, GovernanceRuleData.DeserializeGovernanceRuleData(e)), _securityConnectorGovernanceRuleClientDiagnostics, Pipeline, "SecurityConnectorGovernanceRuleCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRules_Get - /// - /// - /// - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string ruleId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var scope = _securityConnectorGovernanceRuleClientDiagnostics.CreateScope("SecurityConnectorGovernanceRuleCollection.Exists"); - scope.Start(); - try - { - var response = await _securityConnectorGovernanceRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ruleId, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRules_Get - /// - /// - /// - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string ruleId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var scope = _securityConnectorGovernanceRuleClientDiagnostics.CreateScope("SecurityConnectorGovernanceRuleCollection.Exists"); - scope.Start(); - try - { - var response = _securityConnectorGovernanceRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ruleId, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorGovernanceRuleResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorGovernanceRuleResource.cs deleted file mode 100644 index 483a2f4f96d1..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorGovernanceRuleResource.cs +++ /dev/null @@ -1,455 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SecurityConnectorGovernanceRule along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSecurityConnectorGovernanceRuleResource method. - /// Otherwise you can get one from its parent resource using the GetSecurityConnectorGovernanceRule method. - /// - public partial class SecurityConnectorGovernanceRuleResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string securityConnectorName, string ruleId) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _securityConnectorGovernanceRuleClientDiagnostics; - private readonly SecurityConnectorGovernanceRulesRestOperations _securityConnectorGovernanceRuleRestClient; - private readonly ClientDiagnostics _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics; - private readonly GovernanceRulesRestOperations _subscriptionGovernanceRuleGovernanceRulesRestClient; - private readonly ClientDiagnostics _securityConnectorGovernanceRulesExecuteStatusClientDiagnostics; - private readonly SecurityConnectorGovernanceRulesExecuteStatusRestOperations _securityConnectorGovernanceRulesExecuteStatusRestClient; - private readonly GovernanceRuleData _data; - - /// Initializes a new instance of the class for mocking. - protected SecurityConnectorGovernanceRuleResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SecurityConnectorGovernanceRuleResource(ArmClient client, GovernanceRuleData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SecurityConnectorGovernanceRuleResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityConnectorGovernanceRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string securityConnectorGovernanceRuleApiVersion); - _securityConnectorGovernanceRuleRestClient = new SecurityConnectorGovernanceRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityConnectorGovernanceRuleApiVersion); - _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SubscriptionGovernanceRuleResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SubscriptionGovernanceRuleResource.ResourceType, out string subscriptionGovernanceRuleGovernanceRulesApiVersion); - _subscriptionGovernanceRuleGovernanceRulesRestClient = new GovernanceRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, subscriptionGovernanceRuleGovernanceRulesApiVersion); - _securityConnectorGovernanceRulesExecuteStatusClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _securityConnectorGovernanceRulesExecuteStatusRestClient = new SecurityConnectorGovernanceRulesExecuteStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/governanceRules"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual GovernanceRuleData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get a specific governanceRule for the requested scope by ruleId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRules_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _securityConnectorGovernanceRuleClientDiagnostics.CreateScope("SecurityConnectorGovernanceRuleResource.Get"); - scope.Start(); - try - { - var response = await _securityConnectorGovernanceRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityConnectorGovernanceRuleResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific governanceRule for the requested scope by ruleId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRules_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _securityConnectorGovernanceRuleClientDiagnostics.CreateScope("SecurityConnectorGovernanceRuleResource.Get"); - scope.Start(); - try - { - var response = _securityConnectorGovernanceRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityConnectorGovernanceRuleResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a GovernanceRule over a given scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRules_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _securityConnectorGovernanceRuleClientDiagnostics.CreateScope("SecurityConnectorGovernanceRuleResource.Delete"); - scope.Start(); - try - { - var response = await _securityConnectorGovernanceRuleRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a GovernanceRule over a given scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRules_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _securityConnectorGovernanceRuleClientDiagnostics.CreateScope("SecurityConnectorGovernanceRuleResource.Delete"); - scope.Start(); - try - { - var response = _securityConnectorGovernanceRuleRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or update a security GovernanceRule on the given security connector. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRules_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, GovernanceRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityConnectorGovernanceRuleClientDiagnostics.CreateScope("SecurityConnectorGovernanceRuleResource.Update"); - scope.Start(); - try - { - var response = await _securityConnectorGovernanceRuleRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityConnectorGovernanceRuleResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or update a security GovernanceRule on the given security connector. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRules_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, GovernanceRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityConnectorGovernanceRuleClientDiagnostics.CreateScope("SecurityConnectorGovernanceRuleResource.Update"); - scope.Start(); - try - { - var response = _securityConnectorGovernanceRuleRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityConnectorGovernanceRuleResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Execute a security GovernanceRule on the given security connector. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/execute - /// - /// - /// Operation Id - /// GovernanceRules_RuleIdExecuteSingleSecurityConnector - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - public virtual async Task ExecuteRuleAsync(WaitUntil waitUntil, ExecuteGovernanceRuleParams executeGovernanceRuleParams = null, CancellationToken cancellationToken = default) - { - using var scope = _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics.CreateScope("SecurityConnectorGovernanceRuleResource.ExecuteRule"); - scope.Start(); - try - { - var response = await _subscriptionGovernanceRuleGovernanceRulesRestClient.RuleIdExecuteSingleSecurityConnectorAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, executeGovernanceRuleParams, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(_subscriptionGovernanceRuleGovernanceRulesClientDiagnostics, Pipeline, _subscriptionGovernanceRuleGovernanceRulesRestClient.CreateRuleIdExecuteSingleSecurityConnectorRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, executeGovernanceRuleParams).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Execute a security GovernanceRule on the given security connector. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/execute - /// - /// - /// Operation Id - /// GovernanceRules_RuleIdExecuteSingleSecurityConnector - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - public virtual ArmOperation ExecuteRule(WaitUntil waitUntil, ExecuteGovernanceRuleParams executeGovernanceRuleParams = null, CancellationToken cancellationToken = default) - { - using var scope = _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics.CreateScope("SecurityConnectorGovernanceRuleResource.ExecuteRule"); - scope.Start(); - try - { - var response = _subscriptionGovernanceRuleGovernanceRulesRestClient.RuleIdExecuteSingleSecurityConnector(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, executeGovernanceRuleParams, cancellationToken); - var operation = new SecurityCenterArmOperation(_subscriptionGovernanceRuleGovernanceRulesClientDiagnostics, Pipeline, _subscriptionGovernanceRuleGovernanceRulesRestClient.CreateRuleIdExecuteSingleSecurityConnectorRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, executeGovernanceRuleParams).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific governanceRule execution status for the requested scope by ruleId and operationId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId} - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRulesExecuteStatus_Get - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetRuleExecutionStatusAsync(WaitUntil waitUntil, string operationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); - - using var scope = _securityConnectorGovernanceRulesExecuteStatusClientDiagnostics.CreateScope("SecurityConnectorGovernanceRuleResource.GetRuleExecutionStatus"); - scope.Start(); - try - { - var response = await _securityConnectorGovernanceRulesExecuteStatusRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(new ExecuteRuleStatusOperationSource(), _securityConnectorGovernanceRulesExecuteStatusClientDiagnostics, Pipeline, _securityConnectorGovernanceRulesExecuteStatusRestClient.CreateGetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific governanceRule execution status for the requested scope by ruleId and operationId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId} - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRulesExecuteStatus_Get - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual ArmOperation GetRuleExecutionStatus(WaitUntil waitUntil, string operationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); - - using var scope = _securityConnectorGovernanceRulesExecuteStatusClientDiagnostics.CreateScope("SecurityConnectorGovernanceRuleResource.GetRuleExecutionStatus"); - scope.Start(); - try - { - var response = _securityConnectorGovernanceRulesExecuteStatusRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId, cancellationToken); - var operation = new SecurityCenterArmOperation(new ExecuteRuleStatusOperationSource(), _securityConnectorGovernanceRulesExecuteStatusClientDiagnostics, Pipeline, _securityConnectorGovernanceRulesExecuteStatusRestClient.CreateGetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, operationId).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorResource.cs deleted file mode 100644 index 7129471caa49..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityConnectorResource.cs +++ /dev/null @@ -1,707 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SecurityConnector along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSecurityConnectorResource method. - /// Otherwise you can get one from its parent resource using the GetSecurityConnector method. - /// - public partial class SecurityConnectorResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string securityConnectorName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _securityConnectorClientDiagnostics; - private readonly SecurityConnectorsRestOperations _securityConnectorRestClient; - private readonly SecurityConnectorData _data; - - /// Initializes a new instance of the class for mocking. - protected SecurityConnectorResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SecurityConnectorResource(ArmClient client, SecurityConnectorData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SecurityConnectorResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityConnectorClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string securityConnectorApiVersion); - _securityConnectorRestClient = new SecurityConnectorsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityConnectorApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/securityConnectors"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecurityConnectorData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// Gets a collection of SecurityConnectorGovernanceRuleResources in the SecurityConnector. - /// An object representing collection of SecurityConnectorGovernanceRuleResources and their operations over a SecurityConnectorGovernanceRuleResource. - public virtual SecurityConnectorGovernanceRuleCollection GetSecurityConnectorGovernanceRules() - { - return GetCachedClient(Client => new SecurityConnectorGovernanceRuleCollection(Client, Id)); - } - - /// - /// Get a specific governanceRule for the requested scope by ruleId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRules_Get - /// - /// - /// - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetSecurityConnectorGovernanceRuleAsync(string ruleId, CancellationToken cancellationToken = default) - { - return await GetSecurityConnectorGovernanceRules().GetAsync(ruleId, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a specific governanceRule for the requested scope by ruleId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// SecurityConnectorGovernanceRules_Get - /// - /// - /// - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetSecurityConnectorGovernanceRule(string ruleId, CancellationToken cancellationToken = default) - { - return GetSecurityConnectorGovernanceRules().Get(ruleId, cancellationToken); - } - - /// Gets a collection of SecurityConnectorApplicationResources in the SecurityConnector. - /// An object representing collection of SecurityConnectorApplicationResources and their operations over a SecurityConnectorApplicationResource. - public virtual SecurityConnectorApplicationCollection GetSecurityConnectorApplications() - { - return GetCachedClient(Client => new SecurityConnectorApplicationCollection(Client, Id)); - } - - /// - /// Get a specific application for the requested scope by applicationId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// SecurityConnectorApplications_Get - /// - /// - /// - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual async Task> GetSecurityConnectorApplicationAsync(string applicationId, CancellationToken cancellationToken = default) - { - return await GetSecurityConnectorApplications().GetAsync(applicationId, cancellationToken).ConfigureAwait(false); - } - - /// - /// Get a specific application for the requested scope by applicationId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// SecurityConnectorApplications_Get - /// - /// - /// - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - [ForwardsClientCalls] - public virtual Response GetSecurityConnectorApplication(string applicationId, CancellationToken cancellationToken = default) - { - return GetSecurityConnectorApplications().Get(applicationId, cancellationToken); - } - - /// - /// Retrieves details of a specific security connector - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorResource.Get"); - scope.Start(); - try - { - var response = await _securityConnectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityConnectorResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves details of a specific security connector - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorResource.Get"); - scope.Start(); - try - { - var response = _securityConnectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityConnectorResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes a security connector. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorResource.Delete"); - scope.Start(); - try - { - var response = await _securityConnectorRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes a security connector. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorResource.Delete"); - scope.Start(); - try - { - var response = _securityConnectorRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates a security connector - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Update - /// - /// - /// - /// The security connector resource. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(SecurityConnectorData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorResource.Update"); - scope.Start(); - try - { - var response = await _securityConnectorRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new SecurityConnectorResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates a security connector - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Update - /// - /// - /// - /// The security connector resource. - /// The cancellation token to use. - /// is null. - public virtual Response Update(SecurityConnectorData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorResource.Update"); - scope.Start(); - try - { - var response = _securityConnectorRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken); - return Response.FromValue(new SecurityConnectorResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Get - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues[key] = value; - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _securityConnectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new SecurityConnectorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new SecurityConnectorData(current.Location); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Get - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _securityConnectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new SecurityConnectorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new SecurityConnectorData(current.Location); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(patch, cancellationToken: cancellationToken); - return result; - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Get - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _securityConnectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new SecurityConnectorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new SecurityConnectorData(current.Location); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Get - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _securityConnectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new SecurityConnectorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new SecurityConnectorData(current.Location); - patch.Tags.ReplaceWith(tags); - var result = Update(patch, cancellationToken: cancellationToken); - return result; - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Get - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.Remove(key); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _securityConnectorRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new SecurityConnectorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new SecurityConnectorData(current.Location); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName} - /// - /// - /// Operation Id - /// SecurityConnectors_Get - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _securityConnectorClientDiagnostics.CreateScope("SecurityConnectorResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _securityConnectorRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new SecurityConnectorResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new SecurityConnectorData(current.Location); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(patch, cancellationToken: cancellationToken); - return result; - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityContactCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityContactCollection.cs deleted file mode 100644 index a1a5fbbe0e32..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityContactCollection.cs +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSecurityContacts method from an instance of . - /// - public partial class SecurityContactCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _securityContactClientDiagnostics; - private readonly SecurityContactsRestOperations _securityContactRestClient; - - /// Initializes a new instance of the class for mocking. - protected SecurityContactCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SecurityContactCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityContactClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecurityContactResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SecurityContactResource.ResourceType, out string securityContactApiVersion); - _securityContactRestClient = new SecurityContactsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityContactApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SubscriptionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); - } - - /// - /// Create security contact configurations for the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName} - /// - /// - /// Operation Id - /// SecurityContacts_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the security contact object. - /// Security contact object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string securityContactName, SecurityContactData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(securityContactName, nameof(securityContactName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityContactClientDiagnostics.CreateScope("SecurityContactCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _securityContactRestClient.CreateAsync(Id.SubscriptionId, securityContactName, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityContactResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create security contact configurations for the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName} - /// - /// - /// Operation Id - /// SecurityContacts_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the security contact object. - /// Security contact object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string securityContactName, SecurityContactData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(securityContactName, nameof(securityContactName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityContactClientDiagnostics.CreateScope("SecurityContactCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _securityContactRestClient.Create(Id.SubscriptionId, securityContactName, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityContactResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get Default Security contact configurations for the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName} - /// - /// - /// Operation Id - /// SecurityContacts_Get - /// - /// - /// - /// Name of the security contact object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string securityContactName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(securityContactName, nameof(securityContactName)); - - using var scope = _securityContactClientDiagnostics.CreateScope("SecurityContactCollection.Get"); - scope.Start(); - try - { - var response = await _securityContactRestClient.GetAsync(Id.SubscriptionId, securityContactName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityContactResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get Default Security contact configurations for the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName} - /// - /// - /// Operation Id - /// SecurityContacts_Get - /// - /// - /// - /// Name of the security contact object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string securityContactName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(securityContactName, nameof(securityContactName)); - - using var scope = _securityContactClientDiagnostics.CreateScope("SecurityContactCollection.Get"); - scope.Start(); - try - { - var response = _securityContactRestClient.Get(Id.SubscriptionId, securityContactName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityContactResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List all security contact configurations for the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts - /// - /// - /// Operation Id - /// SecurityContacts_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityContactRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityContactRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityContactResource(Client, SecurityContactData.DeserializeSecurityContactData(e)), _securityContactClientDiagnostics, Pipeline, "SecurityContactCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List all security contact configurations for the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts - /// - /// - /// Operation Id - /// SecurityContacts_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityContactRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityContactRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityContactResource(Client, SecurityContactData.DeserializeSecurityContactData(e)), _securityContactClientDiagnostics, Pipeline, "SecurityContactCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName} - /// - /// - /// Operation Id - /// SecurityContacts_Get - /// - /// - /// - /// Name of the security contact object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string securityContactName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(securityContactName, nameof(securityContactName)); - - using var scope = _securityContactClientDiagnostics.CreateScope("SecurityContactCollection.Exists"); - scope.Start(); - try - { - var response = await _securityContactRestClient.GetAsync(Id.SubscriptionId, securityContactName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName} - /// - /// - /// Operation Id - /// SecurityContacts_Get - /// - /// - /// - /// Name of the security contact object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string securityContactName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(securityContactName, nameof(securityContactName)); - - using var scope = _securityContactClientDiagnostics.CreateScope("SecurityContactCollection.Exists"); - scope.Start(); - try - { - var response = _securityContactRestClient.Get(Id.SubscriptionId, securityContactName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityContactData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityContactData.cs deleted file mode 100644 index 0dcc3cb318e0..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityContactData.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SecurityContact data model. - /// Contact details and configurations for notifications coming from Microsoft Defender for Cloud. - /// - public partial class SecurityContactData : ResourceData - { - /// Initializes a new instance of SecurityContactData. - public SecurityContactData() - { - } - - /// Initializes a new instance of SecurityContactData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// List of email addresses which will get notifications from Microsoft Defender for Cloud by the configurations defined in this security contact. - /// The security contact's phone number. - /// Defines whether to send email notifications about new security alerts. - /// Defines whether to send email notifications from Microsoft Defender for Cloud to persons with specific RBAC roles on the subscription. - internal SecurityContactData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string emails, string phone, SecurityContactPropertiesAlertNotifications alertNotifications, SecurityContactPropertiesNotificationsByRole notificationsByRole) : base(id, name, resourceType, systemData) - { - Emails = emails; - Phone = phone; - AlertNotifications = alertNotifications; - NotificationsByRole = notificationsByRole; - } - - /// List of email addresses which will get notifications from Microsoft Defender for Cloud by the configurations defined in this security contact. - public string Emails { get; set; } - /// The security contact's phone number. - public string Phone { get; set; } - /// Defines whether to send email notifications about new security alerts. - public SecurityContactPropertiesAlertNotifications AlertNotifications { get; set; } - /// Defines whether to send email notifications from Microsoft Defender for Cloud to persons with specific RBAC roles on the subscription. - public SecurityContactPropertiesNotificationsByRole NotificationsByRole { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityContactResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityContactResource.cs deleted file mode 100644 index c5387e877900..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityContactResource.cs +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SecurityContact along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSecurityContactResource method. - /// Otherwise you can get one from its parent resource using the GetSecurityContact method. - /// - public partial class SecurityContactResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string securityContactName) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _securityContactClientDiagnostics; - private readonly SecurityContactsRestOperations _securityContactRestClient; - private readonly SecurityContactData _data; - - /// Initializes a new instance of the class for mocking. - protected SecurityContactResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SecurityContactResource(ArmClient client, SecurityContactData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SecurityContactResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityContactClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string securityContactApiVersion); - _securityContactRestClient = new SecurityContactsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityContactApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/securityContacts"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecurityContactData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get Default Security contact configurations for the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName} - /// - /// - /// Operation Id - /// SecurityContacts_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _securityContactClientDiagnostics.CreateScope("SecurityContactResource.Get"); - scope.Start(); - try - { - var response = await _securityContactRestClient.GetAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityContactResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get Default Security contact configurations for the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName} - /// - /// - /// Operation Id - /// SecurityContacts_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _securityContactClientDiagnostics.CreateScope("SecurityContactResource.Get"); - scope.Start(); - try - { - var response = _securityContactRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityContactResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete security contact configurations for the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName} - /// - /// - /// Operation Id - /// SecurityContacts_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _securityContactClientDiagnostics.CreateScope("SecurityContactResource.Delete"); - scope.Start(); - try - { - var response = await _securityContactRestClient.DeleteAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete security contact configurations for the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName} - /// - /// - /// Operation Id - /// SecurityContacts_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _securityContactClientDiagnostics.CreateScope("SecurityContactResource.Delete"); - scope.Start(); - try - { - var response = _securityContactRestClient.Delete(Id.SubscriptionId, Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create security contact configurations for the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName} - /// - /// - /// Operation Id - /// SecurityContacts_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Security contact object. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, SecurityContactData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityContactClientDiagnostics.CreateScope("SecurityContactResource.Update"); - scope.Start(); - try - { - var response = await _securityContactRestClient.CreateAsync(Id.SubscriptionId, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityContactResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create security contact configurations for the subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName} - /// - /// - /// Operation Id - /// SecurityContacts_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Security contact object. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, SecurityContactData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityContactClientDiagnostics.CreateScope("SecurityContactResource.Update"); - scope.Start(); - try - { - var response = _securityContactRestClient.Create(Id.SubscriptionId, Id.Name, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityContactResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySettingCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySettingCollection.cs deleted file mode 100644 index e2cb8136eeea..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySettingCollection.cs +++ /dev/null @@ -1,322 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSecuritySettings method from an instance of . - /// - public partial class SecuritySettingCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _securitySettingSettingsClientDiagnostics; - private readonly SettingsRestOperations _securitySettingSettingsRestClient; - - /// Initializes a new instance of the class for mocking. - protected SecuritySettingCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SecuritySettingCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securitySettingSettingsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecuritySettingResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SecuritySettingResource.ResourceType, out string securitySettingSettingsApiVersion); - _securitySettingSettingsRestClient = new SettingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securitySettingSettingsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SubscriptionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); - } - - /// - /// updating settings about different configurations in Microsoft Defender for Cloud - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName} - /// - /// - /// Operation Id - /// Settings_Update - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the setting. - /// Setting object. - /// The cancellation token to use. - /// is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, SecuritySettingName settingName, SecuritySettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securitySettingSettingsClientDiagnostics.CreateScope("SecuritySettingCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _securitySettingSettingsRestClient.UpdateAsync(Id.SubscriptionId, settingName, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecuritySettingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// updating settings about different configurations in Microsoft Defender for Cloud - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName} - /// - /// - /// Operation Id - /// Settings_Update - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the setting. - /// Setting object. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, SecuritySettingName settingName, SecuritySettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securitySettingSettingsClientDiagnostics.CreateScope("SecuritySettingCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _securitySettingSettingsRestClient.Update(Id.SubscriptionId, settingName, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecuritySettingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Settings of different configurations in Microsoft Defender for Cloud - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName} - /// - /// - /// Operation Id - /// Settings_Get - /// - /// - /// - /// The name of the setting. - /// The cancellation token to use. - public virtual async Task> GetAsync(SecuritySettingName settingName, CancellationToken cancellationToken = default) - { - using var scope = _securitySettingSettingsClientDiagnostics.CreateScope("SecuritySettingCollection.Get"); - scope.Start(); - try - { - var response = await _securitySettingSettingsRestClient.GetAsync(Id.SubscriptionId, settingName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecuritySettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Settings of different configurations in Microsoft Defender for Cloud - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName} - /// - /// - /// Operation Id - /// Settings_Get - /// - /// - /// - /// The name of the setting. - /// The cancellation token to use. - public virtual Response Get(SecuritySettingName settingName, CancellationToken cancellationToken = default) - { - using var scope = _securitySettingSettingsClientDiagnostics.CreateScope("SecuritySettingCollection.Get"); - scope.Start(); - try - { - var response = _securitySettingSettingsRestClient.Get(Id.SubscriptionId, settingName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecuritySettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Settings about different configurations in Microsoft Defender for Cloud - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/settings - /// - /// - /// Operation Id - /// Settings_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securitySettingSettingsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securitySettingSettingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecuritySettingResource(Client, SecuritySettingData.DeserializeSecuritySettingData(e)), _securitySettingSettingsClientDiagnostics, Pipeline, "SecuritySettingCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Settings about different configurations in Microsoft Defender for Cloud - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/settings - /// - /// - /// Operation Id - /// Settings_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securitySettingSettingsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securitySettingSettingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecuritySettingResource(Client, SecuritySettingData.DeserializeSecuritySettingData(e)), _securitySettingSettingsClientDiagnostics, Pipeline, "SecuritySettingCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName} - /// - /// - /// Operation Id - /// Settings_Get - /// - /// - /// - /// The name of the setting. - /// The cancellation token to use. - public virtual async Task> ExistsAsync(SecuritySettingName settingName, CancellationToken cancellationToken = default) - { - using var scope = _securitySettingSettingsClientDiagnostics.CreateScope("SecuritySettingCollection.Exists"); - scope.Start(); - try - { - var response = await _securitySettingSettingsRestClient.GetAsync(Id.SubscriptionId, settingName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName} - /// - /// - /// Operation Id - /// Settings_Get - /// - /// - /// - /// The name of the setting. - /// The cancellation token to use. - public virtual Response Exists(SecuritySettingName settingName, CancellationToken cancellationToken = default) - { - using var scope = _securitySettingSettingsClientDiagnostics.CreateScope("SecuritySettingCollection.Exists"); - scope.Start(); - try - { - var response = _securitySettingSettingsRestClient.Get(Id.SubscriptionId, settingName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySettingData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySettingData.cs deleted file mode 100644 index eb061ad1b15d..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySettingData.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SecuritySetting data model. - /// The kind of the security setting - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include and . - /// - public partial class SecuritySettingData : ResourceData - { - /// Initializes a new instance of SecuritySettingData. - public SecuritySettingData() - { - } - - /// Initializes a new instance of SecuritySettingData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// the kind of the settings string. - internal SecuritySettingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SettingKind kind) : base(id, name, resourceType, systemData) - { - Kind = kind; - } - - /// the kind of the settings string. - internal SettingKind Kind { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySettingResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySettingResource.cs deleted file mode 100644 index 85678d24d859..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySettingResource.cs +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SecuritySetting along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSecuritySettingResource method. - /// Otherwise you can get one from its parent resource using the GetSecuritySetting method. - /// - public partial class SecuritySettingResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, SecuritySettingName settingName) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _securitySettingSettingsClientDiagnostics; - private readonly SettingsRestOperations _securitySettingSettingsRestClient; - private readonly SecuritySettingData _data; - - /// Initializes a new instance of the class for mocking. - protected SecuritySettingResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SecuritySettingResource(ArmClient client, SecuritySettingData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SecuritySettingResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securitySettingSettingsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string securitySettingSettingsApiVersion); - _securitySettingSettingsRestClient = new SettingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securitySettingSettingsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/settings"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecuritySettingData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Settings of different configurations in Microsoft Defender for Cloud - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName} - /// - /// - /// Operation Id - /// Settings_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _securitySettingSettingsClientDiagnostics.CreateScope("SecuritySettingResource.Get"); - scope.Start(); - try - { - var response = await _securitySettingSettingsRestClient.GetAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecuritySettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Settings of different configurations in Microsoft Defender for Cloud - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName} - /// - /// - /// Operation Id - /// Settings_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _securitySettingSettingsClientDiagnostics.CreateScope("SecuritySettingResource.Get"); - scope.Start(); - try - { - var response = _securitySettingSettingsRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecuritySettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// updating settings about different configurations in Microsoft Defender for Cloud - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName} - /// - /// - /// Operation Id - /// Settings_Update - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Setting object. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, SecuritySettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securitySettingSettingsClientDiagnostics.CreateScope("SecuritySettingResource.Update"); - scope.Start(); - try - { - var response = await _securitySettingSettingsRestClient.UpdateAsync(Id.SubscriptionId, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecuritySettingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// updating settings about different configurations in Microsoft Defender for Cloud - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName} - /// - /// - /// Operation Id - /// Settings_Update - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Setting object. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, SecuritySettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securitySettingSettingsClientDiagnostics.CreateScope("SecuritySettingResource.Update"); - scope.Start(); - try - { - var response = _securitySettingSettingsRestClient.Update(Id.SubscriptionId, Id.Name, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecuritySettingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySubAssessmentCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySubAssessmentCollection.cs deleted file mode 100644 index da8db1c681c7..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySubAssessmentCollection.cs +++ /dev/null @@ -1,258 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSecuritySubAssessments method from an instance of . - /// - public partial class SecuritySubAssessmentCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _securitySubAssessmentSubAssessmentsClientDiagnostics; - private readonly SubAssessmentsRestOperations _securitySubAssessmentSubAssessmentsRestClient; - - /// Initializes a new instance of the class for mocking. - protected SecuritySubAssessmentCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SecuritySubAssessmentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securitySubAssessmentSubAssessmentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecuritySubAssessmentResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SecuritySubAssessmentResource.ResourceType, out string securitySubAssessmentSubAssessmentsApiVersion); - _securitySubAssessmentSubAssessmentsRestClient = new SubAssessmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securitySubAssessmentSubAssessmentsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SecurityAssessmentResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SecurityAssessmentResource.ResourceType), nameof(id)); - } - - /// - /// Get a security sub-assessment on your scanned resource - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName} - /// - /// - /// Operation Id - /// SubAssessments_Get - /// - /// - /// - /// The Sub-Assessment Key - Unique key for the sub-assessment type. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string subAssessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subAssessmentName, nameof(subAssessmentName)); - - using var scope = _securitySubAssessmentSubAssessmentsClientDiagnostics.CreateScope("SecuritySubAssessmentCollection.Get"); - scope.Start(); - try - { - var response = await _securitySubAssessmentSubAssessmentsRestClient.GetAsync(Id.Parent, Id.Name, subAssessmentName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecuritySubAssessmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a security sub-assessment on your scanned resource - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName} - /// - /// - /// Operation Id - /// SubAssessments_Get - /// - /// - /// - /// The Sub-Assessment Key - Unique key for the sub-assessment type. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string subAssessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subAssessmentName, nameof(subAssessmentName)); - - using var scope = _securitySubAssessmentSubAssessmentsClientDiagnostics.CreateScope("SecuritySubAssessmentCollection.Get"); - scope.Start(); - try - { - var response = _securitySubAssessmentSubAssessmentsRestClient.Get(Id.Parent, Id.Name, subAssessmentName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecuritySubAssessmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get security sub-assessments on all your scanned resources inside a scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments - /// - /// - /// Operation Id - /// SubAssessments_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securitySubAssessmentSubAssessmentsRestClient.CreateListRequest(Id.Parent, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securitySubAssessmentSubAssessmentsRestClient.CreateListNextPageRequest(nextLink, Id.Parent, Id.Name); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecuritySubAssessmentResource(Client, SecuritySubAssessmentData.DeserializeSecuritySubAssessmentData(e)), _securitySubAssessmentSubAssessmentsClientDiagnostics, Pipeline, "SecuritySubAssessmentCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Get security sub-assessments on all your scanned resources inside a scope - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments - /// - /// - /// Operation Id - /// SubAssessments_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securitySubAssessmentSubAssessmentsRestClient.CreateListRequest(Id.Parent, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securitySubAssessmentSubAssessmentsRestClient.CreateListNextPageRequest(nextLink, Id.Parent, Id.Name); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecuritySubAssessmentResource(Client, SecuritySubAssessmentData.DeserializeSecuritySubAssessmentData(e)), _securitySubAssessmentSubAssessmentsClientDiagnostics, Pipeline, "SecuritySubAssessmentCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName} - /// - /// - /// Operation Id - /// SubAssessments_Get - /// - /// - /// - /// The Sub-Assessment Key - Unique key for the sub-assessment type. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string subAssessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subAssessmentName, nameof(subAssessmentName)); - - using var scope = _securitySubAssessmentSubAssessmentsClientDiagnostics.CreateScope("SecuritySubAssessmentCollection.Exists"); - scope.Start(); - try - { - var response = await _securitySubAssessmentSubAssessmentsRestClient.GetAsync(Id.Parent, Id.Name, subAssessmentName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName} - /// - /// - /// Operation Id - /// SubAssessments_Get - /// - /// - /// - /// The Sub-Assessment Key - Unique key for the sub-assessment type. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string subAssessmentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subAssessmentName, nameof(subAssessmentName)); - - using var scope = _securitySubAssessmentSubAssessmentsClientDiagnostics.CreateScope("SecuritySubAssessmentCollection.Exists"); - scope.Start(); - try - { - var response = _securitySubAssessmentSubAssessmentsRestClient.Get(Id.Parent, Id.Name, subAssessmentName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySubAssessmentData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySubAssessmentData.cs deleted file mode 100644 index 53d5068daacc..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySubAssessmentData.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SecuritySubAssessment data model. - /// Security sub-assessment on a resource - /// - public partial class SecuritySubAssessmentData : ResourceData - { - /// Initializes a new instance of SecuritySubAssessmentData. - public SecuritySubAssessmentData() - { - } - - /// Initializes a new instance of SecuritySubAssessmentData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Vulnerability ID. - /// User friendly display name of the sub-assessment. - /// Status of the sub-assessment. - /// Information on how to remediate this sub-assessment. - /// Description of the impact of this sub-assessment. - /// Category of the sub-assessment. - /// Human readable description of the assessment status. - /// The date and time the sub-assessment was generated. - /// - /// Details of the resource that was assessed - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - /// - /// Details of the sub-assessment - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - internal SecuritySubAssessmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string vulnerabilityId, string displayName, SubAssessmentStatus status, string remediation, string impact, string category, string description, DateTimeOffset? generatedOn, SecurityCenterResourceDetails resourceDetails, SecuritySubAssessmentAdditionalInfo additionalData) : base(id, name, resourceType, systemData) - { - VulnerabilityId = vulnerabilityId; - DisplayName = displayName; - Status = status; - Remediation = remediation; - Impact = impact; - Category = category; - Description = description; - GeneratedOn = generatedOn; - ResourceDetails = resourceDetails; - AdditionalData = additionalData; - } - - /// Vulnerability ID. - public string VulnerabilityId { get; } - /// User friendly display name of the sub-assessment. - public string DisplayName { get; } - /// Status of the sub-assessment. - public SubAssessmentStatus Status { get; set; } - /// Information on how to remediate this sub-assessment. - public string Remediation { get; } - /// Description of the impact of this sub-assessment. - public string Impact { get; } - /// Category of the sub-assessment. - public string Category { get; } - /// Human readable description of the assessment status. - public string Description { get; } - /// The date and time the sub-assessment was generated. - public DateTimeOffset? GeneratedOn { get; } - /// - /// Details of the resource that was assessed - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public SecurityCenterResourceDetails ResourceDetails { get; set; } - /// - /// Details of the sub-assessment - /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . - /// - public SecuritySubAssessmentAdditionalInfo AdditionalData { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySubAssessmentResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySubAssessmentResource.cs deleted file mode 100644 index a9c4057e566e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecuritySubAssessmentResource.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SecuritySubAssessment along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSecuritySubAssessmentResource method. - /// Otherwise you can get one from its parent resource using the GetSecuritySubAssessment method. - /// - public partial class SecuritySubAssessmentResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string scope, string assessmentName, string subAssessmentName) - { - var resourceId = $"{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _securitySubAssessmentSubAssessmentsClientDiagnostics; - private readonly SubAssessmentsRestOperations _securitySubAssessmentSubAssessmentsRestClient; - private readonly SecuritySubAssessmentData _data; - - /// Initializes a new instance of the class for mocking. - protected SecuritySubAssessmentResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SecuritySubAssessmentResource(ArmClient client, SecuritySubAssessmentData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SecuritySubAssessmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securitySubAssessmentSubAssessmentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string securitySubAssessmentSubAssessmentsApiVersion); - _securitySubAssessmentSubAssessmentsRestClient = new SubAssessmentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securitySubAssessmentSubAssessmentsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/assessments/subAssessments"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecuritySubAssessmentData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get a security sub-assessment on your scanned resource - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName} - /// - /// - /// Operation Id - /// SubAssessments_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _securitySubAssessmentSubAssessmentsClientDiagnostics.CreateScope("SecuritySubAssessmentResource.Get"); - scope.Start(); - try - { - var response = await _securitySubAssessmentSubAssessmentsRestClient.GetAsync(Id.Parent.Parent, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecuritySubAssessmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a security sub-assessment on your scanned resource - /// - /// - /// Request Path - /// /{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName} - /// - /// - /// Operation Id - /// SubAssessments_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _securitySubAssessmentSubAssessmentsClientDiagnostics.CreateScope("SecuritySubAssessmentResource.Get"); - scope.Start(); - try - { - var response = _securitySubAssessmentSubAssessmentsRestClient.Get(Id.Parent.Parent, Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecuritySubAssessmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityTaskData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityTaskData.cs deleted file mode 100644 index d3e968ce1457..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityTaskData.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SecurityTask data model. - /// Security task that we recommend to do in order to strengthen security - /// - public partial class SecurityTaskData : ResourceData - { - /// Initializes a new instance of SecurityTaskData. - public SecurityTaskData() - { - } - - /// Initializes a new instance of SecurityTaskData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// State of the task (Active, Resolved etc.). - /// The time this task was discovered in UTC. - /// Changing set of properties, depending on the task type that is derived from the name field. - /// The time this task's details were last changed in UTC. - /// Additional data on the state of the task. - internal SecurityTaskData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string state, DateTimeOffset? createdOn, SecurityTaskProperties securityTaskParameters, DateTimeOffset? lastStateChangedOn, string subState) : base(id, name, resourceType, systemData) - { - State = state; - CreatedOn = createdOn; - SecurityTaskParameters = securityTaskParameters; - LastStateChangedOn = lastStateChangedOn; - SubState = subState; - } - - /// State of the task (Active, Resolved etc.). - public string State { get; } - /// The time this task was discovered in UTC. - public DateTimeOffset? CreatedOn { get; } - /// Changing set of properties, depending on the task type that is derived from the name field. - public SecurityTaskProperties SecurityTaskParameters { get; set; } - /// The time this task's details were last changed in UTC. - public DateTimeOffset? LastStateChangedOn { get; } - /// Additional data on the state of the task. - public string SubState { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityWorkspaceSettingCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityWorkspaceSettingCollection.cs deleted file mode 100644 index 1060181f416a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityWorkspaceSettingCollection.cs +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSecurityWorkspaceSettings method from an instance of . - /// - public partial class SecurityWorkspaceSettingCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics; - private readonly WorkspaceSettingsRestOperations _securityWorkspaceSettingWorkspaceSettingsRestClient; - - /// Initializes a new instance of the class for mocking. - protected SecurityWorkspaceSettingCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SecurityWorkspaceSettingCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SecurityWorkspaceSettingResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SecurityWorkspaceSettingResource.ResourceType, out string securityWorkspaceSettingWorkspaceSettingsApiVersion); - _securityWorkspaceSettingWorkspaceSettingsRestClient = new WorkspaceSettingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityWorkspaceSettingWorkspaceSettingsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SubscriptionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); - } - - /// - /// creating settings about where we should store your security data and logs - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName} - /// - /// - /// Operation Id - /// WorkspaceSettings_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the security setting. - /// Security data setting object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string workspaceSettingName, SecurityWorkspaceSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(workspaceSettingName, nameof(workspaceSettingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics.CreateScope("SecurityWorkspaceSettingCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _securityWorkspaceSettingWorkspaceSettingsRestClient.CreateAsync(Id.SubscriptionId, workspaceSettingName, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityWorkspaceSettingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// creating settings about where we should store your security data and logs - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName} - /// - /// - /// Operation Id - /// WorkspaceSettings_Create - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Name of the security setting. - /// Security data setting object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string workspaceSettingName, SecurityWorkspaceSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(workspaceSettingName, nameof(workspaceSettingName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics.CreateScope("SecurityWorkspaceSettingCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _securityWorkspaceSettingWorkspaceSettingsRestClient.Create(Id.SubscriptionId, workspaceSettingName, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityWorkspaceSettingResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName} - /// - /// - /// Operation Id - /// WorkspaceSettings_Get - /// - /// - /// - /// Name of the security setting. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string workspaceSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(workspaceSettingName, nameof(workspaceSettingName)); - - using var scope = _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics.CreateScope("SecurityWorkspaceSettingCollection.Get"); - scope.Start(); - try - { - var response = await _securityWorkspaceSettingWorkspaceSettingsRestClient.GetAsync(Id.SubscriptionId, workspaceSettingName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityWorkspaceSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName} - /// - /// - /// Operation Id - /// WorkspaceSettings_Get - /// - /// - /// - /// Name of the security setting. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string workspaceSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(workspaceSettingName, nameof(workspaceSettingName)); - - using var scope = _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics.CreateScope("SecurityWorkspaceSettingCollection.Get"); - scope.Start(); - try - { - var response = _securityWorkspaceSettingWorkspaceSettingsRestClient.Get(Id.SubscriptionId, workspaceSettingName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityWorkspaceSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings - /// - /// - /// Operation Id - /// WorkspaceSettings_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityWorkspaceSettingWorkspaceSettingsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityWorkspaceSettingWorkspaceSettingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SecurityWorkspaceSettingResource(Client, SecurityWorkspaceSettingData.DeserializeSecurityWorkspaceSettingData(e)), _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics, Pipeline, "SecurityWorkspaceSettingCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings - /// - /// - /// Operation Id - /// WorkspaceSettings_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _securityWorkspaceSettingWorkspaceSettingsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _securityWorkspaceSettingWorkspaceSettingsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SecurityWorkspaceSettingResource(Client, SecurityWorkspaceSettingData.DeserializeSecurityWorkspaceSettingData(e)), _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics, Pipeline, "SecurityWorkspaceSettingCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName} - /// - /// - /// Operation Id - /// WorkspaceSettings_Get - /// - /// - /// - /// Name of the security setting. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string workspaceSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(workspaceSettingName, nameof(workspaceSettingName)); - - using var scope = _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics.CreateScope("SecurityWorkspaceSettingCollection.Exists"); - scope.Start(); - try - { - var response = await _securityWorkspaceSettingWorkspaceSettingsRestClient.GetAsync(Id.SubscriptionId, workspaceSettingName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName} - /// - /// - /// Operation Id - /// WorkspaceSettings_Get - /// - /// - /// - /// Name of the security setting. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string workspaceSettingName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(workspaceSettingName, nameof(workspaceSettingName)); - - using var scope = _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics.CreateScope("SecurityWorkspaceSettingCollection.Exists"); - scope.Start(); - try - { - var response = _securityWorkspaceSettingWorkspaceSettingsRestClient.Get(Id.SubscriptionId, workspaceSettingName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityWorkspaceSettingData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityWorkspaceSettingData.cs deleted file mode 100644 index 4ca21d0cfb0e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityWorkspaceSettingData.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SecurityWorkspaceSetting data model. - /// Configures where to store the OMS agent data for workspaces under a scope - /// - public partial class SecurityWorkspaceSettingData : ResourceData - { - /// Initializes a new instance of SecurityWorkspaceSettingData. - public SecurityWorkspaceSettingData() - { - } - - /// Initializes a new instance of SecurityWorkspaceSettingData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The full Azure ID of the workspace to save the data in. - /// All the VMs in this scope will send their security data to the mentioned workspace unless overridden by a setting with more specific scope. - internal SecurityWorkspaceSettingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ResourceIdentifier workspaceId, string scope) : base(id, name, resourceType, systemData) - { - WorkspaceId = workspaceId; - Scope = scope; - } - - /// The full Azure ID of the workspace to save the data in. - public ResourceIdentifier WorkspaceId { get; set; } - /// All the VMs in this scope will send their security data to the mentioned workspace unless overridden by a setting with more specific scope. - public string Scope { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityWorkspaceSettingResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityWorkspaceSettingResource.cs deleted file mode 100644 index 2b3a78ded72a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityWorkspaceSettingResource.cs +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SecurityWorkspaceSetting along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSecurityWorkspaceSettingResource method. - /// Otherwise you can get one from its parent resource using the GetSecurityWorkspaceSetting method. - /// - public partial class SecurityWorkspaceSettingResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string workspaceSettingName) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics; - private readonly WorkspaceSettingsRestOperations _securityWorkspaceSettingWorkspaceSettingsRestClient; - private readonly SecurityWorkspaceSettingData _data; - - /// Initializes a new instance of the class for mocking. - protected SecurityWorkspaceSettingResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SecurityWorkspaceSettingResource(ArmClient client, SecurityWorkspaceSettingData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SecurityWorkspaceSettingResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string securityWorkspaceSettingWorkspaceSettingsApiVersion); - _securityWorkspaceSettingWorkspaceSettingsRestClient = new WorkspaceSettingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityWorkspaceSettingWorkspaceSettingsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/workspaceSettings"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecurityWorkspaceSettingData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName} - /// - /// - /// Operation Id - /// WorkspaceSettings_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics.CreateScope("SecurityWorkspaceSettingResource.Get"); - scope.Start(); - try - { - var response = await _securityWorkspaceSettingWorkspaceSettingsRestClient.GetAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityWorkspaceSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace configuration was set - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName} - /// - /// - /// Operation Id - /// WorkspaceSettings_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics.CreateScope("SecurityWorkspaceSettingResource.Get"); - scope.Start(); - try - { - var response = _securityWorkspaceSettingWorkspaceSettingsRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityWorkspaceSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName} - /// - /// - /// Operation Id - /// WorkspaceSettings_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics.CreateScope("SecurityWorkspaceSettingResource.Delete"); - scope.Start(); - try - { - var response = await _securityWorkspaceSettingWorkspaceSettingsRestClient.DeleteAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName} - /// - /// - /// Operation Id - /// WorkspaceSettings_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics.CreateScope("SecurityWorkspaceSettingResource.Delete"); - scope.Start(); - try - { - var response = _securityWorkspaceSettingWorkspaceSettingsRestClient.Delete(Id.SubscriptionId, Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Settings about where we should store your security data and logs - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName} - /// - /// - /// Operation Id - /// WorkspaceSettings_Update - /// - /// - /// - /// Security data setting object. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(SecurityWorkspaceSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics.CreateScope("SecurityWorkspaceSettingResource.Update"); - scope.Start(); - try - { - var response = await _securityWorkspaceSettingWorkspaceSettingsRestClient.UpdateAsync(Id.SubscriptionId, Id.Name, data, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new SecurityWorkspaceSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Settings about where we should store your security data and logs - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName} - /// - /// - /// Operation Id - /// WorkspaceSettings_Update - /// - /// - /// - /// Security data setting object. - /// The cancellation token to use. - /// is null. - public virtual Response Update(SecurityWorkspaceSettingData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityWorkspaceSettingWorkspaceSettingsClientDiagnostics.CreateScope("SecurityWorkspaceSettingResource.Update"); - scope.Start(); - try - { - var response = _securityWorkspaceSettingWorkspaceSettingsRestClient.Update(Id.SubscriptionId, Id.Name, data, cancellationToken); - return Response.FromValue(new SecurityWorkspaceSettingResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ServerVulnerabilityAssessmentCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ServerVulnerabilityAssessmentCollection.cs deleted file mode 100644 index 1dec17e967fb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ServerVulnerabilityAssessmentCollection.cs +++ /dev/null @@ -1,316 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetServerVulnerabilityAssessments method from an instance of . - /// - public partial class ServerVulnerabilityAssessmentCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _serverVulnerabilityAssessmentClientDiagnostics; - private readonly ServerVulnerabilityAssessmentRestOperations _serverVulnerabilityAssessmentRestClient; - private readonly string _resourceNamespace; - private readonly string _resourceType; - private readonly string _resourceName; - - /// Initializes a new instance of the class for mocking. - protected ServerVulnerabilityAssessmentCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - /// The Namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - internal ServerVulnerabilityAssessmentCollection(ArmClient client, ResourceIdentifier id, string resourceNamespace, string resourceType, string resourceName) : base(client, id) - { - _resourceNamespace = resourceNamespace; - _resourceType = resourceType; - _resourceName = resourceName; - _serverVulnerabilityAssessmentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ServerVulnerabilityAssessmentResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ServerVulnerabilityAssessmentResource.ResourceType, out string serverVulnerabilityAssessmentApiVersion); - _serverVulnerabilityAssessmentRestClient = new ServerVulnerabilityAssessmentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serverVulnerabilityAssessmentApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Creating a server vulnerability assessment on a resource, which will onboard a resource for having a vulnerability assessment on it - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment} - /// - /// - /// Operation Id - /// ServerVulnerabilityAssessment_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _serverVulnerabilityAssessmentClientDiagnostics.CreateScope("ServerVulnerabilityAssessmentCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _serverVulnerabilityAssessmentRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new ServerVulnerabilityAssessmentResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creating a server vulnerability assessment on a resource, which will onboard a resource for having a vulnerability assessment on it - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment} - /// - /// - /// Operation Id - /// ServerVulnerabilityAssessment_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _serverVulnerabilityAssessmentClientDiagnostics.CreateScope("ServerVulnerabilityAssessmentCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _serverVulnerabilityAssessmentRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new ServerVulnerabilityAssessmentResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a server vulnerability assessment onboarding statuses on a given resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment} - /// - /// - /// Operation Id - /// ServerVulnerabilityAssessment_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _serverVulnerabilityAssessmentClientDiagnostics.CreateScope("ServerVulnerabilityAssessmentCollection.Get"); - scope.Start(); - try - { - var response = await _serverVulnerabilityAssessmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ServerVulnerabilityAssessmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a server vulnerability assessment onboarding statuses on a given resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment} - /// - /// - /// Operation Id - /// ServerVulnerabilityAssessment_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _serverVulnerabilityAssessmentClientDiagnostics.CreateScope("ServerVulnerabilityAssessmentCollection.Get"); - scope.Start(); - try - { - var response = _serverVulnerabilityAssessmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ServerVulnerabilityAssessmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a list of server vulnerability assessment onboarding statuses on a given resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments - /// - /// - /// Operation Id - /// ServerVulnerabilityAssessment_ListByExtendedResource - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _serverVulnerabilityAssessmentRestClient.CreateListByExtendedResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new ServerVulnerabilityAssessmentResource(Client, ServerVulnerabilityAssessmentData.DeserializeServerVulnerabilityAssessmentData(e)), _serverVulnerabilityAssessmentClientDiagnostics, Pipeline, "ServerVulnerabilityAssessmentCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Gets a list of server vulnerability assessment onboarding statuses on a given resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments - /// - /// - /// Operation Id - /// ServerVulnerabilityAssessment_ListByExtendedResource - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _serverVulnerabilityAssessmentRestClient.CreateListByExtendedResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName); - return PageableHelpers.CreatePageable(FirstPageRequest, null, e => new ServerVulnerabilityAssessmentResource(Client, ServerVulnerabilityAssessmentData.DeserializeServerVulnerabilityAssessmentData(e)), _serverVulnerabilityAssessmentClientDiagnostics, Pipeline, "ServerVulnerabilityAssessmentCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment} - /// - /// - /// Operation Id - /// ServerVulnerabilityAssessment_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> ExistsAsync(CancellationToken cancellationToken = default) - { - using var scope = _serverVulnerabilityAssessmentClientDiagnostics.CreateScope("ServerVulnerabilityAssessmentCollection.Exists"); - scope.Start(); - try - { - var response = await _serverVulnerabilityAssessmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment} - /// - /// - /// Operation Id - /// ServerVulnerabilityAssessment_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Exists(CancellationToken cancellationToken = default) - { - using var scope = _serverVulnerabilityAssessmentClientDiagnostics.CreateScope("ServerVulnerabilityAssessmentCollection.Exists"); - scope.Start(); - try - { - var response = _serverVulnerabilityAssessmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ServerVulnerabilityAssessmentData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ServerVulnerabilityAssessmentData.cs deleted file mode 100644 index 27f358b36ed8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ServerVulnerabilityAssessmentData.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the ServerVulnerabilityAssessment data model. - /// Describes the server vulnerability assessment details on a resource - /// - public partial class ServerVulnerabilityAssessmentData : ResourceData - { - /// Initializes a new instance of ServerVulnerabilityAssessmentData. - public ServerVulnerabilityAssessmentData() - { - } - - /// Initializes a new instance of ServerVulnerabilityAssessmentData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The provisioningState of the vulnerability assessment capability on the VM. - internal ServerVulnerabilityAssessmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ServerVulnerabilityAssessmentPropertiesProvisioningState? provisioningState) : base(id, name, resourceType, systemData) - { - ProvisioningState = provisioningState; - } - - /// The provisioningState of the vulnerability assessment capability on the VM. - public ServerVulnerabilityAssessmentPropertiesProvisioningState? ProvisioningState { get; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ServerVulnerabilityAssessmentResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ServerVulnerabilityAssessmentResource.cs deleted file mode 100644 index 35866a19af7b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/ServerVulnerabilityAssessmentResource.cs +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a ServerVulnerabilityAssessment along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetServerVulnerabilityAssessmentResource method. - /// Otherwise you can get one from its parent resource using the GetServerVulnerabilityAssessment method. - /// - public partial class ServerVulnerabilityAssessmentResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/default"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _serverVulnerabilityAssessmentClientDiagnostics; - private readonly ServerVulnerabilityAssessmentRestOperations _serverVulnerabilityAssessmentRestClient; - private readonly ServerVulnerabilityAssessmentData _data; - - /// Initializes a new instance of the class for mocking. - protected ServerVulnerabilityAssessmentResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal ServerVulnerabilityAssessmentResource(ArmClient client, ServerVulnerabilityAssessmentData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal ServerVulnerabilityAssessmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _serverVulnerabilityAssessmentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string serverVulnerabilityAssessmentApiVersion); - _serverVulnerabilityAssessmentRestClient = new ServerVulnerabilityAssessmentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serverVulnerabilityAssessmentApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/serverVulnerabilityAssessments"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual ServerVulnerabilityAssessmentData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets a server vulnerability assessment onboarding statuses on a given resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment} - /// - /// - /// Operation Id - /// ServerVulnerabilityAssessment_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _serverVulnerabilityAssessmentClientDiagnostics.CreateScope("ServerVulnerabilityAssessmentResource.Get"); - scope.Start(); - try - { - var response = await _serverVulnerabilityAssessmentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.ResourceType.Namespace, Id.Parent.ResourceType.GetLastType(), Id.Parent.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ServerVulnerabilityAssessmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a server vulnerability assessment onboarding statuses on a given resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment} - /// - /// - /// Operation Id - /// ServerVulnerabilityAssessment_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _serverVulnerabilityAssessmentClientDiagnostics.CreateScope("ServerVulnerabilityAssessmentResource.Get"); - scope.Start(); - try - { - var response = _serverVulnerabilityAssessmentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.ResourceType.Namespace, Id.Parent.ResourceType.GetLastType(), Id.Parent.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ServerVulnerabilityAssessmentResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removing server vulnerability assessment from a resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment} - /// - /// - /// Operation Id - /// ServerVulnerabilityAssessment_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _serverVulnerabilityAssessmentClientDiagnostics.CreateScope("ServerVulnerabilityAssessmentResource.Delete"); - scope.Start(); - try - { - var response = await _serverVulnerabilityAssessmentRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.ResourceType.Namespace, Id.Parent.ResourceType.GetLastType(), Id.Parent.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(_serverVulnerabilityAssessmentClientDiagnostics, Pipeline, _serverVulnerabilityAssessmentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.ResourceType.Namespace, Id.Parent.ResourceType.GetLastType(), Id.Parent.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removing server vulnerability assessment from a resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment} - /// - /// - /// Operation Id - /// ServerVulnerabilityAssessment_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _serverVulnerabilityAssessmentClientDiagnostics.CreateScope("ServerVulnerabilityAssessmentResource.Delete"); - scope.Start(); - try - { - var response = _serverVulnerabilityAssessmentRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.ResourceType.Namespace, Id.Parent.ResourceType.GetLastType(), Id.Parent.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(_serverVulnerabilityAssessmentClientDiagnostics, Pipeline, _serverVulnerabilityAssessmentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.ResourceType.Namespace, Id.Parent.ResourceType.GetLastType(), Id.Parent.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creating a server vulnerability assessment on a resource, which will onboard a resource for having a vulnerability assessment on it - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment} - /// - /// - /// Operation Id - /// ServerVulnerabilityAssessment_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _serverVulnerabilityAssessmentClientDiagnostics.CreateScope("ServerVulnerabilityAssessmentResource.Update"); - scope.Start(); - try - { - var response = await _serverVulnerabilityAssessmentRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.ResourceType.Namespace, Id.Parent.ResourceType.GetLastType(), Id.Parent.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new ServerVulnerabilityAssessmentResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creating a server vulnerability assessment on a resource, which will onboard a resource for having a vulnerability assessment on it - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment} - /// - /// - /// Operation Id - /// ServerVulnerabilityAssessment_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Update(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _serverVulnerabilityAssessmentClientDiagnostics.CreateScope("ServerVulnerabilityAssessmentResource.Update"); - scope.Start(); - try - { - var response = _serverVulnerabilityAssessmentRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.ResourceType.Namespace, Id.Parent.ResourceType.GetLastType(), Id.Parent.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new ServerVulnerabilityAssessmentResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SoftwareInventoryCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SoftwareInventoryCollection.cs deleted file mode 100644 index 7a329712964b..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SoftwareInventoryCollection.cs +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSoftwareInventories method from an instance of . - /// - public partial class SoftwareInventoryCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _softwareInventoryClientDiagnostics; - private readonly SoftwareInventoriesRestOperations _softwareInventoryRestClient; - private readonly string _resourceNamespace; - private readonly string _resourceType; - private readonly string _resourceName; - - /// Initializes a new instance of the class for mocking. - protected SoftwareInventoryCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - /// The namespace of the resource. - /// The type of the resource. - /// Name of the resource. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - internal SoftwareInventoryCollection(ArmClient client, ResourceIdentifier id, string resourceNamespace, string resourceType, string resourceName) : base(client, id) - { - _resourceNamespace = resourceNamespace; - _resourceType = resourceType; - _resourceName = resourceName; - _softwareInventoryClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SoftwareInventoryResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SoftwareInventoryResource.ResourceType, out string softwareInventoryApiVersion); - _softwareInventoryRestClient = new SoftwareInventoriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, softwareInventoryApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// Gets a single software data of the virtual machine. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName} - /// - /// - /// Operation Id - /// SoftwareInventories_Get - /// - /// - /// - /// Name of the installed software. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string softwareName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(softwareName, nameof(softwareName)); - - using var scope = _softwareInventoryClientDiagnostics.CreateScope("SoftwareInventoryCollection.Get"); - scope.Start(); - try - { - var response = await _softwareInventoryRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName, softwareName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SoftwareInventoryResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a single software data of the virtual machine. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName} - /// - /// - /// Operation Id - /// SoftwareInventories_Get - /// - /// - /// - /// Name of the installed software. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string softwareName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(softwareName, nameof(softwareName)); - - using var scope = _softwareInventoryClientDiagnostics.CreateScope("SoftwareInventoryCollection.Get"); - scope.Start(); - try - { - var response = _softwareInventoryRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName, softwareName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SoftwareInventoryResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the software inventory of the virtual machine. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories - /// - /// - /// Operation Id - /// SoftwareInventories_ListByExtendedResource - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _softwareInventoryRestClient.CreateListByExtendedResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _softwareInventoryRestClient.CreateListByExtendedResourceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SoftwareInventoryResource(Client, SoftwareInventoryData.DeserializeSoftwareInventoryData(e)), _softwareInventoryClientDiagnostics, Pipeline, "SoftwareInventoryCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Gets the software inventory of the virtual machine. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories - /// - /// - /// Operation Id - /// SoftwareInventories_ListByExtendedResource - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _softwareInventoryRestClient.CreateListByExtendedResourceRequest(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _softwareInventoryRestClient.CreateListByExtendedResourceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SoftwareInventoryResource(Client, SoftwareInventoryData.DeserializeSoftwareInventoryData(e)), _softwareInventoryClientDiagnostics, Pipeline, "SoftwareInventoryCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName} - /// - /// - /// Operation Id - /// SoftwareInventories_Get - /// - /// - /// - /// Name of the installed software. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string softwareName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(softwareName, nameof(softwareName)); - - using var scope = _softwareInventoryClientDiagnostics.CreateScope("SoftwareInventoryCollection.Exists"); - scope.Start(); - try - { - var response = await _softwareInventoryRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName, softwareName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName} - /// - /// - /// Operation Id - /// SoftwareInventories_Get - /// - /// - /// - /// Name of the installed software. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string softwareName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(softwareName, nameof(softwareName)); - - using var scope = _softwareInventoryClientDiagnostics.CreateScope("SoftwareInventoryCollection.Exists"); - scope.Start(); - try - { - var response = _softwareInventoryRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _resourceNamespace, _resourceType, _resourceName, softwareName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SoftwareInventoryData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SoftwareInventoryData.cs deleted file mode 100644 index ca027cbdf4bb..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SoftwareInventoryData.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SoftwareInventory data model. - /// Represents a software data - /// - public partial class SoftwareInventoryData : ResourceData - { - /// Initializes a new instance of SoftwareInventoryData. - public SoftwareInventoryData() - { - } - - /// Initializes a new instance of SoftwareInventoryData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Unique identifier for the virtual machine in the service. - /// Platform of the operating system running on the device. - /// Name of the software vendor. - /// Name of the software product. - /// Version number of the software product. - /// End of support status. - /// The end of support date in case the product is upcoming end of support. - /// Number of weaknesses. - /// First time that the software was seen in the device. - internal SoftwareInventoryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string deviceId, string osPlatform, string vendor, string softwareName, string version, EndOfSupportStatus? endOfSupportStatus, string endOfSupportDate, int? numberOfKnownVulnerabilities, DateTimeOffset? firstSeenOn) : base(id, name, resourceType, systemData) - { - DeviceId = deviceId; - OSPlatform = osPlatform; - Vendor = vendor; - SoftwareName = softwareName; - Version = version; - EndOfSupportStatus = endOfSupportStatus; - EndOfSupportDate = endOfSupportDate; - NumberOfKnownVulnerabilities = numberOfKnownVulnerabilities; - FirstSeenOn = firstSeenOn; - } - - /// Unique identifier for the virtual machine in the service. - public string DeviceId { get; set; } - /// Platform of the operating system running on the device. - public string OSPlatform { get; set; } - /// Name of the software vendor. - public string Vendor { get; set; } - /// Name of the software product. - public string SoftwareName { get; set; } - /// Version number of the software product. - public string Version { get; set; } - /// End of support status. - public EndOfSupportStatus? EndOfSupportStatus { get; set; } - /// The end of support date in case the product is upcoming end of support. - public string EndOfSupportDate { get; set; } - /// Number of weaknesses. - public int? NumberOfKnownVulnerabilities { get; set; } - /// First time that the software was seen in the device. - public DateTimeOffset? FirstSeenOn { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SoftwareInventoryResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SoftwareInventoryResource.cs deleted file mode 100644 index af830d1f2239..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SoftwareInventoryResource.cs +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SoftwareInventory along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSoftwareInventoryResource method. - /// Otherwise you can get one from its parent resource using the GetSoftwareInventory method. - /// - public partial class SoftwareInventoryResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceNamespace, string resourceType, string resourceName, string softwareName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _softwareInventoryClientDiagnostics; - private readonly SoftwareInventoriesRestOperations _softwareInventoryRestClient; - private readonly SoftwareInventoryData _data; - - /// Initializes a new instance of the class for mocking. - protected SoftwareInventoryResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SoftwareInventoryResource(ArmClient client, SoftwareInventoryData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SoftwareInventoryResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _softwareInventoryClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string softwareInventoryApiVersion); - _softwareInventoryRestClient = new SoftwareInventoriesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, softwareInventoryApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/softwareInventories"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SoftwareInventoryData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets a single software data of the virtual machine. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName} - /// - /// - /// Operation Id - /// SoftwareInventories_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _softwareInventoryClientDiagnostics.CreateScope("SoftwareInventoryResource.Get"); - scope.Start(); - try - { - var response = await _softwareInventoryRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.ResourceType.Namespace, Id.Parent.ResourceType.GetLastType(), Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SoftwareInventoryResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a single software data of the virtual machine. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName} - /// - /// - /// Operation Id - /// SoftwareInventories_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _softwareInventoryClientDiagnostics.CreateScope("SoftwareInventoryResource.Get"); - scope.Start(); - try - { - var response = _softwareInventoryRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.ResourceType.Namespace, Id.Parent.ResourceType.GetLastType(), Id.Parent.Name, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SoftwareInventoryResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentBaselineRuleCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentBaselineRuleCollection.cs deleted file mode 100644 index 0f40659de4d8..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentBaselineRuleCollection.cs +++ /dev/null @@ -1,320 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSqlVulnerabilityAssessmentBaselineRules method from an instance of . - /// - public partial class SqlVulnerabilityAssessmentBaselineRuleCollection : ArmCollection - { - private readonly ClientDiagnostics _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics; - private readonly SqlVulnerabilityAssessmentBaselineRulesRestOperations _sqlVulnerabilityAssessmentBaselineRuleRestClient; - - /// Initializes a new instance of the class for mocking. - protected SqlVulnerabilityAssessmentBaselineRuleCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SqlVulnerabilityAssessmentBaselineRuleCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SqlVulnerabilityAssessmentBaselineRuleResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SqlVulnerabilityAssessmentBaselineRuleResource.ResourceType, out string sqlVulnerabilityAssessmentBaselineRuleApiVersion); - _sqlVulnerabilityAssessmentBaselineRuleRestClient = new SqlVulnerabilityAssessmentBaselineRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sqlVulnerabilityAssessmentBaselineRuleApiVersion); - } - - /// - /// Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The rule Id. - /// The workspace Id. - /// The baseline results for this rule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string ruleId, Guid workspaceId, SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentBaselineRuleCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _sqlVulnerabilityAssessmentBaselineRuleRestClient.CreateOrUpdateAsync(Id, ruleId, workspaceId, content, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SqlVulnerabilityAssessmentBaselineRuleResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The rule Id. - /// The workspace Id. - /// The baseline results for this rule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string ruleId, Guid workspaceId, SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentBaselineRuleCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _sqlVulnerabilityAssessmentBaselineRuleRestClient.CreateOrUpdate(Id, ruleId, workspaceId, content, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SqlVulnerabilityAssessmentBaselineRuleResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the results for a given rule in the Baseline. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_Get - /// - /// - /// - /// The rule Id. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string ruleId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var scope = _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentBaselineRuleCollection.Get"); - scope.Start(); - try - { - var response = await _sqlVulnerabilityAssessmentBaselineRuleRestClient.GetAsync(Id, ruleId, workspaceId, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SqlVulnerabilityAssessmentBaselineRuleResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the results for a given rule in the Baseline. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_Get - /// - /// - /// - /// The rule Id. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string ruleId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var scope = _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentBaselineRuleCollection.Get"); - scope.Start(); - try - { - var response = _sqlVulnerabilityAssessmentBaselineRuleRestClient.Get(Id, ruleId, workspaceId, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SqlVulnerabilityAssessmentBaselineRuleResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the results for all rules in the Baseline. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_List - /// - /// - /// - /// The workspace Id. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(Guid workspaceId, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _sqlVulnerabilityAssessmentBaselineRuleRestClient.CreateListRequest(Id, workspaceId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new SqlVulnerabilityAssessmentBaselineRuleResource(Client, SqlVulnerabilityAssessmentBaselineRuleData.DeserializeSqlVulnerabilityAssessmentBaselineRuleData(e)), _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics, Pipeline, "SqlVulnerabilityAssessmentBaselineRuleCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Gets the results for all rules in the Baseline. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_List - /// - /// - /// - /// The workspace Id. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(Guid workspaceId, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _sqlVulnerabilityAssessmentBaselineRuleRestClient.CreateListRequest(Id, workspaceId); - return PageableHelpers.CreatePageable(FirstPageRequest, null, e => new SqlVulnerabilityAssessmentBaselineRuleResource(Client, SqlVulnerabilityAssessmentBaselineRuleData.DeserializeSqlVulnerabilityAssessmentBaselineRuleData(e)), _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics, Pipeline, "SqlVulnerabilityAssessmentBaselineRuleCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_Get - /// - /// - /// - /// The rule Id. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string ruleId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var scope = _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentBaselineRuleCollection.Exists"); - scope.Start(); - try - { - var response = await _sqlVulnerabilityAssessmentBaselineRuleRestClient.GetAsync(Id, ruleId, workspaceId, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_Get - /// - /// - /// - /// The rule Id. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string ruleId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var scope = _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentBaselineRuleCollection.Exists"); - scope.Start(); - try - { - var response = _sqlVulnerabilityAssessmentBaselineRuleRestClient.Get(Id, ruleId, workspaceId, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentBaselineRuleData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentBaselineRuleData.cs deleted file mode 100644 index 076719d581ad..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentBaselineRuleData.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SqlVulnerabilityAssessmentBaselineRule data model. - /// Rule results. - /// - public partial class SqlVulnerabilityAssessmentBaselineRuleData : ResourceData - { - /// Initializes a new instance of SqlVulnerabilityAssessmentBaselineRuleData. - public SqlVulnerabilityAssessmentBaselineRuleData() - { - } - - /// Initializes a new instance of SqlVulnerabilityAssessmentBaselineRuleData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Rule results properties. - internal SqlVulnerabilityAssessmentBaselineRuleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RuleResultsProperties properties) : base(id, name, resourceType, systemData) - { - Properties = properties; - } - - /// Rule results properties. - internal RuleResultsProperties Properties { get; set; } - /// Expected results in the baseline. - public IList> RuleResults - { - get - { - if (Properties is null) - Properties = new RuleResultsProperties(); - return Properties.Results; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentBaselineRuleResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentBaselineRuleResource.cs deleted file mode 100644 index 3b4590661cda..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentBaselineRuleResource.cs +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SqlVulnerabilityAssessmentBaselineRule along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSqlVulnerabilityAssessmentBaselineRuleResource method. - /// Otherwise you can get one from its parent resource using the GetSqlVulnerabilityAssessmentBaselineRule method. - /// - public partial class SqlVulnerabilityAssessmentBaselineRuleResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string resourceId, string ruleId) - { - var resourceId0 = $"{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}"; - return new ResourceIdentifier(resourceId0); - } - - private readonly ClientDiagnostics _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics; - private readonly SqlVulnerabilityAssessmentBaselineRulesRestOperations _sqlVulnerabilityAssessmentBaselineRuleRestClient; - private readonly SqlVulnerabilityAssessmentBaselineRuleData _data; - - /// Initializes a new instance of the class for mocking. - protected SqlVulnerabilityAssessmentBaselineRuleResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SqlVulnerabilityAssessmentBaselineRuleResource(ArmClient client, SqlVulnerabilityAssessmentBaselineRuleData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SqlVulnerabilityAssessmentBaselineRuleResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string sqlVulnerabilityAssessmentBaselineRuleApiVersion); - _sqlVulnerabilityAssessmentBaselineRuleRestClient = new SqlVulnerabilityAssessmentBaselineRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sqlVulnerabilityAssessmentBaselineRuleApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SqlVulnerabilityAssessmentBaselineRuleData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets the results for a given rule in the Baseline. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_Get - /// - /// - /// - /// The workspace Id. - /// The cancellation token to use. - public virtual async Task> GetAsync(Guid workspaceId, CancellationToken cancellationToken = default) - { - using var scope = _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentBaselineRuleResource.Get"); - scope.Start(); - try - { - var response = await _sqlVulnerabilityAssessmentBaselineRuleRestClient.GetAsync(Id.Parent.Parent, Id.Name, workspaceId, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SqlVulnerabilityAssessmentBaselineRuleResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the results for a given rule in the Baseline. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_Get - /// - /// - /// - /// The workspace Id. - /// The cancellation token to use. - public virtual Response Get(Guid workspaceId, CancellationToken cancellationToken = default) - { - using var scope = _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentBaselineRuleResource.Get"); - scope.Start(); - try - { - var response = _sqlVulnerabilityAssessmentBaselineRuleRestClient.Get(Id.Parent.Parent, Id.Name, workspaceId, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SqlVulnerabilityAssessmentBaselineRuleResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes a rule from the Baseline of a given database. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The workspace Id. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, Guid workspaceId, CancellationToken cancellationToken = default) - { - using var scope = _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentBaselineRuleResource.Delete"); - scope.Start(); - try - { - var response = await _sqlVulnerabilityAssessmentBaselineRuleRestClient.DeleteAsync(Id.Parent.Parent, Id.Name, workspaceId, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Deletes a rule from the Baseline of a given database. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The workspace Id. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, Guid workspaceId, CancellationToken cancellationToken = default) - { - using var scope = _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentBaselineRuleResource.Delete"); - scope.Start(); - try - { - var response = _sqlVulnerabilityAssessmentBaselineRuleRestClient.Delete(Id.Parent.Parent, Id.Name, workspaceId, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The workspace Id. - /// The baseline results for this rule. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, Guid workspaceId, SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentBaselineRuleResource.Update"); - scope.Start(); - try - { - var response = await _sqlVulnerabilityAssessmentBaselineRuleRestClient.CreateOrUpdateAsync(Id.Parent.Parent, Id.Name, workspaceId, content, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SqlVulnerabilityAssessmentBaselineRuleResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates a Baseline for a rule in a database. Will overwrite any previously existing results. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentBaselineRules_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The workspace Id. - /// The baseline results for this rule. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, Guid workspaceId, SqlVulnerabilityAssessmentBaselineRuleCreateOrUpdateContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _sqlVulnerabilityAssessmentBaselineRuleClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentBaselineRuleResource.Update"); - scope.Start(); - try - { - var response = _sqlVulnerabilityAssessmentBaselineRuleRestClient.CreateOrUpdate(Id.Parent.Parent, Id.Name, workspaceId, content, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SqlVulnerabilityAssessmentBaselineRuleResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentScanCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentScanCollection.cs deleted file mode 100644 index 21efd41ff02a..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentScanCollection.cs +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSqlVulnerabilityAssessmentScans method from an instance of . - /// - public partial class SqlVulnerabilityAssessmentScanCollection : ArmCollection - { - private readonly ClientDiagnostics _sqlVulnerabilityAssessmentScanClientDiagnostics; - private readonly SqlVulnerabilityAssessmentScansRestOperations _sqlVulnerabilityAssessmentScanRestClient; - - /// Initializes a new instance of the class for mocking. - protected SqlVulnerabilityAssessmentScanCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SqlVulnerabilityAssessmentScanCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _sqlVulnerabilityAssessmentScanClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SqlVulnerabilityAssessmentScanResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SqlVulnerabilityAssessmentScanResource.ResourceType, out string sqlVulnerabilityAssessmentScanApiVersion); - _sqlVulnerabilityAssessmentScanRestClient = new SqlVulnerabilityAssessmentScansRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sqlVulnerabilityAssessmentScanApiVersion); - } - - /// - /// Gets the scan details of a single scan record. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentScans_Get - /// - /// - /// - /// The scan Id. Type 'latest' to get the scan record for the latest scan. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string scanId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(scanId, nameof(scanId)); - - using var scope = _sqlVulnerabilityAssessmentScanClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentScanCollection.Get"); - scope.Start(); - try - { - var response = await _sqlVulnerabilityAssessmentScanRestClient.GetAsync(Id, scanId, workspaceId, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SqlVulnerabilityAssessmentScanResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the scan details of a single scan record. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentScans_Get - /// - /// - /// - /// The scan Id. Type 'latest' to get the scan record for the latest scan. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string scanId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(scanId, nameof(scanId)); - - using var scope = _sqlVulnerabilityAssessmentScanClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentScanCollection.Get"); - scope.Start(); - try - { - var response = _sqlVulnerabilityAssessmentScanRestClient.Get(Id, scanId, workspaceId, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SqlVulnerabilityAssessmentScanResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a list of scan records. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentScans_List - /// - /// - /// - /// The workspace Id. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(Guid workspaceId, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _sqlVulnerabilityAssessmentScanRestClient.CreateListRequest(Id, workspaceId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new SqlVulnerabilityAssessmentScanResource(Client, SqlVulnerabilityAssessmentScanData.DeserializeSqlVulnerabilityAssessmentScanData(e)), _sqlVulnerabilityAssessmentScanClientDiagnostics, Pipeline, "SqlVulnerabilityAssessmentScanCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Gets a list of scan records. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentScans_List - /// - /// - /// - /// The workspace Id. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(Guid workspaceId, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _sqlVulnerabilityAssessmentScanRestClient.CreateListRequest(Id, workspaceId); - return PageableHelpers.CreatePageable(FirstPageRequest, null, e => new SqlVulnerabilityAssessmentScanResource(Client, SqlVulnerabilityAssessmentScanData.DeserializeSqlVulnerabilityAssessmentScanData(e)), _sqlVulnerabilityAssessmentScanClientDiagnostics, Pipeline, "SqlVulnerabilityAssessmentScanCollection.GetAll", "value", null, cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentScans_Get - /// - /// - /// - /// The scan Id. Type 'latest' to get the scan record for the latest scan. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string scanId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(scanId, nameof(scanId)); - - using var scope = _sqlVulnerabilityAssessmentScanClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentScanCollection.Exists"); - scope.Start(); - try - { - var response = await _sqlVulnerabilityAssessmentScanRestClient.GetAsync(Id, scanId, workspaceId, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentScans_Get - /// - /// - /// - /// The scan Id. Type 'latest' to get the scan record for the latest scan. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string scanId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(scanId, nameof(scanId)); - - using var scope = _sqlVulnerabilityAssessmentScanClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentScanCollection.Exists"); - scope.Start(); - try - { - var response = _sqlVulnerabilityAssessmentScanRestClient.Get(Id, scanId, workspaceId, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentScanData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentScanData.cs deleted file mode 100644 index adc51dd08048..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentScanData.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using Azure.Core; -using Azure.ResourceManager.Models; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing the SqlVulnerabilityAssessmentScan data model. - /// A vulnerability assessment scan record. - /// - public partial class SqlVulnerabilityAssessmentScanData : ResourceData - { - /// Initializes a new instance of SqlVulnerabilityAssessmentScanData. - public SqlVulnerabilityAssessmentScanData() - { - } - - /// Initializes a new instance of SqlVulnerabilityAssessmentScanData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// A vulnerability assessment scan record properties. - internal SqlVulnerabilityAssessmentScanData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, SqlVulnerabilityAssessmentScanProperties properties) : base(id, name, resourceType, systemData) - { - Properties = properties; - } - - /// A vulnerability assessment scan record properties. - public SqlVulnerabilityAssessmentScanProperties Properties { get; set; } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentScanResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentScanResource.cs deleted file mode 100644 index aff1f8c718ad..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SqlVulnerabilityAssessmentScanResource.cs +++ /dev/null @@ -1,276 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SqlVulnerabilityAssessmentScan along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSqlVulnerabilityAssessmentScanResource method. - /// Otherwise you can get one from its parent resource using the GetSqlVulnerabilityAssessmentScan method. - /// - public partial class SqlVulnerabilityAssessmentScanResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string resourceId, string scanId) - { - var resourceId0 = $"{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}"; - return new ResourceIdentifier(resourceId0); - } - - private readonly ClientDiagnostics _sqlVulnerabilityAssessmentScanClientDiagnostics; - private readonly SqlVulnerabilityAssessmentScansRestOperations _sqlVulnerabilityAssessmentScanRestClient; - private readonly ClientDiagnostics _sqlVulnerabilityAssessmentScanResultsClientDiagnostics; - private readonly SqlVulnerabilityAssessmentScanResultsRestOperations _sqlVulnerabilityAssessmentScanResultsRestClient; - private readonly SqlVulnerabilityAssessmentScanData _data; - - /// Initializes a new instance of the class for mocking. - protected SqlVulnerabilityAssessmentScanResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SqlVulnerabilityAssessmentScanResource(ArmClient client, SqlVulnerabilityAssessmentScanData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SqlVulnerabilityAssessmentScanResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _sqlVulnerabilityAssessmentScanClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string sqlVulnerabilityAssessmentScanApiVersion); - _sqlVulnerabilityAssessmentScanRestClient = new SqlVulnerabilityAssessmentScansRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sqlVulnerabilityAssessmentScanApiVersion); - _sqlVulnerabilityAssessmentScanResultsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _sqlVulnerabilityAssessmentScanResultsRestClient = new SqlVulnerabilityAssessmentScanResultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/sqlVulnerabilityAssessments/scans"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SqlVulnerabilityAssessmentScanData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Gets the scan details of a single scan record. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentScans_Get - /// - /// - /// - /// The workspace Id. - /// The cancellation token to use. - public virtual async Task> GetAsync(Guid workspaceId, CancellationToken cancellationToken = default) - { - using var scope = _sqlVulnerabilityAssessmentScanClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentScanResource.Get"); - scope.Start(); - try - { - var response = await _sqlVulnerabilityAssessmentScanRestClient.GetAsync(Id.Parent.Parent, Id.Name, workspaceId, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SqlVulnerabilityAssessmentScanResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the scan details of a single scan record. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentScans_Get - /// - /// - /// - /// The workspace Id. - /// The cancellation token to use. - public virtual Response Get(Guid workspaceId, CancellationToken cancellationToken = default) - { - using var scope = _sqlVulnerabilityAssessmentScanClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentScanResource.Get"); - scope.Start(); - try - { - var response = _sqlVulnerabilityAssessmentScanRestClient.Get(Id.Parent.Parent, Id.Name, workspaceId, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SqlVulnerabilityAssessmentScanResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the scan results of a single rule in a scan record. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults/{scanResultId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentScanResults_Get - /// - /// - /// - /// The rule Id of the results. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetSqlVulnerabilityAssessmentScanResultAsync(string scanResultId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(scanResultId, nameof(scanResultId)); - - using var scope = _sqlVulnerabilityAssessmentScanResultsClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentScanResource.GetSqlVulnerabilityAssessmentScanResult"); - scope.Start(); - try - { - var response = await _sqlVulnerabilityAssessmentScanResultsRestClient.GetAsync(Id.Parent.Parent, Id.Name, scanResultId, workspaceId, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets the scan results of a single rule in a scan record. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults/{scanResultId} - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentScanResults_Get - /// - /// - /// - /// The rule Id of the results. - /// The workspace Id. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response GetSqlVulnerabilityAssessmentScanResult(string scanResultId, Guid workspaceId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(scanResultId, nameof(scanResultId)); - - using var scope = _sqlVulnerabilityAssessmentScanResultsClientDiagnostics.CreateScope("SqlVulnerabilityAssessmentScanResource.GetSqlVulnerabilityAssessmentScanResult"); - scope.Start(); - try - { - var response = _sqlVulnerabilityAssessmentScanResultsRestClient.Get(Id.Parent.Parent, Id.Name, scanResultId, workspaceId, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Gets a list of scan results for a single scan record. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentScanResults_List - /// - /// - /// - /// The workspace Id. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetSqlVulnerabilityAssessmentScanResultsAsync(Guid workspaceId, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _sqlVulnerabilityAssessmentScanResultsRestClient.CreateListRequest(Id.Parent.Parent, Id.Name, workspaceId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, null, SqlVulnerabilityAssessmentScanResult.DeserializeSqlVulnerabilityAssessmentScanResult, _sqlVulnerabilityAssessmentScanResultsClientDiagnostics, Pipeline, "SqlVulnerabilityAssessmentScanResource.GetSqlVulnerabilityAssessmentScanResults", "value", null, cancellationToken); - } - - /// - /// Gets a list of scan results for a single scan record. - /// - /// - /// Request Path - /// /{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults - /// - /// - /// Operation Id - /// SqlVulnerabilityAssessmentScanResults_List - /// - /// - /// - /// The workspace Id. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetSqlVulnerabilityAssessmentScanResults(Guid workspaceId, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _sqlVulnerabilityAssessmentScanResultsRestClient.CreateListRequest(Id.Parent.Parent, Id.Name, workspaceId); - return PageableHelpers.CreatePageable(FirstPageRequest, null, SqlVulnerabilityAssessmentScanResult.DeserializeSqlVulnerabilityAssessmentScanResult, _sqlVulnerabilityAssessmentScanResultsClientDiagnostics, Pipeline, "SqlVulnerabilityAssessmentScanResource.GetSqlVulnerabilityAssessmentScanResults", "value", null, cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/StandardCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/StandardCollection.cs new file mode 100644 index 000000000000..e1a9c888859e --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/StandardCollection.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.SecurityCenter +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetStandards method from an instance of . + /// + public partial class StandardCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _standardClientDiagnostics; + private readonly StandardsRestOperations _standardRestClient; + + /// Initializes a new instance of the class for mocking. + protected StandardCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal StandardCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _standardClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", StandardResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(StandardResource.ResourceType, out string standardApiVersion); + _standardRestClient = new StandardsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, standardApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create a security standard on the given scope. Available only for custom standards. Will create/update the required standard definitions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} + /// + /// + /// Operation Id + /// Standards_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The Security Standard key - unique key for the standard type. + /// Custom security standard over a pre-defined scope. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string standardId, StandardData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(standardId, nameof(standardId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _standardClientDiagnostics.CreateScope("StandardCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _standardRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, standardId, data, cancellationToken).ConfigureAwait(false); + var operation = new SecurityCenterArmOperation(Response.FromValue(new StandardResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a security standard on the given scope. Available only for custom standards. Will create/update the required standard definitions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} + /// + /// + /// Operation Id + /// Standards_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The Security Standard key - unique key for the standard type. + /// Custom security standard over a pre-defined scope. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string standardId, StandardData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(standardId, nameof(standardId)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _standardClientDiagnostics.CreateScope("StandardCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _standardRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, standardId, data, cancellationToken); + var operation = new SecurityCenterArmOperation(Response.FromValue(new StandardResource(Client, response), response.GetRawResponse())); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a specific security standard for the requested scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} + /// + /// + /// Operation Id + /// Standards_Get + /// + /// + /// + /// The Security Standard key - unique key for the standard type. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string standardId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(standardId, nameof(standardId)); + + using var scope = _standardClientDiagnostics.CreateScope("StandardCollection.Get"); + scope.Start(); + try + { + var response = await _standardRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, standardId, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new StandardResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a specific security standard for the requested scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} + /// + /// + /// Operation Id + /// Standards_Get + /// + /// + /// + /// The Security Standard key - unique key for the standard type. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string standardId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(standardId, nameof(standardId)); + + using var scope = _standardClientDiagnostics.CreateScope("StandardCollection.Get"); + scope.Start(); + try + { + var response = _standardRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, standardId, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new StandardResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get security standards on all your resources inside a scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards + /// + /// + /// Operation Id + /// Standards_List + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _standardRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _standardRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new StandardResource(Client, StandardData.DeserializeStandardData(e)), _standardClientDiagnostics, Pipeline, "StandardCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Get security standards on all your resources inside a scope + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards + /// + /// + /// Operation Id + /// Standards_List + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _standardRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _standardRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new StandardResource(Client, StandardData.DeserializeStandardData(e)), _standardClientDiagnostics, Pipeline, "StandardCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} + /// + /// + /// Operation Id + /// Standards_Get + /// + /// + /// + /// The Security Standard key - unique key for the standard type. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string standardId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(standardId, nameof(standardId)); + + using var scope = _standardClientDiagnostics.CreateScope("StandardCollection.Exists"); + scope.Start(); + try + { + var response = await _standardRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, standardId, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} + /// + /// + /// Operation Id + /// Standards_Get + /// + /// + /// + /// The Security Standard key - unique key for the standard type. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string standardId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(standardId, nameof(standardId)); + + using var scope = _standardClientDiagnostics.CreateScope("StandardCollection.Exists"); + scope.Start(); + try + { + var response = _standardRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, standardId, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/StandardData.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/StandardData.cs new file mode 100644 index 000000000000..aa1d1f784a1a --- /dev/null +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/StandardData.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.SecurityCenter.Models; + +namespace Azure.ResourceManager.SecurityCenter +{ + /// + /// A class representing the Standard data model. + /// Security Standard on a resource + /// + public partial class StandardData : TrackedResourceData + { + /// Initializes a new instance of StandardData. + /// The location. + public StandardData(AzureLocation location) : base(location) + { + Components = new ChangeTrackingList(); + SupportedClouds = new ChangeTrackingList(); + } + + /// Initializes a new instance of StandardData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// display name of the standard, equivalent to the standardId. + /// standard type (Custom or BuiltIn only currently). + /// description of the standard. + /// category of the standard provided. + /// List of component objects containing component unique keys (such as assessment keys) to apply to standard scope. Currently only supports assessment keys. + /// List of all standard supported clouds. + /// Kind of the resource. + /// Entity tag is used for comparing two or more entities from the same requested resource. + internal StandardData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string displayName, string standardType, string description, string category, IList components, IList supportedClouds, string kind, ETag? eTag) : base(id, name, resourceType, systemData, tags, location) + { + DisplayName = displayName; + StandardType = standardType; + Description = description; + Category = category; + Components = components; + SupportedClouds = supportedClouds; + Kind = kind; + ETag = eTag; + } + + /// display name of the standard, equivalent to the standardId. + public string DisplayName { get; set; } + /// standard type (Custom or BuiltIn only currently). + public string StandardType { get; } + /// description of the standard. + public string Description { get; set; } + /// category of the standard provided. + public string Category { get; set; } + /// List of component objects containing component unique keys (such as assessment keys) to apply to standard scope. Currently only supports assessment keys. + public IList Components { get; } + /// List of all standard supported clouds. + public IList SupportedClouds { get; } + /// Kind of the resource. + public string Kind { get; set; } + /// Entity tag is used for comparing two or more entities from the same requested resource. + public ETag? ETag { get; set; } + } +} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAutomationResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/StandardResource.cs similarity index 59% rename from sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAutomationResource.cs rename to sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/StandardResource.cs index 383e76506e59..904e2d6e0014 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SecurityAutomationResource.cs +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/StandardResource.cs @@ -15,65 +15,64 @@ using Azure.Core.Pipeline; using Azure.ResourceManager; using Azure.ResourceManager.Resources; -using Azure.ResourceManager.SecurityCenter.Models; namespace Azure.ResourceManager.SecurityCenter { /// - /// A Class representing a SecurityAutomation along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSecurityAutomationResource method. - /// Otherwise you can get one from its parent resource using the GetSecurityAutomation method. + /// A Class representing a Standard along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetStandardResource method. + /// Otherwise you can get one from its parent resource using the GetStandard method. /// - public partial class SecurityAutomationResource : ArmResource + public partial class StandardResource : ArmResource { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string automationName) + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string standardId) { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId}"; return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _securityAutomationAutomationsClientDiagnostics; - private readonly AutomationsRestOperations _securityAutomationAutomationsRestClient; - private readonly SecurityAutomationData _data; + private readonly ClientDiagnostics _standardClientDiagnostics; + private readonly StandardsRestOperations _standardRestClient; + private readonly StandardData _data; - /// Initializes a new instance of the class for mocking. - protected SecurityAutomationResource() + /// Initializes a new instance of the class for mocking. + protected StandardResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal SecurityAutomationResource(ArmClient client, SecurityAutomationData data) : this(client, data.Id) + internal StandardResource(ArmClient client, StandardData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal SecurityAutomationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal StandardResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _securityAutomationAutomationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string securityAutomationAutomationsApiVersion); - _securityAutomationAutomationsRestClient = new AutomationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, securityAutomationAutomationsApiVersion); + _standardClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string standardApiVersion); + _standardRestClient = new StandardsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, standardApiVersion); #if DEBUG ValidateResourceId(Id); #endif } /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/automations"; + public static readonly ResourceType ResourceType = "Microsoft.Security/standards"; /// Gets whether or not the current instance has data. public virtual bool HasData { get; } /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual SecurityAutomationData Data + public virtual StandardData Data { get { @@ -90,29 +89,29 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Retrieves information about the model of a security automation. + /// Get a specific security standard for the requested scope /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} /// /// /// Operation Id - /// Automations_Get + /// Standards_Get /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationResource.Get"); + using var scope = _standardClientDiagnostics.CreateScope("StandardResource.Get"); scope.Start(); try { - var response = await _securityAutomationAutomationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _standardRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityAutomationResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new StandardResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -122,29 +121,29 @@ public virtual async Task> GetAsync(Cancell } /// - /// Retrieves information about the model of a security automation. + /// Get a specific security standard for the requested scope /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} /// /// /// Operation Id - /// Automations_Get + /// Standards_Get /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationResource.Get"); + using var scope = _standardClientDiagnostics.CreateScope("StandardResource.Get"); scope.Start(); try { - var response = _securityAutomationAutomationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _standardRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SecurityAutomationResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new StandardResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -154,15 +153,15 @@ public virtual Response Get(CancellationToken cancel } /// - /// Deletes a security automation. + /// Delete a security standard on a scope. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} /// /// /// Operation Id - /// Automations_Delete + /// Standards_Delete /// /// /// @@ -170,11 +169,11 @@ public virtual Response Get(CancellationToken cancel /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationResource.Delete"); + using var scope = _standardClientDiagnostics.CreateScope("StandardResource.Delete"); scope.Start(); try { - var response = await _securityAutomationAutomationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _standardRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); var operation = new SecurityCenterArmOperation(response); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); @@ -188,15 +187,15 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Deletes a security automation. + /// Delete a security standard on a scope. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} /// /// /// Operation Id - /// Automations_Delete + /// Standards_Delete /// /// /// @@ -204,11 +203,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationResource.Delete"); + using var scope = _standardClientDiagnostics.CreateScope("StandardResource.Delete"); scope.Start(); try { - var response = _securityAutomationAutomationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _standardRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); var operation = new SecurityCenterArmOperation(response); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); @@ -222,32 +221,32 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Creates or updates a security automation. If a security automation is already created and a subsequent request is issued for the same automation id, then it will be updated. + /// Create a security standard on the given scope. Available only for custom standards. Will create/update the required standard definitions. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} /// /// /// Operation Id - /// Automations_CreateOrUpdate + /// Standards_CreateOrUpdate /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security automation resource. + /// Custom security standard over a pre-defined scope. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, SecurityAutomationData data, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, StandardData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationResource.Update"); + using var scope = _standardClientDiagnostics.CreateScope("StandardResource.Update"); scope.Start(); try { - var response = await _securityAutomationAutomationsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityAutomationResource(Client, response), response.GetRawResponse())); + var response = await _standardRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new SecurityCenterArmOperation(Response.FromValue(new StandardResource(Client, response), response.GetRawResponse())); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -260,32 +259,32 @@ public virtual async Task> UpdateAsync( } /// - /// Creates or updates a security automation. If a security automation is already created and a subsequent request is issued for the same automation id, then it will be updated. + /// Create a security standard on the given scope. Available only for custom standards. Will create/update the required standard definitions. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} /// /// /// Operation Id - /// Automations_CreateOrUpdate + /// Standards_CreateOrUpdate /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security automation resource. + /// Custom security standard over a pre-defined scope. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, SecurityAutomationData data, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, StandardData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationResource.Update"); + using var scope = _standardClientDiagnostics.CreateScope("StandardResource.Update"); scope.Start(); try { - var response = _securityAutomationAutomationsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SecurityAutomationResource(Client, response), response.GetRawResponse())); + var response = _standardRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken); + var operation = new SecurityCenterArmOperation(Response.FromValue(new StandardResource(Client, response), response.GetRawResponse())); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -297,84 +296,16 @@ public virtual ArmOperation Update(WaitUntil waitUnt } } - /// - /// Validates the security automation model before create or update. Any validation errors are returned to the client. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}/validate - /// - /// - /// Operation Id - /// Automations_Validate - /// - /// - /// - /// The security automation resource. - /// The cancellation token to use. - /// is null. - public virtual async Task> ValidateAsync(SecurityAutomationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationResource.Validate"); - scope.Start(); - try - { - var response = await _securityAutomationAutomationsRestClient.ValidateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Validates the security automation model before create or update. Any validation errors are returned to the client. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}/validate - /// - /// - /// Operation Id - /// Automations_Validate - /// - /// - /// - /// The security automation resource. - /// The cancellation token to use. - /// is null. - public virtual Response Validate(SecurityAutomationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationResource.Validate"); - scope.Start(); - try - { - var response = _securityAutomationAutomationsRestClient.Validate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - /// /// Add a tag to the current resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} /// /// /// Operation Id - /// Automations_Get + /// Standards_Get /// /// /// @@ -382,12 +313,12 @@ public virtual Response Validate(SecurityAut /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationResource.AddTag"); + using var scope = _standardClientDiagnostics.CreateScope("StandardResource.AddTag"); scope.Start(); try { @@ -396,8 +327,8 @@ public virtual async Task> AddTagAsync(stri var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _securityAutomationAutomationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new SecurityAutomationResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _standardRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new StandardResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -419,11 +350,11 @@ public virtual async Task> AddTagAsync(stri /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} /// /// /// Operation Id - /// Automations_Get + /// Standards_Get /// /// /// @@ -431,12 +362,12 @@ public virtual async Task> AddTagAsync(stri /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationResource.AddTag"); + using var scope = _standardClientDiagnostics.CreateScope("StandardResource.AddTag"); scope.Start(); try { @@ -445,8 +376,8 @@ public virtual Response AddTag(string key, string va var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _securityAutomationAutomationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new SecurityAutomationResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _standardRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new StandardResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -468,22 +399,22 @@ public virtual Response AddTag(string key, string va /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} /// /// /// Operation Id - /// Automations_Get + /// Standards_Get /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationResource.SetTags"); + using var scope = _standardClientDiagnostics.CreateScope("StandardResource.SetTags"); scope.Start(); try { @@ -493,8 +424,8 @@ public virtual async Task> SetTagsAsync(IDi var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _securityAutomationAutomationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new SecurityAutomationResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _standardRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new StandardResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -516,22 +447,22 @@ public virtual async Task> SetTagsAsync(IDi /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} /// /// /// Operation Id - /// Automations_Get + /// Standards_Get /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationResource.SetTags"); + using var scope = _standardClientDiagnostics.CreateScope("StandardResource.SetTags"); scope.Start(); try { @@ -541,8 +472,8 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} /// /// /// Operation Id - /// Automations_Get + /// Standards_Get /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationResource.RemoveTag"); + using var scope = _standardClientDiagnostics.CreateScope("StandardResource.RemoveTag"); scope.Start(); try { @@ -588,8 +519,8 @@ public virtual async Task> RemoveTagAsync(s var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _securityAutomationAutomationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new SecurityAutomationResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _standardRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new StandardResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { @@ -611,22 +542,22 @@ public virtual async Task> RemoveTagAsync(s /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/standards/{standardId} /// /// /// Operation Id - /// Automations_Get + /// Standards_Get /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _securityAutomationAutomationsClientDiagnostics.CreateScope("SecurityAutomationResource.RemoveTag"); + using var scope = _standardClientDiagnostics.CreateScope("StandardResource.RemoveTag"); scope.Start(); try { @@ -635,8 +566,8 @@ public virtual Response RemoveTag(string key, Cancel var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _securityAutomationAutomationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new SecurityAutomationResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _standardRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new StandardResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionAssessmentMetadataCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionAssessmentMetadataCollection.cs deleted file mode 100644 index 64917cd369d2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionAssessmentMetadataCollection.cs +++ /dev/null @@ -1,341 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSubscriptionAssessmentMetadata method from an instance of . - /// - public partial class SubscriptionAssessmentMetadataCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics; - private readonly AssessmentsMetadataRestOperations _subscriptionAssessmentMetadataAssessmentsMetadataRestClient; - - /// Initializes a new instance of the class for mocking. - protected SubscriptionAssessmentMetadataCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SubscriptionAssessmentMetadataCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SubscriptionAssessmentMetadataResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SubscriptionAssessmentMetadataResource.ResourceType, out string subscriptionAssessmentMetadataAssessmentsMetadataApiVersion); - _subscriptionAssessmentMetadataAssessmentsMetadataRestClient = new AssessmentsMetadataRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, subscriptionAssessmentMetadataAssessmentsMetadataApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SubscriptionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); - } - - /// - /// Create metadata information on an assessment type in a specific subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_CreateInSubscription - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The Assessment Key - Unique key for the assessment type. - /// AssessmentMetadata object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string assessmentMetadataName, SecurityAssessmentMetadataData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("SubscriptionAssessmentMetadataCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _subscriptionAssessmentMetadataAssessmentsMetadataRestClient.CreateInSubscriptionAsync(Id.SubscriptionId, assessmentMetadataName, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SubscriptionAssessmentMetadataResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create metadata information on an assessment type in a specific subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_CreateInSubscription - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The Assessment Key - Unique key for the assessment type. - /// AssessmentMetadata object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string assessmentMetadataName, SecurityAssessmentMetadataData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("SubscriptionAssessmentMetadataCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _subscriptionAssessmentMetadataAssessmentsMetadataRestClient.CreateInSubscription(Id.SubscriptionId, assessmentMetadataName, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SubscriptionAssessmentMetadataResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get metadata information on an assessment type in a specific subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_GetInSubscription - /// - /// - /// - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string assessmentMetadataName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - - using var scope = _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("SubscriptionAssessmentMetadataCollection.Get"); - scope.Start(); - try - { - var response = await _subscriptionAssessmentMetadataAssessmentsMetadataRestClient.GetInSubscriptionAsync(Id.SubscriptionId, assessmentMetadataName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionAssessmentMetadataResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get metadata information on an assessment type in a specific subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_GetInSubscription - /// - /// - /// - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string assessmentMetadataName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - - using var scope = _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("SubscriptionAssessmentMetadataCollection.Get"); - scope.Start(); - try - { - var response = _subscriptionAssessmentMetadataAssessmentsMetadataRestClient.GetInSubscription(Id.SubscriptionId, assessmentMetadataName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionAssessmentMetadataResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get metadata information on all assessment types in a specific subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata - /// - /// - /// Operation Id - /// AssessmentsMetadata_ListBySubscription - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _subscriptionAssessmentMetadataAssessmentsMetadataRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _subscriptionAssessmentMetadataAssessmentsMetadataRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SubscriptionAssessmentMetadataResource(Client, SecurityAssessmentMetadataData.DeserializeSecurityAssessmentMetadataData(e)), _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics, Pipeline, "SubscriptionAssessmentMetadataCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Get metadata information on all assessment types in a specific subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata - /// - /// - /// Operation Id - /// AssessmentsMetadata_ListBySubscription - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _subscriptionAssessmentMetadataAssessmentsMetadataRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _subscriptionAssessmentMetadataAssessmentsMetadataRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SubscriptionAssessmentMetadataResource(Client, SecurityAssessmentMetadataData.DeserializeSecurityAssessmentMetadataData(e)), _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics, Pipeline, "SubscriptionAssessmentMetadataCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_GetInSubscription - /// - /// - /// - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string assessmentMetadataName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - - using var scope = _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("SubscriptionAssessmentMetadataCollection.Exists"); - scope.Start(); - try - { - var response = await _subscriptionAssessmentMetadataAssessmentsMetadataRestClient.GetInSubscriptionAsync(Id.SubscriptionId, assessmentMetadataName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_GetInSubscription - /// - /// - /// - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string assessmentMetadataName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - - using var scope = _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("SubscriptionAssessmentMetadataCollection.Exists"); - scope.Start(); - try - { - var response = _subscriptionAssessmentMetadataAssessmentsMetadataRestClient.GetInSubscription(Id.SubscriptionId, assessmentMetadataName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionAssessmentMetadataResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionAssessmentMetadataResource.cs deleted file mode 100644 index 6282617b8e46..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionAssessmentMetadataResource.cs +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SubscriptionAssessmentMetadata along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSubscriptionAssessmentMetadataResource method. - /// Otherwise you can get one from its parent resource using the GetSubscriptionAssessmentMetadata method. - /// - public partial class SubscriptionAssessmentMetadataResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string assessmentMetadataName) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics; - private readonly AssessmentsMetadataRestOperations _subscriptionAssessmentMetadataAssessmentsMetadataRestClient; - private readonly SecurityAssessmentMetadataData _data; - - /// Initializes a new instance of the class for mocking. - protected SubscriptionAssessmentMetadataResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SubscriptionAssessmentMetadataResource(ArmClient client, SecurityAssessmentMetadataData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SubscriptionAssessmentMetadataResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string subscriptionAssessmentMetadataAssessmentsMetadataApiVersion); - _subscriptionAssessmentMetadataAssessmentsMetadataRestClient = new AssessmentsMetadataRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, subscriptionAssessmentMetadataAssessmentsMetadataApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/assessmentMetadata"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecurityAssessmentMetadataData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get metadata information on an assessment type in a specific subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_GetInSubscription - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("SubscriptionAssessmentMetadataResource.Get"); - scope.Start(); - try - { - var response = await _subscriptionAssessmentMetadataAssessmentsMetadataRestClient.GetInSubscriptionAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionAssessmentMetadataResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get metadata information on an assessment type in a specific subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_GetInSubscription - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("SubscriptionAssessmentMetadataResource.Get"); - scope.Start(); - try - { - var response = _subscriptionAssessmentMetadataAssessmentsMetadataRestClient.GetInSubscription(Id.SubscriptionId, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionAssessmentMetadataResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the assessments of that type in that subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_DeleteInSubscription - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("SubscriptionAssessmentMetadataResource.Delete"); - scope.Start(); - try - { - var response = await _subscriptionAssessmentMetadataAssessmentsMetadataRestClient.DeleteInSubscriptionAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete metadata information on an assessment type in a specific subscription, will cause the deletion of all the assessments of that type in that subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_DeleteInSubscription - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("SubscriptionAssessmentMetadataResource.Delete"); - scope.Start(); - try - { - var response = _subscriptionAssessmentMetadataAssessmentsMetadataRestClient.DeleteInSubscription(Id.SubscriptionId, Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create metadata information on an assessment type in a specific subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_CreateInSubscription - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// AssessmentMetadata object. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, SecurityAssessmentMetadataData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("SubscriptionAssessmentMetadataResource.Update"); - scope.Start(); - try - { - var response = await _subscriptionAssessmentMetadataAssessmentsMetadataRestClient.CreateInSubscriptionAsync(Id.SubscriptionId, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SubscriptionAssessmentMetadataResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Create metadata information on an assessment type in a specific subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_CreateInSubscription - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// AssessmentMetadata object. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, SecurityAssessmentMetadataData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _subscriptionAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("SubscriptionAssessmentMetadataResource.Update"); - scope.Start(); - try - { - var response = _subscriptionAssessmentMetadataAssessmentsMetadataRestClient.CreateInSubscription(Id.SubscriptionId, Id.Name, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SubscriptionAssessmentMetadataResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionGovernanceRuleCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionGovernanceRuleCollection.cs deleted file mode 100644 index 0f70680f07e1..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionGovernanceRuleCollection.cs +++ /dev/null @@ -1,346 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSubscriptionGovernanceRules method from an instance of . - /// - public partial class SubscriptionGovernanceRuleCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics; - private readonly GovernanceRulesRestOperations _subscriptionGovernanceRuleGovernanceRulesRestClient; - private readonly ClientDiagnostics _subscriptionGovernanceRuleGovernanceRuleClientDiagnostics; - private readonly GovernanceRuleRestOperations _subscriptionGovernanceRuleGovernanceRuleRestClient; - - /// Initializes a new instance of the class for mocking. - protected SubscriptionGovernanceRuleCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SubscriptionGovernanceRuleCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SubscriptionGovernanceRuleResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SubscriptionGovernanceRuleResource.ResourceType, out string subscriptionGovernanceRuleGovernanceRulesApiVersion); - _subscriptionGovernanceRuleGovernanceRulesRestClient = new GovernanceRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, subscriptionGovernanceRuleGovernanceRulesApiVersion); - _subscriptionGovernanceRuleGovernanceRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SubscriptionGovernanceRuleResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SubscriptionGovernanceRuleResource.ResourceType, out string subscriptionGovernanceRuleGovernanceRuleApiVersion); - _subscriptionGovernanceRuleGovernanceRuleRestClient = new GovernanceRuleRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, subscriptionGovernanceRuleGovernanceRuleApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SubscriptionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); - } - - /// - /// Creates or update a security GovernanceRule on the given subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// GovernanceRules_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string ruleId, GovernanceRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics.CreateScope("SubscriptionGovernanceRuleCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _subscriptionGovernanceRuleGovernanceRulesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, ruleId, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SubscriptionGovernanceRuleResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or update a security GovernanceRule on the given subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// GovernanceRules_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string ruleId, GovernanceRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics.CreateScope("SubscriptionGovernanceRuleCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _subscriptionGovernanceRuleGovernanceRulesRestClient.CreateOrUpdate(Id.SubscriptionId, ruleId, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SubscriptionGovernanceRuleResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific governanceRule for the requested scope by ruleId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// GovernanceRules_Get - /// - /// - /// - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string ruleId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var scope = _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics.CreateScope("SubscriptionGovernanceRuleCollection.Get"); - scope.Start(); - try - { - var response = await _subscriptionGovernanceRuleGovernanceRulesRestClient.GetAsync(Id.SubscriptionId, ruleId, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionGovernanceRuleResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific governanceRule for the requested scope by ruleId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// GovernanceRules_Get - /// - /// - /// - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string ruleId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var scope = _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics.CreateScope("SubscriptionGovernanceRuleCollection.Get"); - scope.Start(); - try - { - var response = _subscriptionGovernanceRuleGovernanceRulesRestClient.Get(Id.SubscriptionId, ruleId, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionGovernanceRuleResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a list of all relevant governanceRules over a subscription level scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules - /// - /// - /// Operation Id - /// GovernanceRule_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _subscriptionGovernanceRuleGovernanceRuleRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _subscriptionGovernanceRuleGovernanceRuleRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SubscriptionGovernanceRuleResource(Client, GovernanceRuleData.DeserializeGovernanceRuleData(e)), _subscriptionGovernanceRuleGovernanceRuleClientDiagnostics, Pipeline, "SubscriptionGovernanceRuleCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Get a list of all relevant governanceRules over a subscription level scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules - /// - /// - /// Operation Id - /// GovernanceRule_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _subscriptionGovernanceRuleGovernanceRuleRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _subscriptionGovernanceRuleGovernanceRuleRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SubscriptionGovernanceRuleResource(Client, GovernanceRuleData.DeserializeGovernanceRuleData(e)), _subscriptionGovernanceRuleGovernanceRuleClientDiagnostics, Pipeline, "SubscriptionGovernanceRuleCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// GovernanceRules_Get - /// - /// - /// - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string ruleId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var scope = _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics.CreateScope("SubscriptionGovernanceRuleCollection.Exists"); - scope.Start(); - try - { - var response = await _subscriptionGovernanceRuleGovernanceRulesRestClient.GetAsync(Id.SubscriptionId, ruleId, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// GovernanceRules_Get - /// - /// - /// - /// The security GovernanceRule key - unique key for the standard GovernanceRule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string ruleId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(ruleId, nameof(ruleId)); - - using var scope = _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics.CreateScope("SubscriptionGovernanceRuleCollection.Exists"); - scope.Start(); - try - { - var response = _subscriptionGovernanceRuleGovernanceRulesRestClient.Get(Id.SubscriptionId, ruleId, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionGovernanceRuleResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionGovernanceRuleResource.cs deleted file mode 100644 index b7e49d6c9340..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionGovernanceRuleResource.cs +++ /dev/null @@ -1,451 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SubscriptionGovernanceRule along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSubscriptionGovernanceRuleResource method. - /// Otherwise you can get one from its parent resource using the GetSubscriptionGovernanceRule method. - /// - public partial class SubscriptionGovernanceRuleResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string ruleId) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics; - private readonly GovernanceRulesRestOperations _subscriptionGovernanceRuleGovernanceRulesRestClient; - private readonly ClientDiagnostics _subscriptionGovernanceRulesExecuteStatusClientDiagnostics; - private readonly SubscriptionGovernanceRulesExecuteStatusRestOperations _subscriptionGovernanceRulesExecuteStatusRestClient; - private readonly GovernanceRuleData _data; - - /// Initializes a new instance of the class for mocking. - protected SubscriptionGovernanceRuleResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SubscriptionGovernanceRuleResource(ArmClient client, GovernanceRuleData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SubscriptionGovernanceRuleResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string subscriptionGovernanceRuleGovernanceRulesApiVersion); - _subscriptionGovernanceRuleGovernanceRulesRestClient = new GovernanceRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, subscriptionGovernanceRuleGovernanceRulesApiVersion); - _subscriptionGovernanceRulesExecuteStatusClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _subscriptionGovernanceRulesExecuteStatusRestClient = new SubscriptionGovernanceRulesExecuteStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/governanceRules"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual GovernanceRuleData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get a specific governanceRule for the requested scope by ruleId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// GovernanceRules_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics.CreateScope("SubscriptionGovernanceRuleResource.Get"); - scope.Start(); - try - { - var response = await _subscriptionGovernanceRuleGovernanceRulesRestClient.GetAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionGovernanceRuleResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific governanceRule for the requested scope by ruleId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// GovernanceRules_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics.CreateScope("SubscriptionGovernanceRuleResource.Get"); - scope.Start(); - try - { - var response = _subscriptionGovernanceRuleGovernanceRulesRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionGovernanceRuleResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a GovernanceRule over a given scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// GovernanceRules_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics.CreateScope("SubscriptionGovernanceRuleResource.Delete"); - scope.Start(); - try - { - var response = await _subscriptionGovernanceRuleGovernanceRulesRestClient.DeleteAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete a GovernanceRule over a given scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// GovernanceRules_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics.CreateScope("SubscriptionGovernanceRuleResource.Delete"); - scope.Start(); - try - { - var response = _subscriptionGovernanceRuleGovernanceRulesRestClient.Delete(Id.SubscriptionId, Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or update a security GovernanceRule on the given subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// GovernanceRules_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, GovernanceRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics.CreateScope("SubscriptionGovernanceRuleResource.Update"); - scope.Start(); - try - { - var response = await _subscriptionGovernanceRuleGovernanceRulesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SubscriptionGovernanceRuleResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or update a security GovernanceRule on the given subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId} - /// - /// - /// Operation Id - /// GovernanceRules_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, GovernanceRuleData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics.CreateScope("SubscriptionGovernanceRuleResource.Update"); - scope.Start(); - try - { - var response = _subscriptionGovernanceRuleGovernanceRulesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.Name, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SubscriptionGovernanceRuleResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Execute a security GovernanceRule on the given subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute - /// - /// - /// Operation Id - /// GovernanceRules_RuleIdExecuteSingleSubscription - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - public virtual async Task ExecuteRuleAsync(WaitUntil waitUntil, ExecuteGovernanceRuleParams executeGovernanceRuleParams = null, CancellationToken cancellationToken = default) - { - using var scope = _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics.CreateScope("SubscriptionGovernanceRuleResource.ExecuteRule"); - scope.Start(); - try - { - var response = await _subscriptionGovernanceRuleGovernanceRulesRestClient.RuleIdExecuteSingleSubscriptionAsync(Id.SubscriptionId, Id.Name, executeGovernanceRuleParams, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(_subscriptionGovernanceRuleGovernanceRulesClientDiagnostics, Pipeline, _subscriptionGovernanceRuleGovernanceRulesRestClient.CreateRuleIdExecuteSingleSubscriptionRequest(Id.SubscriptionId, Id.Name, executeGovernanceRuleParams).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Execute a security GovernanceRule on the given subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute - /// - /// - /// Operation Id - /// GovernanceRules_RuleIdExecuteSingleSubscription - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// GovernanceRule over a subscription scope. - /// The cancellation token to use. - public virtual ArmOperation ExecuteRule(WaitUntil waitUntil, ExecuteGovernanceRuleParams executeGovernanceRuleParams = null, CancellationToken cancellationToken = default) - { - using var scope = _subscriptionGovernanceRuleGovernanceRulesClientDiagnostics.CreateScope("SubscriptionGovernanceRuleResource.ExecuteRule"); - scope.Start(); - try - { - var response = _subscriptionGovernanceRuleGovernanceRulesRestClient.RuleIdExecuteSingleSubscription(Id.SubscriptionId, Id.Name, executeGovernanceRuleParams, cancellationToken); - var operation = new SecurityCenterArmOperation(_subscriptionGovernanceRuleGovernanceRulesClientDiagnostics, Pipeline, _subscriptionGovernanceRuleGovernanceRulesRestClient.CreateRuleIdExecuteSingleSubscriptionRequest(Id.SubscriptionId, Id.Name, executeGovernanceRuleParams).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific governanceRule execution status for the requested scope by ruleId and operationId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId} - /// - /// - /// Operation Id - /// SubscriptionGovernanceRulesExecuteStatus_Get - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetRuleExecutionStatusAsync(WaitUntil waitUntil, string operationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); - - using var scope = _subscriptionGovernanceRulesExecuteStatusClientDiagnostics.CreateScope("SubscriptionGovernanceRuleResource.GetRuleExecutionStatus"); - scope.Start(); - try - { - var response = await _subscriptionGovernanceRulesExecuteStatusRestClient.GetAsync(Id.SubscriptionId, Id.Name, operationId, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(new ExecuteRuleStatusOperationSource(), _subscriptionGovernanceRulesExecuteStatusClientDiagnostics, Pipeline, _subscriptionGovernanceRulesExecuteStatusRestClient.CreateGetRequest(Id.SubscriptionId, Id.Name, operationId).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific governanceRule execution status for the requested scope by ruleId and operationId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId} - /// - /// - /// Operation Id - /// SubscriptionGovernanceRulesExecuteStatus_Get - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security GovernanceRule execution key - unique key for the execution of GovernanceRule. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual ArmOperation GetRuleExecutionStatus(WaitUntil waitUntil, string operationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); - - using var scope = _subscriptionGovernanceRulesExecuteStatusClientDiagnostics.CreateScope("SubscriptionGovernanceRuleResource.GetRuleExecutionStatus"); - scope.Start(); - try - { - var response = _subscriptionGovernanceRulesExecuteStatusRestClient.Get(Id.SubscriptionId, Id.Name, operationId, cancellationToken); - var operation = new SecurityCenterArmOperation(new ExecuteRuleStatusOperationSource(), _subscriptionGovernanceRulesExecuteStatusClientDiagnostics, Pipeline, _subscriptionGovernanceRulesExecuteStatusRestClient.CreateGetRequest(Id.SubscriptionId, Id.Name, operationId).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityAlertCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityAlertCollection.cs deleted file mode 100644 index e1fc1723765e..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityAlertCollection.cs +++ /dev/null @@ -1,339 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.SecurityCenter.Models; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSubscriptionSecurityAlerts method from an instance of . - /// - public partial class SubscriptionSecurityAlertCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _subscriptionSecurityAlertAlertsClientDiagnostics; - private readonly AlertsRestOperations _subscriptionSecurityAlertAlertsRestClient; - private readonly ClientDiagnostics _alertsClientDiagnostics; - private readonly AlertsRestOperations _alertsRestClient; - - /// Initializes a new instance of the class for mocking. - protected SubscriptionSecurityAlertCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SubscriptionSecurityAlertCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _subscriptionSecurityAlertAlertsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SubscriptionSecurityAlertResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SubscriptionSecurityAlertResource.ResourceType, out string subscriptionSecurityAlertAlertsApiVersion); - _subscriptionSecurityAlertAlertsRestClient = new AlertsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, subscriptionSecurityAlertAlertsApiVersion); - _alertsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _alertsRestClient = new AlertsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SecurityCenterLocationResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SecurityCenterLocationResource.ResourceType), nameof(id)); - } - - /// - /// Get an alert that is associated with a subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} - /// - /// - /// Operation Id - /// Alerts_GetSubscriptionLevel - /// - /// - /// - /// Name of the alert object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var scope = _subscriptionSecurityAlertAlertsClientDiagnostics.CreateScope("SubscriptionSecurityAlertCollection.Get"); - scope.Start(); - try - { - var response = await _subscriptionSecurityAlertAlertsRestClient.GetSubscriptionLevelAsync(Id.SubscriptionId, new AzureLocation(Id.Name), alertName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionSecurityAlertResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get an alert that is associated with a subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} - /// - /// - /// Operation Id - /// Alerts_GetSubscriptionLevel - /// - /// - /// - /// Name of the alert object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var scope = _subscriptionSecurityAlertAlertsClientDiagnostics.CreateScope("SubscriptionSecurityAlertCollection.Get"); - scope.Start(); - try - { - var response = _subscriptionSecurityAlertAlertsRestClient.GetSubscriptionLevel(Id.SubscriptionId, new AzureLocation(Id.Name), alertName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionSecurityAlertResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// List all the alerts that are associated with the subscription that are stored in a specific location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts - /// - /// - /// Operation Id - /// Alerts_ListSubscriptionLevelByRegion - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _subscriptionSecurityAlertAlertsRestClient.CreateListSubscriptionLevelByRegionRequest(Id.SubscriptionId, new AzureLocation(Id.Name)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _subscriptionSecurityAlertAlertsRestClient.CreateListSubscriptionLevelByRegionNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Name)); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SubscriptionSecurityAlertResource(Client, SecurityAlertData.DeserializeSecurityAlertData(e)), _subscriptionSecurityAlertAlertsClientDiagnostics, Pipeline, "SubscriptionSecurityAlertCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// List all the alerts that are associated with the subscription that are stored in a specific location - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts - /// - /// - /// Operation Id - /// Alerts_ListSubscriptionLevelByRegion - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _subscriptionSecurityAlertAlertsRestClient.CreateListSubscriptionLevelByRegionRequest(Id.SubscriptionId, new AzureLocation(Id.Name)); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _subscriptionSecurityAlertAlertsRestClient.CreateListSubscriptionLevelByRegionNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Name)); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SubscriptionSecurityAlertResource(Client, SecurityAlertData.DeserializeSecurityAlertData(e)), _subscriptionSecurityAlertAlertsClientDiagnostics, Pipeline, "SubscriptionSecurityAlertCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Simulate security alerts - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate - /// - /// - /// Operation Id - /// Alerts_Simulate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Alert Simulator Request Properties. - /// The cancellation token to use. - /// is null. - public virtual async Task SimulateAsync(WaitUntil waitUntil, SecurityAlertSimulatorContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _alertsClientDiagnostics.CreateScope("SubscriptionSecurityAlertCollection.Simulate"); - scope.Start(); - try - { - var response = await _alertsRestClient.SimulateAsync(Id.SubscriptionId, new AzureLocation(Id.Name), content, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(_alertsClientDiagnostics, Pipeline, _alertsRestClient.CreateSimulateRequest(Id.SubscriptionId, new AzureLocation(Id.Name), content).Request, response, OperationFinalStateVia.OriginalUri); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Simulate security alerts - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate - /// - /// - /// Operation Id - /// Alerts_Simulate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Alert Simulator Request Properties. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Simulate(WaitUntil waitUntil, SecurityAlertSimulatorContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _alertsClientDiagnostics.CreateScope("SubscriptionSecurityAlertCollection.Simulate"); - scope.Start(); - try - { - var response = _alertsRestClient.Simulate(Id.SubscriptionId, new AzureLocation(Id.Name), content, cancellationToken); - var operation = new SecurityCenterArmOperation(_alertsClientDiagnostics, Pipeline, _alertsRestClient.CreateSimulateRequest(Id.SubscriptionId, new AzureLocation(Id.Name), content).Request, response, OperationFinalStateVia.OriginalUri); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} - /// - /// - /// Operation Id - /// Alerts_GetSubscriptionLevel - /// - /// - /// - /// Name of the alert object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var scope = _subscriptionSecurityAlertAlertsClientDiagnostics.CreateScope("SubscriptionSecurityAlertCollection.Exists"); - scope.Start(); - try - { - var response = await _subscriptionSecurityAlertAlertsRestClient.GetSubscriptionLevelAsync(Id.SubscriptionId, new AzureLocation(Id.Name), alertName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} - /// - /// - /// Operation Id - /// Alerts_GetSubscriptionLevel - /// - /// - /// - /// Name of the alert object. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string alertName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(alertName, nameof(alertName)); - - using var scope = _subscriptionSecurityAlertAlertsClientDiagnostics.CreateScope("SubscriptionSecurityAlertCollection.Exists"); - scope.Start(); - try - { - var response = _subscriptionSecurityAlertAlertsRestClient.GetSubscriptionLevel(Id.SubscriptionId, new AzureLocation(Id.Name), alertName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityAlertResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityAlertResource.cs deleted file mode 100644 index a20c952fcb38..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityAlertResource.cs +++ /dev/null @@ -1,393 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SubscriptionSecurityAlert along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSubscriptionSecurityAlertResource method. - /// Otherwise you can get one from its parent resource using the GetSubscriptionSecurityAlert method. - /// - public partial class SubscriptionSecurityAlertResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation ascLocation, string alertName) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _subscriptionSecurityAlertAlertsClientDiagnostics; - private readonly AlertsRestOperations _subscriptionSecurityAlertAlertsRestClient; - private readonly SecurityAlertData _data; - - /// Initializes a new instance of the class for mocking. - protected SubscriptionSecurityAlertResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SubscriptionSecurityAlertResource(ArmClient client, SecurityAlertData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SubscriptionSecurityAlertResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _subscriptionSecurityAlertAlertsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string subscriptionSecurityAlertAlertsApiVersion); - _subscriptionSecurityAlertAlertsRestClient = new AlertsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, subscriptionSecurityAlertAlertsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/locations/alerts"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecurityAlertData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get an alert that is associated with a subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} - /// - /// - /// Operation Id - /// Alerts_GetSubscriptionLevel - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionSecurityAlertAlertsClientDiagnostics.CreateScope("SubscriptionSecurityAlertResource.Get"); - scope.Start(); - try - { - var response = await _subscriptionSecurityAlertAlertsRestClient.GetSubscriptionLevelAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionSecurityAlertResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get an alert that is associated with a subscription - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName} - /// - /// - /// Operation Id - /// Alerts_GetSubscriptionLevel - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionSecurityAlertAlertsClientDiagnostics.CreateScope("SubscriptionSecurityAlertResource.Get"); - scope.Start(); - try - { - var response = _subscriptionSecurityAlertAlertsRestClient.GetSubscriptionLevel(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionSecurityAlertResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update the alert's state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss - /// - /// - /// Operation Id - /// Alerts_UpdateSubscriptionLevelStateToDismiss - /// - /// - /// - /// The cancellation token to use. - public virtual async Task DismissAsync(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionSecurityAlertAlertsClientDiagnostics.CreateScope("SubscriptionSecurityAlertResource.Dismiss"); - scope.Start(); - try - { - var response = await _subscriptionSecurityAlertAlertsRestClient.UpdateSubscriptionLevelStateToDismissAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update the alert's state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss - /// - /// - /// Operation Id - /// Alerts_UpdateSubscriptionLevelStateToDismiss - /// - /// - /// - /// The cancellation token to use. - public virtual Response Dismiss(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionSecurityAlertAlertsClientDiagnostics.CreateScope("SubscriptionSecurityAlertResource.Dismiss"); - scope.Start(); - try - { - var response = _subscriptionSecurityAlertAlertsRestClient.UpdateSubscriptionLevelStateToDismiss(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update the alert's state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve - /// - /// - /// Operation Id - /// Alerts_UpdateSubscriptionLevelStateToResolve - /// - /// - /// - /// The cancellation token to use. - public virtual async Task ResolveAsync(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionSecurityAlertAlertsClientDiagnostics.CreateScope("SubscriptionSecurityAlertResource.Resolve"); - scope.Start(); - try - { - var response = await _subscriptionSecurityAlertAlertsRestClient.UpdateSubscriptionLevelStateToResolveAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update the alert's state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve - /// - /// - /// Operation Id - /// Alerts_UpdateSubscriptionLevelStateToResolve - /// - /// - /// - /// The cancellation token to use. - public virtual Response Resolve(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionSecurityAlertAlertsClientDiagnostics.CreateScope("SubscriptionSecurityAlertResource.Resolve"); - scope.Start(); - try - { - var response = _subscriptionSecurityAlertAlertsRestClient.UpdateSubscriptionLevelStateToResolve(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update the alert's state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate - /// - /// - /// Operation Id - /// Alerts_UpdateSubscriptionLevelStateToActivate - /// - /// - /// - /// The cancellation token to use. - public virtual async Task ActivateAsync(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionSecurityAlertAlertsClientDiagnostics.CreateScope("SubscriptionSecurityAlertResource.Activate"); - scope.Start(); - try - { - var response = await _subscriptionSecurityAlertAlertsRestClient.UpdateSubscriptionLevelStateToActivateAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update the alert's state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate - /// - /// - /// Operation Id - /// Alerts_UpdateSubscriptionLevelStateToActivate - /// - /// - /// - /// The cancellation token to use. - public virtual Response Activate(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionSecurityAlertAlertsClientDiagnostics.CreateScope("SubscriptionSecurityAlertResource.Activate"); - scope.Start(); - try - { - var response = _subscriptionSecurityAlertAlertsRestClient.UpdateSubscriptionLevelStateToActivate(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update the alert's state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress - /// - /// - /// Operation Id - /// Alerts_UpdateSubscriptionLevelStateToInProgress - /// - /// - /// - /// The cancellation token to use. - public virtual async Task UpdateSatateToInProgressAsync(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionSecurityAlertAlertsClientDiagnostics.CreateScope("SubscriptionSecurityAlertResource.UpdateSatateToInProgress"); - scope.Start(); - try - { - var response = await _subscriptionSecurityAlertAlertsRestClient.UpdateSubscriptionLevelStateToInProgressAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Update the alert's state - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress - /// - /// - /// Operation Id - /// Alerts_UpdateSubscriptionLevelStateToInProgress - /// - /// - /// - /// The cancellation token to use. - public virtual Response UpdateSatateToInProgress(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionSecurityAlertAlertsClientDiagnostics.CreateScope("SubscriptionSecurityAlertResource.UpdateSatateToInProgress"); - scope.Start(); - try - { - var response = _subscriptionSecurityAlertAlertsRestClient.UpdateSubscriptionLevelStateToInProgress(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityApplicationCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityApplicationCollection.cs deleted file mode 100644 index d14e46f290df..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityApplicationCollection.cs +++ /dev/null @@ -1,346 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSubscriptionSecurityApplications method from an instance of . - /// - public partial class SubscriptionSecurityApplicationCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _subscriptionSecurityApplicationApplicationClientDiagnostics; - private readonly ApplicationRestOperations _subscriptionSecurityApplicationApplicationRestClient; - private readonly ClientDiagnostics _subscriptionSecurityApplicationApplicationsClientDiagnostics; - private readonly ApplicationsRestOperations _subscriptionSecurityApplicationApplicationsRestClient; - - /// Initializes a new instance of the class for mocking. - protected SubscriptionSecurityApplicationCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SubscriptionSecurityApplicationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _subscriptionSecurityApplicationApplicationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SubscriptionSecurityApplicationResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SubscriptionSecurityApplicationResource.ResourceType, out string subscriptionSecurityApplicationApplicationApiVersion); - _subscriptionSecurityApplicationApplicationRestClient = new ApplicationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, subscriptionSecurityApplicationApplicationApiVersion); - _subscriptionSecurityApplicationApplicationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SubscriptionSecurityApplicationResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SubscriptionSecurityApplicationResource.ResourceType, out string subscriptionSecurityApplicationApplicationsApiVersion); - _subscriptionSecurityApplicationApplicationsRestClient = new ApplicationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, subscriptionSecurityApplicationApplicationsApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SubscriptionResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); - } - - /// - /// Creates or update a security application on the given subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// Application_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security Application key - unique key for the standard application. - /// Application over a subscription scope. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string applicationId, SecurityApplicationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _subscriptionSecurityApplicationApplicationClientDiagnostics.CreateScope("SubscriptionSecurityApplicationCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _subscriptionSecurityApplicationApplicationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, applicationId, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SubscriptionSecurityApplicationResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or update a security application on the given subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// Application_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The security Application key - unique key for the standard application. - /// Application over a subscription scope. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string applicationId, SecurityApplicationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _subscriptionSecurityApplicationApplicationClientDiagnostics.CreateScope("SubscriptionSecurityApplicationCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _subscriptionSecurityApplicationApplicationRestClient.CreateOrUpdate(Id.SubscriptionId, applicationId, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SubscriptionSecurityApplicationResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific application for the requested scope by applicationId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// Application_Get - /// - /// - /// - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string applicationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - - using var scope = _subscriptionSecurityApplicationApplicationClientDiagnostics.CreateScope("SubscriptionSecurityApplicationCollection.Get"); - scope.Start(); - try - { - var response = await _subscriptionSecurityApplicationApplicationRestClient.GetAsync(Id.SubscriptionId, applicationId, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionSecurityApplicationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific application for the requested scope by applicationId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// Application_Get - /// - /// - /// - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string applicationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - - using var scope = _subscriptionSecurityApplicationApplicationClientDiagnostics.CreateScope("SubscriptionSecurityApplicationCollection.Get"); - scope.Start(); - try - { - var response = _subscriptionSecurityApplicationApplicationRestClient.Get(Id.SubscriptionId, applicationId, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionSecurityApplicationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a list of all relevant applications over a subscription level scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications - /// - /// - /// Operation Id - /// Applications_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _subscriptionSecurityApplicationApplicationsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _subscriptionSecurityApplicationApplicationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SubscriptionSecurityApplicationResource(Client, SecurityApplicationData.DeserializeSecurityApplicationData(e)), _subscriptionSecurityApplicationApplicationsClientDiagnostics, Pipeline, "SubscriptionSecurityApplicationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Get a list of all relevant applications over a subscription level scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications - /// - /// - /// Operation Id - /// Applications_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _subscriptionSecurityApplicationApplicationsRestClient.CreateListRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _subscriptionSecurityApplicationApplicationsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SubscriptionSecurityApplicationResource(Client, SecurityApplicationData.DeserializeSecurityApplicationData(e)), _subscriptionSecurityApplicationApplicationsClientDiagnostics, Pipeline, "SubscriptionSecurityApplicationCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// Application_Get - /// - /// - /// - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string applicationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - - using var scope = _subscriptionSecurityApplicationApplicationClientDiagnostics.CreateScope("SubscriptionSecurityApplicationCollection.Exists"); - scope.Start(); - try - { - var response = await _subscriptionSecurityApplicationApplicationRestClient.GetAsync(Id.SubscriptionId, applicationId, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// Application_Get - /// - /// - /// - /// The security Application key - unique key for the standard application. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string applicationId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(applicationId, nameof(applicationId)); - - using var scope = _subscriptionSecurityApplicationApplicationClientDiagnostics.CreateScope("SubscriptionSecurityApplicationCollection.Exists"); - scope.Start(); - try - { - var response = _subscriptionSecurityApplicationApplicationRestClient.Get(Id.SubscriptionId, applicationId, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityApplicationResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityApplicationResource.cs deleted file mode 100644 index 7de3a2dfac6c..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityApplicationResource.cs +++ /dev/null @@ -1,298 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SubscriptionSecurityApplication along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSubscriptionSecurityApplicationResource method. - /// Otherwise you can get one from its parent resource using the GetSubscriptionSecurityApplication method. - /// - public partial class SubscriptionSecurityApplicationResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string applicationId) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _subscriptionSecurityApplicationApplicationClientDiagnostics; - private readonly ApplicationRestOperations _subscriptionSecurityApplicationApplicationRestClient; - private readonly SecurityApplicationData _data; - - /// Initializes a new instance of the class for mocking. - protected SubscriptionSecurityApplicationResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SubscriptionSecurityApplicationResource(ArmClient client, SecurityApplicationData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SubscriptionSecurityApplicationResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _subscriptionSecurityApplicationApplicationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string subscriptionSecurityApplicationApplicationApiVersion); - _subscriptionSecurityApplicationApplicationRestClient = new ApplicationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, subscriptionSecurityApplicationApplicationApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/applications"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecurityApplicationData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get a specific application for the requested scope by applicationId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// Application_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionSecurityApplicationApplicationClientDiagnostics.CreateScope("SubscriptionSecurityApplicationResource.Get"); - scope.Start(); - try - { - var response = await _subscriptionSecurityApplicationApplicationRestClient.GetAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionSecurityApplicationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get a specific application for the requested scope by applicationId - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// Application_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionSecurityApplicationApplicationClientDiagnostics.CreateScope("SubscriptionSecurityApplicationResource.Get"); - scope.Start(); - try - { - var response = _subscriptionSecurityApplicationApplicationRestClient.Get(Id.SubscriptionId, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionSecurityApplicationResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete an Application over a given scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// Application_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _subscriptionSecurityApplicationApplicationClientDiagnostics.CreateScope("SubscriptionSecurityApplicationResource.Delete"); - scope.Start(); - try - { - var response = await _subscriptionSecurityApplicationApplicationRestClient.DeleteAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Delete an Application over a given scope - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// Application_Delete - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _subscriptionSecurityApplicationApplicationClientDiagnostics.CreateScope("SubscriptionSecurityApplicationResource.Delete"); - scope.Start(); - try - { - var response = _subscriptionSecurityApplicationApplicationRestClient.Delete(Id.SubscriptionId, Id.Name, cancellationToken); - var operation = new SecurityCenterArmOperation(response); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or update a security application on the given subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// Application_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Application over a subscription scope. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, SecurityApplicationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _subscriptionSecurityApplicationApplicationClientDiagnostics.CreateScope("SubscriptionSecurityApplicationResource.Update"); - scope.Start(); - try - { - var response = await _subscriptionSecurityApplicationApplicationRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SubscriptionSecurityApplicationResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Creates or update a security application on the given subscription. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId} - /// - /// - /// Operation Id - /// Application_CreateOrUpdate - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Application over a subscription scope. - /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, SecurityApplicationData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _subscriptionSecurityApplicationApplicationClientDiagnostics.CreateScope("SubscriptionSecurityApplicationResource.Update"); - scope.Start(); - try - { - var response = _subscriptionSecurityApplicationApplicationRestClient.CreateOrUpdate(Id.SubscriptionId, Id.Name, data, cancellationToken); - var operation = new SecurityCenterArmOperation(Response.FromValue(new SubscriptionSecurityApplicationResource(Client, response), response.GetRawResponse())); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityTaskCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityTaskCollection.cs deleted file mode 100644 index 7e819d091cf5..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityTaskCollection.cs +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetSubscriptionSecurityTasks method from an instance of . - /// - public partial class SubscriptionSecurityTaskCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _subscriptionSecurityTaskTasksClientDiagnostics; - private readonly TasksRestOperations _subscriptionSecurityTaskTasksRestClient; - - /// Initializes a new instance of the class for mocking. - protected SubscriptionSecurityTaskCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal SubscriptionSecurityTaskCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _subscriptionSecurityTaskTasksClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", SubscriptionSecurityTaskResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(SubscriptionSecurityTaskResource.ResourceType, out string subscriptionSecurityTaskTasksApiVersion); - _subscriptionSecurityTaskTasksRestClient = new TasksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, subscriptionSecurityTaskTasksApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != SecurityCenterLocationResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SecurityCenterLocationResource.ResourceType), nameof(id)); - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} - /// - /// - /// Operation Id - /// Tasks_GetSubscriptionLevelTask - /// - /// - /// - /// Name of the task object, will be a GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string taskName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); - - using var scope = _subscriptionSecurityTaskTasksClientDiagnostics.CreateScope("SubscriptionSecurityTaskCollection.Get"); - scope.Start(); - try - { - var response = await _subscriptionSecurityTaskTasksRestClient.GetSubscriptionLevelTaskAsync(Id.SubscriptionId, new AzureLocation(Id.Name), taskName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionSecurityTaskResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} - /// - /// - /// Operation Id - /// Tasks_GetSubscriptionLevelTask - /// - /// - /// - /// Name of the task object, will be a GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string taskName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); - - using var scope = _subscriptionSecurityTaskTasksClientDiagnostics.CreateScope("SubscriptionSecurityTaskCollection.Get"); - scope.Start(); - try - { - var response = _subscriptionSecurityTaskTasksRestClient.GetSubscriptionLevelTask(Id.SubscriptionId, new AzureLocation(Id.Name), taskName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionSecurityTaskResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks - /// - /// - /// Operation Id - /// Tasks_ListByHomeRegion - /// - /// - /// - /// OData filter. Optional. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _subscriptionSecurityTaskTasksRestClient.CreateListByHomeRegionRequest(Id.SubscriptionId, new AzureLocation(Id.Name), filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _subscriptionSecurityTaskTasksRestClient.CreateListByHomeRegionNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Name), filter); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SubscriptionSecurityTaskResource(Client, SecurityTaskData.DeserializeSecurityTaskData(e)), _subscriptionSecurityTaskTasksClientDiagnostics, Pipeline, "SubscriptionSecurityTaskCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks - /// - /// - /// Operation Id - /// Tasks_ListByHomeRegion - /// - /// - /// - /// OData filter. Optional. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string filter = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _subscriptionSecurityTaskTasksRestClient.CreateListByHomeRegionRequest(Id.SubscriptionId, new AzureLocation(Id.Name), filter); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _subscriptionSecurityTaskTasksRestClient.CreateListByHomeRegionNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Name), filter); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SubscriptionSecurityTaskResource(Client, SecurityTaskData.DeserializeSecurityTaskData(e)), _subscriptionSecurityTaskTasksClientDiagnostics, Pipeline, "SubscriptionSecurityTaskCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} - /// - /// - /// Operation Id - /// Tasks_GetSubscriptionLevelTask - /// - /// - /// - /// Name of the task object, will be a GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string taskName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); - - using var scope = _subscriptionSecurityTaskTasksClientDiagnostics.CreateScope("SubscriptionSecurityTaskCollection.Exists"); - scope.Start(); - try - { - var response = await _subscriptionSecurityTaskTasksRestClient.GetSubscriptionLevelTaskAsync(Id.SubscriptionId, new AzureLocation(Id.Name), taskName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} - /// - /// - /// Operation Id - /// Tasks_GetSubscriptionLevelTask - /// - /// - /// - /// Name of the task object, will be a GUID. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string taskName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(taskName, nameof(taskName)); - - using var scope = _subscriptionSecurityTaskTasksClientDiagnostics.CreateScope("SubscriptionSecurityTaskCollection.Exists"); - scope.Start(); - try - { - var response = _subscriptionSecurityTaskTasksRestClient.GetSubscriptionLevelTask(Id.SubscriptionId, new AzureLocation(Id.Name), taskName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityTaskResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityTaskResource.cs deleted file mode 100644 index b9d2a2954b11..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/SubscriptionSecurityTaskResource.cs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a SubscriptionSecurityTask along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetSubscriptionSecurityTaskResource method. - /// Otherwise you can get one from its parent resource using the GetSubscriptionSecurityTask method. - /// - public partial class SubscriptionSecurityTaskResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation ascLocation, string taskName) - { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _subscriptionSecurityTaskTasksClientDiagnostics; - private readonly TasksRestOperations _subscriptionSecurityTaskTasksRestClient; - private readonly SecurityTaskData _data; - - /// Initializes a new instance of the class for mocking. - protected SubscriptionSecurityTaskResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal SubscriptionSecurityTaskResource(ArmClient client, SecurityTaskData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal SubscriptionSecurityTaskResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _subscriptionSecurityTaskTasksClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string subscriptionSecurityTaskTasksApiVersion); - _subscriptionSecurityTaskTasksRestClient = new TasksRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, subscriptionSecurityTaskTasksApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/locations/tasks"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecurityTaskData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} - /// - /// - /// Operation Id - /// Tasks_GetSubscriptionLevelTask - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionSecurityTaskTasksClientDiagnostics.CreateScope("SubscriptionSecurityTaskResource.Get"); - scope.Start(); - try - { - var response = await _subscriptionSecurityTaskTasksRestClient.GetSubscriptionLevelTaskAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionSecurityTaskResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Recommended tasks that will help improve the security of the subscription proactively - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName} - /// - /// - /// Operation Id - /// Tasks_GetSubscriptionLevelTask - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _subscriptionSecurityTaskTasksClientDiagnostics.CreateScope("SubscriptionSecurityTaskResource.Get"); - scope.Start(); - try - { - var response = _subscriptionSecurityTaskTasksRestClient.GetSubscriptionLevelTask(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new SubscriptionSecurityTaskResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/TenantAssessmentMetadataCollection.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/TenantAssessmentMetadataCollection.cs deleted file mode 100644 index a5d0af1db325..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/TenantAssessmentMetadataCollection.cs +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetTenantAssessmentMetadata method from an instance of . - /// - public partial class TenantAssessmentMetadataCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _tenantAssessmentMetadataAssessmentsMetadataClientDiagnostics; - private readonly AssessmentsMetadataRestOperations _tenantAssessmentMetadataAssessmentsMetadataRestClient; - - /// Initializes a new instance of the class for mocking. - protected TenantAssessmentMetadataCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal TenantAssessmentMetadataCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _tenantAssessmentMetadataAssessmentsMetadataClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", TenantAssessmentMetadataResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(TenantAssessmentMetadataResource.ResourceType, out string tenantAssessmentMetadataAssessmentsMetadataApiVersion); - _tenantAssessmentMetadataAssessmentsMetadataRestClient = new AssessmentsMetadataRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, tenantAssessmentMetadataAssessmentsMetadataApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != TenantResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, TenantResource.ResourceType), nameof(id)); - } - - /// - /// Get metadata information on an assessment type - /// - /// - /// Request Path - /// /providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_Get - /// - /// - /// - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string assessmentMetadataName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - - using var scope = _tenantAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("TenantAssessmentMetadataCollection.Get"); - scope.Start(); - try - { - var response = await _tenantAssessmentMetadataAssessmentsMetadataRestClient.GetAsync(assessmentMetadataName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new TenantAssessmentMetadataResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get metadata information on an assessment type - /// - /// - /// Request Path - /// /providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_Get - /// - /// - /// - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string assessmentMetadataName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - - using var scope = _tenantAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("TenantAssessmentMetadataCollection.Get"); - scope.Start(); - try - { - var response = _tenantAssessmentMetadataAssessmentsMetadataRestClient.Get(assessmentMetadataName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new TenantAssessmentMetadataResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get metadata information on all assessment types - /// - /// - /// Request Path - /// /providers/Microsoft.Security/assessmentMetadata - /// - /// - /// Operation Id - /// AssessmentsMetadata_List - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _tenantAssessmentMetadataAssessmentsMetadataRestClient.CreateListRequest(); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _tenantAssessmentMetadataAssessmentsMetadataRestClient.CreateListNextPageRequest(nextLink); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new TenantAssessmentMetadataResource(Client, SecurityAssessmentMetadataData.DeserializeSecurityAssessmentMetadataData(e)), _tenantAssessmentMetadataAssessmentsMetadataClientDiagnostics, Pipeline, "TenantAssessmentMetadataCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Get metadata information on all assessment types - /// - /// - /// Request Path - /// /providers/Microsoft.Security/assessmentMetadata - /// - /// - /// Operation Id - /// AssessmentsMetadata_List - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _tenantAssessmentMetadataAssessmentsMetadataRestClient.CreateListRequest(); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _tenantAssessmentMetadataAssessmentsMetadataRestClient.CreateListNextPageRequest(nextLink); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new TenantAssessmentMetadataResource(Client, SecurityAssessmentMetadataData.DeserializeSecurityAssessmentMetadataData(e)), _tenantAssessmentMetadataAssessmentsMetadataClientDiagnostics, Pipeline, "TenantAssessmentMetadataCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_Get - /// - /// - /// - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string assessmentMetadataName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - - using var scope = _tenantAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("TenantAssessmentMetadataCollection.Exists"); - scope.Start(); - try - { - var response = await _tenantAssessmentMetadataAssessmentsMetadataRestClient.GetAsync(assessmentMetadataName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_Get - /// - /// - /// - /// The Assessment Key - Unique key for the assessment type. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string assessmentMetadataName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(assessmentMetadataName, nameof(assessmentMetadataName)); - - using var scope = _tenantAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("TenantAssessmentMetadataCollection.Exists"); - scope.Start(); - try - { - var response = _tenantAssessmentMetadataAssessmentsMetadataRestClient.Get(assessmentMetadataName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/TenantAssessmentMetadataResource.cs b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/TenantAssessmentMetadataResource.cs deleted file mode 100644 index b36cb23dfca2..000000000000 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/Generated/TenantAssessmentMetadataResource.cs +++ /dev/null @@ -1,154 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.SecurityCenter -{ - /// - /// A Class representing a TenantAssessmentMetadata along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetTenantAssessmentMetadataResource method. - /// Otherwise you can get one from its parent resource using the GetTenantAssessmentMetadata method. - /// - public partial class TenantAssessmentMetadataResource : ArmResource - { - /// Generate the resource identifier of a instance. - public static ResourceIdentifier CreateResourceIdentifier(string assessmentMetadataName) - { - var resourceId = $"/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _tenantAssessmentMetadataAssessmentsMetadataClientDiagnostics; - private readonly AssessmentsMetadataRestOperations _tenantAssessmentMetadataAssessmentsMetadataRestClient; - private readonly SecurityAssessmentMetadataData _data; - - /// Initializes a new instance of the class for mocking. - protected TenantAssessmentMetadataResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal TenantAssessmentMetadataResource(ArmClient client, SecurityAssessmentMetadataData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal TenantAssessmentMetadataResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _tenantAssessmentMetadataAssessmentsMetadataClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SecurityCenter", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string tenantAssessmentMetadataAssessmentsMetadataApiVersion); - _tenantAssessmentMetadataAssessmentsMetadataRestClient = new AssessmentsMetadataRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, tenantAssessmentMetadataAssessmentsMetadataApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.Security/assessmentMetadata"; - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual SecurityAssessmentMetadataData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Get metadata information on an assessment type - /// - /// - /// Request Path - /// /providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_Get - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _tenantAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("TenantAssessmentMetadataResource.Get"); - scope.Start(); - try - { - var response = await _tenantAssessmentMetadataAssessmentsMetadataRestClient.GetAsync(Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new TenantAssessmentMetadataResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Get metadata information on an assessment type - /// - /// - /// Request Path - /// /providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName} - /// - /// - /// Operation Id - /// AssessmentsMetadata_Get - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _tenantAssessmentMetadataAssessmentsMetadataClientDiagnostics.CreateScope("TenantAssessmentMetadataResource.Get"); - scope.Start(); - try - { - var response = _tenantAssessmentMetadataAssessmentsMetadataRestClient.Get(Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new TenantAssessmentMetadataResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/autorest.md b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/autorest.md index 65530c7182ec..baf84cd5fb61 100644 --- a/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/autorest.md +++ b/sdk/securitycenter/Azure.ResourceManager.SecurityCenter/src/autorest.md @@ -9,7 +9,7 @@ generate-model-factory: false csharp: true library-name: SecurityCenter namespace: Azure.ResourceManager.SecurityCenter -require: https://github.com/Azure/azure-rest-api-specs/blob/f7386016ed8edfdc59d00003c1298afa6966842c/specification/security/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/security/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true