-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
ActivityLogAlertData.cs
78 lines (70 loc) · 4.01 KB
/
ActivityLogAlertData.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System.Collections.Generic;
using Azure.Core;
using Azure.ResourceManager.Models;
using Azure.ResourceManager.Monitor.Models;
namespace Azure.ResourceManager.Monitor
{
/// <summary>
/// A class representing the ActivityLogAlert data model.
/// An Activity Log Alert rule resource.
/// </summary>
public partial class ActivityLogAlertData : TrackedResourceData
{
/// <summary> Initializes a new instance of ActivityLogAlertData. </summary>
/// <param name="location"> The location. </param>
public ActivityLogAlertData(AzureLocation location) : base(location)
{
Scopes = new ChangeTrackingList<string>();
}
/// <summary> Initializes a new instance of ActivityLogAlertData. </summary>
/// <param name="id"> The id. </param>
/// <param name="name"> The name. </param>
/// <param name="resourceType"> The resourceType. </param>
/// <param name="systemData"> The systemData. </param>
/// <param name="tags"> The tags. </param>
/// <param name="location"> The location. </param>
/// <param name="scopes"> 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. </param>
/// <param name="condition"> The condition that will cause this alert to activate. </param>
/// <param name="actions"> The actions that will activate when the condition is met. </param>
/// <param name="isEnabled"> 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. </param>
/// <param name="description"> A description of this Activity Log Alert rule. </param>
internal ActivityLogAlertData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary<string, string> tags, AzureLocation location, IList<string> scopes, AlertRuleAllOfCondition condition, ActionList actions, bool? isEnabled, string description) : base(id, name, resourceType, systemData, tags, location)
{
Scopes = scopes;
Condition = condition;
Actions = actions;
IsEnabled = isEnabled;
Description = description;
}
/// <summary> 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. </summary>
public IList<string> Scopes { get; }
/// <summary> The condition that will cause this alert to activate. </summary>
internal AlertRuleAllOfCondition Condition { get; set; }
/// <summary> The list of Activity Log Alert rule conditions. </summary>
public IList<ActivityLogAlertAnyOfOrLeafCondition> ConditionAllOf
{
get => Condition is null ? default : Condition.AllOf;
set => Condition = new AlertRuleAllOfCondition(value);
}
/// <summary> The actions that will activate when the condition is met. </summary>
internal ActionList Actions { get; set; }
/// <summary> The list of the Action Groups. </summary>
public IList<ActivityLogAlertActionGroup> ActionsActionGroups
{
get
{
if (Actions is null)
Actions = new ActionList();
return Actions.ActionGroups;
}
}
/// <summary> 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. </summary>
public bool? IsEnabled { get; set; }
/// <summary> A description of this Activity Log Alert rule. </summary>
public string Description { get; set; }
}
}