|
| 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 JsonSubTypes; |
| 25 | +using System.ComponentModel.DataAnnotations; |
| 26 | +using OpenAPIDateConverter = Adyen.ApiSerialization.OpenAPIDateConverter; |
| 27 | + |
| 28 | +namespace Adyen.Model.BalancePlatform |
| 29 | +{ |
| 30 | + /// <summary> |
| 31 | + /// BalanceWebhookSetting |
| 32 | + /// </summary> |
| 33 | + [DataContract(Name = "BalanceWebhookSetting")] |
| 34 | + [JsonConverter(typeof(JsonSubtypes), "Type")] |
| 35 | + [JsonSubtypes.KnownSubType(typeof(BalanceWebhookSetting), "balance")] |
| 36 | + public partial class BalanceWebhookSetting : WebhookSetting, IEquatable<BalanceWebhookSetting>, IValidatableObject |
| 37 | + { |
| 38 | + /// <summary> |
| 39 | + /// Initializes a new instance of the <see cref="BalanceWebhookSetting" /> class. |
| 40 | + /// </summary> |
| 41 | + [JsonConstructorAttribute] |
| 42 | + protected BalanceWebhookSetting() { } |
| 43 | + /// <summary> |
| 44 | + /// Initializes a new instance of the <see cref="BalanceWebhookSetting" /> class. |
| 45 | + /// </summary> |
| 46 | + /// <param name="conditions">The list of settings and criteria for triggering the [balance webhook](https://docs.adyen.com/api-explorer/balance-webhooks/latest/post/balanceAccount.balance.updated)..</param> |
| 47 | + /// <param name="currency">The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance. (required).</param> |
| 48 | + /// <param name="id">The unique identifier of the webhook setting. (required).</param> |
| 49 | + /// <param name="status">status (required).</param> |
| 50 | + /// <param name="target">target (required).</param> |
| 51 | + /// <param name="type">type (required) (default to "BalanceWebhookSetting").</param> |
| 52 | + public BalanceWebhookSetting(List<Condition> conditions = default(List<Condition>), string currency = default(string), string id = default(string), string status = default(string), Target target = default(Target), SettingType type = "BalanceWebhookSetting") : base(currency, id, status, target, type) |
| 53 | + { |
| 54 | + this.Conditions = conditions; |
| 55 | + } |
| 56 | + |
| 57 | + /// <summary> |
| 58 | + /// The list of settings and criteria for triggering the [balance webhook](https://docs.adyen.com/api-explorer/balance-webhooks/latest/post/balanceAccount.balance.updated). |
| 59 | + /// </summary> |
| 60 | + /// <value>The list of settings and criteria for triggering the [balance webhook](https://docs.adyen.com/api-explorer/balance-webhooks/latest/post/balanceAccount.balance.updated).</value> |
| 61 | + [DataMember(Name = "conditions", EmitDefaultValue = false)] |
| 62 | + public List<Condition> Conditions { get; set; } |
| 63 | + |
| 64 | + /// <summary> |
| 65 | + /// Returns the string presentation of the object |
| 66 | + /// </summary> |
| 67 | + /// <returns>String presentation of the object</returns> |
| 68 | + public override string ToString() |
| 69 | + { |
| 70 | + StringBuilder sb = new StringBuilder(); |
| 71 | + sb.Append("class BalanceWebhookSetting {\n"); |
| 72 | + sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n"); |
| 73 | + sb.Append(" Conditions: ").Append(Conditions).Append("\n"); |
| 74 | + sb.Append("}\n"); |
| 75 | + return sb.ToString(); |
| 76 | + } |
| 77 | + |
| 78 | + /// <summary> |
| 79 | + /// Returns the JSON string presentation of the object |
| 80 | + /// </summary> |
| 81 | + /// <returns>JSON string presentation of the object</returns> |
| 82 | + public override string ToJson() |
| 83 | + { |
| 84 | + return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); |
| 85 | + } |
| 86 | + |
| 87 | + /// <summary> |
| 88 | + /// Returns true if objects are equal |
| 89 | + /// </summary> |
| 90 | + /// <param name="input">Object to be compared</param> |
| 91 | + /// <returns>Boolean</returns> |
| 92 | + public override bool Equals(object input) |
| 93 | + { |
| 94 | + return this.Equals(input as BalanceWebhookSetting); |
| 95 | + } |
| 96 | + |
| 97 | + /// <summary> |
| 98 | + /// Returns true if BalanceWebhookSetting instances are equal |
| 99 | + /// </summary> |
| 100 | + /// <param name="input">Instance of BalanceWebhookSetting to be compared</param> |
| 101 | + /// <returns>Boolean</returns> |
| 102 | + public bool Equals(BalanceWebhookSetting input) |
| 103 | + { |
| 104 | + if (input == null) |
| 105 | + { |
| 106 | + return false; |
| 107 | + } |
| 108 | + return base.Equals(input) && |
| 109 | + ( |
| 110 | + this.Conditions == input.Conditions || |
| 111 | + this.Conditions != null && |
| 112 | + input.Conditions != null && |
| 113 | + this.Conditions.SequenceEqual(input.Conditions) |
| 114 | + ); |
| 115 | + } |
| 116 | + |
| 117 | + /// <summary> |
| 118 | + /// Gets the hash code |
| 119 | + /// </summary> |
| 120 | + /// <returns>Hash code</returns> |
| 121 | + public override int GetHashCode() |
| 122 | + { |
| 123 | + unchecked // Overflow is fine, just wrap |
| 124 | + { |
| 125 | + int hashCode = base.GetHashCode(); |
| 126 | + if (this.Conditions != null) |
| 127 | + { |
| 128 | + hashCode = (hashCode * 59) + this.Conditions.GetHashCode(); |
| 129 | + } |
| 130 | + return hashCode; |
| 131 | + } |
| 132 | + } |
| 133 | + /// <summary> |
| 134 | + /// To validate all properties of the instance |
| 135 | + /// </summary> |
| 136 | + /// <param name="validationContext">Validation context</param> |
| 137 | + /// <returns>Validation Result</returns> |
| 138 | + public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext) |
| 139 | + { |
| 140 | + return this.BaseValidate(validationContext); |
| 141 | + } |
| 142 | + |
| 143 | + /// <summary> |
| 144 | + /// To validate all properties of the instance |
| 145 | + /// </summary> |
| 146 | + /// <param name="validationContext">Validation context</param> |
| 147 | + /// <returns>Validation Result</returns> |
| 148 | + protected IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> BaseValidate(ValidationContext validationContext) |
| 149 | + { |
| 150 | + foreach (var x in BaseValidate(validationContext)) |
| 151 | + { |
| 152 | + yield return x; |
| 153 | + } |
| 154 | + yield break; |
| 155 | + } |
| 156 | + } |
| 157 | + |
| 158 | +} |
0 commit comments