|
| 1 | +// |
| 2 | +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. |
| 3 | +// |
| 4 | +using System; |
| 5 | +using System.Collections.Generic; |
| 6 | +using System.Linq; |
| 7 | +using System.Text; |
| 8 | +using System.Text.Json; |
| 9 | +using System.Text.Json.Serialization; |
| 10 | +using Algolia.Search.Serializer; |
| 11 | + |
| 12 | +namespace Algolia.Search.Models.AbtestingV3; |
| 13 | + |
| 14 | +/// <summary> |
| 15 | +/// ABTest |
| 16 | +/// </summary> |
| 17 | +public partial class ABTest |
| 18 | +{ |
| 19 | + /// <summary> |
| 20 | + /// Gets or Sets Status |
| 21 | + /// </summary> |
| 22 | + [JsonPropertyName("status")] |
| 23 | + public Status? Status { get; set; } |
| 24 | + |
| 25 | + /// <summary> |
| 26 | + /// Initializes a new instance of the ABTest class. |
| 27 | + /// </summary> |
| 28 | + [JsonConstructor] |
| 29 | + public ABTest() { } |
| 30 | + |
| 31 | + /// <summary> |
| 32 | + /// Initializes a new instance of the ABTest class. |
| 33 | + /// </summary> |
| 34 | + /// <param name="abTestID">Unique A/B test identifier. (required).</param> |
| 35 | + /// <param name="updatedAt">Date and time when the A/B test was last updated, in RFC 3339 format. (required).</param> |
| 36 | + /// <param name="createdAt">Date and time when the A/B test was created, in RFC 3339 format. (required).</param> |
| 37 | + /// <param name="endAt">End date and time of the A/B test, in RFC 3339 format. (required).</param> |
| 38 | + /// <param name="name">A/B test name. (required).</param> |
| 39 | + /// <param name="status">status (required).</param> |
| 40 | + /// <param name="variants">A/B test variants. The first variant is your _control_ index, typically your production index. All of the additional variants are indexes with changed settings that you want to test against the control. (required).</param> |
| 41 | + public ABTest( |
| 42 | + int abTestID, |
| 43 | + string updatedAt, |
| 44 | + string createdAt, |
| 45 | + string endAt, |
| 46 | + string name, |
| 47 | + Status? status, |
| 48 | + List<Variant> variants |
| 49 | + ) |
| 50 | + { |
| 51 | + AbTestID = abTestID; |
| 52 | + UpdatedAt = updatedAt ?? throw new ArgumentNullException(nameof(updatedAt)); |
| 53 | + CreatedAt = createdAt ?? throw new ArgumentNullException(nameof(createdAt)); |
| 54 | + EndAt = endAt ?? throw new ArgumentNullException(nameof(endAt)); |
| 55 | + Name = name ?? throw new ArgumentNullException(nameof(name)); |
| 56 | + Status = status; |
| 57 | + Variants = variants ?? throw new ArgumentNullException(nameof(variants)); |
| 58 | + } |
| 59 | + |
| 60 | + /// <summary> |
| 61 | + /// Unique A/B test identifier. |
| 62 | + /// </summary> |
| 63 | + /// <value>Unique A/B test identifier.</value> |
| 64 | + [JsonPropertyName("abTestID")] |
| 65 | + public int AbTestID { get; set; } |
| 66 | + |
| 67 | + /// <summary> |
| 68 | + /// Date and time when the A/B test was last updated, in RFC 3339 format. |
| 69 | + /// </summary> |
| 70 | + /// <value>Date and time when the A/B test was last updated, in RFC 3339 format.</value> |
| 71 | + [JsonPropertyName("updatedAt")] |
| 72 | + public string UpdatedAt { get; set; } |
| 73 | + |
| 74 | + /// <summary> |
| 75 | + /// Date and time when the A/B test was created, in RFC 3339 format. |
| 76 | + /// </summary> |
| 77 | + /// <value>Date and time when the A/B test was created, in RFC 3339 format.</value> |
| 78 | + [JsonPropertyName("createdAt")] |
| 79 | + public string CreatedAt { get; set; } |
| 80 | + |
| 81 | + /// <summary> |
| 82 | + /// End date and time of the A/B test, in RFC 3339 format. |
| 83 | + /// </summary> |
| 84 | + /// <value>End date and time of the A/B test, in RFC 3339 format.</value> |
| 85 | + [JsonPropertyName("endAt")] |
| 86 | + public string EndAt { get; set; } |
| 87 | + |
| 88 | + /// <summary> |
| 89 | + /// A/B test name. |
| 90 | + /// </summary> |
| 91 | + /// <value>A/B test name.</value> |
| 92 | + [JsonPropertyName("name")] |
| 93 | + public string Name { get; set; } |
| 94 | + |
| 95 | + /// <summary> |
| 96 | + /// A/B test variants. The first variant is your _control_ index, typically your production index. All of the additional variants are indexes with changed settings that you want to test against the control. |
| 97 | + /// </summary> |
| 98 | + /// <value>A/B test variants. The first variant is your _control_ index, typically your production index. All of the additional variants are indexes with changed settings that you want to test against the control. </value> |
| 99 | + [JsonPropertyName("variants")] |
| 100 | + public List<Variant> Variants { get; set; } |
| 101 | + |
| 102 | + /// <summary> |
| 103 | + /// Gets or Sets Configuration |
| 104 | + /// </summary> |
| 105 | + [JsonPropertyName("configuration")] |
| 106 | + public ABTestConfiguration Configuration { get; set; } |
| 107 | + |
| 108 | + /// <summary> |
| 109 | + /// Unique migrated A/B test identifier. |
| 110 | + /// </summary> |
| 111 | + /// <value>Unique migrated A/B test identifier.</value> |
| 112 | + [JsonPropertyName("migratedAbTestID")] |
| 113 | + public int? MigratedAbTestID { get; set; } |
| 114 | + |
| 115 | + /// <summary> |
| 116 | + /// Returns the string presentation of the object |
| 117 | + /// </summary> |
| 118 | + /// <returns>String presentation of the object</returns> |
| 119 | + public override string ToString() |
| 120 | + { |
| 121 | + StringBuilder sb = new StringBuilder(); |
| 122 | + sb.Append("class ABTest {\n"); |
| 123 | + sb.Append(" AbTestID: ").Append(AbTestID).Append("\n"); |
| 124 | + sb.Append(" UpdatedAt: ").Append(UpdatedAt).Append("\n"); |
| 125 | + sb.Append(" CreatedAt: ").Append(CreatedAt).Append("\n"); |
| 126 | + sb.Append(" EndAt: ").Append(EndAt).Append("\n"); |
| 127 | + sb.Append(" Name: ").Append(Name).Append("\n"); |
| 128 | + sb.Append(" Status: ").Append(Status).Append("\n"); |
| 129 | + sb.Append(" Variants: ").Append(Variants).Append("\n"); |
| 130 | + sb.Append(" Configuration: ").Append(Configuration).Append("\n"); |
| 131 | + sb.Append(" MigratedAbTestID: ").Append(MigratedAbTestID).Append("\n"); |
| 132 | + sb.Append("}\n"); |
| 133 | + return sb.ToString(); |
| 134 | + } |
| 135 | + |
| 136 | + /// <summary> |
| 137 | + /// Returns the JSON string presentation of the object |
| 138 | + /// </summary> |
| 139 | + /// <returns>JSON string presentation of the object</returns> |
| 140 | + public virtual string ToJson() |
| 141 | + { |
| 142 | + return JsonSerializer.Serialize(this, JsonConfig.Options); |
| 143 | + } |
| 144 | + |
| 145 | + /// <summary> |
| 146 | + /// Returns true if objects are equal |
| 147 | + /// </summary> |
| 148 | + /// <param name="obj">Object to be compared</param> |
| 149 | + /// <returns>Boolean</returns> |
| 150 | + public override bool Equals(object obj) |
| 151 | + { |
| 152 | + if (obj is not ABTest input) |
| 153 | + { |
| 154 | + return false; |
| 155 | + } |
| 156 | + |
| 157 | + return (AbTestID == input.AbTestID || AbTestID.Equals(input.AbTestID)) |
| 158 | + && (UpdatedAt == input.UpdatedAt || (UpdatedAt != null && UpdatedAt.Equals(input.UpdatedAt))) |
| 159 | + && (CreatedAt == input.CreatedAt || (CreatedAt != null && CreatedAt.Equals(input.CreatedAt))) |
| 160 | + && (EndAt == input.EndAt || (EndAt != null && EndAt.Equals(input.EndAt))) |
| 161 | + && (Name == input.Name || (Name != null && Name.Equals(input.Name))) |
| 162 | + && (Status == input.Status || Status.Equals(input.Status)) |
| 163 | + && ( |
| 164 | + Variants == input.Variants |
| 165 | + || Variants != null && input.Variants != null && Variants.SequenceEqual(input.Variants) |
| 166 | + ) |
| 167 | + && ( |
| 168 | + Configuration == input.Configuration |
| 169 | + || (Configuration != null && Configuration.Equals(input.Configuration)) |
| 170 | + ) |
| 171 | + && ( |
| 172 | + MigratedAbTestID == input.MigratedAbTestID |
| 173 | + || MigratedAbTestID.Equals(input.MigratedAbTestID) |
| 174 | + ); |
| 175 | + } |
| 176 | + |
| 177 | + /// <summary> |
| 178 | + /// Gets the hash code |
| 179 | + /// </summary> |
| 180 | + /// <returns>Hash code</returns> |
| 181 | + public override int GetHashCode() |
| 182 | + { |
| 183 | + unchecked // Overflow is fine, just wrap |
| 184 | + { |
| 185 | + int hashCode = 41; |
| 186 | + hashCode = (hashCode * 59) + AbTestID.GetHashCode(); |
| 187 | + if (UpdatedAt != null) |
| 188 | + { |
| 189 | + hashCode = (hashCode * 59) + UpdatedAt.GetHashCode(); |
| 190 | + } |
| 191 | + if (CreatedAt != null) |
| 192 | + { |
| 193 | + hashCode = (hashCode * 59) + CreatedAt.GetHashCode(); |
| 194 | + } |
| 195 | + if (EndAt != null) |
| 196 | + { |
| 197 | + hashCode = (hashCode * 59) + EndAt.GetHashCode(); |
| 198 | + } |
| 199 | + if (Name != null) |
| 200 | + { |
| 201 | + hashCode = (hashCode * 59) + Name.GetHashCode(); |
| 202 | + } |
| 203 | + hashCode = (hashCode * 59) + Status.GetHashCode(); |
| 204 | + if (Variants != null) |
| 205 | + { |
| 206 | + hashCode = (hashCode * 59) + Variants.GetHashCode(); |
| 207 | + } |
| 208 | + if (Configuration != null) |
| 209 | + { |
| 210 | + hashCode = (hashCode * 59) + Configuration.GetHashCode(); |
| 211 | + } |
| 212 | + hashCode = (hashCode * 59) + MigratedAbTestID.GetHashCode(); |
| 213 | + return hashCode; |
| 214 | + } |
| 215 | + } |
| 216 | +} |
0 commit comments