Skip to content

Commit 1574b51

Browse files
algolia-botshortcutsmillotp
committed
fix(clients): highlight and snippet results e2e (#3567) (generated) [skip ci]
Co-authored-by: Clément Vannicatte <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 4cbbce5 commit 1574b51

File tree

187 files changed

+3358
-3062
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+3358
-3062
lines changed

clients/algoliasearch-client-csharp/algoliasearch/Models/Abtesting/ABTest.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,15 @@ public ABTest() { }
3131
/// Initializes a new instance of the ABTest class.
3232
/// </summary>
3333
/// <param name="abTestID">Unique A/B test identifier. (required).</param>
34-
/// <param name="clickSignificance">clickSignificance (required).</param>
35-
/// <param name="conversionSignificance">conversionSignificance (required).</param>
36-
/// <param name="addToCartSignificance">addToCartSignificance (required).</param>
37-
/// <param name="purchaseSignificance">purchaseSignificance (required).</param>
38-
/// <param name="revenueSignificance">revenueSignificance (required).</param>
3934
/// <param name="updatedAt">Date and time when the A/B test was last updated, in RFC 3339 format. (required).</param>
4035
/// <param name="createdAt">Date and time when the A/B test was created, in RFC 3339 format. (required).</param>
4136
/// <param name="endAt">End date and time of the A/B test, in RFC 3339 format. (required).</param>
4237
/// <param name="name">A/B test name. (required).</param>
4338
/// <param name="status">status (required).</param>
4439
/// <param name="variants">A/B test variants. The first variant is your _control_ index, typically your production index. The second variant is an index with changed settings that you want to test against the control. (required).</param>
45-
public ABTest(int abTestID, double? clickSignificance, double? conversionSignificance, double? addToCartSignificance, double? purchaseSignificance, Dictionary<string, double> revenueSignificance, string updatedAt, string createdAt, string endAt, string name, Status? status, List<Variant> variants)
40+
public ABTest(int abTestID, string updatedAt, string createdAt, string endAt, string name, Status? status, List<Variant> variants)
4641
{
4742
AbTestID = abTestID;
48-
ClickSignificance = clickSignificance ?? throw new ArgumentNullException(nameof(clickSignificance));
49-
ConversionSignificance = conversionSignificance ?? throw new ArgumentNullException(nameof(conversionSignificance));
50-
AddToCartSignificance = addToCartSignificance ?? throw new ArgumentNullException(nameof(addToCartSignificance));
51-
PurchaseSignificance = purchaseSignificance ?? throw new ArgumentNullException(nameof(purchaseSignificance));
52-
RevenueSignificance = revenueSignificance ?? throw new ArgumentNullException(nameof(revenueSignificance));
5343
UpdatedAt = updatedAt ?? throw new ArgumentNullException(nameof(updatedAt));
5444
CreatedAt = createdAt ?? throw new ArgumentNullException(nameof(createdAt));
5545
EndAt = endAt ?? throw new ArgumentNullException(nameof(endAt));

clients/algoliasearch-client-csharp/algoliasearch/Models/Abtesting/AddABTestsVariant.cs

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ public partial class AddABTestsVariant : AbstractSchema
2222
{
2323
/// <summary>
2424
/// Initializes a new instance of the AddABTestsVariant class
25-
/// with a AbTestsVariant
25+
/// with a AbTestsVariantSearchParams
2626
/// </summary>
27-
/// <param name="actualInstance">An instance of AbTestsVariant.</param>
28-
public AddABTestsVariant(AbTestsVariant actualInstance)
27+
/// <param name="actualInstance">An instance of AbTestsVariantSearchParams.</param>
28+
public AddABTestsVariant(AbTestsVariantSearchParams actualInstance)
2929
{
3030
ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
3131
}
3232

3333
/// <summary>
3434
/// Initializes a new instance of the AddABTestsVariant class
35-
/// with a AbTestsVariantSearchParams
35+
/// with a AbTestsVariant
3636
/// </summary>
37-
/// <param name="actualInstance">An instance of AbTestsVariantSearchParams.</param>
38-
public AddABTestsVariant(AbTestsVariantSearchParams actualInstance)
37+
/// <param name="actualInstance">An instance of AbTestsVariant.</param>
38+
public AddABTestsVariant(AbTestsVariant actualInstance)
3939
{
4040
ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
4141
}
@@ -47,42 +47,42 @@ public AddABTestsVariant(AbTestsVariantSearchParams actualInstance)
4747
public sealed override object ActualInstance { get; set; }
4848

4949
/// <summary>
50-
/// Get the actual instance of `AbTestsVariant`. If the actual instance is not `AbTestsVariant`,
50+
/// Get the actual instance of `AbTestsVariantSearchParams`. If the actual instance is not `AbTestsVariantSearchParams`,
5151
/// the InvalidClassException will be thrown
5252
/// </summary>
53-
/// <returns>An instance of AbTestsVariant</returns>
54-
public AbTestsVariant AsAbTestsVariant()
53+
/// <returns>An instance of AbTestsVariantSearchParams</returns>
54+
public AbTestsVariantSearchParams AsAbTestsVariantSearchParams()
5555
{
56-
return (AbTestsVariant)ActualInstance;
56+
return (AbTestsVariantSearchParams)ActualInstance;
5757
}
5858

5959
/// <summary>
60-
/// Get the actual instance of `AbTestsVariantSearchParams`. If the actual instance is not `AbTestsVariantSearchParams`,
60+
/// Get the actual instance of `AbTestsVariant`. If the actual instance is not `AbTestsVariant`,
6161
/// the InvalidClassException will be thrown
6262
/// </summary>
63-
/// <returns>An instance of AbTestsVariantSearchParams</returns>
64-
public AbTestsVariantSearchParams AsAbTestsVariantSearchParams()
63+
/// <returns>An instance of AbTestsVariant</returns>
64+
public AbTestsVariant AsAbTestsVariant()
6565
{
66-
return (AbTestsVariantSearchParams)ActualInstance;
66+
return (AbTestsVariant)ActualInstance;
6767
}
6868

6969

7070
/// <summary>
71-
/// Check if the actual instance is of `AbTestsVariant` type.
71+
/// Check if the actual instance is of `AbTestsVariantSearchParams` type.
7272
/// </summary>
7373
/// <returns>Whether or not the instance is the type</returns>
74-
public bool IsAbTestsVariant()
74+
public bool IsAbTestsVariantSearchParams()
7575
{
76-
return ActualInstance.GetType() == typeof(AbTestsVariant);
76+
return ActualInstance.GetType() == typeof(AbTestsVariantSearchParams);
7777
}
7878

7979
/// <summary>
80-
/// Check if the actual instance is of `AbTestsVariantSearchParams` type.
80+
/// Check if the actual instance is of `AbTestsVariant` type.
8181
/// </summary>
8282
/// <returns>Whether or not the instance is the type</returns>
83-
public bool IsAbTestsVariantSearchParams()
83+
public bool IsAbTestsVariant()
8484
{
85-
return ActualInstance.GetType() == typeof(AbTestsVariantSearchParams);
85+
return ActualInstance.GetType() == typeof(AbTestsVariant);
8686
}
8787

8888
/// <summary>
@@ -169,28 +169,28 @@ public override AddABTestsVariant Read(ref Utf8JsonReader reader, Type typeToCon
169169
{
170170
var jsonDocument = JsonDocument.ParseValue(ref reader);
171171
var root = jsonDocument.RootElement;
172-
if (root.ValueKind == JsonValueKind.Object)
172+
if (root.ValueKind == JsonValueKind.Object && root.TryGetProperty("customSearchParameters", out _))
173173
{
174174
try
175175
{
176-
return new AddABTestsVariant(jsonDocument.Deserialize<AbTestsVariant>(JsonConfig.Options));
176+
return new AddABTestsVariant(jsonDocument.Deserialize<AbTestsVariantSearchParams>(JsonConfig.Options));
177177
}
178178
catch (Exception exception)
179179
{
180180
// deserialization failed, try the next one
181-
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into AbTestsVariant: {exception}");
181+
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into AbTestsVariantSearchParams: {exception}");
182182
}
183183
}
184184
if (root.ValueKind == JsonValueKind.Object)
185185
{
186186
try
187187
{
188-
return new AddABTestsVariant(jsonDocument.Deserialize<AbTestsVariantSearchParams>(JsonConfig.Options));
188+
return new AddABTestsVariant(jsonDocument.Deserialize<AbTestsVariant>(JsonConfig.Options));
189189
}
190190
catch (Exception exception)
191191
{
192192
// deserialization failed, try the next one
193-
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into AbTestsVariantSearchParams: {exception}");
193+
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into AbTestsVariant: {exception}");
194194
}
195195
}
196196
throw new InvalidDataException($"The JSON string cannot be deserialized into any schema defined.");

clients/algoliasearch-client-csharp/algoliasearch/Models/Abtesting/Variant.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,25 @@ public Variant() { }
2525
/// Initializes a new instance of the Variant class.
2626
/// </summary>
2727
/// <param name="addToCartCount">Number of add-to-cart events for this variant. (required).</param>
28-
/// <param name="addToCartRate">[Add-to-cart rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#add-to-cart-rate) for this variant. (required).</param>
29-
/// <param name="averageClickPosition">[Average click position](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-position) for this variant. (required).</param>
3028
/// <param name="clickCount">Number of click events for this variant. (required).</param>
31-
/// <param name="clickThroughRate">[Click-through rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#click-through-rate) for this variant. (required).</param>
3229
/// <param name="conversionCount">Number of click events for this variant. (required).</param>
33-
/// <param name="conversionRate">[Conversion rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#conversion-rate) for this variant. (required).</param>
3430
/// <param name="description">Description for this variant. (required).</param>
3531
/// <param name="index">Index name of the A/B test variant (case-sensitive). (required).</param>
3632
/// <param name="noResultCount">Number of [searches without results](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#searches-without-results) for this variant. (required).</param>
3733
/// <param name="purchaseCount">Number of purchase events for this variant. (required).</param>
38-
/// <param name="purchaseRate">[Purchase rate](https://www.algolia.com/doc/guides/search-analytics/concepts/metrics/#purchase-rate) for this variant. (required).</param>
3934
/// <param name="searchCount">Number of searches for this variant. (required).</param>
4035
/// <param name="trafficPercentage">Percentage of search requests each variant receives. (required).</param>
4136
/// <param name="userCount">Number of users that made searches to this variant. (required).</param>
4237
/// <param name="trackedUserCount">Number of users that made tracked searches to this variant. (required).</param>
43-
public Variant(int addToCartCount, double? addToCartRate, int? averageClickPosition, int clickCount, double? clickThroughRate, int conversionCount, double? conversionRate, string description, string index, int? noResultCount, int purchaseCount, double? purchaseRate, int? searchCount, int trafficPercentage, int? userCount, int? trackedUserCount)
38+
public Variant(int addToCartCount, int clickCount, int conversionCount, string description, string index, int? noResultCount, int purchaseCount, int? searchCount, int trafficPercentage, int? userCount, int? trackedUserCount)
4439
{
4540
AddToCartCount = addToCartCount;
46-
AddToCartRate = addToCartRate ?? throw new ArgumentNullException(nameof(addToCartRate));
47-
AverageClickPosition = averageClickPosition ?? throw new ArgumentNullException(nameof(averageClickPosition));
4841
ClickCount = clickCount;
49-
ClickThroughRate = clickThroughRate ?? throw new ArgumentNullException(nameof(clickThroughRate));
5042
ConversionCount = conversionCount;
51-
ConversionRate = conversionRate ?? throw new ArgumentNullException(nameof(conversionRate));
5243
Description = description ?? throw new ArgumentNullException(nameof(description));
5344
Index = index ?? throw new ArgumentNullException(nameof(index));
5445
NoResultCount = noResultCount ?? throw new ArgumentNullException(nameof(noResultCount));
5546
PurchaseCount = purchaseCount;
56-
PurchaseRate = purchaseRate ?? throw new ArgumentNullException(nameof(purchaseRate));
5747
SearchCount = searchCount ?? throw new ArgumentNullException(nameof(searchCount));
5848
TrafficPercentage = trafficPercentage;
5949
UserCount = userCount ?? throw new ArgumentNullException(nameof(userCount));

clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthInput.cs

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ namespace Algolia.Search.Models.Ingestion;
2020
[JsonConverter(typeof(AuthInputJsonConverter))]
2121
public partial class AuthInput : AbstractSchema
2222
{
23+
/// <summary>
24+
/// Initializes a new instance of the AuthInput class
25+
/// with a AuthOAuth
26+
/// </summary>
27+
/// <param name="actualInstance">An instance of AuthOAuth.</param>
28+
public AuthInput(AuthOAuth actualInstance)
29+
{
30+
ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
31+
}
32+
2333
/// <summary>
2434
/// Initializes a new instance of the AuthInput class
2535
/// with a AuthGoogleServiceAccount
@@ -50,16 +60,6 @@ public AuthInput(AuthAPIKey actualInstance)
5060
ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
5161
}
5262

53-
/// <summary>
54-
/// Initializes a new instance of the AuthInput class
55-
/// with a AuthOAuth
56-
/// </summary>
57-
/// <param name="actualInstance">An instance of AuthOAuth.</param>
58-
public AuthInput(AuthOAuth actualInstance)
59-
{
60-
ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
61-
}
62-
6363
/// <summary>
6464
/// Initializes a new instance of the AuthInput class
6565
/// with a AuthAlgolia
@@ -86,6 +86,16 @@ public AuthInput(AuthAlgoliaInsights actualInstance)
8686
/// </summary>
8787
public sealed override object ActualInstance { get; set; }
8888

89+
/// <summary>
90+
/// Get the actual instance of `AuthOAuth`. If the actual instance is not `AuthOAuth`,
91+
/// the InvalidClassException will be thrown
92+
/// </summary>
93+
/// <returns>An instance of AuthOAuth</returns>
94+
public AuthOAuth AsAuthOAuth()
95+
{
96+
return (AuthOAuth)ActualInstance;
97+
}
98+
8999
/// <summary>
90100
/// Get the actual instance of `AuthGoogleServiceAccount`. If the actual instance is not `AuthGoogleServiceAccount`,
91101
/// the InvalidClassException will be thrown
@@ -116,16 +126,6 @@ public AuthAPIKey AsAuthAPIKey()
116126
return (AuthAPIKey)ActualInstance;
117127
}
118128

119-
/// <summary>
120-
/// Get the actual instance of `AuthOAuth`. If the actual instance is not `AuthOAuth`,
121-
/// the InvalidClassException will be thrown
122-
/// </summary>
123-
/// <returns>An instance of AuthOAuth</returns>
124-
public AuthOAuth AsAuthOAuth()
125-
{
126-
return (AuthOAuth)ActualInstance;
127-
}
128-
129129
/// <summary>
130130
/// Get the actual instance of `AuthAlgolia`. If the actual instance is not `AuthAlgolia`,
131131
/// the InvalidClassException will be thrown
@@ -147,6 +147,15 @@ public AuthAlgoliaInsights AsAuthAlgoliaInsights()
147147
}
148148

149149

150+
/// <summary>
151+
/// Check if the actual instance is of `AuthOAuth` type.
152+
/// </summary>
153+
/// <returns>Whether or not the instance is the type</returns>
154+
public bool IsAuthOAuth()
155+
{
156+
return ActualInstance.GetType() == typeof(AuthOAuth);
157+
}
158+
150159
/// <summary>
151160
/// Check if the actual instance is of `AuthGoogleServiceAccount` type.
152161
/// </summary>
@@ -174,15 +183,6 @@ public bool IsAuthAPIKey()
174183
return ActualInstance.GetType() == typeof(AuthAPIKey);
175184
}
176185

177-
/// <summary>
178-
/// Check if the actual instance is of `AuthOAuth` type.
179-
/// </summary>
180-
/// <returns>Whether or not the instance is the type</returns>
181-
public bool IsAuthOAuth()
182-
{
183-
return ActualInstance.GetType() == typeof(AuthOAuth);
184-
}
185-
186186
/// <summary>
187187
/// Check if the actual instance is of `AuthAlgolia` type.
188188
/// </summary>
@@ -285,52 +285,52 @@ public override AuthInput Read(ref Utf8JsonReader reader, Type typeToConvert, Js
285285
{
286286
var jsonDocument = JsonDocument.ParseValue(ref reader);
287287
var root = jsonDocument.RootElement;
288-
if (root.ValueKind == JsonValueKind.Object)
288+
if (root.ValueKind == JsonValueKind.Object && root.TryGetProperty("url", out _) && root.TryGetProperty("client_id", out _) && root.TryGetProperty("client_secret", out _))
289289
{
290290
try
291291
{
292-
return new AuthInput(jsonDocument.Deserialize<AuthGoogleServiceAccount>(JsonConfig.Options));
292+
return new AuthInput(jsonDocument.Deserialize<AuthOAuth>(JsonConfig.Options));
293293
}
294294
catch (Exception exception)
295295
{
296296
// deserialization failed, try the next one
297-
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into AuthGoogleServiceAccount: {exception}");
297+
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into AuthOAuth: {exception}");
298298
}
299299
}
300-
if (root.ValueKind == JsonValueKind.Object)
300+
if (root.ValueKind == JsonValueKind.Object && root.TryGetProperty("clientEmail", out _) && root.TryGetProperty("privateKey", out _))
301301
{
302302
try
303303
{
304-
return new AuthInput(jsonDocument.Deserialize<AuthBasic>(JsonConfig.Options));
304+
return new AuthInput(jsonDocument.Deserialize<AuthGoogleServiceAccount>(JsonConfig.Options));
305305
}
306306
catch (Exception exception)
307307
{
308308
// deserialization failed, try the next one
309-
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into AuthBasic: {exception}");
309+
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into AuthGoogleServiceAccount: {exception}");
310310
}
311311
}
312-
if (root.ValueKind == JsonValueKind.Object)
312+
if (root.ValueKind == JsonValueKind.Object && root.TryGetProperty("username", out _) && root.TryGetProperty("password", out _))
313313
{
314314
try
315315
{
316-
return new AuthInput(jsonDocument.Deserialize<AuthAPIKey>(JsonConfig.Options));
316+
return new AuthInput(jsonDocument.Deserialize<AuthBasic>(JsonConfig.Options));
317317
}
318318
catch (Exception exception)
319319
{
320320
// deserialization failed, try the next one
321-
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into AuthAPIKey: {exception}");
321+
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into AuthBasic: {exception}");
322322
}
323323
}
324-
if (root.ValueKind == JsonValueKind.Object)
324+
if (root.ValueKind == JsonValueKind.Object && root.TryGetProperty("key", out _))
325325
{
326326
try
327327
{
328-
return new AuthInput(jsonDocument.Deserialize<AuthOAuth>(JsonConfig.Options));
328+
return new AuthInput(jsonDocument.Deserialize<AuthAPIKey>(JsonConfig.Options));
329329
}
330330
catch (Exception exception)
331331
{
332332
// deserialization failed, try the next one
333-
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into AuthOAuth: {exception}");
333+
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into AuthAPIKey: {exception}");
334334
}
335335
}
336336
if (root.ValueKind == JsonValueKind.Object)

clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/AuthInputPartial.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public override AuthInputPartial Read(ref Utf8JsonReader reader, Type typeToConv
285285
{
286286
var jsonDocument = JsonDocument.ParseValue(ref reader);
287287
var root = jsonDocument.RootElement;
288-
if (root.ValueKind == JsonValueKind.Object)
288+
if (root.ValueKind == JsonValueKind.Object && root.TryGetProperty("clientEmail", out _))
289289
{
290290
try
291291
{
@@ -297,7 +297,7 @@ public override AuthInputPartial Read(ref Utf8JsonReader reader, Type typeToConv
297297
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into AuthGoogleServiceAccountPartial: {exception}");
298298
}
299299
}
300-
if (root.ValueKind == JsonValueKind.Object)
300+
if (root.ValueKind == JsonValueKind.Object && root.TryGetProperty("username", out _))
301301
{
302302
try
303303
{
@@ -309,7 +309,7 @@ public override AuthInputPartial Read(ref Utf8JsonReader reader, Type typeToConv
309309
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into AuthBasicPartial: {exception}");
310310
}
311311
}
312-
if (root.ValueKind == JsonValueKind.Object)
312+
if (root.ValueKind == JsonValueKind.Object && root.TryGetProperty("key", out _))
313313
{
314314
try
315315
{
@@ -321,7 +321,7 @@ public override AuthInputPartial Read(ref Utf8JsonReader reader, Type typeToConv
321321
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into AuthAPIKeyPartial: {exception}");
322322
}
323323
}
324-
if (root.ValueKind == JsonValueKind.Object)
324+
if (root.ValueKind == JsonValueKind.Object && root.TryGetProperty("url", out _))
325325
{
326326
try
327327
{

0 commit comments

Comments
 (0)