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.
- ///
- /// -
- ///