diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ActionGroupResource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ActionGroupResource.cs index d778d106ae463..b953eceea3bd1 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ActionGroupResource.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ActionGroupResource.cs @@ -241,6 +241,120 @@ public virtual Response Update(ActionGroupPatch patch, Canc } } + /// + /// Send test notifications to a set of provided receivers + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}/createNotifications + /// Operation Id: ActionGroups_CreateNotificationsAtActionGroupResourceLevel + /// + /// 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 notification request body which includes the contact details. + /// The cancellation token to use. + /// is null. + public virtual async Task CreateNotificationsAtActionGroupResourceLevelAsync(WaitUntil waitUntil, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(notificationRequest, nameof(notificationRequest)); + + using var scope = _actionGroupClientDiagnostics.CreateScope("ActionGroupResource.CreateNotificationsAtActionGroupResourceLevel"); + scope.Start(); + try + { + var response = await _actionGroupRestClient.CreateNotificationsAtActionGroupResourceLevelAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, notificationRequest, cancellationToken).ConfigureAwait(false); + var operation = new MonitorArmOperation(_actionGroupClientDiagnostics, Pipeline, _actionGroupRestClient.CreateCreateNotificationsAtActionGroupResourceLevelRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, notificationRequest).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Send test notifications to a set of provided receivers + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}/createNotifications + /// Operation Id: ActionGroups_CreateNotificationsAtActionGroupResourceLevel + /// + /// 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 notification request body which includes the contact details. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation CreateNotificationsAtActionGroupResourceLevel(WaitUntil waitUntil, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(notificationRequest, nameof(notificationRequest)); + + using var scope = _actionGroupClientDiagnostics.CreateScope("ActionGroupResource.CreateNotificationsAtActionGroupResourceLevel"); + scope.Start(); + try + { + var response = _actionGroupRestClient.CreateNotificationsAtActionGroupResourceLevel(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, notificationRequest, cancellationToken); + var operation = new MonitorArmOperation(_actionGroupClientDiagnostics, Pipeline, _actionGroupRestClient.CreateCreateNotificationsAtActionGroupResourceLevelRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, notificationRequest).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the test notifications by the notification id + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}/notificationStatus/{notificationId} + /// Operation Id: ActionGroups_GetTestNotificationsAtActionGroupResourceLevel + /// + /// The notification id. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetTestNotificationsAtActionGroupResourceLevelAsync(string notificationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(notificationId, nameof(notificationId)); + + using var scope = _actionGroupClientDiagnostics.CreateScope("ActionGroupResource.GetTestNotificationsAtActionGroupResourceLevel"); + scope.Start(); + try + { + var response = await _actionGroupRestClient.GetTestNotificationsAtActionGroupResourceLevelAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, notificationId, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the test notifications by the notification id + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}/notificationStatus/{notificationId} + /// Operation Id: ActionGroups_GetTestNotificationsAtActionGroupResourceLevel + /// + /// The notification id. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response GetTestNotificationsAtActionGroupResourceLevel(string notificationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(notificationId, nameof(notificationId)); + + using var scope = _actionGroupClientDiagnostics.CreateScope("ActionGroupResource.GetTestNotificationsAtActionGroupResourceLevel"); + scope.Start(); + try + { + var response = _actionGroupRestClient.GetTestNotificationsAtActionGroupResourceLevel(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, notificationId, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled. This operation is only supported for Email or SMS receivers. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/actionGroups/{actionGroupName}/subscribe diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ActivityLogAlertCollection.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ActivityLogAlertCollection.cs index 7df2df70cb0e6..052a7f75d828b 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ActivityLogAlertCollection.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ActivityLogAlertCollection.cs @@ -55,13 +55,13 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Create a new activity log alert or update an existing one. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Create a new Activity Log Alert rule or update an existing one. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_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 activity log alert. - /// The activity log alert to create or use for the update. + /// The name of the Activity Log Alert rule. + /// The Activity Log Alert rule to create or use for the update. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. @@ -88,13 +88,13 @@ public virtual async Task> CreateOrUpdate } /// - /// Create a new activity log alert or update an existing one. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Create a new Activity Log Alert rule or update an existing one. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_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 activity log alert. - /// The activity log alert to create or use for the update. + /// The name of the Activity Log Alert rule. + /// The Activity Log Alert rule to create or use for the update. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// or is null. @@ -121,11 +121,11 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w } /// - /// Get an activity log alert. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Get an Activity Log Alert rule. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_Get /// - /// The name of the activity log alert. + /// The name of the Activity Log Alert rule. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -150,11 +150,11 @@ public virtual async Task> GetAsync(string ac } /// - /// Get an activity log alert. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Get an Activity Log Alert rule. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_Get /// - /// The name of the activity log alert. + /// The name of the Activity Log Alert rule. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -179,8 +179,8 @@ public virtual Response Get(string activityLogAlertNam } /// - /// Get a list of all activity log alerts in a resource group. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts + /// Get a list of all Activity Log Alert rules in a resource group. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts /// Operation Id: ActivityLogAlerts_ListByResourceGroup /// /// The cancellation token to use. @@ -194,7 +194,7 @@ async Task> FirstPageFunc(int? pageSizeHint) try { var response = await _activityLogAlertRestClient.ListByResourceGroupAsync(Id.SubscriptionId, Id.ResourceGroupName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value.Select(value => new ActivityLogAlertResource(Client, value)), null, response.GetRawResponse()); + return Page.FromValues(response.Value.Value.Select(value => new ActivityLogAlertResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -202,12 +202,27 @@ async Task> FirstPageFunc(int? pageSizeHint) throw; } } - return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _activityLogAlertClientDiagnostics.CreateScope("ActivityLogAlertCollection.GetAll"); + scope.Start(); + try + { + var response = await _activityLogAlertRestClient.ListByResourceGroupNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new ActivityLogAlertResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); } /// - /// Get a list of all activity log alerts in a resource group. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts + /// Get a list of all Activity Log Alert rules in a resource group. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts /// Operation Id: ActivityLogAlerts_ListByResourceGroup /// /// The cancellation token to use. @@ -221,7 +236,22 @@ Page FirstPageFunc(int? pageSizeHint) try { var response = _activityLogAlertRestClient.ListByResourceGroup(Id.SubscriptionId, Id.ResourceGroupName, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value.Select(value => new ActivityLogAlertResource(Client, value)), null, response.GetRawResponse()); + return Page.FromValues(response.Value.Value.Select(value => new ActivityLogAlertResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _activityLogAlertClientDiagnostics.CreateScope("ActivityLogAlertCollection.GetAll"); + scope.Start(); + try + { + var response = _activityLogAlertRestClient.ListByResourceGroupNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new ActivityLogAlertResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -229,15 +259,15 @@ Page FirstPageFunc(int? pageSizeHint) throw; } } - return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); } /// /// Checks to see if the resource exists in azure. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_Get /// - /// The name of the activity log alert. + /// The name of the Activity Log Alert rule. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -261,10 +291,10 @@ public virtual async Task> ExistsAsync(string activityLogAlertNam /// /// Checks to see if the resource exists in azure. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_Get /// - /// The name of the activity log alert. + /// The name of the Activity Log Alert rule. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ActivityLogAlertData.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ActivityLogAlertData.cs index 39ee981f8a4e1..ae314b7e5fd03 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ActivityLogAlertData.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ActivityLogAlertData.cs @@ -29,47 +29,47 @@ public ActivityLogAlertData(AzureLocation location) : base(location) /// The systemData. /// The tags. /// The location. - /// A list of resourceIds that will be used as prefixes. The alert will only apply to activityLogs with resourceIds that fall under one of these prefixes. This list must include at least one item. - /// Indicates whether this activity log alert is enabled. If an activity log alert is not enabled, then none of its actions will be activated. + /// A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item. /// The condition that will cause this alert to activate. /// The actions that will activate when the condition is met. - /// A description of this activity log alert. - internal ActivityLogAlertData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IList scopes, bool? enabled, ActivityLogAlertAllOfCondition condition, ActivityLogAlertActionList actions, string description) : base(id, name, resourceType, systemData, tags, location) + /// Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated. + /// A description of this Activity Log Alert rule. + internal ActivityLogAlertData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IList scopes, AlertRuleAllOfCondition condition, ActionList actions, bool? enabled, string description) : base(id, name, resourceType, systemData, tags, location) { Scopes = scopes; - Enabled = enabled; Condition = condition; Actions = actions; + Enabled = enabled; Description = description; } - /// A list of resourceIds that will be used as prefixes. The alert will only apply to activityLogs with resourceIds that fall under one of these prefixes. This list must include at least one item. + /// A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item. public IList Scopes { get; } - /// Indicates whether this activity log alert is enabled. If an activity log alert is not enabled, then none of its actions will be activated. - public bool? Enabled { get; set; } /// The condition that will cause this alert to activate. - internal ActivityLogAlertAllOfCondition Condition { get; set; } - /// The list of activity log alert conditions. - public IList ConditionAllOf + internal AlertRuleAllOfCondition Condition { get; set; } + /// The list of Activity Log Alert rule conditions. + public IList ConditionAllOf { get => Condition is null ? default : Condition.AllOf; - set => Condition = new ActivityLogAlertAllOfCondition(value); + set => Condition = new AlertRuleAllOfCondition(value); } /// The actions that will activate when the condition is met. - internal ActivityLogAlertActionList Actions { get; set; } - /// The list of activity log alerts. - public IList ActionsActionGroups + internal ActionList Actions { get; set; } + /// The list of the Action Groups. + public IList ActionsActionGroups { get { if (Actions is null) - Actions = new ActivityLogAlertActionList(); + Actions = new ActionList(); return Actions.ActionGroups; } } - /// A description of this activity log alert. + /// Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated. + public bool? Enabled { get; set; } + /// A description of this Activity Log Alert rule. public string Description { get; set; } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ActivityLogAlertResource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ActivityLogAlertResource.cs index 7ac0862dc0358..916df32fce7c6 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ActivityLogAlertResource.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/ActivityLogAlertResource.cs @@ -30,7 +30,7 @@ public partial class ActivityLogAlertResource : ArmResource /// Generate the resource identifier of a instance. public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string activityLogAlertName) { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName}"; return new ResourceIdentifier(resourceId); } @@ -66,7 +66,7 @@ internal ActivityLogAlertResource(ArmClient client, ResourceIdentifier id) : bas } /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "microsoft.insights/activityLogAlerts"; + public static readonly ResourceType ResourceType = "Microsoft.Insights/activityLogAlerts"; /// Gets whether or not the current instance has data. public virtual bool HasData { get; } @@ -90,8 +90,8 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Get an activity log alert. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Get an Activity Log Alert rule. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_Get /// /// The cancellation token to use. @@ -114,8 +114,8 @@ public virtual async Task> GetAsync(Cancellat } /// - /// Get an activity log alert. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Get an Activity Log Alert rule. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_Get /// /// The cancellation token to use. @@ -138,8 +138,8 @@ public virtual Response Get(CancellationToken cancella } /// - /// Delete an activity log alert. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Delete an Activity Log Alert rule. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_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. @@ -164,8 +164,8 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Delete an activity log alert. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Delete an Activity Log Alert rule. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_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. @@ -190,8 +190,8 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_Update /// /// Parameters supplied to the operation. @@ -216,8 +216,8 @@ public virtual async Task> UpdateAsync(Activi } /// - /// Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_Update /// /// Parameters supplied to the operation. @@ -243,7 +243,7 @@ public virtual Response Update(ActivityLogAlertPatch p /// /// Add a tag to the current resource. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_Get /// /// The key for the tag. @@ -274,7 +274,7 @@ public virtual async Task> AddTagAsync(string /// /// Add a tag to the current resource. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_Get /// /// The key for the tag. @@ -305,7 +305,7 @@ public virtual Response AddTag(string key, string valu /// /// Replace the tags on the resource with the given set. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_Get /// /// The set of tags to use as replacement. @@ -335,7 +335,7 @@ public virtual async Task> SetTagsAsync(IDict /// /// Replace the tags on the resource with the given set. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_Get /// /// The set of tags to use as replacement. @@ -365,7 +365,7 @@ public virtual Response SetTags(IDictionary /// Removes a tag by key from the resource. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_Get /// /// The key for the tag. @@ -394,7 +394,7 @@ public virtual async Task> RemoveTagAsync(str /// /// Removes a tag by key from the resource. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_Get /// /// The key for the tag. diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/DataCollectionEndpointResource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/DataCollectionEndpointResource.cs index 0805c243b9f04..013db238b36a9 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/DataCollectionEndpointResource.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/DataCollectionEndpointResource.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.Globalization; +using System.Linq; using System.Threading; using System.Threading.Tasks; using Azure; @@ -36,6 +37,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _dataCollectionEndpointClientDiagnostics; private readonly DataCollectionEndpointsRestOperations _dataCollectionEndpointRestClient; + private readonly ClientDiagnostics _dataCollectionRuleAssociationClientDiagnostics; + private readonly DataCollectionRuleAssociationsRestOperations _dataCollectionRuleAssociationRestClient; private readonly DataCollectionEndpointData _data; /// Initializes a new instance of the class for mocking. @@ -60,6 +63,9 @@ internal DataCollectionEndpointResource(ArmClient client, ResourceIdentifier id) _dataCollectionEndpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Monitor", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string dataCollectionEndpointApiVersion); _dataCollectionEndpointRestClient = new DataCollectionEndpointsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataCollectionEndpointApiVersion); + _dataCollectionRuleAssociationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Monitor", DataCollectionRuleAssociationResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataCollectionRuleAssociationResource.ResourceType, out string dataCollectionRuleAssociationApiVersion); + _dataCollectionRuleAssociationRestClient = new DataCollectionRuleAssociationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataCollectionRuleAssociationApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -241,6 +247,90 @@ public virtual Response Update(ResourceForUpdate } } + /// + /// Lists associations for the specified data collection endpoint. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}/associations + /// Operation Id: DataCollectionRuleAssociations_ListByDataCollectionEndpoint + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDataCollectionRuleAssociationsAsync(CancellationToken cancellationToken = default) + { + async Task> FirstPageFunc(int? pageSizeHint) + { + using var scope = _dataCollectionRuleAssociationClientDiagnostics.CreateScope("DataCollectionEndpointResource.GetDataCollectionRuleAssociations"); + scope.Start(); + try + { + var response = await _dataCollectionRuleAssociationRestClient.ListByDataCollectionEndpointAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new DataCollectionRuleAssociationResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _dataCollectionRuleAssociationClientDiagnostics.CreateScope("DataCollectionEndpointResource.GetDataCollectionRuleAssociations"); + scope.Start(); + try + { + var response = await _dataCollectionRuleAssociationRestClient.ListByDataCollectionEndpointNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new DataCollectionRuleAssociationResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); + } + + /// + /// Lists associations for the specified data collection endpoint. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints/{dataCollectionEndpointName}/associations + /// Operation Id: DataCollectionRuleAssociations_ListByDataCollectionEndpoint + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDataCollectionRuleAssociations(CancellationToken cancellationToken = default) + { + Page FirstPageFunc(int? pageSizeHint) + { + using var scope = _dataCollectionRuleAssociationClientDiagnostics.CreateScope("DataCollectionEndpointResource.GetDataCollectionRuleAssociations"); + scope.Start(); + try + { + var response = _dataCollectionRuleAssociationRestClient.ListByDataCollectionEndpoint(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new DataCollectionRuleAssociationResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = _dataCollectionRuleAssociationClientDiagnostics.CreateScope("DataCollectionEndpointResource.GetDataCollectionRuleAssociations"); + scope.Start(); + try + { + var response = _dataCollectionRuleAssociationRestClient.ListByDataCollectionEndpointNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new DataCollectionRuleAssociationResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); + } + /// /// Add a tag to the current resource. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/dataCollectionEndpoints/{dataCollectionEndpointName} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorExtensions.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorExtensions.cs index 23b40f0534684..fbdcb26733727 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorExtensions.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/MonitorExtensions.cs @@ -195,7 +195,7 @@ public static Pageable GetAlertRules(this SubscriptionResourc /// The notification request body which includes the contact details. /// The cancellation token to use. /// is null. - public static async Task> PostTestNotificationsActionGroupAsync(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) + public static async Task PostTestNotificationsActionGroupAsync(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) { Argument.AssertNotNull(notificationRequest, nameof(notificationRequest)); @@ -212,7 +212,7 @@ public static async Task> PostTestNotific /// The notification request body which includes the contact details. /// The cancellation token to use. /// is null. - public static ArmOperation PostTestNotificationsActionGroup(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) + public static ArmOperation PostTestNotificationsActionGroup(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) { Argument.AssertNotNull(notificationRequest, nameof(notificationRequest)); @@ -396,8 +396,8 @@ public static Pageable GetPrivateLinkScopes(this Subsc } /// - /// Get a list of all activity log alerts in a subscription. - /// Request Path: /subscriptions/{subscriptionId}/providers/microsoft.insights/activityLogAlerts + /// Get a list of all Activity Log Alert rules in a subscription. + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Insights/activityLogAlerts /// Operation Id: ActivityLogAlerts_ListBySubscriptionId /// /// The instance the method will execute against. @@ -409,8 +409,8 @@ public static AsyncPageable GetActivityLogAlertsAsync( } /// - /// Get a list of all activity log alerts in a subscription. - /// Request Path: /subscriptions/{subscriptionId}/providers/microsoft.insights/activityLogAlerts + /// Get a list of all Activity Log Alert rules in a subscription. + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Insights/activityLogAlerts /// Operation Id: ActivityLogAlerts_ListBySubscriptionId /// /// The instance the method will execute against. @@ -731,12 +731,12 @@ public static ActivityLogAlertCollection GetActivityLogAlerts(this ResourceGroup } /// - /// Get an activity log alert. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Get an Activity Log Alert rule. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_Get /// /// The instance the method will execute against. - /// The name of the activity log alert. + /// The name of the Activity Log Alert rule. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -747,12 +747,12 @@ public static async Task> GetActivityLogAlert } /// - /// Get an activity log alert. - /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName} + /// Get an Activity Log Alert rule. + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/activityLogAlerts/{activityLogAlertName} /// Operation Id: ActivityLogAlerts_Get /// /// The instance the method will execute against. - /// The name of the activity log alert. + /// The name of the Activity Log Alert rule. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -842,6 +842,74 @@ public static Response GetDataCollectionRule(this Re return resourceGroupResource.GetDataCollectionRules().Get(dataCollectionRuleName, cancellationToken); } + /// + /// Send test notifications to a set of provided receivers + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/createNotifications + /// Operation Id: ActionGroups_CreateNotificationsAtResourceGroupLevel + /// + /// The instance the method will execute against. + /// 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 notification request body which includes the contact details. + /// The cancellation token to use. + /// is null. + public static async Task CreateNotificationsAtResourceGroupLevelActionGroupAsync(this ResourceGroupResource resourceGroupResource, WaitUntil waitUntil, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(notificationRequest, nameof(notificationRequest)); + + return await GetExtensionClient(resourceGroupResource).CreateNotificationsAtResourceGroupLevelActionGroupAsync(waitUntil, notificationRequest, cancellationToken).ConfigureAwait(false); + } + + /// + /// Send test notifications to a set of provided receivers + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/createNotifications + /// Operation Id: ActionGroups_CreateNotificationsAtResourceGroupLevel + /// + /// The instance the method will execute against. + /// 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 notification request body which includes the contact details. + /// The cancellation token to use. + /// is null. + public static ArmOperation CreateNotificationsAtResourceGroupLevelActionGroup(this ResourceGroupResource resourceGroupResource, WaitUntil waitUntil, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(notificationRequest, nameof(notificationRequest)); + + return GetExtensionClient(resourceGroupResource).CreateNotificationsAtResourceGroupLevelActionGroup(waitUntil, notificationRequest, cancellationToken); + } + + /// + /// Get the test notifications by the notification id + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/notificationStatus/{notificationId} + /// Operation Id: ActionGroups_GetTestNotificationsAtResourceGroupLevel + /// + /// The instance the method will execute against. + /// The notification id. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public static async Task> GetTestNotificationsAtResourceGroupLevelActionGroupAsync(this ResourceGroupResource resourceGroupResource, string notificationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(notificationId, nameof(notificationId)); + + return await GetExtensionClient(resourceGroupResource).GetTestNotificationsAtResourceGroupLevelActionGroupAsync(notificationId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the test notifications by the notification id + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/notificationStatus/{notificationId} + /// Operation Id: ActionGroups_GetTestNotificationsAtResourceGroupLevel + /// + /// The instance the method will execute against. + /// The notification id. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public static Response GetTestNotificationsAtResourceGroupLevelActionGroup(this ResourceGroupResource resourceGroupResource, string notificationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(notificationId, nameof(notificationId)); + + return GetExtensionClient(resourceGroupResource).GetTestNotificationsAtResourceGroupLevelActionGroup(notificationId, cancellationToken); + } + /// /// Get the status of an azure asynchronous operation associated with a private link scope operation. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopeOperationStatuses/{asyncOperationId} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs index 09a11a0b5d9bc..711ff504466c7 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs @@ -19,6 +19,8 @@ namespace Azure.ResourceManager.Monitor /// A class to add extension methods to ResourceGroupResource. internal partial class ResourceGroupResourceExtensionClient : ArmResource { + private ClientDiagnostics _actionGroupClientDiagnostics; + private ActionGroupsRestOperations _actionGroupRestClient; private ClientDiagnostics _privateLinkScopeOperationStatusClientDiagnostics; private PrivateLinkScopeOperationStatusRestOperations _privateLinkScopeOperationStatusRestClient; @@ -34,6 +36,8 @@ internal ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifi { } + private ClientDiagnostics ActionGroupClientDiagnostics => _actionGroupClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Monitor", ActionGroupResource.ResourceType.Namespace, Diagnostics); + private ActionGroupsRestOperations ActionGroupRestClient => _actionGroupRestClient ??= new ActionGroupsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ActionGroupResource.ResourceType)); private ClientDiagnostics PrivateLinkScopeOperationStatusClientDiagnostics => _privateLinkScopeOperationStatusClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Monitor", ProviderConstants.DefaultProviderNamespace, Diagnostics); private PrivateLinkScopeOperationStatusRestOperations PrivateLinkScopeOperationStatusRestClient => _privateLinkScopeOperationStatusRestClient ??= new PrivateLinkScopeOperationStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); @@ -106,6 +110,106 @@ public virtual DataCollectionRuleCollection GetDataCollectionRules() return GetCachedClient(Client => new DataCollectionRuleCollection(Client, Id)); } + /// + /// Send test notifications to a set of provided receivers + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/createNotifications + /// Operation Id: ActionGroups_CreateNotificationsAtResourceGroupLevel + /// + /// 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 notification request body which includes the contact details. + /// The cancellation token to use. + public virtual async Task CreateNotificationsAtResourceGroupLevelActionGroupAsync(WaitUntil waitUntil, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) + { + using var scope = ActionGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateNotificationsAtResourceGroupLevelActionGroup"); + scope.Start(); + try + { + var response = await ActionGroupRestClient.CreateNotificationsAtResourceGroupLevelAsync(Id.SubscriptionId, Id.ResourceGroupName, notificationRequest, cancellationToken).ConfigureAwait(false); + var operation = new MonitorArmOperation(ActionGroupClientDiagnostics, Pipeline, ActionGroupRestClient.CreateCreateNotificationsAtResourceGroupLevelRequest(Id.SubscriptionId, Id.ResourceGroupName, notificationRequest).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Send test notifications to a set of provided receivers + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/createNotifications + /// Operation Id: ActionGroups_CreateNotificationsAtResourceGroupLevel + /// + /// 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 notification request body which includes the contact details. + /// The cancellation token to use. + public virtual ArmOperation CreateNotificationsAtResourceGroupLevelActionGroup(WaitUntil waitUntil, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) + { + using var scope = ActionGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.CreateNotificationsAtResourceGroupLevelActionGroup"); + scope.Start(); + try + { + var response = ActionGroupRestClient.CreateNotificationsAtResourceGroupLevel(Id.SubscriptionId, Id.ResourceGroupName, notificationRequest, cancellationToken); + var operation = new MonitorArmOperation(ActionGroupClientDiagnostics, Pipeline, ActionGroupRestClient.CreateCreateNotificationsAtResourceGroupLevelRequest(Id.SubscriptionId, Id.ResourceGroupName, notificationRequest).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the test notifications by the notification id + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/notificationStatus/{notificationId} + /// Operation Id: ActionGroups_GetTestNotificationsAtResourceGroupLevel + /// + /// The notification id. + /// The cancellation token to use. + public virtual async Task> GetTestNotificationsAtResourceGroupLevelActionGroupAsync(string notificationId, CancellationToken cancellationToken = default) + { + using var scope = ActionGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetTestNotificationsAtResourceGroupLevelActionGroup"); + scope.Start(); + try + { + var response = await ActionGroupRestClient.GetTestNotificationsAtResourceGroupLevelAsync(Id.SubscriptionId, Id.ResourceGroupName, notificationId, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the test notifications by the notification id + /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insights/notificationStatus/{notificationId} + /// Operation Id: ActionGroups_GetTestNotificationsAtResourceGroupLevel + /// + /// The notification id. + /// The cancellation token to use. + public virtual Response GetTestNotificationsAtResourceGroupLevelActionGroup(string notificationId, CancellationToken cancellationToken = default) + { + using var scope = ActionGroupClientDiagnostics.CreateScope("ResourceGroupResourceExtensionClient.GetTestNotificationsAtResourceGroupLevelActionGroup"); + scope.Start(); + try + { + var response = ActionGroupRestClient.GetTestNotificationsAtResourceGroupLevel(Id.SubscriptionId, Id.ResourceGroupName, notificationId, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Get the status of an azure asynchronous operation associated with a private link scope operation. /// Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/privateLinkScopeOperationStatuses/{asyncOperationId} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs index 939b15050ae57..ade026fa41cc9 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs @@ -233,16 +233,16 @@ Page FirstPageFunc(int? pageSizeHint) /// 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 notification request body which includes the contact details. /// The cancellation token to use. - public virtual async Task> PostTestNotificationsActionGroupAsync(WaitUntil waitUntil, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) + public virtual async Task PostTestNotificationsActionGroupAsync(WaitUntil waitUntil, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) { using var scope = ActionGroupClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.PostTestNotificationsActionGroup"); scope.Start(); try { var response = await ActionGroupRestClient.PostTestNotificationsAsync(Id.SubscriptionId, notificationRequest, cancellationToken).ConfigureAwait(false); - var operation = new MonitorArmOperation(new TestNotificationResponseOperationSource(), ActionGroupClientDiagnostics, Pipeline, ActionGroupRestClient.CreatePostTestNotificationsRequest(Id.SubscriptionId, notificationRequest).Request, response, OperationFinalStateVia.Location); + var operation = new MonitorArmOperation(ActionGroupClientDiagnostics, Pipeline, ActionGroupRestClient.CreatePostTestNotificationsRequest(Id.SubscriptionId, notificationRequest).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; } catch (Exception e) @@ -260,16 +260,16 @@ public virtual async Task> PostTestNotifi /// 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 notification request body which includes the contact details. /// The cancellation token to use. - public virtual ArmOperation PostTestNotificationsActionGroup(WaitUntil waitUntil, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) + public virtual ArmOperation PostTestNotificationsActionGroup(WaitUntil waitUntil, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) { using var scope = ActionGroupClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.PostTestNotificationsActionGroup"); scope.Start(); try { var response = ActionGroupRestClient.PostTestNotifications(Id.SubscriptionId, notificationRequest, cancellationToken); - var operation = new MonitorArmOperation(new TestNotificationResponseOperationSource(), ActionGroupClientDiagnostics, Pipeline, ActionGroupRestClient.CreatePostTestNotificationsRequest(Id.SubscriptionId, notificationRequest).Request, response, OperationFinalStateVia.Location); + var operation = new MonitorArmOperation(ActionGroupClientDiagnostics, Pipeline, ActionGroupRestClient.CreatePostTestNotificationsRequest(Id.SubscriptionId, notificationRequest).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); + operation.WaitForCompletionResponse(cancellationToken); return operation; } catch (Exception e) @@ -662,8 +662,8 @@ Page NextPageFunc(string nextLink, int? pageSizeHint) } /// - /// Get a list of all activity log alerts in a subscription. - /// Request Path: /subscriptions/{subscriptionId}/providers/microsoft.insights/activityLogAlerts + /// Get a list of all Activity Log Alert rules in a subscription. + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Insights/activityLogAlerts /// Operation Id: ActivityLogAlerts_ListBySubscriptionId /// /// The cancellation token to use. @@ -677,7 +677,7 @@ async Task> FirstPageFunc(int? pageSizeHint) try { var response = await ActivityLogAlertRestClient.ListBySubscriptionIdAsync(Id.SubscriptionId, cancellationToken: cancellationToken).ConfigureAwait(false); - return Page.FromValues(response.Value.Value.Select(value => new ActivityLogAlertResource(Client, value)), null, response.GetRawResponse()); + return Page.FromValues(response.Value.Value.Select(value => new ActivityLogAlertResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -685,12 +685,27 @@ async Task> FirstPageFunc(int? pageSizeHint) throw; } } - return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, null); + async Task> NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = ActivityLogAlertClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetActivityLogAlerts"); + scope.Start(); + try + { + var response = await ActivityLogAlertRestClient.ListBySubscriptionIdNextPageAsync(nextLink, Id.SubscriptionId, cancellationToken: cancellationToken).ConfigureAwait(false); + return Page.FromValues(response.Value.Value.Select(value => new ActivityLogAlertResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc); } /// - /// Get a list of all activity log alerts in a subscription. - /// Request Path: /subscriptions/{subscriptionId}/providers/microsoft.insights/activityLogAlerts + /// Get a list of all Activity Log Alert rules in a subscription. + /// Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Insights/activityLogAlerts /// Operation Id: ActivityLogAlerts_ListBySubscriptionId /// /// The cancellation token to use. @@ -704,7 +719,7 @@ Page FirstPageFunc(int? pageSizeHint) try { var response = ActivityLogAlertRestClient.ListBySubscriptionId(Id.SubscriptionId, cancellationToken: cancellationToken); - return Page.FromValues(response.Value.Value.Select(value => new ActivityLogAlertResource(Client, value)), null, response.GetRawResponse()); + return Page.FromValues(response.Value.Value.Select(value => new ActivityLogAlertResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); } catch (Exception e) { @@ -712,7 +727,22 @@ Page FirstPageFunc(int? pageSizeHint) throw; } } - return PageableHelpers.CreateEnumerable(FirstPageFunc, null); + Page NextPageFunc(string nextLink, int? pageSizeHint) + { + using var scope = ActivityLogAlertClientDiagnostics.CreateScope("SubscriptionResourceExtensionClient.GetActivityLogAlerts"); + scope.Start(); + try + { + var response = ActivityLogAlertRestClient.ListBySubscriptionIdNextPage(nextLink, Id.SubscriptionId, cancellationToken: cancellationToken); + return Page.FromValues(response.Value.Value.Select(value => new ActivityLogAlertResource(Client, value)), response.Value.NextLink, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc); } /// diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/LongRunningOperation/TestNotificationResponseOperationSource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/LongRunningOperation/TestNotificationResponseOperationSource.cs deleted file mode 100644 index fff4027cbb4e9..0000000000000 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/LongRunningOperation/TestNotificationResponseOperationSource.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.ResourceManager.Monitor.Models; - -namespace Azure.ResourceManager.Monitor -{ - internal class TestNotificationResponseOperationSource : IOperationSource - { - TestNotificationResponse IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - return TestNotificationResponse.DeserializeTestNotificationResponse(document.RootElement); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - return TestNotificationResponse.DeserializeTestNotificationResponse(document.RootElement); - } - } -} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertActionGroup.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActionGroupProperties.Serialization.cs similarity index 87% rename from sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertActionGroup.Serialization.cs rename to sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActionGroupProperties.Serialization.cs index eecf03534288b..401aedd89fc11 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertActionGroup.Serialization.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActionGroupProperties.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Monitor.Models { - public partial class ActivityLogAlertActionGroup : IUtf8JsonSerializable + public partial class ActionGroupProperties : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -32,7 +32,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteEndObject(); } - internal static ActivityLogAlertActionGroup DeserializeActivityLogAlertActionGroup(JsonElement element) + internal static ActionGroupProperties DeserializeActionGroupProperties(JsonElement element) { string actionGroupId = default; Optional> webhookProperties = default; @@ -59,7 +59,7 @@ internal static ActivityLogAlertActionGroup DeserializeActivityLogAlertActionGro continue; } } - return new ActivityLogAlertActionGroup(actionGroupId, Optional.ToDictionary(webhookProperties)); + return new ActionGroupProperties(actionGroupId, Optional.ToDictionary(webhookProperties)); } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertActionGroup.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActionGroupProperties.cs similarity index 63% rename from sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertActionGroup.cs rename to sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActionGroupProperties.cs index 145fb3d3c8785..a35aac118f58e 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertActionGroup.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActionGroupProperties.cs @@ -12,12 +12,12 @@ namespace Azure.ResourceManager.Monitor.Models { /// A pointer to an Azure Action Group. - public partial class ActivityLogAlertActionGroup + public partial class ActionGroupProperties { - /// Initializes a new instance of ActivityLogAlertActionGroup. - /// The resourceId of the action group. This cannot be null or empty. + /// Initializes a new instance of ActionGroupProperties. + /// The resource ID of the Action Group. This cannot be null or empty. /// is null. - public ActivityLogAlertActionGroup(string actionGroupId) + public ActionGroupProperties(string actionGroupId) { if (actionGroupId == null) { @@ -28,16 +28,16 @@ public ActivityLogAlertActionGroup(string actionGroupId) WebhookProperties = new ChangeTrackingDictionary(); } - /// Initializes a new instance of ActivityLogAlertActionGroup. - /// The resourceId of the action group. This cannot be null or empty. + /// Initializes a new instance of ActionGroupProperties. + /// The resource ID of the Action Group. This cannot be null or empty. /// the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. - internal ActivityLogAlertActionGroup(string actionGroupId, IDictionary webhookProperties) + internal ActionGroupProperties(string actionGroupId, IDictionary webhookProperties) { ActionGroupId = actionGroupId; WebhookProperties = webhookProperties; } - /// The resourceId of the action group. This cannot be null or empty. + /// The resource ID of the Action Group. This cannot be null or empty. public string ActionGroupId { get; set; } /// the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. public IDictionary WebhookProperties { get; } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertActionList.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActionList.Serialization.cs similarity index 71% rename from sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertActionList.Serialization.cs rename to sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActionList.Serialization.cs index 6847f46a9ef54..a0dd5dfa97909 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertActionList.Serialization.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActionList.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Monitor.Models { - internal partial class ActivityLogAlertActionList : IUtf8JsonSerializable + internal partial class ActionList : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -29,9 +29,9 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteEndObject(); } - internal static ActivityLogAlertActionList DeserializeActivityLogAlertActionList(JsonElement element) + internal static ActionList DeserializeActionList(JsonElement element) { - Optional> actionGroups = default; + Optional> actionGroups = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("actionGroups")) @@ -41,16 +41,16 @@ internal static ActivityLogAlertActionList DeserializeActivityLogAlertActionList property.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ActivityLogAlertActionGroup.DeserializeActivityLogAlertActionGroup(item)); + array.Add(ActionGroupProperties.DeserializeActionGroupProperties(item)); } actionGroups = array; continue; } } - return new ActivityLogAlertActionList(Optional.ToList(actionGroups)); + return new ActionList(Optional.ToList(actionGroups)); } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActionList.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActionList.cs new file mode 100644 index 0000000000000..e1617a5d29622 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActionList.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// A list of Activity Log Alert rule actions. + internal partial class ActionList + { + /// Initializes a new instance of ActionList. + public ActionList() + { + ActionGroups = new ChangeTrackingList(); + } + + /// Initializes a new instance of ActionList. + /// The list of the Action Groups. + internal ActionList(IList actionGroups) + { + ActionGroups = actionGroups; + } + + /// The list of the Action Groups. + public IList ActionGroups { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertActionList.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertActionList.cs deleted file mode 100644 index 8e53580ae32f9..0000000000000 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertActionList.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.Monitor.Models -{ - /// A list of activity log alert actions. - internal partial class ActivityLogAlertActionList - { - /// Initializes a new instance of ActivityLogAlertActionList. - public ActivityLogAlertActionList() - { - ActionGroups = new ChangeTrackingList(); - } - - /// Initializes a new instance of ActivityLogAlertActionList. - /// The list of activity log alerts. - internal ActivityLogAlertActionList(IList actionGroups) - { - ActionGroups = actionGroups; - } - - /// The list of activity log alerts. - public IList ActionGroups { get; } - } -} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertAllOfCondition.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertAllOfCondition.cs deleted file mode 100644 index 034cf9525f949..0000000000000 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertAllOfCondition.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Azure.ResourceManager.Monitor.Models -{ - /// An Activity Log alert condition that is met when all its member conditions are met. - internal partial class ActivityLogAlertAllOfCondition - { - /// Initializes a new instance of ActivityLogAlertAllOfCondition. - /// The list of activity log alert conditions. - /// is null. - public ActivityLogAlertAllOfCondition(IEnumerable allOf) - { - if (allOf == null) - { - throw new ArgumentNullException(nameof(allOf)); - } - - AllOf = allOf.ToList(); - } - - /// Initializes a new instance of ActivityLogAlertAllOfCondition. - /// The list of activity log alert conditions. - internal ActivityLogAlertAllOfCondition(IList allOf) - { - AllOf = allOf; - } - - /// The list of activity log alert conditions. - public IList AllOf { get; } - } -} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertData.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertData.Serialization.cs index 401c086160d25..7cebbbd143ba3 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertData.Serialization.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertData.Serialization.cs @@ -40,11 +40,6 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } - if (Optional.IsDefined(Enabled)) - { - writer.WritePropertyName("enabled"); - writer.WriteBooleanValue(Enabled.Value); - } if (Optional.IsDefined(Condition)) { writer.WritePropertyName("condition"); @@ -52,15 +47,13 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } if (Optional.IsDefined(Actions)) { - if (Actions != null) - { - writer.WritePropertyName("actions"); - writer.WriteObjectValue(Actions); - } - else - { - writer.WriteNull("actions"); - } + writer.WritePropertyName("actions"); + writer.WriteObjectValue(Actions); + } + if (Optional.IsDefined(Enabled)) + { + writer.WritePropertyName("enabled"); + writer.WriteBooleanValue(Enabled.Value); } if (Optional.IsDefined(Description)) { @@ -80,9 +73,9 @@ internal static ActivityLogAlertData DeserializeActivityLogAlertData(JsonElement ResourceType type = default; SystemData systemData = default; Optional> scopes = default; + Optional condition = default; + Optional actions = default; Optional enabled = default; - Optional condition = default; - Optional actions = default; Optional description = default; foreach (var property in element.EnumerateObject()) { @@ -145,34 +138,34 @@ internal static ActivityLogAlertData DeserializeActivityLogAlertData(JsonElement scopes = array; continue; } - if (property0.NameEquals("enabled")) + if (property0.NameEquals("condition")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } - enabled = property0.Value.GetBoolean(); + condition = AlertRuleAllOfCondition.DeserializeAlertRuleAllOfCondition(property0.Value); continue; } - if (property0.NameEquals("condition")) + if (property0.NameEquals("actions")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } - condition = ActivityLogAlertAllOfCondition.DeserializeActivityLogAlertAllOfCondition(property0.Value); + actions = ActionList.DeserializeActionList(property0.Value); continue; } - if (property0.NameEquals("actions")) + if (property0.NameEquals("enabled")) { if (property0.Value.ValueKind == JsonValueKind.Null) { - actions = null; + property0.ThrowNonNullablePropertyIsNull(); continue; } - actions = ActivityLogAlertActionList.DeserializeActivityLogAlertActionList(property0.Value); + enabled = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("description")) @@ -184,7 +177,7 @@ internal static ActivityLogAlertData DeserializeActivityLogAlertData(JsonElement continue; } } - return new ActivityLogAlertData(id, name, type, systemData, tags, location, Optional.ToList(scopes), Optional.ToNullable(enabled), condition.Value, actions.Value, description.Value); + return new ActivityLogAlertData(id, name, type, systemData, tags, location, Optional.ToList(scopes), condition.Value, actions.Value, Optional.ToNullable(enabled), description.Value); } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertLeafCondition.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertLeafCondition.Serialization.cs deleted file mode 100644 index cbb9a9850c8ee..0000000000000 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertLeafCondition.Serialization.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.Monitor.Models -{ - public partial class ActivityLogAlertLeafCondition : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - writer.WritePropertyName("field"); - writer.WriteStringValue(Field); - writer.WritePropertyName("equals"); - writer.WriteStringValue(EqualsValue); - writer.WriteEndObject(); - } - - internal static ActivityLogAlertLeafCondition DeserializeActivityLogAlertLeafCondition(JsonElement element) - { - string field = default; - string @equals = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("field")) - { - field = property.Value.GetString(); - continue; - } - if (property.NameEquals("equals")) - { - @equals = property.Value.GetString(); - continue; - } - } - return new ActivityLogAlertLeafCondition(field, @equals); - } - } -} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertLeafCondition.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertLeafCondition.cs deleted file mode 100644 index 985e9c6e2924c..0000000000000 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertLeafCondition.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.Monitor.Models -{ - /// An Activity Log alert condition that is met by comparing an activity log field and value. - public partial class ActivityLogAlertLeafCondition - { - /// Initializes a new instance of ActivityLogAlertLeafCondition. - /// The name of the field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties.'. - /// The field value will be compared to this value (case-insensitive) to determine if the condition is met. - /// or is null. - public ActivityLogAlertLeafCondition(string field, string equalsValue) - { - if (field == null) - { - throw new ArgumentNullException(nameof(field)); - } - if (equalsValue == null) - { - throw new ArgumentNullException(nameof(equalsValue)); - } - - Field = field; - EqualsValue = equalsValue; - } - - /// The name of the field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties.'. - public string Field { get; set; } - /// The field value will be compared to this value (case-insensitive) to determine if the condition is met. - public string EqualsValue { get; set; } - } -} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertPatch.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertPatch.cs index d2d62561b4b12..04a56457bd43e 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertPatch.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertPatch.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Monitor.Models { - /// An activity log alert object for the body of patch operations. + /// An Activity Log Alert rule object for the body of patch operations. public partial class ActivityLogAlertPatch { /// Initializes a new instance of ActivityLogAlertPatch. @@ -19,9 +19,9 @@ public ActivityLogAlertPatch() Tags = new ChangeTrackingDictionary(); } - /// Resource tags. + /// The resource tags. public IDictionary Tags { get; } - /// Indicates whether this activity log alert is enabled. If an activity log alert is not enabled, then none of its actions will be activated. + /// Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated. public bool? Enabled { get; set; } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertAllOfCondition.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleAllOfCondition.Serialization.cs similarity index 65% rename from sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertAllOfCondition.Serialization.cs rename to sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleAllOfCondition.Serialization.cs index 22f94401eba09..834602270701b 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertAllOfCondition.Serialization.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleAllOfCondition.Serialization.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Monitor.Models { - internal partial class ActivityLogAlertAllOfCondition : IUtf8JsonSerializable + internal partial class AlertRuleAllOfCondition : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -26,23 +26,23 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteEndObject(); } - internal static ActivityLogAlertAllOfCondition DeserializeActivityLogAlertAllOfCondition(JsonElement element) + internal static AlertRuleAllOfCondition DeserializeAlertRuleAllOfCondition(JsonElement element) { - IList allOf = default; + IList allOf = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("allOf")) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ActivityLogAlertLeafCondition.DeserializeActivityLogAlertLeafCondition(item)); + array.Add(AlertRuleAnyOfOrLeafCondition.DeserializeAlertRuleAnyOfOrLeafCondition(item)); } allOf = array; continue; } } - return new ActivityLogAlertAllOfCondition(allOf); + return new AlertRuleAllOfCondition(allOf); } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleAllOfCondition.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleAllOfCondition.cs new file mode 100644 index 0000000000000..f9406b7521a8d --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleAllOfCondition.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// An Activity Log Alert rule condition that is met when all its member conditions are met. + internal partial class AlertRuleAllOfCondition + { + /// Initializes a new instance of AlertRuleAllOfCondition. + /// The list of Activity Log Alert rule conditions. + /// is null. + public AlertRuleAllOfCondition(IEnumerable allOf) + { + if (allOf == null) + { + throw new ArgumentNullException(nameof(allOf)); + } + + AllOf = allOf.ToList(); + } + + /// Initializes a new instance of AlertRuleAllOfCondition. + /// The list of Activity Log Alert rule conditions. + internal AlertRuleAllOfCondition(IList allOf) + { + AllOf = allOf; + } + + /// The list of Activity Log Alert rule conditions. + public IList AllOf { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleAnyOfOrLeafCondition.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleAnyOfOrLeafCondition.Serialization.cs new file mode 100644 index 0000000000000..9d26b2cbfdbf8 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleAnyOfOrLeafCondition.Serialization.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class AlertRuleAnyOfOrLeafCondition : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(AnyOf)) + { + writer.WritePropertyName("anyOf"); + writer.WriteStartArray(); + foreach (var item in AnyOf) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Field)) + { + writer.WritePropertyName("field"); + writer.WriteStringValue(Field); + } + if (Optional.IsDefined(EqualsValue)) + { + writer.WritePropertyName("equals"); + writer.WriteStringValue(EqualsValue); + } + if (Optional.IsCollectionDefined(ContainsAny)) + { + writer.WritePropertyName("containsAny"); + writer.WriteStartArray(); + foreach (var item in ContainsAny) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static AlertRuleAnyOfOrLeafCondition DeserializeAlertRuleAnyOfOrLeafCondition(JsonElement element) + { + Optional> anyOf = default; + Optional field = default; + Optional @equals = default; + Optional> containsAny = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("anyOf")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeAlertRuleLeafCondition(item)); + } + anyOf = array; + continue; + } + if (property.NameEquals("field")) + { + field = property.Value.GetString(); + continue; + } + if (property.NameEquals("equals")) + { + @equals = property.Value.GetString(); + continue; + } + if (property.NameEquals("containsAny")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + containsAny = array; + continue; + } + } + return new AlertRuleAnyOfOrLeafCondition(field.Value, @equals.Value, Optional.ToList(containsAny), Optional.ToList(anyOf)); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleAnyOfOrLeafCondition.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleAnyOfOrLeafCondition.cs new file mode 100644 index 0000000000000..bb43decda02f6 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleAnyOfOrLeafCondition.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// + /// An Activity Log Alert rule condition that is met when all its member conditions are met. + /// Each condition can be of one of the following types: + /// __Important__: Each type has its unique subset of properties. Properties from different types CANNOT exist in one condition. + /// * __Leaf Condition -__ must contain 'field' and either 'equals' or 'containsAny'. + /// _Please note, 'anyOf' should __not__ be set in a Leaf Condition._ + /// * __AnyOf Condition -__ must contain __only__ 'anyOf' (which is an array of Leaf Conditions). + /// _Please note, 'field', 'equals' and 'containsAny' should __not__ be set in an AnyOf Condition._ + /// + /// + public partial class AlertRuleAnyOfOrLeafCondition : AlertRuleLeafCondition + { + /// Initializes a new instance of AlertRuleAnyOfOrLeafCondition. + public AlertRuleAnyOfOrLeafCondition() + { + AnyOf = new ChangeTrackingList(); + } + + /// Initializes a new instance of AlertRuleAnyOfOrLeafCondition. + /// + /// The name of the Activity Log event's field that this condition will examine. + /// The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. + /// + /// The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. + /// The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + /// An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. + internal AlertRuleAnyOfOrLeafCondition(string field, string equalsValue, IList containsAny, IList anyOf) : base(field, equalsValue, containsAny) + { + AnyOf = anyOf; + } + + /// An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. + public IList AnyOf { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleLeafCondition.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleLeafCondition.Serialization.cs new file mode 100644 index 0000000000000..135f24680f733 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleLeafCondition.Serialization.cs @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + public partial class AlertRuleLeafCondition : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Field)) + { + writer.WritePropertyName("field"); + writer.WriteStringValue(Field); + } + if (Optional.IsDefined(EqualsValue)) + { + writer.WritePropertyName("equals"); + writer.WriteStringValue(EqualsValue); + } + if (Optional.IsCollectionDefined(ContainsAny)) + { + writer.WritePropertyName("containsAny"); + writer.WriteStartArray(); + foreach (var item in ContainsAny) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + + internal static AlertRuleLeafCondition DeserializeAlertRuleLeafCondition(JsonElement element) + { + Optional field = default; + Optional @equals = default; + Optional> containsAny = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("field")) + { + field = property.Value.GetString(); + continue; + } + if (property.NameEquals("equals")) + { + @equals = property.Value.GetString(); + continue; + } + if (property.NameEquals("containsAny")) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + containsAny = array; + continue; + } + } + return new AlertRuleLeafCondition(field.Value, @equals.Value, Optional.ToList(containsAny)); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleLeafCondition.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleLeafCondition.cs new file mode 100644 index 0000000000000..eaa05a5ca8894 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleLeafCondition.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// + /// An Activity Log Alert rule condition that is met by comparing the field and value of an Activity Log event. + /// This condition must contain 'field' and either 'equals' or 'containsAny'. + /// + public partial class AlertRuleLeafCondition + { + /// Initializes a new instance of AlertRuleLeafCondition. + public AlertRuleLeafCondition() + { + ContainsAny = new ChangeTrackingList(); + } + + /// Initializes a new instance of AlertRuleLeafCondition. + /// + /// The name of the Activity Log event's field that this condition will examine. + /// The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. + /// + /// The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. + /// The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + internal AlertRuleLeafCondition(string field, string equalsValue, IList containsAny) + { + Field = field; + EqualsValue = equalsValue; + ContainsAny = containsAny; + } + + /// + /// The name of the Activity Log event's field that this condition will examine. + /// The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. + /// + public string Field { get; set; } + /// The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. + public string EqualsValue { get; set; } + /// The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. + public IList ContainsAny { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertList.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleList.Serialization.cs similarity index 85% rename from sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertList.Serialization.cs rename to sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleList.Serialization.cs index 2c43c6f1650ac..d93a8c634b04f 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertList.Serialization.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleList.Serialization.cs @@ -12,9 +12,9 @@ namespace Azure.ResourceManager.Monitor.Models { - internal partial class ActivityLogAlertList + internal partial class AlertRuleList { - internal static ActivityLogAlertList DeserializeActivityLogAlertList(JsonElement element) + internal static AlertRuleList DeserializeAlertRuleList(JsonElement element) { Optional> value = default; Optional nextLink = default; @@ -41,7 +41,7 @@ internal static ActivityLogAlertList DeserializeActivityLogAlertList(JsonElement continue; } } - return new ActivityLogAlertList(Optional.ToList(value), nextLink.Value); + return new AlertRuleList(Optional.ToList(value), nextLink.Value); } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertList.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleList.cs similarity index 57% rename from sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertList.cs rename to sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleList.cs index ce08b6c1131fc..c6892232829e9 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ActivityLogAlertList.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/AlertRuleList.cs @@ -11,25 +11,25 @@ namespace Azure.ResourceManager.Monitor.Models { - /// A list of activity log alerts. - internal partial class ActivityLogAlertList + /// A list of Activity Log Alert rules. + internal partial class AlertRuleList { - /// Initializes a new instance of ActivityLogAlertList. - internal ActivityLogAlertList() + /// Initializes a new instance of AlertRuleList. + internal AlertRuleList() { Value = new ChangeTrackingList(); } - /// Initializes a new instance of ActivityLogAlertList. - /// The list of activity log alerts. + /// Initializes a new instance of AlertRuleList. + /// The list of Activity Log Alert rules. /// Provides the link to retrieve the next set of elements. - internal ActivityLogAlertList(IReadOnlyList value, string nextLink) + internal AlertRuleList(IReadOnlyList value, string nextLink) { Value = value; NextLink = nextLink; } - /// The list of activity log alerts. + /// The list of Activity Log Alert rules. public IReadOnlyList Value { get; } /// Provides the link to retrieve the next set of elements. public string NextLink { get; } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ColumnDefinition.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ColumnDefinition.cs new file mode 100644 index 0000000000000..c500587a21c3a --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ColumnDefinition.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Definition of custom data column. + internal partial class ColumnDefinition + { + /// Initializes a new instance of ColumnDefinition. + internal ColumnDefinition() + { + } + + /// The name of the column. + public string Name { get; } + /// The type of the column data. + public KnownColumnDefinitionType? KnownColumnDefinitionType { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/DataFlow.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/DataFlow.cs index abb21614379aa..3b551aa92f38d 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/DataFlow.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/DataFlow.cs @@ -24,5 +24,9 @@ internal DataFlow() public IReadOnlyList Streams { get; } /// List of destinations for this data flow. public IReadOnlyList Destinations { get; } + /// The KQL query to transform stream data. + public string TransformKql { get; } + /// The output stream of the transform. Only required if the transform changes data to a different stream. + public string OutputStream { get; } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/DataSourcesSpec.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/DataSourcesSpec.cs index adb6f636a17a9..a0e0e168b8255 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/DataSourcesSpec.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/DataSourcesSpec.cs @@ -20,6 +20,8 @@ internal DataSourcesSpec() WindowsEventLogs = new ChangeTrackingList(); Syslog = new ChangeTrackingList(); Extensions = new ChangeTrackingList(); + LogFiles = new ChangeTrackingList(); + IisLogs = new ChangeTrackingList(); } /// The list of performance counter data source configurations. @@ -30,5 +32,9 @@ internal DataSourcesSpec() public IReadOnlyList Syslog { get; } /// The list of Azure VM extension data source configurations. public IReadOnlyList Extensions { get; } + /// The list of Log files source configurations. + public IReadOnlyList LogFiles { get; } + /// The list of IIS logs source configurations. + public IReadOnlyList IisLogs { get; } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ErrorResponseAutoGenerated.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ErrorResponseAutoGenerated.Serialization.cs new file mode 100644 index 0000000000000..99058d6ed2fbd --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ErrorResponseAutoGenerated.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + internal partial class ErrorResponseAutoGenerated + { + internal static ErrorResponseAutoGenerated DeserializeErrorResponseAutoGenerated(JsonElement element) + { + Optional code = default; + Optional message = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code")) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message")) + { + message = property.Value.GetString(); + continue; + } + } + return new ErrorResponseAutoGenerated(code.Value, message.Value); + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ErrorResponseAutoGenerated.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ErrorResponseAutoGenerated.cs new file mode 100644 index 0000000000000..9d32cbdc66a74 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/ErrorResponseAutoGenerated.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Monitor.Models +{ + /// The error response. + internal partial class ErrorResponseAutoGenerated + { + /// Initializes a new instance of ErrorResponseAutoGenerated. + internal ErrorResponseAutoGenerated() + { + } + + /// Initializes a new instance of ErrorResponseAutoGenerated. + /// The error code. + /// The error message indicating why the operation failed. + internal ErrorResponseAutoGenerated(string code, string message) + { + Code = code; + Message = message; + } + + /// The error code. + public string Code { get; } + /// The error message indicating why the operation failed. + public string Message { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/IisLogsDataSource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/IisLogsDataSource.cs new file mode 100644 index 0000000000000..928bcbfba3329 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/IisLogsDataSource.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Enables IIS logs to be collected by this data collection rule. + internal partial class IisLogsDataSource + { + /// Initializes a new instance of IisLogsDataSource. + /// IIS streams. + /// is null. + internal IisLogsDataSource(IEnumerable streams) + { + if (streams == null) + { + throw new ArgumentNullException(nameof(streams)); + } + + Streams = streams.ToList(); + LogDirectories = new ChangeTrackingList(); + } + + /// IIS streams. + public IReadOnlyList Streams { get; } + /// Absolute paths file location. + public IReadOnlyList LogDirectories { get; } + /// + /// A friendly name for the data source. + /// This name should be unique across all data sources (regardless of type) within the data collection rule. + /// + public string Name { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/KnownColumnDefinitionType.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/KnownColumnDefinitionType.cs new file mode 100644 index 0000000000000..706e982a342e3 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/KnownColumnDefinitionType.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// The type of the column data. + internal readonly partial struct KnownColumnDefinitionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public KnownColumnDefinitionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StringValue = "string"; + private const string IntValue = "int"; + private const string LongValue = "long"; + private const string RealValue = "real"; + private const string BooleanValue = "boolean"; + private const string DatetimeValue = "datetime"; + private const string DynamicValue = "dynamic"; + + /// string. + public static KnownColumnDefinitionType String { get; } = new KnownColumnDefinitionType(StringValue); + /// int. + public static KnownColumnDefinitionType Int { get; } = new KnownColumnDefinitionType(IntValue); + /// long. + public static KnownColumnDefinitionType Long { get; } = new KnownColumnDefinitionType(LongValue); + /// real. + public static KnownColumnDefinitionType Real { get; } = new KnownColumnDefinitionType(RealValue); + /// boolean. + public static KnownColumnDefinitionType Boolean { get; } = new KnownColumnDefinitionType(BooleanValue); + /// datetime. + public static KnownColumnDefinitionType Datetime { get; } = new KnownColumnDefinitionType(DatetimeValue); + /// dynamic. + public static KnownColumnDefinitionType Dynamic { get; } = new KnownColumnDefinitionType(DynamicValue); + /// Determines if two values are the same. + public static bool operator ==(KnownColumnDefinitionType left, KnownColumnDefinitionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(KnownColumnDefinitionType left, KnownColumnDefinitionType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator KnownColumnDefinitionType(string value) => new KnownColumnDefinitionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is KnownColumnDefinitionType other && Equals(other); + /// + public bool Equals(KnownColumnDefinitionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/KnownLogFileTextSettingsRecordStartTimestampFormat.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/KnownLogFileTextSettingsRecordStartTimestampFormat.cs new file mode 100644 index 0000000000000..16b07810cece3 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/KnownLogFileTextSettingsRecordStartTimestampFormat.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// One of the supported timestamp formats. + internal readonly partial struct KnownLogFileTextSettingsRecordStartTimestampFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public KnownLogFileTextSettingsRecordStartTimestampFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ISO8601Value = "ISO 8601"; + private const string YyyyMMDDHHMMSSValue = "YYYY-MM-DD HH:MM:SS"; + private const string MDYyyyHHMMSSAMPMValue = "M/D/YYYY HH:MM:SS AM/PM"; + private const string MonDDYyyyHHMMSSValue = "Mon DD, YYYY HH:MM:SS"; + private const string YyMMddHHMmSsValue = "yyMMdd HH:mm:ss"; + private const string DdMMyyHHMmSsValue = "ddMMyy HH:mm:ss"; + private const string MMMDHhMmSsValue = "MMM d hh:mm:ss"; + private const string DdMMMYyyyHHMmSsZzzValue = "dd/MMM/yyyy:HH:mm:ss zzz"; + private const string YyyyMMDdTHHMmSsKValue = "yyyy-MM-ddTHH:mm:ssK"; + + /// ISO 8601. + public static KnownLogFileTextSettingsRecordStartTimestampFormat ISO8601 { get; } = new KnownLogFileTextSettingsRecordStartTimestampFormat(ISO8601Value); + /// YYYY-MM-DD HH:MM:SS. + public static KnownLogFileTextSettingsRecordStartTimestampFormat YyyyMMDDHHMMSS { get; } = new KnownLogFileTextSettingsRecordStartTimestampFormat(YyyyMMDDHHMMSSValue); + /// M/D/YYYY HH:MM:SS AM/PM. + public static KnownLogFileTextSettingsRecordStartTimestampFormat MDYyyyHHMMSSAMPM { get; } = new KnownLogFileTextSettingsRecordStartTimestampFormat(MDYyyyHHMMSSAMPMValue); + /// Mon DD, YYYY HH:MM:SS. + public static KnownLogFileTextSettingsRecordStartTimestampFormat MonDDYyyyHHMMSS { get; } = new KnownLogFileTextSettingsRecordStartTimestampFormat(MonDDYyyyHHMMSSValue); + /// yyMMdd HH:mm:ss. + public static KnownLogFileTextSettingsRecordStartTimestampFormat YyMMddHHMmSs { get; } = new KnownLogFileTextSettingsRecordStartTimestampFormat(YyMMddHHMmSsValue); + /// ddMMyy HH:mm:ss. + public static KnownLogFileTextSettingsRecordStartTimestampFormat DdMMyyHHMmSs { get; } = new KnownLogFileTextSettingsRecordStartTimestampFormat(DdMMyyHHMmSsValue); + /// MMM d hh:mm:ss. + public static KnownLogFileTextSettingsRecordStartTimestampFormat MMMDHhMmSs { get; } = new KnownLogFileTextSettingsRecordStartTimestampFormat(MMMDHhMmSsValue); + /// dd/MMM/yyyy:HH:mm:ss zzz. + public static KnownLogFileTextSettingsRecordStartTimestampFormat DdMMMYyyyHHMmSsZzz { get; } = new KnownLogFileTextSettingsRecordStartTimestampFormat(DdMMMYyyyHHMmSsZzzValue); + /// yyyy-MM-ddTHH:mm:ssK. + public static KnownLogFileTextSettingsRecordStartTimestampFormat YyyyMMDdTHHMmSsK { get; } = new KnownLogFileTextSettingsRecordStartTimestampFormat(YyyyMMDdTHHMmSsKValue); + /// Determines if two values are the same. + public static bool operator ==(KnownLogFileTextSettingsRecordStartTimestampFormat left, KnownLogFileTextSettingsRecordStartTimestampFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(KnownLogFileTextSettingsRecordStartTimestampFormat left, KnownLogFileTextSettingsRecordStartTimestampFormat right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator KnownLogFileTextSettingsRecordStartTimestampFormat(string value) => new KnownLogFileTextSettingsRecordStartTimestampFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is KnownLogFileTextSettingsRecordStartTimestampFormat other && Equals(other); + /// + public bool Equals(KnownLogFileTextSettingsRecordStartTimestampFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/KnownLogFilesDataSourceFormat.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/KnownLogFilesDataSourceFormat.cs new file mode 100644 index 0000000000000..9bb4d379d6f2d --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/KnownLogFilesDataSourceFormat.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// The data format of the log files. + internal readonly partial struct KnownLogFilesDataSourceFormat : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public KnownLogFilesDataSourceFormat(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string TextValue = "text"; + + /// text. + public static KnownLogFilesDataSourceFormat Text { get; } = new KnownLogFilesDataSourceFormat(TextValue); + /// Determines if two values are the same. + public static bool operator ==(KnownLogFilesDataSourceFormat left, KnownLogFilesDataSourceFormat right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(KnownLogFilesDataSourceFormat left, KnownLogFilesDataSourceFormat right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator KnownLogFilesDataSourceFormat(string value) => new KnownLogFilesDataSourceFormat(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is KnownLogFilesDataSourceFormat other && Equals(other); + /// + public bool Equals(KnownLogFilesDataSourceFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogFileSettings.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogFileSettings.cs new file mode 100644 index 0000000000000..049df7880c2f0 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogFileSettings.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Settings for different log file formats. + internal partial class LogFileSettings + { + /// Initializes a new instance of LogFileSettings. + internal LogFileSettings() + { + } + + /// Text settings. + internal LogFileSettingsText Text { get; } + /// One of the supported timestamp formats. + public KnownLogFileTextSettingsRecordStartTimestampFormat? TextRecordStartTimestampFormat + { + get => Text?.RecordStartTimestampFormat; + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogFileSettingsText.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogFileSettingsText.cs new file mode 100644 index 0000000000000..4cf78a36f4063 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogFileSettingsText.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Text settings. + internal partial class LogFileSettingsText : LogFileTextSettings + { + /// Initializes a new instance of LogFileSettingsText. + /// One of the supported timestamp formats. + internal LogFileSettingsText(KnownLogFileTextSettingsRecordStartTimestampFormat recordStartTimestampFormat) : base(recordStartTimestampFormat) + { + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogFileTextSettings.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogFileTextSettings.cs new file mode 100644 index 0000000000000..98a9b2df62711 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogFileTextSettings.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Settings for text log files. + internal partial class LogFileTextSettings + { + /// Initializes a new instance of LogFileTextSettings. + /// One of the supported timestamp formats. + internal LogFileTextSettings(KnownLogFileTextSettingsRecordStartTimestampFormat recordStartTimestampFormat) + { + RecordStartTimestampFormat = recordStartTimestampFormat; + } + + /// One of the supported timestamp formats. + public KnownLogFileTextSettingsRecordStartTimestampFormat RecordStartTimestampFormat { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogFilesDataSource.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogFilesDataSource.cs new file mode 100644 index 0000000000000..eeb7269400d59 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogFilesDataSource.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Definition of which custom log files will be collected by this data collection rule. + internal partial class LogFilesDataSource + { + /// Initializes a new instance of LogFilesDataSource. + /// + /// List of streams that this data source will be sent to. + /// A stream indicates what schema will be used for this data source + /// + /// File Patterns where the log files are located. + /// The data format of the log files. + /// or is null. + internal LogFilesDataSource(IEnumerable streams, IEnumerable filePatterns, KnownLogFilesDataSourceFormat format) + { + if (streams == null) + { + throw new ArgumentNullException(nameof(streams)); + } + if (filePatterns == null) + { + throw new ArgumentNullException(nameof(filePatterns)); + } + + Streams = streams.ToList(); + FilePatterns = filePatterns.ToList(); + Format = format; + } + + /// + /// List of streams that this data source will be sent to. + /// A stream indicates what schema will be used for this data source + /// + public IReadOnlyList Streams { get; } + /// File Patterns where the log files are located. + public IReadOnlyList FilePatterns { get; } + /// The data format of the log files. + public KnownLogFilesDataSourceFormat Format { get; } + /// The log files specific settings. + internal LogFilesDataSourceSettings Settings { get; } + /// One of the supported timestamp formats. + public KnownLogFileTextSettingsRecordStartTimestampFormat? TextRecordStartTimestampFormat + { + get => Settings?.TextRecordStartTimestampFormat; + } + + /// + /// A friendly name for the data source. + /// This name should be unique across all data sources (regardless of type) within the data collection rule. + /// + public string Name { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogFilesDataSourceSettings.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogFilesDataSourceSettings.cs new file mode 100644 index 0000000000000..09e33062edc70 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/LogFilesDataSourceSettings.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Monitor.Models +{ + /// The log files specific settings. + internal partial class LogFilesDataSourceSettings : LogFileSettings + { + /// Initializes a new instance of LogFilesDataSourceSettings. + internal LogFilesDataSourceSettings() + { + } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/Metadata.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/Metadata.cs new file mode 100644 index 0000000000000..335ba3c6e8cbb --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/Metadata.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Metadata about the resource. + internal partial class Metadata + { + /// Initializes a new instance of Metadata. + internal Metadata() + { + } + + /// Azure offering managing this resource on-behalf-of customer. + public string ProvisionedBy { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/StreamDeclaration.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/StreamDeclaration.cs new file mode 100644 index 0000000000000..c19133eee2b76 --- /dev/null +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/StreamDeclaration.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Monitor.Models +{ + /// Declaration of a custom stream. + internal partial class StreamDeclaration + { + /// Initializes a new instance of StreamDeclaration. + internal StreamDeclaration() + { + Columns = new ChangeTrackingList(); + } + + /// List of columns used by data in this stream. + public IReadOnlyList Columns { get; } + } +} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TestNotificationResponse.Serialization.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TestNotificationResponse.Serialization.cs deleted file mode 100644 index e887676da6d17..0000000000000 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TestNotificationResponse.Serialization.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.Monitor.Models -{ - public partial class TestNotificationResponse - { - internal static TestNotificationResponse DeserializeTestNotificationResponse(JsonElement element) - { - string notificationId = default; - string correlationId = default; - string createdTime = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("notificationId")) - { - notificationId = property.Value.GetString(); - continue; - } - if (property.NameEquals("correlationId")) - { - correlationId = property.Value.GetString(); - continue; - } - if (property.NameEquals("createdTime")) - { - createdTime = property.Value.GetString(); - continue; - } - } - return new TestNotificationResponse(notificationId, correlationId, createdTime); - } - } -} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TestNotificationResponse.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TestNotificationResponse.cs deleted file mode 100644 index 638bee3b601f0..0000000000000 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/Models/TestNotificationResponse.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.Monitor.Models -{ - /// The response when test notification succeeded. - public partial class TestNotificationResponse - { - /// Initializes a new instance of TestNotificationResponse. - /// The notification id. - /// The correlation id. - /// The created time. - /// , or is null. - internal TestNotificationResponse(string notificationId, string correlationId, string createdTime) - { - if (notificationId == null) - { - throw new ArgumentNullException(nameof(notificationId)); - } - if (correlationId == null) - { - throw new ArgumentNullException(nameof(correlationId)); - } - if (createdTime == null) - { - throw new ArgumentNullException(nameof(createdTime)); - } - - NotificationId = notificationId; - CorrelationId = correlationId; - CreatedTime = createdTime; - } - - /// The notification id. - public string NotificationId { get; } - /// The correlation id. - public string CorrelationId { get; } - /// The created time. - public string CreatedTime { get; } - } -} diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/ActionGroupsRestOperations.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/ActionGroupsRestOperations.cs index 77631d3ab01ae..d99a00886ede0 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/ActionGroupsRestOperations.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/ActionGroupsRestOperations.cs @@ -33,7 +33,7 @@ public ActionGroupsRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-09-01"; + _apiVersion = apiVersion ?? "2022-06-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -428,6 +428,154 @@ public Response PostTestNotifications(string subscriptionId, NotificationRequest } } + internal HttpMessage CreateCreateNotificationsAtResourceGroupLevelRequest(string subscriptionId, string resourceGroupName, NotificationRequestBody notificationRequest) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Insights/createNotifications", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(notificationRequest); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Send test notifications to a set of provided receivers. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The notification request body which includes the contact details. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task CreateNotificationsAtResourceGroupLevelAsync(string subscriptionId, string resourceGroupName, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNull(notificationRequest, nameof(notificationRequest)); + + using var message = CreateCreateNotificationsAtResourceGroupLevelRequest(subscriptionId, resourceGroupName, notificationRequest); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Send test notifications to a set of provided receivers. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The notification request body which includes the contact details. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response CreateNotificationsAtResourceGroupLevel(string subscriptionId, string resourceGroupName, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNull(notificationRequest, nameof(notificationRequest)); + + using var message = CreateCreateNotificationsAtResourceGroupLevelRequest(subscriptionId, resourceGroupName, notificationRequest); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateNotificationsAtActionGroupResourceLevelRequest(string subscriptionId, string resourceGroupName, string actionGroupName, NotificationRequestBody notificationRequest) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Insights/actionGroups/", false); + uri.AppendPath(actionGroupName, true); + uri.AppendPath("/createNotifications", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(notificationRequest); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Send test notifications to a set of provided receivers. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the action group. + /// The notification request body which includes the contact details. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateNotificationsAtActionGroupResourceLevelAsync(string subscriptionId, string resourceGroupName, string actionGroupName, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(actionGroupName, nameof(actionGroupName)); + Argument.AssertNotNull(notificationRequest, nameof(notificationRequest)); + + using var message = CreateCreateNotificationsAtActionGroupResourceLevelRequest(subscriptionId, resourceGroupName, actionGroupName, notificationRequest); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Send test notifications to a set of provided receivers. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the action group. + /// The notification request body which includes the contact details. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateNotificationsAtActionGroupResourceLevel(string subscriptionId, string resourceGroupName, string actionGroupName, NotificationRequestBody notificationRequest, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(actionGroupName, nameof(actionGroupName)); + Argument.AssertNotNull(notificationRequest, nameof(notificationRequest)); + + using var message = CreateCreateNotificationsAtActionGroupResourceLevelRequest(subscriptionId, resourceGroupName, actionGroupName, notificationRequest); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateGetTestNotificationsRequest(string subscriptionId, string notificationId) { var message = _pipeline.CreateMessage(); @@ -500,6 +648,168 @@ public Response GetTestNotifications(string sub } } + internal HttpMessage CreateGetTestNotificationsAtResourceGroupLevelRequest(string subscriptionId, string resourceGroupName, string notificationId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Insights/notificationStatus/", false); + uri.AppendPath(notificationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the test notifications by the notification id. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The notification id. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetTestNotificationsAtResourceGroupLevelAsync(string subscriptionId, string resourceGroupName, string notificationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(notificationId, nameof(notificationId)); + + using var message = CreateGetTestNotificationsAtResourceGroupLevelRequest(subscriptionId, resourceGroupName, notificationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TestNotificationDetailsResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TestNotificationDetailsResponse.DeserializeTestNotificationDetailsResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the test notifications by the notification id. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The notification id. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetTestNotificationsAtResourceGroupLevel(string subscriptionId, string resourceGroupName, string notificationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(notificationId, nameof(notificationId)); + + using var message = CreateGetTestNotificationsAtResourceGroupLevelRequest(subscriptionId, resourceGroupName, notificationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TestNotificationDetailsResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TestNotificationDetailsResponse.DeserializeTestNotificationDetailsResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetTestNotificationsAtActionGroupResourceLevelRequest(string subscriptionId, string resourceGroupName, string actionGroupName, string notificationId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Insights/actionGroups/", false); + uri.AppendPath(actionGroupName, true); + uri.AppendPath("/notificationStatus/", false); + uri.AppendPath(notificationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the test notifications by the notification id. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the action group. + /// The notification id. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetTestNotificationsAtActionGroupResourceLevelAsync(string subscriptionId, string resourceGroupName, string actionGroupName, string notificationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(actionGroupName, nameof(actionGroupName)); + Argument.AssertNotNullOrEmpty(notificationId, nameof(notificationId)); + + using var message = CreateGetTestNotificationsAtActionGroupResourceLevelRequest(subscriptionId, resourceGroupName, actionGroupName, notificationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + TestNotificationDetailsResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = TestNotificationDetailsResponse.DeserializeTestNotificationDetailsResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the test notifications by the notification id. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the action group. + /// The notification id. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetTestNotificationsAtActionGroupResourceLevel(string subscriptionId, string resourceGroupName, string actionGroupName, string notificationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(actionGroupName, nameof(actionGroupName)); + Argument.AssertNotNullOrEmpty(notificationId, nameof(notificationId)); + + using var message = CreateGetTestNotificationsAtActionGroupResourceLevelRequest(subscriptionId, resourceGroupName, actionGroupName, notificationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + TestNotificationDetailsResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = TestNotificationDetailsResponse.DeserializeTestNotificationDetailsResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateListBySubscriptionIdRequest(string subscriptionId) { var message = _pipeline.CreateMessage(); diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/ActivityLogAlertsRestOperations.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/ActivityLogAlertsRestOperations.cs index 24e0d329882e7..86ff18c14ca15 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/ActivityLogAlertsRestOperations.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/ActivityLogAlertsRestOperations.cs @@ -33,7 +33,7 @@ public ActivityLogAlertsRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2017-04-01"; + _apiVersion = apiVersion ?? "2020-10-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -48,7 +48,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/microsoft.insights/activityLogAlerts/", false); + uri.AppendPath("/providers/Microsoft.Insights/activityLogAlerts/", false); uri.AppendPath(activityLogAlertName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; @@ -61,11 +61,11 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r return message; } - /// Create a new activity log alert or update an existing one. + /// Create a new Activity Log Alert rule or update an existing one. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the activity log alert. - /// The activity log alert to create or use for the update. + /// The name of the Activity Log Alert rule. + /// The Activity Log Alert rule to create or use for the update. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -93,11 +93,11 @@ public async Task> CreateOrUpdateAsync(string sub } } - /// Create a new activity log alert or update an existing one. + /// Create a new Activity Log Alert rule or update an existing one. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the activity log alert. - /// The activity log alert to create or use for the update. + /// The name of the Activity Log Alert rule. + /// The Activity Log Alert rule to create or use for the update. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -136,7 +136,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/microsoft.insights/activityLogAlerts/", false); + uri.AppendPath("/providers/Microsoft.Insights/activityLogAlerts/", false); uri.AppendPath(activityLogAlertName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; @@ -145,10 +145,10 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Get an activity log alert. + /// Get an Activity Log Alert rule. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the activity log alert. + /// The name of the Activity Log Alert rule. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -176,10 +176,10 @@ public async Task> GetAsync(string subscriptionId } } - /// Get an activity log alert. + /// Get an Activity Log Alert rule. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the activity log alert. + /// The name of the Activity Log Alert rule. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -218,7 +218,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/microsoft.insights/activityLogAlerts/", false); + uri.AppendPath("/providers/Microsoft.Insights/activityLogAlerts/", false); uri.AppendPath(activityLogAlertName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; @@ -227,10 +227,10 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Delete an activity log alert. + /// Delete an Activity Log Alert rule. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the activity log alert. + /// The name of the Activity Log Alert rule. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -252,10 +252,10 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } } - /// Delete an activity log alert. + /// Delete an Activity Log Alert rule. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the activity log alert. + /// The name of the Activity Log Alert rule. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. @@ -288,7 +288,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/microsoft.insights/activityLogAlerts/", false); + uri.AppendPath("/providers/Microsoft.Insights/activityLogAlerts/", false); uri.AppendPath(activityLogAlertName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; @@ -301,10 +301,10 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG return message; } - /// Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. + /// Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the activity log alert. + /// The name of the Activity Log Alert rule. /// Parameters supplied to the operation. /// The cancellation token to use. /// , , or is null. @@ -332,10 +332,10 @@ public async Task> UpdateAsync(string subscriptio } } - /// Updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method. + /// Updates 'tags' and 'enabled' fields in an existing Alert rule. This method is used to update the Alert rule tags, and to enable or disable the Alert rule. To update other fields use CreateOrUpdate operation. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the activity log alert. + /// The name of the Activity Log Alert rule. /// Parameters supplied to the operation. /// The cancellation token to use. /// , , or is null. @@ -372,7 +372,7 @@ internal HttpMessage CreateListBySubscriptionIdRequest(string subscriptionId) uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/microsoft.insights/activityLogAlerts", false); + uri.AppendPath("/providers/Microsoft.Insights/activityLogAlerts", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -380,12 +380,12 @@ internal HttpMessage CreateListBySubscriptionIdRequest(string subscriptionId) return message; } - /// Get a list of all activity log alerts in a subscription. + /// Get a list of all Activity Log Alert rules in a subscription. /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionIdAsync(string subscriptionId, CancellationToken cancellationToken = default) + public async Task> ListBySubscriptionIdAsync(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -395,9 +395,9 @@ public async Task> ListBySubscriptionIdAsync(stri { case 200: { - ActivityLogAlertList value = default; + AlertRuleList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ActivityLogAlertList.DeserializeActivityLogAlertList(document.RootElement); + value = AlertRuleList.DeserializeAlertRuleList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -405,12 +405,12 @@ public async Task> ListBySubscriptionIdAsync(stri } } - /// Get a list of all activity log alerts in a subscription. + /// Get a list of all Activity Log Alert rules in a subscription. /// The ID of the target subscription. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionId(string subscriptionId, CancellationToken cancellationToken = default) + public Response ListBySubscriptionId(string subscriptionId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -420,9 +420,9 @@ public Response ListBySubscriptionId(string subscriptionId { case 200: { - ActivityLogAlertList value = default; + AlertRuleList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ActivityLogAlertList.DeserializeActivityLogAlertList(document.RootElement); + value = AlertRuleList.DeserializeAlertRuleList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -441,7 +441,7 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/microsoft.insights/activityLogAlerts", false); + uri.AppendPath("/providers/Microsoft.Insights/activityLogAlerts", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -449,13 +449,13 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str return message; } - /// Get a list of all activity log alerts in a resource group. + /// Get a list of all Activity Log Alert rules in a resource group. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -466,9 +466,9 @@ public async Task> ListByResourceGroupAsync(strin { case 200: { - ActivityLogAlertList value = default; + AlertRuleList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ActivityLogAlertList.DeserializeActivityLogAlertList(document.RootElement); + value = AlertRuleList.DeserializeAlertRuleList(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -476,13 +476,13 @@ public async Task> ListByResourceGroupAsync(strin } } - /// Get a list of all activity log alerts in a resource group. + /// Get a list of all Activity Log Alert rules in a resource group. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The cancellation token to use. /// or is null. /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -493,9 +493,149 @@ public Response ListByResourceGroup(string subscriptionId, { case 200: { - ActivityLogAlertList value = default; + AlertRuleList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ActivityLogAlertList.DeserializeActivityLogAlertList(document.RootElement); + value = AlertRuleList.DeserializeAlertRuleList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBySubscriptionIdNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a list of all Activity Log Alert rules in a subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionIdNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionIdNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AlertRuleList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AlertRuleList.DeserializeAlertRuleList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a list of all Activity Log Alert rules in a subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionIdNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionIdNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AlertRuleList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AlertRuleList.DeserializeAlertRuleList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a list of all Activity Log Alert rules in a resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AlertRuleList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AlertRuleList.DeserializeAlertRuleList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a list of all Activity Log Alert rules in a resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AlertRuleList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AlertRuleList.DeserializeAlertRuleList(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/DataCollectionEndpointsRestOperations.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/DataCollectionEndpointsRestOperations.cs index 86664d522be20..c7e2f8cc359e6 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/DataCollectionEndpointsRestOperations.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/DataCollectionEndpointsRestOperations.cs @@ -33,7 +33,7 @@ public DataCollectionEndpointsRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-04-01"; + _apiVersion = apiVersion ?? "2021-09-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/DataCollectionRuleAssociationsRestOperations.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/DataCollectionRuleAssociationsRestOperations.cs index 4904ad2be888f..b22951a7964ad 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/DataCollectionRuleAssociationsRestOperations.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/DataCollectionRuleAssociationsRestOperations.cs @@ -33,7 +33,7 @@ public DataCollectionRuleAssociationsRestOperations(HttpPipeline pipeline, strin { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-04-01"; + _apiVersion = apiVersion ?? "2021-09-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -181,6 +181,85 @@ public Response ListBy } } + internal HttpMessage CreateListByDataCollectionEndpointRequest(string subscriptionId, string resourceGroupName, string dataCollectionEndpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Insights/dataCollectionEndpoints/", false); + uri.AppendPath(dataCollectionEndpointName, true); + uri.AppendPath("/associations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists associations for the specified data collection endpoint. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the data collection endpoint. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByDataCollectionEndpointAsync(string subscriptionId, string resourceGroupName, string dataCollectionEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dataCollectionEndpointName, nameof(dataCollectionEndpointName)); + + using var message = CreateListByDataCollectionEndpointRequest(subscriptionId, resourceGroupName, dataCollectionEndpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataCollectionRuleAssociationProxyOnlyResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DataCollectionRuleAssociationProxyOnlyResourceListResult.DeserializeDataCollectionRuleAssociationProxyOnlyResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists associations for the specified data collection endpoint. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the data collection endpoint. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByDataCollectionEndpoint(string subscriptionId, string resourceGroupName, string dataCollectionEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dataCollectionEndpointName, nameof(dataCollectionEndpointName)); + + using var message = CreateListByDataCollectionEndpointRequest(subscriptionId, resourceGroupName, dataCollectionEndpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataCollectionRuleAssociationProxyOnlyResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DataCollectionRuleAssociationProxyOnlyResourceListResult.DeserializeDataCollectionRuleAssociationProxyOnlyResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateGetRequest(string resourceUri, string associationName) { var message = _pipeline.CreateMessage(); @@ -545,5 +624,81 @@ public Response ListBy throw new RequestFailedException(message.Response); } } + + internal HttpMessage CreateListByDataCollectionEndpointNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string dataCollectionEndpointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists associations for the specified data collection endpoint. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the data collection endpoint. The name is case insensitive. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByDataCollectionEndpointNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string dataCollectionEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dataCollectionEndpointName, nameof(dataCollectionEndpointName)); + + using var message = CreateListByDataCollectionEndpointNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataCollectionEndpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataCollectionRuleAssociationProxyOnlyResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DataCollectionRuleAssociationProxyOnlyResourceListResult.DeserializeDataCollectionRuleAssociationProxyOnlyResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists associations for the specified data collection endpoint. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the data collection endpoint. The name is case insensitive. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByDataCollectionEndpointNextPage(string nextLink, string subscriptionId, string resourceGroupName, string dataCollectionEndpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(dataCollectionEndpointName, nameof(dataCollectionEndpointName)); + + using var message = CreateListByDataCollectionEndpointNextPageRequest(nextLink, subscriptionId, resourceGroupName, dataCollectionEndpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataCollectionRuleAssociationProxyOnlyResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DataCollectionRuleAssociationProxyOnlyResourceListResult.DeserializeDataCollectionRuleAssociationProxyOnlyResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } } } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/DataCollectionRulesRestOperations.cs b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/DataCollectionRulesRestOperations.cs index 92a4c6305090a..a15f2bb45e14d 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/DataCollectionRulesRestOperations.cs +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/Generated/RestOperations/DataCollectionRulesRestOperations.cs @@ -33,7 +33,7 @@ public DataCollectionRulesRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-04-01"; + _apiVersion = apiVersion ?? "2021-09-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/monitor/Azure.ResourceManager.Monitor/src/autorest.md b/sdk/monitor/Azure.ResourceManager.Monitor/src/autorest.md index 834cf90f1d4cd..fc5351feb070e 100644 --- a/sdk/monitor/Azure.ResourceManager.Monitor/src/autorest.md +++ b/sdk/monitor/Azure.ResourceManager.Monitor/src/autorest.md @@ -7,7 +7,7 @@ Run `dotnet build /t:GenerateCode` to generate code. azure-arm: true library-name: Monitor namespace: Azure.ResourceManager.Monitor -require: https://github.com/Azure/azure-rest-api-specs/blob/35f8a4df47aedc1ce185c854595cba6b83fa6c71/specification/monitor/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/a416080c85111fbe4e0a483a1b99f1126ca6e97c/specification/monitor/resource-manager/readme.md clear-output-folder: true skip-csproj: true