|
| 1 | +/* |
| 2 | +* Configuration API |
| 3 | +* |
| 4 | +* |
| 5 | +* The version of the OpenAPI document: 2 |
| 6 | +* |
| 7 | +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). |
| 8 | +* https://openapi-generator.tech |
| 9 | +* Do not edit the class manually. |
| 10 | +*/ |
| 11 | + |
| 12 | +using System; |
| 13 | +using System.Collections; |
| 14 | +using System.Collections.Generic; |
| 15 | +using System.Collections.ObjectModel; |
| 16 | +using System.Linq; |
| 17 | +using System.IO; |
| 18 | +using System.Runtime.Serialization; |
| 19 | +using System.Text; |
| 20 | +using System.Text.RegularExpressions; |
| 21 | +using Newtonsoft.Json; |
| 22 | +using Newtonsoft.Json.Converters; |
| 23 | +using Newtonsoft.Json.Linq; |
| 24 | +using System.ComponentModel.DataAnnotations; |
| 25 | +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; |
| 26 | + |
| 27 | +namespace Adyen.Model.BalancePlatform |
| 28 | +{ |
| 29 | + /// <summary> |
| 30 | + /// BalanceWebhookSettingsRequest |
| 31 | + /// </summary> |
| 32 | + [DataContract(Name = "BalanceWebhookSettingsRequest")] |
| 33 | + public partial class BalanceWebhookSettingsRequest : IEquatable<BalanceWebhookSettingsRequest>, IValidatableObject |
| 34 | + { |
| 35 | + /// <summary> |
| 36 | + /// The status of the webhook setting. Possible values: * **active**: You receive a balance webhook if any of the conditions in this setting are met. * **inactive**: You do not receive a balance webhook even if the conditions in this settings are met. |
| 37 | + /// </summary> |
| 38 | + /// <value>The status of the webhook setting. Possible values: * **active**: You receive a balance webhook if any of the conditions in this setting are met. * **inactive**: You do not receive a balance webhook even if the conditions in this settings are met.</value> |
| 39 | + [JsonConverter(typeof(StringEnumConverter))] |
| 40 | + public enum StatusEnum |
| 41 | + { |
| 42 | + /// <summary> |
| 43 | + /// Enum Active for value: active |
| 44 | + /// </summary> |
| 45 | + [EnumMember(Value = "active")] |
| 46 | + Active = 1, |
| 47 | + |
| 48 | + /// <summary> |
| 49 | + /// Enum Inactive for value: inactive |
| 50 | + /// </summary> |
| 51 | + [EnumMember(Value = "inactive")] |
| 52 | + Inactive = 2 |
| 53 | + |
| 54 | + } |
| 55 | + |
| 56 | + |
| 57 | + /// <summary> |
| 58 | + /// The status of the webhook setting. Possible values: * **active**: You receive a balance webhook if any of the conditions in this setting are met. * **inactive**: You do not receive a balance webhook even if the conditions in this settings are met. |
| 59 | + /// </summary> |
| 60 | + /// <value>The status of the webhook setting. Possible values: * **active**: You receive a balance webhook if any of the conditions in this setting are met. * **inactive**: You do not receive a balance webhook even if the conditions in this settings are met.</value> |
| 61 | + [DataMember(Name = "status", IsRequired = false, EmitDefaultValue = false)] |
| 62 | + public StatusEnum Status { get; set; } |
| 63 | + /// <summary> |
| 64 | + /// The type of the webhook you are configuring. Set to **balance**. |
| 65 | + /// </summary> |
| 66 | + /// <value>The type of the webhook you are configuring. Set to **balance**.</value> |
| 67 | + [JsonConverter(typeof(StringEnumConverter))] |
| 68 | + public enum TypeEnum |
| 69 | + { |
| 70 | + /// <summary> |
| 71 | + /// Enum Balance for value: balance |
| 72 | + /// </summary> |
| 73 | + [EnumMember(Value = "balance")] |
| 74 | + Balance = 1 |
| 75 | + |
| 76 | + } |
| 77 | + |
| 78 | + |
| 79 | + /// <summary> |
| 80 | + /// The type of the webhook you are configuring. Set to **balance**. |
| 81 | + /// </summary> |
| 82 | + /// <value>The type of the webhook you are configuring. Set to **balance**.</value> |
| 83 | + [DataMember(Name = "type", IsRequired = false, EmitDefaultValue = false)] |
| 84 | + public TypeEnum Type { get; set; } |
| 85 | + /// <summary> |
| 86 | + /// Initializes a new instance of the <see cref="BalanceWebhookSettingsRequest" /> class. |
| 87 | + /// </summary> |
| 88 | + [JsonConstructorAttribute] |
| 89 | + protected BalanceWebhookSettingsRequest() { } |
| 90 | + /// <summary> |
| 91 | + /// Initializes a new instance of the <see cref="BalanceWebhookSettingsRequest" /> class. |
| 92 | + /// </summary> |
| 93 | + /// <param name="conditions">The array of conditions a balance change must meet for Adyen to send the webhook..</param> |
| 94 | + /// <param name="currency">The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance. (required).</param> |
| 95 | + /// <param name="status">The status of the webhook setting. Possible values: * **active**: You receive a balance webhook if any of the conditions in this setting are met. * **inactive**: You do not receive a balance webhook even if the conditions in this settings are met. (required).</param> |
| 96 | + /// <param name="target">target (required).</param> |
| 97 | + /// <param name="type">The type of the webhook you are configuring. Set to **balance**. (required).</param> |
| 98 | + public BalanceWebhookSettingsRequest(List<Condition> conditions = default(List<Condition>), string currency = default(string), StatusEnum status = default(StatusEnum), Target target = default(Target), TypeEnum type = default(TypeEnum)) |
| 99 | + { |
| 100 | + this.Currency = currency; |
| 101 | + this.Status = status; |
| 102 | + this.Target = target; |
| 103 | + this.Type = type; |
| 104 | + this.Conditions = conditions; |
| 105 | + } |
| 106 | + |
| 107 | + /// <summary> |
| 108 | + /// The array of conditions a balance change must meet for Adyen to send the webhook. |
| 109 | + /// </summary> |
| 110 | + /// <value>The array of conditions a balance change must meet for Adyen to send the webhook.</value> |
| 111 | + [DataMember(Name = "conditions", EmitDefaultValue = false)] |
| 112 | + public List<Condition> Conditions { get; set; } |
| 113 | + |
| 114 | + /// <summary> |
| 115 | + /// The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance. |
| 116 | + /// </summary> |
| 117 | + /// <value>The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance.</value> |
| 118 | + [DataMember(Name = "currency", IsRequired = false, EmitDefaultValue = false)] |
| 119 | + public string Currency { get; set; } |
| 120 | + |
| 121 | + /// <summary> |
| 122 | + /// Gets or Sets Target |
| 123 | + /// </summary> |
| 124 | + [DataMember(Name = "target", IsRequired = false, EmitDefaultValue = false)] |
| 125 | + public Target Target { get; set; } |
| 126 | + |
| 127 | + /// <summary> |
| 128 | + /// Returns the string presentation of the object |
| 129 | + /// </summary> |
| 130 | + /// <returns>String presentation of the object</returns> |
| 131 | + public override string ToString() |
| 132 | + { |
| 133 | + StringBuilder sb = new StringBuilder(); |
| 134 | + sb.Append("class BalanceWebhookSettingsRequest {\n"); |
| 135 | + sb.Append(" Conditions: ").Append(Conditions).Append("\n"); |
| 136 | + sb.Append(" Currency: ").Append(Currency).Append("\n"); |
| 137 | + sb.Append(" Status: ").Append(Status).Append("\n"); |
| 138 | + sb.Append(" Target: ").Append(Target).Append("\n"); |
| 139 | + sb.Append(" Type: ").Append(Type).Append("\n"); |
| 140 | + sb.Append("}\n"); |
| 141 | + return sb.ToString(); |
| 142 | + } |
| 143 | + |
| 144 | + /// <summary> |
| 145 | + /// Returns the JSON string presentation of the object |
| 146 | + /// </summary> |
| 147 | + /// <returns>JSON string presentation of the object</returns> |
| 148 | + public virtual string ToJson() |
| 149 | + { |
| 150 | + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); |
| 151 | + } |
| 152 | + |
| 153 | + /// <summary> |
| 154 | + /// Returns true if objects are equal |
| 155 | + /// </summary> |
| 156 | + /// <param name="input">Object to be compared</param> |
| 157 | + /// <returns>Boolean</returns> |
| 158 | + public override bool Equals(object input) |
| 159 | + { |
| 160 | + return this.Equals(input as BalanceWebhookSettingsRequest); |
| 161 | + } |
| 162 | + |
| 163 | + /// <summary> |
| 164 | + /// Returns true if BalanceWebhookSettingsRequest instances are equal |
| 165 | + /// </summary> |
| 166 | + /// <param name="input">Instance of BalanceWebhookSettingsRequest to be compared</param> |
| 167 | + /// <returns>Boolean</returns> |
| 168 | + public bool Equals(BalanceWebhookSettingsRequest input) |
| 169 | + { |
| 170 | + if (input == null) |
| 171 | + { |
| 172 | + return false; |
| 173 | + } |
| 174 | + return |
| 175 | + ( |
| 176 | + this.Conditions == input.Conditions || |
| 177 | + this.Conditions != null && |
| 178 | + input.Conditions != null && |
| 179 | + this.Conditions.SequenceEqual(input.Conditions) |
| 180 | + ) && |
| 181 | + ( |
| 182 | + this.Currency == input.Currency || |
| 183 | + (this.Currency != null && |
| 184 | + this.Currency.Equals(input.Currency)) |
| 185 | + ) && |
| 186 | + ( |
| 187 | + this.Status == input.Status || |
| 188 | + this.Status.Equals(input.Status) |
| 189 | + ) && |
| 190 | + ( |
| 191 | + this.Target == input.Target || |
| 192 | + (this.Target != null && |
| 193 | + this.Target.Equals(input.Target)) |
| 194 | + ) && |
| 195 | + ( |
| 196 | + this.Type == input.Type || |
| 197 | + this.Type.Equals(input.Type) |
| 198 | + ); |
| 199 | + } |
| 200 | + |
| 201 | + /// <summary> |
| 202 | + /// Gets the hash code |
| 203 | + /// </summary> |
| 204 | + /// <returns>Hash code</returns> |
| 205 | + public override int GetHashCode() |
| 206 | + { |
| 207 | + unchecked // Overflow is fine, just wrap |
| 208 | + { |
| 209 | + int hashCode = 41; |
| 210 | + if (this.Conditions != null) |
| 211 | + { |
| 212 | + hashCode = (hashCode * 59) + this.Conditions.GetHashCode(); |
| 213 | + } |
| 214 | + if (this.Currency != null) |
| 215 | + { |
| 216 | + hashCode = (hashCode * 59) + this.Currency.GetHashCode(); |
| 217 | + } |
| 218 | + hashCode = (hashCode * 59) + this.Status.GetHashCode(); |
| 219 | + if (this.Target != null) |
| 220 | + { |
| 221 | + hashCode = (hashCode * 59) + this.Target.GetHashCode(); |
| 222 | + } |
| 223 | + hashCode = (hashCode * 59) + this.Type.GetHashCode(); |
| 224 | + return hashCode; |
| 225 | + } |
| 226 | + } |
| 227 | + /// <summary> |
| 228 | + /// To validate all properties of the instance |
| 229 | + /// </summary> |
| 230 | + /// <param name="validationContext">Validation context</param> |
| 231 | + /// <returns>Validation Result</returns> |
| 232 | + public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext) |
| 233 | + { |
| 234 | + yield break; |
| 235 | + } |
| 236 | + } |
| 237 | + |
| 238 | +} |
0 commit comments