Skip to content

Commit c07b524

Browse files
fix(specs): document abTest field on listIndices response (generated)
algolia/api-clients-automation#6443 Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com> Co-authored-by: Eric Zaharia <94015633+eric-zaharia@users.noreply.github.com>
1 parent 2728f93 commit c07b524

4 files changed

Lines changed: 420 additions & 1 deletion

File tree

algoliasearch/Models/Search/FetchedIndex.cs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,19 @@ bool pendingTask
141141
[JsonPropertyName("virtual")]
142142
public bool? Virtual { get; set; }
143143

144+
/// <summary>
145+
/// Gets or Sets AbTest
146+
/// </summary>
147+
[JsonPropertyName("abTest")]
148+
public FetchedIndexAbTest AbTest { get; set; }
149+
150+
/// <summary>
151+
/// Name of the index that owns the A/B test configuration. Only present when this index participates in an A/B test configured on another index.
152+
/// </summary>
153+
/// <value>Name of the index that owns the A/B test configuration. Only present when this index participates in an A/B test configured on another index.</value>
154+
[JsonPropertyName("sourceABTest")]
155+
public string SourceABTest { get; set; }
156+
144157
/// <summary>
145158
/// Returns the string presentation of the object
146159
/// </summary>
@@ -161,6 +174,8 @@ public override string ToString()
161174
sb.Append(" Primary: ").Append(Primary).Append("\n");
162175
sb.Append(" Replicas: ").Append(Replicas).Append("\n");
163176
sb.Append(" Virtual: ").Append(Virtual).Append("\n");
177+
sb.Append(" AbTest: ").Append(AbTest).Append("\n");
178+
sb.Append(" SourceABTest: ").Append(SourceABTest).Append("\n");
164179
sb.Append("}\n");
165180
return sb.ToString();
166181
}
@@ -203,7 +218,12 @@ public override bool Equals(object obj)
203218
Replicas == input.Replicas
204219
|| Replicas != null && input.Replicas != null && Replicas.SequenceEqual(input.Replicas)
205220
)
206-
&& (Virtual == input.Virtual || Virtual.Equals(input.Virtual));
221+
&& (Virtual == input.Virtual || Virtual.Equals(input.Virtual))
222+
&& (AbTest == input.AbTest || (AbTest != null && AbTest.Equals(input.AbTest)))
223+
&& (
224+
SourceABTest == input.SourceABTest
225+
|| (SourceABTest != null && SourceABTest.Equals(input.SourceABTest))
226+
);
207227
}
208228

209229
/// <summary>
@@ -242,6 +262,14 @@ public override int GetHashCode()
242262
hashCode = (hashCode * 59) + Replicas.GetHashCode();
243263
}
244264
hashCode = (hashCode * 59) + Virtual.GetHashCode();
265+
if (AbTest != null)
266+
{
267+
hashCode = (hashCode * 59) + AbTest.GetHashCode();
268+
}
269+
if (SourceABTest != null)
270+
{
271+
hashCode = (hashCode * 59) + SourceABTest.GetHashCode();
272+
}
245273
return hashCode;
246274
}
247275
}
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
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.Search;
13+
14+
/// <summary>
15+
/// A/B test metadata. Only present if the index is part of an active A/B test.
16+
/// </summary>
17+
public partial class FetchedIndexAbTest
18+
{
19+
/// <summary>
20+
/// Initializes a new instance of the FetchedIndexAbTest class.
21+
/// </summary>
22+
[JsonConstructor]
23+
public FetchedIndexAbTest() { }
24+
25+
/// <summary>
26+
/// Initializes a new instance of the FetchedIndexAbTest class.
27+
/// </summary>
28+
/// <param name="id">A/B test ID. (required).</param>
29+
/// <param name="variants">A/B test variants. (required).</param>
30+
public FetchedIndexAbTest(int id, List<FetchedIndexAbTestVariant> variants)
31+
{
32+
Id = id;
33+
Variants = variants ?? throw new ArgumentNullException(nameof(variants));
34+
}
35+
36+
/// <summary>
37+
/// A/B test ID.
38+
/// </summary>
39+
/// <value>A/B test ID.</value>
40+
[JsonPropertyName("id")]
41+
public int Id { get; set; }
42+
43+
/// <summary>
44+
/// Whether the A/B test is a dark test (server-side measured, not user-facing). Only present when true.
45+
/// </summary>
46+
/// <value>Whether the A/B test is a dark test (server-side measured, not user-facing). Only present when true.</value>
47+
[JsonPropertyName("isDark")]
48+
public bool? IsDark { get; set; }
49+
50+
/// <summary>
51+
/// A/B test schema version. Only present for v2 and later tests.
52+
/// </summary>
53+
/// <value>A/B test schema version. Only present for v2 and later tests.</value>
54+
[JsonPropertyName("version")]
55+
public int? VarVersion { get; set; }
56+
57+
/// <summary>
58+
/// A/B test type. Only present for v2 and later tests. Currently always `index-configuration`.
59+
/// </summary>
60+
/// <value>A/B test type. Only present for v2 and later tests. Currently always `index-configuration`.</value>
61+
[JsonPropertyName("type")]
62+
public string Type { get; set; }
63+
64+
/// <summary>
65+
/// Gets or Sets Target
66+
/// </summary>
67+
[JsonPropertyName("target")]
68+
public FetchedIndexAbTestTarget Target { get; set; }
69+
70+
/// <summary>
71+
/// A/B test variants.
72+
/// </summary>
73+
/// <value>A/B test variants.</value>
74+
[JsonPropertyName("variants")]
75+
public List<FetchedIndexAbTestVariant> Variants { get; set; }
76+
77+
/// <summary>
78+
/// Returns the string presentation of the object
79+
/// </summary>
80+
/// <returns>String presentation of the object</returns>
81+
public override string ToString()
82+
{
83+
StringBuilder sb = new StringBuilder();
84+
sb.Append("class FetchedIndexAbTest {\n");
85+
sb.Append(" Id: ").Append(Id).Append("\n");
86+
sb.Append(" IsDark: ").Append(IsDark).Append("\n");
87+
sb.Append(" VarVersion: ").Append(VarVersion).Append("\n");
88+
sb.Append(" Type: ").Append(Type).Append("\n");
89+
sb.Append(" Target: ").Append(Target).Append("\n");
90+
sb.Append(" Variants: ").Append(Variants).Append("\n");
91+
sb.Append("}\n");
92+
return sb.ToString();
93+
}
94+
95+
/// <summary>
96+
/// Returns the JSON string presentation of the object
97+
/// </summary>
98+
/// <returns>JSON string presentation of the object</returns>
99+
public virtual string ToJson()
100+
{
101+
return JsonSerializer.Serialize(this, JsonConfig.Options);
102+
}
103+
104+
/// <summary>
105+
/// Returns true if objects are equal
106+
/// </summary>
107+
/// <param name="obj">Object to be compared</param>
108+
/// <returns>Boolean</returns>
109+
public override bool Equals(object obj)
110+
{
111+
if (obj is not FetchedIndexAbTest input)
112+
{
113+
return false;
114+
}
115+
116+
return (Id == input.Id || Id.Equals(input.Id))
117+
&& (IsDark == input.IsDark || IsDark.Equals(input.IsDark))
118+
&& (VarVersion == input.VarVersion || VarVersion.Equals(input.VarVersion))
119+
&& (Type == input.Type || (Type != null && Type.Equals(input.Type)))
120+
&& (Target == input.Target || (Target != null && Target.Equals(input.Target)))
121+
&& (
122+
Variants == input.Variants
123+
|| Variants != null && input.Variants != null && Variants.SequenceEqual(input.Variants)
124+
);
125+
}
126+
127+
/// <summary>
128+
/// Gets the hash code
129+
/// </summary>
130+
/// <returns>Hash code</returns>
131+
public override int GetHashCode()
132+
{
133+
unchecked // Overflow is fine, just wrap
134+
{
135+
int hashCode = 41;
136+
hashCode = (hashCode * 59) + Id.GetHashCode();
137+
hashCode = (hashCode * 59) + IsDark.GetHashCode();
138+
hashCode = (hashCode * 59) + VarVersion.GetHashCode();
139+
if (Type != null)
140+
{
141+
hashCode = (hashCode * 59) + Type.GetHashCode();
142+
}
143+
if (Target != null)
144+
{
145+
hashCode = (hashCode * 59) + Target.GetHashCode();
146+
}
147+
if (Variants != null)
148+
{
149+
hashCode = (hashCode * 59) + Variants.GetHashCode();
150+
}
151+
return hashCode;
152+
}
153+
}
154+
}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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.Search;
13+
14+
/// <summary>
15+
/// A/B test target criteria. Only present for v2 and later tests.
16+
/// </summary>
17+
public partial class FetchedIndexAbTestTarget
18+
{
19+
/// <summary>
20+
/// Initializes a new instance of the FetchedIndexAbTestTarget class.
21+
/// </summary>
22+
[JsonConstructor]
23+
public FetchedIndexAbTestTarget() { }
24+
25+
/// <summary>
26+
/// Initializes a new instance of the FetchedIndexAbTestTarget class.
27+
/// </summary>
28+
/// <param name="indexName">Index name to match. Use `*` to target the entire application. (required).</param>
29+
public FetchedIndexAbTestTarget(string indexName)
30+
{
31+
IndexName = indexName ?? throw new ArgumentNullException(nameof(indexName));
32+
}
33+
34+
/// <summary>
35+
/// Index name to match. Use `*` to target the entire application.
36+
/// </summary>
37+
/// <value>Index name to match. Use `*` to target the entire application.</value>
38+
[JsonPropertyName("indexName")]
39+
public string IndexName { get; set; }
40+
41+
/// <summary>
42+
/// Returns the string presentation of the object
43+
/// </summary>
44+
/// <returns>String presentation of the object</returns>
45+
public override string ToString()
46+
{
47+
StringBuilder sb = new StringBuilder();
48+
sb.Append("class FetchedIndexAbTestTarget {\n");
49+
sb.Append(" IndexName: ").Append(IndexName).Append("\n");
50+
sb.Append("}\n");
51+
return sb.ToString();
52+
}
53+
54+
/// <summary>
55+
/// Returns the JSON string presentation of the object
56+
/// </summary>
57+
/// <returns>JSON string presentation of the object</returns>
58+
public virtual string ToJson()
59+
{
60+
return JsonSerializer.Serialize(this, JsonConfig.Options);
61+
}
62+
63+
/// <summary>
64+
/// Returns true if objects are equal
65+
/// </summary>
66+
/// <param name="obj">Object to be compared</param>
67+
/// <returns>Boolean</returns>
68+
public override bool Equals(object obj)
69+
{
70+
if (obj is not FetchedIndexAbTestTarget input)
71+
{
72+
return false;
73+
}
74+
75+
return (
76+
IndexName == input.IndexName || (IndexName != null && IndexName.Equals(input.IndexName))
77+
);
78+
}
79+
80+
/// <summary>
81+
/// Gets the hash code
82+
/// </summary>
83+
/// <returns>Hash code</returns>
84+
public override int GetHashCode()
85+
{
86+
unchecked // Overflow is fine, just wrap
87+
{
88+
int hashCode = 41;
89+
if (IndexName != null)
90+
{
91+
hashCode = (hashCode * 59) + IndexName.GetHashCode();
92+
}
93+
return hashCode;
94+
}
95+
}
96+
}

0 commit comments

Comments
 (0)