Skip to content

Commit 31b8b37

Browse files
algolia-botFluf22
andcommitted
chore: empty commit (generated)
Co-authored-by: Thomas Raffray <[email protected]>
1 parent 065b093 commit 31b8b37

File tree

84 files changed

+955
-1688
lines changed

Some content is hidden

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

84 files changed

+955
-1688
lines changed

clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/HighlightResult.cs

Lines changed: 12 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,10 @@ public HighlightResult(Dictionary<string, HighlightResult> actualInstance)
4242

4343
/// <summary>
4444
/// Initializes a new instance of the HighlightResult class
45-
/// with a Dictionary{string, HighlightResultOption}
45+
/// with a List{HighlightResult}
4646
/// </summary>
47-
/// <param name="actualInstance">An instance of Dictionary&lt;string, HighlightResultOption&gt;.</param>
48-
public HighlightResult(Dictionary<string, HighlightResultOption> actualInstance)
49-
{
50-
ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
51-
}
52-
53-
/// <summary>
54-
/// Initializes a new instance of the HighlightResult class
55-
/// with a List{HighlightResultOption}
56-
/// </summary>
57-
/// <param name="actualInstance">An instance of List&lt;HighlightResultOption&gt;.</param>
58-
public HighlightResult(List<HighlightResultOption> actualInstance)
47+
/// <param name="actualInstance">An instance of List&lt;HighlightResult&gt;.</param>
48+
public HighlightResult(List<HighlightResult> actualInstance)
5949
{
6050
ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
6151
}
@@ -87,23 +77,13 @@ public Dictionary<string, HighlightResult> AsDictionaryHighlightResult()
8777
}
8878

8979
/// <summary>
90-
/// Get the actual instance of `Dictionary{string, HighlightResultOption}`. If the actual instance is not `Dictionary{string, HighlightResultOption}`,
80+
/// Get the actual instance of `List{HighlightResult}`. If the actual instance is not `List{HighlightResult}`,
9181
/// the InvalidClassException will be thrown
9282
/// </summary>
93-
/// <returns>An instance of Dictionary&lt;string, HighlightResultOption&gt;</returns>
94-
public Dictionary<string, HighlightResultOption> AsDictionaryHighlightResultOption()
83+
/// <returns>An instance of List&lt;HighlightResult&gt;</returns>
84+
public List<HighlightResult> AsListHighlightResult()
9585
{
96-
return (Dictionary<string, HighlightResultOption>)ActualInstance;
97-
}
98-
99-
/// <summary>
100-
/// Get the actual instance of `List{HighlightResultOption}`. If the actual instance is not `List{HighlightResultOption}`,
101-
/// the InvalidClassException will be thrown
102-
/// </summary>
103-
/// <returns>An instance of List&lt;HighlightResultOption&gt;</returns>
104-
public List<HighlightResultOption> AsListHighlightResultOption()
105-
{
106-
return (List<HighlightResultOption>)ActualInstance;
86+
return (List<HighlightResult>)ActualInstance;
10787
}
10888

10989

@@ -126,21 +106,12 @@ public bool IsDictionaryHighlightResult()
126106
}
127107

128108
/// <summary>
129-
/// Check if the actual instance is of `Dictionary{string, HighlightResultOption}` type.
109+
/// Check if the actual instance is of `List{HighlightResult}` type.
130110
/// </summary>
131111
/// <returns>Whether or not the instance is the type</returns>
132-
public bool IsDictionaryHighlightResultOption()
112+
public bool IsListHighlightResult()
133113
{
134-
return ActualInstance.GetType() == typeof(Dictionary<string, HighlightResultOption>);
135-
}
136-
137-
/// <summary>
138-
/// Check if the actual instance is of `List{HighlightResultOption}` type.
139-
/// </summary>
140-
/// <returns>Whether or not the instance is the type</returns>
141-
public bool IsListHighlightResultOption()
142-
{
143-
return ActualInstance.GetType() == typeof(List<HighlightResultOption>);
114+
return ActualInstance.GetType() == typeof(List<HighlightResult>);
144115
}
145116

146117
/// <summary>
@@ -251,28 +222,16 @@ public override HighlightResult Read(ref Utf8JsonReader reader, Type typeToConve
251222
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into Dictionary<string, HighlightResult>: {exception}");
252223
}
253224
}
254-
if (root.ValueKind == JsonValueKind.Object)
255-
{
256-
try
257-
{
258-
return new HighlightResult(jsonDocument.Deserialize<Dictionary<string, HighlightResultOption>>(JsonConfig.Options));
259-
}
260-
catch (Exception exception)
261-
{
262-
// deserialization failed, try the next one
263-
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into Dictionary<string, HighlightResultOption>: {exception}");
264-
}
265-
}
266225
if (root.ValueKind == JsonValueKind.Array)
267226
{
268227
try
269228
{
270-
return new HighlightResult(jsonDocument.Deserialize<List<HighlightResultOption>>(JsonConfig.Options));
229+
return new HighlightResult(jsonDocument.Deserialize<List<HighlightResult>>(JsonConfig.Options));
271230
}
272231
catch (Exception exception)
273232
{
274233
// deserialization failed, try the next one
275-
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into List<HighlightResultOption>: {exception}");
234+
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into List<HighlightResult>: {exception}");
276235
}
277236
}
278237
throw new InvalidDataException($"The JSON string cannot be deserialized into any schema defined.");

clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendationsResults.cs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,10 @@ public RecommendationsResults() { }
2525
/// Initializes a new instance of the RecommendationsResults class.
2626
/// </summary>
2727
/// <param name="processingTimeMS">Time the server took to process the request, in milliseconds. (required).</param>
28-
/// <param name="page">Page of search results to retrieve. (required) (default to 0).</param>
29-
/// <param name="nbHits">Number of results (hits). (required).</param>
30-
/// <param name="nbPages">Number of pages of results. (required).</param>
31-
/// <param name="hitsPerPage">Number of hits per page. (required) (default to 20).</param>
3228
/// <param name="hits">hits (required).</param>
33-
public RecommendationsResults(int processingTimeMS, int page, int nbHits, int nbPages, int hitsPerPage, List<RecommendationsHit> hits)
29+
public RecommendationsResults(int processingTimeMS, List<RecommendationsHit> hits)
3430
{
3531
ProcessingTimeMS = processingTimeMS;
36-
Page = page;
37-
NbHits = nbHits;
38-
NbPages = nbPages;
39-
HitsPerPage = hitsPerPage;
4032
Hits = hits ?? throw new ArgumentNullException(nameof(hits));
4133
}
4234

@@ -220,28 +212,28 @@ public RecommendationsResults(int processingTimeMS, int page, int nbHits, int nb
220212
/// </summary>
221213
/// <value>Page of search results to retrieve.</value>
222214
[JsonPropertyName("page")]
223-
public int Page { get; set; }
215+
public int? Page { get; set; }
224216

225217
/// <summary>
226218
/// Number of results (hits).
227219
/// </summary>
228220
/// <value>Number of results (hits).</value>
229221
[JsonPropertyName("nbHits")]
230-
public int NbHits { get; set; }
222+
public int? NbHits { get; set; }
231223

232224
/// <summary>
233225
/// Number of pages of results.
234226
/// </summary>
235227
/// <value>Number of pages of results.</value>
236228
[JsonPropertyName("nbPages")]
237-
public int NbPages { get; set; }
229+
public int? NbPages { get; set; }
238230

239231
/// <summary>
240232
/// Number of hits per page.
241233
/// </summary>
242234
/// <value>Number of hits per page.</value>
243235
[JsonPropertyName("hitsPerPage")]
244-
public int HitsPerPage { get; set; }
236+
public int? HitsPerPage { get; set; }
245237

246238
/// <summary>
247239
/// Gets or Sets Hits

clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/SnippetResult.cs

Lines changed: 12 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,10 @@ public SnippetResult(Dictionary<string, SnippetResult> actualInstance)
4242

4343
/// <summary>
4444
/// Initializes a new instance of the SnippetResult class
45-
/// with a Dictionary{string, SnippetResultOption}
45+
/// with a List{SnippetResult}
4646
/// </summary>
47-
/// <param name="actualInstance">An instance of Dictionary&lt;string, SnippetResultOption&gt;.</param>
48-
public SnippetResult(Dictionary<string, SnippetResultOption> actualInstance)
49-
{
50-
ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
51-
}
52-
53-
/// <summary>
54-
/// Initializes a new instance of the SnippetResult class
55-
/// with a List{SnippetResultOption}
56-
/// </summary>
57-
/// <param name="actualInstance">An instance of List&lt;SnippetResultOption&gt;.</param>
58-
public SnippetResult(List<SnippetResultOption> actualInstance)
47+
/// <param name="actualInstance">An instance of List&lt;SnippetResult&gt;.</param>
48+
public SnippetResult(List<SnippetResult> actualInstance)
5949
{
6050
ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
6151
}
@@ -87,23 +77,13 @@ public Dictionary<string, SnippetResult> AsDictionarySnippetResult()
8777
}
8878

8979
/// <summary>
90-
/// Get the actual instance of `Dictionary{string, SnippetResultOption}`. If the actual instance is not `Dictionary{string, SnippetResultOption}`,
80+
/// Get the actual instance of `List{SnippetResult}`. If the actual instance is not `List{SnippetResult}`,
9181
/// the InvalidClassException will be thrown
9282
/// </summary>
93-
/// <returns>An instance of Dictionary&lt;string, SnippetResultOption&gt;</returns>
94-
public Dictionary<string, SnippetResultOption> AsDictionarySnippetResultOption()
83+
/// <returns>An instance of List&lt;SnippetResult&gt;</returns>
84+
public List<SnippetResult> AsListSnippetResult()
9585
{
96-
return (Dictionary<string, SnippetResultOption>)ActualInstance;
97-
}
98-
99-
/// <summary>
100-
/// Get the actual instance of `List{SnippetResultOption}`. If the actual instance is not `List{SnippetResultOption}`,
101-
/// the InvalidClassException will be thrown
102-
/// </summary>
103-
/// <returns>An instance of List&lt;SnippetResultOption&gt;</returns>
104-
public List<SnippetResultOption> AsListSnippetResultOption()
105-
{
106-
return (List<SnippetResultOption>)ActualInstance;
86+
return (List<SnippetResult>)ActualInstance;
10787
}
10888

10989

@@ -126,21 +106,12 @@ public bool IsDictionarySnippetResult()
126106
}
127107

128108
/// <summary>
129-
/// Check if the actual instance is of `Dictionary{string, SnippetResultOption}` type.
109+
/// Check if the actual instance is of `List{SnippetResult}` type.
130110
/// </summary>
131111
/// <returns>Whether or not the instance is the type</returns>
132-
public bool IsDictionarySnippetResultOption()
112+
public bool IsListSnippetResult()
133113
{
134-
return ActualInstance.GetType() == typeof(Dictionary<string, SnippetResultOption>);
135-
}
136-
137-
/// <summary>
138-
/// Check if the actual instance is of `List{SnippetResultOption}` type.
139-
/// </summary>
140-
/// <returns>Whether or not the instance is the type</returns>
141-
public bool IsListSnippetResultOption()
142-
{
143-
return ActualInstance.GetType() == typeof(List<SnippetResultOption>);
114+
return ActualInstance.GetType() == typeof(List<SnippetResult>);
144115
}
145116

146117
/// <summary>
@@ -251,28 +222,16 @@ public override SnippetResult Read(ref Utf8JsonReader reader, Type typeToConvert
251222
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into Dictionary<string, SnippetResult>: {exception}");
252223
}
253224
}
254-
if (root.ValueKind == JsonValueKind.Object)
255-
{
256-
try
257-
{
258-
return new SnippetResult(jsonDocument.Deserialize<Dictionary<string, SnippetResultOption>>(JsonConfig.Options));
259-
}
260-
catch (Exception exception)
261-
{
262-
// deserialization failed, try the next one
263-
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into Dictionary<string, SnippetResultOption>: {exception}");
264-
}
265-
}
266225
if (root.ValueKind == JsonValueKind.Array)
267226
{
268227
try
269228
{
270-
return new SnippetResult(jsonDocument.Deserialize<List<SnippetResultOption>>(JsonConfig.Options));
229+
return new SnippetResult(jsonDocument.Deserialize<List<SnippetResult>>(JsonConfig.Options));
271230
}
272231
catch (Exception exception)
273232
{
274233
// deserialization failed, try the next one
275-
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into List<SnippetResultOption>: {exception}");
234+
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into List<SnippetResult>: {exception}");
276235
}
277236
}
278237
throw new InvalidDataException($"The JSON string cannot be deserialized into any schema defined.");

clients/algoliasearch-client-csharp/algoliasearch/Models/Search/HighlightResult.cs

Lines changed: 12 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,10 @@ public HighlightResult(Dictionary<string, HighlightResult> actualInstance)
4242

4343
/// <summary>
4444
/// Initializes a new instance of the HighlightResult class
45-
/// with a Dictionary{string, HighlightResultOption}
45+
/// with a List{HighlightResult}
4646
/// </summary>
47-
/// <param name="actualInstance">An instance of Dictionary&lt;string, HighlightResultOption&gt;.</param>
48-
public HighlightResult(Dictionary<string, HighlightResultOption> actualInstance)
49-
{
50-
ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
51-
}
52-
53-
/// <summary>
54-
/// Initializes a new instance of the HighlightResult class
55-
/// with a List{HighlightResultOption}
56-
/// </summary>
57-
/// <param name="actualInstance">An instance of List&lt;HighlightResultOption&gt;.</param>
58-
public HighlightResult(List<HighlightResultOption> actualInstance)
47+
/// <param name="actualInstance">An instance of List&lt;HighlightResult&gt;.</param>
48+
public HighlightResult(List<HighlightResult> actualInstance)
5949
{
6050
ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
6151
}
@@ -87,23 +77,13 @@ public Dictionary<string, HighlightResult> AsDictionaryHighlightResult()
8777
}
8878

8979
/// <summary>
90-
/// Get the actual instance of `Dictionary{string, HighlightResultOption}`. If the actual instance is not `Dictionary{string, HighlightResultOption}`,
80+
/// Get the actual instance of `List{HighlightResult}`. If the actual instance is not `List{HighlightResult}`,
9181
/// the InvalidClassException will be thrown
9282
/// </summary>
93-
/// <returns>An instance of Dictionary&lt;string, HighlightResultOption&gt;</returns>
94-
public Dictionary<string, HighlightResultOption> AsDictionaryHighlightResultOption()
83+
/// <returns>An instance of List&lt;HighlightResult&gt;</returns>
84+
public List<HighlightResult> AsListHighlightResult()
9585
{
96-
return (Dictionary<string, HighlightResultOption>)ActualInstance;
97-
}
98-
99-
/// <summary>
100-
/// Get the actual instance of `List{HighlightResultOption}`. If the actual instance is not `List{HighlightResultOption}`,
101-
/// the InvalidClassException will be thrown
102-
/// </summary>
103-
/// <returns>An instance of List&lt;HighlightResultOption&gt;</returns>
104-
public List<HighlightResultOption> AsListHighlightResultOption()
105-
{
106-
return (List<HighlightResultOption>)ActualInstance;
86+
return (List<HighlightResult>)ActualInstance;
10787
}
10888

10989

@@ -126,21 +106,12 @@ public bool IsDictionaryHighlightResult()
126106
}
127107

128108
/// <summary>
129-
/// Check if the actual instance is of `Dictionary{string, HighlightResultOption}` type.
109+
/// Check if the actual instance is of `List{HighlightResult}` type.
130110
/// </summary>
131111
/// <returns>Whether or not the instance is the type</returns>
132-
public bool IsDictionaryHighlightResultOption()
112+
public bool IsListHighlightResult()
133113
{
134-
return ActualInstance.GetType() == typeof(Dictionary<string, HighlightResultOption>);
135-
}
136-
137-
/// <summary>
138-
/// Check if the actual instance is of `List{HighlightResultOption}` type.
139-
/// </summary>
140-
/// <returns>Whether or not the instance is the type</returns>
141-
public bool IsListHighlightResultOption()
142-
{
143-
return ActualInstance.GetType() == typeof(List<HighlightResultOption>);
114+
return ActualInstance.GetType() == typeof(List<HighlightResult>);
144115
}
145116

146117
/// <summary>
@@ -251,28 +222,16 @@ public override HighlightResult Read(ref Utf8JsonReader reader, Type typeToConve
251222
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into Dictionary<string, HighlightResult>: {exception}");
252223
}
253224
}
254-
if (root.ValueKind == JsonValueKind.Object)
255-
{
256-
try
257-
{
258-
return new HighlightResult(jsonDocument.Deserialize<Dictionary<string, HighlightResultOption>>(JsonConfig.Options));
259-
}
260-
catch (Exception exception)
261-
{
262-
// deserialization failed, try the next one
263-
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into Dictionary<string, HighlightResultOption>: {exception}");
264-
}
265-
}
266225
if (root.ValueKind == JsonValueKind.Array)
267226
{
268227
try
269228
{
270-
return new HighlightResult(jsonDocument.Deserialize<List<HighlightResultOption>>(JsonConfig.Options));
229+
return new HighlightResult(jsonDocument.Deserialize<List<HighlightResult>>(JsonConfig.Options));
271230
}
272231
catch (Exception exception)
273232
{
274233
// deserialization failed, try the next one
275-
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into List<HighlightResultOption>: {exception}");
234+
System.Diagnostics.Debug.WriteLine($"Failed to deserialize into List<HighlightResult>: {exception}");
276235
}
277236
}
278237
throw new InvalidDataException($"The JSON string cannot be deserialized into any schema defined.");

0 commit comments

Comments
 (0)