|
| 1 | +// <auto-generated> |
| 2 | +// Auto-generated by StoneAPI, do not modify. |
| 3 | +// </auto-generated> |
| 4 | + |
| 5 | +namespace Dropbox.Api.TeamLog |
| 6 | +{ |
| 7 | + using sys = System; |
| 8 | + using col = System.Collections.Generic; |
| 9 | + using re = System.Text.RegularExpressions; |
| 10 | + |
| 11 | + using enc = Dropbox.Api.Stone; |
| 12 | + |
| 13 | + /// <summary> |
| 14 | + /// <para>Changed an alert state.</para> |
| 15 | + /// </summary> |
| 16 | + public class AdminAlertingAlertStateChangedDetails |
| 17 | + { |
| 18 | + #pragma warning disable 108 |
| 19 | + |
| 20 | + /// <summary> |
| 21 | + /// <para>The encoder instance.</para> |
| 22 | + /// </summary> |
| 23 | + internal static enc.StructEncoder<AdminAlertingAlertStateChangedDetails> Encoder = new AdminAlertingAlertStateChangedDetailsEncoder(); |
| 24 | + |
| 25 | + /// <summary> |
| 26 | + /// <para>The decoder instance.</para> |
| 27 | + /// </summary> |
| 28 | + internal static enc.StructDecoder<AdminAlertingAlertStateChangedDetails> Decoder = new AdminAlertingAlertStateChangedDetailsDecoder(); |
| 29 | + |
| 30 | + /// <summary> |
| 31 | + /// <para>Initializes a new instance of the <see |
| 32 | + /// cref="AdminAlertingAlertStateChangedDetails" /> class.</para> |
| 33 | + /// </summary> |
| 34 | + /// <param name="alertName">Alert name.</param> |
| 35 | + /// <param name="alertSeverity">Alert severity.</param> |
| 36 | + /// <param name="alertCategory">Alert category.</param> |
| 37 | + /// <param name="alertInstanceId">Alert ID.</param> |
| 38 | + /// <param name="previousValue">Alert state before the change.</param> |
| 39 | + /// <param name="newValue">Alert state after the change.</param> |
| 40 | + public AdminAlertingAlertStateChangedDetails(string alertName, |
| 41 | + AdminAlertSeverityEnum alertSeverity, |
| 42 | + AdminAlertCategoryEnum alertCategory, |
| 43 | + string alertInstanceId, |
| 44 | + AdminAlertGeneralStateEnum previousValue, |
| 45 | + AdminAlertGeneralStateEnum newValue) |
| 46 | + { |
| 47 | + if (alertName == null) |
| 48 | + { |
| 49 | + throw new sys.ArgumentNullException("alertName"); |
| 50 | + } |
| 51 | + |
| 52 | + if (alertSeverity == null) |
| 53 | + { |
| 54 | + throw new sys.ArgumentNullException("alertSeverity"); |
| 55 | + } |
| 56 | + |
| 57 | + if (alertCategory == null) |
| 58 | + { |
| 59 | + throw new sys.ArgumentNullException("alertCategory"); |
| 60 | + } |
| 61 | + |
| 62 | + if (alertInstanceId == null) |
| 63 | + { |
| 64 | + throw new sys.ArgumentNullException("alertInstanceId"); |
| 65 | + } |
| 66 | + |
| 67 | + if (previousValue == null) |
| 68 | + { |
| 69 | + throw new sys.ArgumentNullException("previousValue"); |
| 70 | + } |
| 71 | + |
| 72 | + if (newValue == null) |
| 73 | + { |
| 74 | + throw new sys.ArgumentNullException("newValue"); |
| 75 | + } |
| 76 | + |
| 77 | + this.AlertName = alertName; |
| 78 | + this.AlertSeverity = alertSeverity; |
| 79 | + this.AlertCategory = alertCategory; |
| 80 | + this.AlertInstanceId = alertInstanceId; |
| 81 | + this.PreviousValue = previousValue; |
| 82 | + this.NewValue = newValue; |
| 83 | + } |
| 84 | + |
| 85 | + /// <summary> |
| 86 | + /// <para>Initializes a new instance of the <see |
| 87 | + /// cref="AdminAlertingAlertStateChangedDetails" /> class.</para> |
| 88 | + /// </summary> |
| 89 | + /// <remarks>This is to construct an instance of the object when |
| 90 | + /// deserializing.</remarks> |
| 91 | + [sys.ComponentModel.EditorBrowsable(sys.ComponentModel.EditorBrowsableState.Never)] |
| 92 | + public AdminAlertingAlertStateChangedDetails() |
| 93 | + { |
| 94 | + } |
| 95 | + |
| 96 | + /// <summary> |
| 97 | + /// <para>Alert name.</para> |
| 98 | + /// </summary> |
| 99 | + public string AlertName { get; protected set; } |
| 100 | + |
| 101 | + /// <summary> |
| 102 | + /// <para>Alert severity.</para> |
| 103 | + /// </summary> |
| 104 | + public AdminAlertSeverityEnum AlertSeverity { get; protected set; } |
| 105 | + |
| 106 | + /// <summary> |
| 107 | + /// <para>Alert category.</para> |
| 108 | + /// </summary> |
| 109 | + public AdminAlertCategoryEnum AlertCategory { get; protected set; } |
| 110 | + |
| 111 | + /// <summary> |
| 112 | + /// <para>Alert ID.</para> |
| 113 | + /// </summary> |
| 114 | + public string AlertInstanceId { get; protected set; } |
| 115 | + |
| 116 | + /// <summary> |
| 117 | + /// <para>Alert state before the change.</para> |
| 118 | + /// </summary> |
| 119 | + public AdminAlertGeneralStateEnum PreviousValue { get; protected set; } |
| 120 | + |
| 121 | + /// <summary> |
| 122 | + /// <para>Alert state after the change.</para> |
| 123 | + /// </summary> |
| 124 | + public AdminAlertGeneralStateEnum NewValue { get; protected set; } |
| 125 | + |
| 126 | + #region Encoder class |
| 127 | + |
| 128 | + /// <summary> |
| 129 | + /// <para>Encoder for <see cref="AdminAlertingAlertStateChangedDetails" />.</para> |
| 130 | + /// </summary> |
| 131 | + private class AdminAlertingAlertStateChangedDetailsEncoder : enc.StructEncoder<AdminAlertingAlertStateChangedDetails> |
| 132 | + { |
| 133 | + /// <summary> |
| 134 | + /// <para>Encode fields of given value.</para> |
| 135 | + /// </summary> |
| 136 | + /// <param name="value">The value.</param> |
| 137 | + /// <param name="writer">The writer.</param> |
| 138 | + public override void EncodeFields(AdminAlertingAlertStateChangedDetails value, enc.IJsonWriter writer) |
| 139 | + { |
| 140 | + WriteProperty("alert_name", value.AlertName, writer, enc.StringEncoder.Instance); |
| 141 | + WriteProperty("alert_severity", value.AlertSeverity, writer, global::Dropbox.Api.TeamLog.AdminAlertSeverityEnum.Encoder); |
| 142 | + WriteProperty("alert_category", value.AlertCategory, writer, global::Dropbox.Api.TeamLog.AdminAlertCategoryEnum.Encoder); |
| 143 | + WriteProperty("alert_instance_id", value.AlertInstanceId, writer, enc.StringEncoder.Instance); |
| 144 | + WriteProperty("previous_value", value.PreviousValue, writer, global::Dropbox.Api.TeamLog.AdminAlertGeneralStateEnum.Encoder); |
| 145 | + WriteProperty("new_value", value.NewValue, writer, global::Dropbox.Api.TeamLog.AdminAlertGeneralStateEnum.Encoder); |
| 146 | + } |
| 147 | + } |
| 148 | + |
| 149 | + #endregion |
| 150 | + |
| 151 | + |
| 152 | + #region Decoder class |
| 153 | + |
| 154 | + /// <summary> |
| 155 | + /// <para>Decoder for <see cref="AdminAlertingAlertStateChangedDetails" />.</para> |
| 156 | + /// </summary> |
| 157 | + private class AdminAlertingAlertStateChangedDetailsDecoder : enc.StructDecoder<AdminAlertingAlertStateChangedDetails> |
| 158 | + { |
| 159 | + /// <summary> |
| 160 | + /// <para>Create a new instance of type <see |
| 161 | + /// cref="AdminAlertingAlertStateChangedDetails" />.</para> |
| 162 | + /// </summary> |
| 163 | + /// <returns>The struct instance.</returns> |
| 164 | + protected override AdminAlertingAlertStateChangedDetails Create() |
| 165 | + { |
| 166 | + return new AdminAlertingAlertStateChangedDetails(); |
| 167 | + } |
| 168 | + |
| 169 | + /// <summary> |
| 170 | + /// <para>Set given field.</para> |
| 171 | + /// </summary> |
| 172 | + /// <param name="value">The field value.</param> |
| 173 | + /// <param name="fieldName">The field name.</param> |
| 174 | + /// <param name="reader">The json reader.</param> |
| 175 | + protected override void SetField(AdminAlertingAlertStateChangedDetails value, string fieldName, enc.IJsonReader reader) |
| 176 | + { |
| 177 | + switch (fieldName) |
| 178 | + { |
| 179 | + case "alert_name": |
| 180 | + value.AlertName = enc.StringDecoder.Instance.Decode(reader); |
| 181 | + break; |
| 182 | + case "alert_severity": |
| 183 | + value.AlertSeverity = global::Dropbox.Api.TeamLog.AdminAlertSeverityEnum.Decoder.Decode(reader); |
| 184 | + break; |
| 185 | + case "alert_category": |
| 186 | + value.AlertCategory = global::Dropbox.Api.TeamLog.AdminAlertCategoryEnum.Decoder.Decode(reader); |
| 187 | + break; |
| 188 | + case "alert_instance_id": |
| 189 | + value.AlertInstanceId = enc.StringDecoder.Instance.Decode(reader); |
| 190 | + break; |
| 191 | + case "previous_value": |
| 192 | + value.PreviousValue = global::Dropbox.Api.TeamLog.AdminAlertGeneralStateEnum.Decoder.Decode(reader); |
| 193 | + break; |
| 194 | + case "new_value": |
| 195 | + value.NewValue = global::Dropbox.Api.TeamLog.AdminAlertGeneralStateEnum.Decoder.Decode(reader); |
| 196 | + break; |
| 197 | + default: |
| 198 | + reader.Skip(); |
| 199 | + break; |
| 200 | + } |
| 201 | + } |
| 202 | + } |
| 203 | + |
| 204 | + #endregion |
| 205 | + } |
| 206 | +} |
0 commit comments