|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Text; |
| 4 | +using System.Linq; |
| 5 | +using System.Runtime.Serialization; |
| 6 | + |
| 7 | +using Newtonsoft.Json; |
| 8 | +using Newtonsoft.Json.Converters; |
| 9 | +using HuaweiCloud.SDK.Core; |
| 10 | + |
| 11 | +namespace HuaweiCloud.SDK.Aom.V2.Model |
| 12 | +{ |
| 13 | + /// <summary> |
| 14 | + /// |
| 15 | + /// </summary> |
| 16 | + public class BatchUpdateActionRules |
| 17 | + { |
| 18 | + |
| 19 | + /// <summary> |
| 20 | + /// 告警规则id。 |
| 21 | + /// </summary> |
| 22 | + [JsonProperty("alarm_rule_id", NullValueHandling = NullValueHandling.Ignore)] |
| 23 | + public long? AlarmRuleId { get; set; } |
| 24 | + |
| 25 | + /// <summary> |
| 26 | + /// 告警规则名称。 |
| 27 | + /// </summary> |
| 28 | + [JsonProperty("alarm_rule_name", NullValueHandling = NullValueHandling.Ignore)] |
| 29 | + public string AlarmRuleName { get; set; } |
| 30 | + |
| 31 | + /// <summary> |
| 32 | + /// 告警规则类型。 |
| 33 | + /// </summary> |
| 34 | + [JsonProperty("alarm_rule_type", NullValueHandling = NullValueHandling.Ignore)] |
| 35 | + public string AlarmRuleType { get; set; } |
| 36 | + |
| 37 | + /// <summary> |
| 38 | + /// 待绑定的告警行动规则名称。 |
| 39 | + /// </summary> |
| 40 | + [JsonProperty("bind_notification_rule_id", NullValueHandling = NullValueHandling.Ignore)] |
| 41 | + public string BindNotificationRuleId { get; set; } |
| 42 | + |
| 43 | + /// <summary> |
| 44 | + /// 通知频率 - 当通知类型为“alarm_policy”时,填“-1” - 当通知类型为“direct”时, - “0”:只告警一次 - “300”:每5分钟 - “600”:每10分钟 - “900”:每15分钟 - “1800”:每30分钟 - “3600”:每1小时 - “10800”:每3小时 - “21600”:每6小时 - “43200”:每12小时 - “86400”:每天 |
| 45 | + /// </summary> |
| 46 | + [JsonProperty("frequency", NullValueHandling = NullValueHandling.Ignore)] |
| 47 | + public string Frequency { get; set; } |
| 48 | + |
| 49 | + /// <summary> |
| 50 | + /// 是否启用告警通知规则。 - 当通知类型为“direct”时,填true - 当通知类型为“alarm_policy”时,填false 如果告警触发“notify_triggered”或告警恢复“notify_resolved”都设置为false(即都不进行告警通知),则notification_enable需设置为false。 |
| 51 | + /// </summary> |
| 52 | + [JsonProperty("notification_enable", NullValueHandling = NullValueHandling.Ignore)] |
| 53 | + public bool? NotificationEnable { get; set; } |
| 54 | + |
| 55 | + /// <summary> |
| 56 | + /// 通知类型。 - “direct”:直接告警 - “alarm_policy”:告警降噪 |
| 57 | + /// </summary> |
| 58 | + [JsonProperty("notification_type", NullValueHandling = NullValueHandling.Ignore)] |
| 59 | + public string NotificationType { get; set; } |
| 60 | + |
| 61 | + /// <summary> |
| 62 | + /// 告警解决是否通知。 - true:通知 - false:不通知 |
| 63 | + /// </summary> |
| 64 | + [JsonProperty("notify_resolved", NullValueHandling = NullValueHandling.Ignore)] |
| 65 | + public bool? NotifyResolved { get; set; } |
| 66 | + |
| 67 | + /// <summary> |
| 68 | + /// 告警触发是否通知。 - true:通知 - false:不通知 |
| 69 | + /// </summary> |
| 70 | + [JsonProperty("notify_triggered", NullValueHandling = NullValueHandling.Ignore)] |
| 71 | + public bool? NotifyTriggered { get; set; } |
| 72 | + |
| 73 | + /// <summary> |
| 74 | + /// 启用告警分组规则。 - 当通知类型为“alarm_policy”时:true - 当通知类型为“direct”时:false 如果告警触发“notify_triggered”或告警恢复“notify_resolved”都设置为false(即都不进行告警通知),则route_group_enable需设置为false。 |
| 75 | + /// </summary> |
| 76 | + [JsonProperty("route_group_enable", NullValueHandling = NullValueHandling.Ignore)] |
| 77 | + public bool? RouteGroupEnable { get; set; } |
| 78 | + |
| 79 | + /// <summary> |
| 80 | + /// 告警分组规则名称。 - 当route_group_enable 为true时,填告警分组规则名称 - 当route_group_enable 为false时,填“” |
| 81 | + /// </summary> |
| 82 | + [JsonProperty("route_group_rule", NullValueHandling = NullValueHandling.Ignore)] |
| 83 | + public string RouteGroupRule { get; set; } |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + /// <summary> |
| 88 | + /// Get the string |
| 89 | + /// </summary> |
| 90 | + public override string ToString() |
| 91 | + { |
| 92 | + var sb = new StringBuilder(); |
| 93 | + sb.Append("class BatchUpdateActionRules {\n"); |
| 94 | + sb.Append(" alarmRuleId: ").Append(AlarmRuleId).Append("\n"); |
| 95 | + sb.Append(" alarmRuleName: ").Append(AlarmRuleName).Append("\n"); |
| 96 | + sb.Append(" alarmRuleType: ").Append(AlarmRuleType).Append("\n"); |
| 97 | + sb.Append(" bindNotificationRuleId: ").Append(BindNotificationRuleId).Append("\n"); |
| 98 | + sb.Append(" frequency: ").Append(Frequency).Append("\n"); |
| 99 | + sb.Append(" notificationEnable: ").Append(NotificationEnable).Append("\n"); |
| 100 | + sb.Append(" notificationType: ").Append(NotificationType).Append("\n"); |
| 101 | + sb.Append(" notifyResolved: ").Append(NotifyResolved).Append("\n"); |
| 102 | + sb.Append(" notifyTriggered: ").Append(NotifyTriggered).Append("\n"); |
| 103 | + sb.Append(" routeGroupEnable: ").Append(RouteGroupEnable).Append("\n"); |
| 104 | + sb.Append(" routeGroupRule: ").Append(RouteGroupRule).Append("\n"); |
| 105 | + sb.Append("}\n"); |
| 106 | + return sb.ToString(); |
| 107 | + } |
| 108 | + |
| 109 | + /// <summary> |
| 110 | + /// Returns true if objects are equal |
| 111 | + /// </summary> |
| 112 | + public override bool Equals(object input) |
| 113 | + { |
| 114 | + return this.Equals(input as BatchUpdateActionRules); |
| 115 | + } |
| 116 | + |
| 117 | + /// <summary> |
| 118 | + /// Returns true if objects are equal |
| 119 | + /// </summary> |
| 120 | + public bool Equals(BatchUpdateActionRules input) |
| 121 | + { |
| 122 | + if (input == null) return false; |
| 123 | + if (this.AlarmRuleId != input.AlarmRuleId || (this.AlarmRuleId != null && !this.AlarmRuleId.Equals(input.AlarmRuleId))) return false; |
| 124 | + if (this.AlarmRuleName != input.AlarmRuleName || (this.AlarmRuleName != null && !this.AlarmRuleName.Equals(input.AlarmRuleName))) return false; |
| 125 | + if (this.AlarmRuleType != input.AlarmRuleType || (this.AlarmRuleType != null && !this.AlarmRuleType.Equals(input.AlarmRuleType))) return false; |
| 126 | + if (this.BindNotificationRuleId != input.BindNotificationRuleId || (this.BindNotificationRuleId != null && !this.BindNotificationRuleId.Equals(input.BindNotificationRuleId))) return false; |
| 127 | + if (this.Frequency != input.Frequency || (this.Frequency != null && !this.Frequency.Equals(input.Frequency))) return false; |
| 128 | + if (this.NotificationEnable != input.NotificationEnable || (this.NotificationEnable != null && !this.NotificationEnable.Equals(input.NotificationEnable))) return false; |
| 129 | + if (this.NotificationType != input.NotificationType || (this.NotificationType != null && !this.NotificationType.Equals(input.NotificationType))) return false; |
| 130 | + if (this.NotifyResolved != input.NotifyResolved || (this.NotifyResolved != null && !this.NotifyResolved.Equals(input.NotifyResolved))) return false; |
| 131 | + if (this.NotifyTriggered != input.NotifyTriggered || (this.NotifyTriggered != null && !this.NotifyTriggered.Equals(input.NotifyTriggered))) return false; |
| 132 | + if (this.RouteGroupEnable != input.RouteGroupEnable || (this.RouteGroupEnable != null && !this.RouteGroupEnable.Equals(input.RouteGroupEnable))) return false; |
| 133 | + if (this.RouteGroupRule != input.RouteGroupRule || (this.RouteGroupRule != null && !this.RouteGroupRule.Equals(input.RouteGroupRule))) return false; |
| 134 | + |
| 135 | + return true; |
| 136 | + } |
| 137 | + |
| 138 | + /// <summary> |
| 139 | + /// Get hash code |
| 140 | + /// </summary> |
| 141 | + public override int GetHashCode() |
| 142 | + { |
| 143 | + unchecked // Overflow is fine, just wrap |
| 144 | + { |
| 145 | + var hashCode = 41; |
| 146 | + if (this.AlarmRuleId != null) hashCode = hashCode * 59 + this.AlarmRuleId.GetHashCode(); |
| 147 | + if (this.AlarmRuleName != null) hashCode = hashCode * 59 + this.AlarmRuleName.GetHashCode(); |
| 148 | + if (this.AlarmRuleType != null) hashCode = hashCode * 59 + this.AlarmRuleType.GetHashCode(); |
| 149 | + if (this.BindNotificationRuleId != null) hashCode = hashCode * 59 + this.BindNotificationRuleId.GetHashCode(); |
| 150 | + if (this.Frequency != null) hashCode = hashCode * 59 + this.Frequency.GetHashCode(); |
| 151 | + if (this.NotificationEnable != null) hashCode = hashCode * 59 + this.NotificationEnable.GetHashCode(); |
| 152 | + if (this.NotificationType != null) hashCode = hashCode * 59 + this.NotificationType.GetHashCode(); |
| 153 | + if (this.NotifyResolved != null) hashCode = hashCode * 59 + this.NotifyResolved.GetHashCode(); |
| 154 | + if (this.NotifyTriggered != null) hashCode = hashCode * 59 + this.NotifyTriggered.GetHashCode(); |
| 155 | + if (this.RouteGroupEnable != null) hashCode = hashCode * 59 + this.RouteGroupEnable.GetHashCode(); |
| 156 | + if (this.RouteGroupRule != null) hashCode = hashCode * 59 + this.RouteGroupRule.GetHashCode(); |
| 157 | + return hashCode; |
| 158 | + } |
| 159 | + } |
| 160 | + } |
| 161 | +} |
0 commit comments