-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
CustomRule.cs
61 lines (54 loc) · 3.1 KB
/
CustomRule.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
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// <auto-generated/>
#nullable disable
using System;
using System.Collections.Generic;
using System.Linq;
using Azure.Core;
namespace Azure.ResourceManager.Cdn.Models
{
/// <summary> Defines the common attributes for a custom rule that can be included in a waf policy. </summary>
public partial class CustomRule
{
/// <summary> Initializes a new instance of CustomRule. </summary>
/// <param name="name"> Defines the name of the custom rule. </param>
/// <param name="priority"> Defines in what order this rule be evaluated in the overall list of custom rules. </param>
/// <param name="matchConditions"> List of match conditions. </param>
/// <param name="action"> Describes what action to be applied when rule matches. </param>
/// <exception cref="ArgumentNullException"> <paramref name="name"/> or <paramref name="matchConditions"/> is null. </exception>
public CustomRule(string name, int priority, IEnumerable<CustomRuleMatchCondition> matchConditions, OverrideActionType action)
{
Argument.AssertNotNull(name, nameof(name));
Argument.AssertNotNull(matchConditions, nameof(matchConditions));
Name = name;
Priority = priority;
MatchConditions = matchConditions.ToList();
Action = action;
}
/// <summary> Initializes a new instance of CustomRule. </summary>
/// <param name="name"> Defines the name of the custom rule. </param>
/// <param name="enabledState"> Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. </param>
/// <param name="priority"> Defines in what order this rule be evaluated in the overall list of custom rules. </param>
/// <param name="matchConditions"> List of match conditions. </param>
/// <param name="action"> Describes what action to be applied when rule matches. </param>
internal CustomRule(string name, CustomRuleEnabledState? enabledState, int priority, IList<CustomRuleMatchCondition> matchConditions, OverrideActionType action)
{
Name = name;
EnabledState = enabledState;
Priority = priority;
MatchConditions = matchConditions;
Action = action;
}
/// <summary> Defines the name of the custom rule. </summary>
public string Name { get; set; }
/// <summary> Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. </summary>
public CustomRuleEnabledState? EnabledState { get; set; }
/// <summary> Defines in what order this rule be evaluated in the overall list of custom rules. </summary>
public int Priority { get; set; }
/// <summary> List of match conditions. </summary>
public IList<CustomRuleMatchCondition> MatchConditions { get; }
/// <summary> Describes what action to be applied when rule matches. </summary>
public OverrideActionType Action { get; set; }
}
}