Skip to content

Commit 97e24f2

Browse files
refactor(specs): re-organise response for Composition API (generated)
algolia/api-clients-automation#5744 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clara Muller <[email protected]>
1 parent 995b709 commit 97e24f2

File tree

5 files changed

+60
-59
lines changed

5 files changed

+60
-59
lines changed

algoliasearch/Models/Composition/CompositionRunAppliedRules.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ public CompositionRunAppliedRules() { }
2525
/// <summary>
2626
/// Initializes a new instance of the CompositionRunAppliedRules class.
2727
/// </summary>
28-
/// <param name="objectID">Unique record identifier. (required).</param>
28+
/// <param name="objectID">The objectID of the applied composition rule on this query. (required).</param>
2929
public CompositionRunAppliedRules(string objectID)
3030
{
3131
ObjectID = objectID ?? throw new ArgumentNullException(nameof(objectID));
3232
}
3333

3434
/// <summary>
35-
/// Unique record identifier.
35+
/// The objectID of the applied composition rule on this query.
3636
/// </summary>
37-
/// <value>Unique record identifier.</value>
37+
/// <value>The objectID of the applied composition rule on this query.</value>
3838
[JsonPropertyName("objectID")]
3939
public string ObjectID { get; set; }
4040

algoliasearch/Models/Composition/CompositionRunSearchResponse.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ public CompositionRunSearchResponse()
2828
/// <summary>
2929
/// Initializes a new instance of the CompositionRunSearchResponse class.
3030
/// </summary>
31-
/// <param name="objectID">Unique record identifier. (required).</param>
31+
/// <param name="objectID">The objectID of the composition which generated this result set. (required).</param>
3232
public CompositionRunSearchResponse(string objectID)
3333
{
3434
ObjectID = objectID ?? throw new ArgumentNullException(nameof(objectID));
3535
AdditionalProperties = new Dictionary<string, object>();
3636
}
3737

3838
/// <summary>
39-
/// Unique record identifier.
39+
/// The objectID of the composition which generated this result set.
4040
/// </summary>
41-
/// <value>Unique record identifier.</value>
41+
/// <value>The objectID of the composition which generated this result set.</value>
4242
[JsonPropertyName("objectID")]
4343
public string ObjectID { get; set; }
4444

algoliasearch/Models/Composition/ResultsInjectedItemAppliedRulesInfoResponse.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ public ResultsInjectedItemAppliedRulesInfoResponse() { }
2525
/// <summary>
2626
/// Initializes a new instance of the ResultsInjectedItemAppliedRulesInfoResponse class.
2727
/// </summary>
28-
/// <param name="objectID">Unique record identifier. (required).</param>
28+
/// <param name="objectID">The objectID of the applied index level rule on this injected group. (required).</param>
2929
public ResultsInjectedItemAppliedRulesInfoResponse(string objectID)
3030
{
3131
ObjectID = objectID ?? throw new ArgumentNullException(nameof(objectID));
3232
}
3333

3434
/// <summary>
35-
/// Unique record identifier.
35+
/// The objectID of the applied index level rule on this injected group.
3636
/// </summary>
37-
/// <value>Unique record identifier.</value>
37+
/// <value>The objectID of the applied index level rule on this injected group.</value>
3838
[JsonPropertyName("objectID")]
3939
public string ObjectID { get; set; }
4040

algoliasearch/Models/Composition/ResultsInjectedItemInfoResponse.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,17 @@ public ResultsInjectedItemInfoResponse()
2828
/// <summary>
2929
/// Initializes a new instance of the ResultsInjectedItemInfoResponse class.
3030
/// </summary>
31-
/// <param name="key">key (required).</param>
31+
/// <param name="key">The key of the injected group. (required).</param>
3232
public ResultsInjectedItemInfoResponse(string key)
3333
{
3434
Key = key ?? throw new ArgumentNullException(nameof(key));
3535
AdditionalProperties = new Dictionary<string, object>();
3636
}
3737

3838
/// <summary>
39-
/// Gets or Sets Key
39+
/// The key of the injected group.
4040
/// </summary>
41+
/// <value>The key of the injected group.</value>
4142
[JsonPropertyName("key")]
4243
public string Key { get; set; }
4344

algoliasearch/Models/Composition/SearchResultsItem.cs

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,32 @@ public SearchResultsItem() { }
2525
/// <summary>
2626
/// Initializes a new instance of the SearchResultsItem class.
2727
/// </summary>
28-
/// <param name="page">The current page of the results. (required).</param>
28+
/// <param name="hits">Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting. (required).</param>
29+
/// <param name="hitsPerPage">Number of hits returned per page. (required).</param>
2930
/// <param name="nbHits">Number of results (hits). (required).</param>
3031
/// <param name="nbPages">Number of pages of results. (required).</param>
31-
/// <param name="hitsPerPage">Number of hits returned per page. (required).</param>
32-
/// <param name="hits">Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting. (required).</param>
33-
/// <param name="query">The search query string. (required).</param>
32+
/// <param name="page">The current page of the results. (required).</param>
3433
/// <param name="varParams">URL-encoded string of all search parameters. (required).</param>
34+
/// <param name="query">The search query string. (required).</param>
3535
/// <param name="compositions">compositions (required).</param>
3636
public SearchResultsItem(
37-
int page,
37+
List<T> hits,
38+
int hitsPerPage,
3839
int nbHits,
3940
int nbPages,
40-
int hitsPerPage,
41-
List<T> hits,
42-
string query,
41+
int page,
4342
string varParams,
43+
string query,
4444
Dictionary<string, ResultsCompositionInfoResponse> compositions
4545
)
4646
{
47-
Page = page;
47+
Hits = hits ?? throw new ArgumentNullException(nameof(hits));
48+
HitsPerPage = hitsPerPage;
4849
NbHits = nbHits;
4950
NbPages = nbPages;
50-
HitsPerPage = hitsPerPage;
51-
Hits = hits ?? throw new ArgumentNullException(nameof(hits));
52-
Query = query ?? throw new ArgumentNullException(nameof(query));
51+
Page = page;
5352
Params = varParams ?? throw new ArgumentNullException(nameof(varParams));
53+
Query = query ?? throw new ArgumentNullException(nameof(query));
5454
Compositions = compositions ?? throw new ArgumentNullException(nameof(compositions));
5555
}
5656

@@ -237,11 +237,18 @@ Dictionary<string, ResultsCompositionInfoResponse> compositions
237237
public bool? AutomaticInsights { get; set; }
238238

239239
/// <summary>
240-
/// The current page of the results.
240+
/// Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting.
241241
/// </summary>
242-
/// <value>The current page of the results.</value>
243-
[JsonPropertyName("page")]
244-
public int Page { get; set; }
242+
/// <value>Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting. </value>
243+
[JsonPropertyName("hits")]
244+
public List<T> Hits { get; set; }
245+
246+
/// <summary>
247+
/// Number of hits returned per page.
248+
/// </summary>
249+
/// <value>Number of hits returned per page.</value>
250+
[JsonPropertyName("hitsPerPage")]
251+
public int HitsPerPage { get; set; }
245252

246253
/// <summary>
247254
/// Number of results (hits).
@@ -258,18 +265,18 @@ Dictionary<string, ResultsCompositionInfoResponse> compositions
258265
public int NbPages { get; set; }
259266

260267
/// <summary>
261-
/// Number of hits returned per page.
268+
/// The current page of the results.
262269
/// </summary>
263-
/// <value>Number of hits returned per page.</value>
264-
[JsonPropertyName("hitsPerPage")]
265-
public int HitsPerPage { get; set; }
270+
/// <value>The current page of the results.</value>
271+
[JsonPropertyName("page")]
272+
public int Page { get; set; }
266273

267274
/// <summary>
268-
/// Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting.
275+
/// URL-encoded string of all search parameters.
269276
/// </summary>
270-
/// <value>Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting. </value>
271-
[JsonPropertyName("hits")]
272-
public List<T> Hits { get; set; }
277+
/// <value>URL-encoded string of all search parameters.</value>
278+
[JsonPropertyName("params")]
279+
public string Params { get; set; }
273280

274281
/// <summary>
275282
/// The search query string.
@@ -278,13 +285,6 @@ Dictionary<string, ResultsCompositionInfoResponse> compositions
278285
[JsonPropertyName("query")]
279286
public string Query { get; set; }
280287

281-
/// <summary>
282-
/// URL-encoded string of all search parameters.
283-
/// </summary>
284-
/// <value>URL-encoded string of all search parameters.</value>
285-
[JsonPropertyName("params")]
286-
public string Params { get; set; }
287-
288288
/// <summary>
289289
/// Gets or Sets Compositions
290290
/// </summary>
@@ -325,13 +325,13 @@ public override string ToString()
325325
sb.Append(" UserData: ").Append(UserData).Append("\n");
326326
sb.Append(" QueryID: ").Append(QueryID).Append("\n");
327327
sb.Append(" AutomaticInsights: ").Append(AutomaticInsights).Append("\n");
328-
sb.Append(" Page: ").Append(Page).Append("\n");
328+
sb.Append(" Hits: ").Append(Hits).Append("\n");
329+
sb.Append(" HitsPerPage: ").Append(HitsPerPage).Append("\n");
329330
sb.Append(" NbHits: ").Append(NbHits).Append("\n");
330331
sb.Append(" NbPages: ").Append(NbPages).Append("\n");
331-
sb.Append(" HitsPerPage: ").Append(HitsPerPage).Append("\n");
332-
sb.Append(" Hits: ").Append(Hits).Append("\n");
333-
sb.Append(" Query: ").Append(Query).Append("\n");
332+
sb.Append(" Page: ").Append(Page).Append("\n");
334333
sb.Append(" Params: ").Append(Params).Append("\n");
334+
sb.Append(" Query: ").Append(Query).Append("\n");
335335
sb.Append(" Compositions: ").Append(Compositions).Append("\n");
336336
sb.Append("}\n");
337337
return sb.ToString();
@@ -433,15 +433,15 @@ public override bool Equals(object obj)
433433
AutomaticInsights == input.AutomaticInsights
434434
|| AutomaticInsights.Equals(input.AutomaticInsights)
435435
)
436-
&& (Page == input.Page || Page.Equals(input.Page))
437-
&& (NbHits == input.NbHits || NbHits.Equals(input.NbHits))
438-
&& (NbPages == input.NbPages || NbPages.Equals(input.NbPages))
439-
&& (HitsPerPage == input.HitsPerPage || HitsPerPage.Equals(input.HitsPerPage))
440436
&& (
441437
Hits == input.Hits || Hits != null && input.Hits != null && Hits.SequenceEqual(input.Hits)
442438
)
443-
&& (Query == input.Query || (Query != null && Query.Equals(input.Query)))
439+
&& (HitsPerPage == input.HitsPerPage || HitsPerPage.Equals(input.HitsPerPage))
440+
&& (NbHits == input.NbHits || NbHits.Equals(input.NbHits))
441+
&& (NbPages == input.NbPages || NbPages.Equals(input.NbPages))
442+
&& (Page == input.Page || Page.Equals(input.Page))
444443
&& (Params == input.Params || (Params != null && Params.Equals(input.Params)))
444+
&& (Query == input.Query || (Query != null && Query.Equals(input.Query)))
445445
&& (
446446
Compositions == input.Compositions
447447
|| Compositions != null
@@ -536,22 +536,22 @@ public override int GetHashCode()
536536
hashCode = (hashCode * 59) + QueryID.GetHashCode();
537537
}
538538
hashCode = (hashCode * 59) + AutomaticInsights.GetHashCode();
539-
hashCode = (hashCode * 59) + Page.GetHashCode();
540-
hashCode = (hashCode * 59) + NbHits.GetHashCode();
541-
hashCode = (hashCode * 59) + NbPages.GetHashCode();
542-
hashCode = (hashCode * 59) + HitsPerPage.GetHashCode();
543539
if (Hits != null)
544540
{
545541
hashCode = (hashCode * 59) + Hits.GetHashCode();
546542
}
547-
if (Query != null)
548-
{
549-
hashCode = (hashCode * 59) + Query.GetHashCode();
550-
}
543+
hashCode = (hashCode * 59) + HitsPerPage.GetHashCode();
544+
hashCode = (hashCode * 59) + NbHits.GetHashCode();
545+
hashCode = (hashCode * 59) + NbPages.GetHashCode();
546+
hashCode = (hashCode * 59) + Page.GetHashCode();
551547
if (Params != null)
552548
{
553549
hashCode = (hashCode * 59) + Params.GetHashCode();
554550
}
551+
if (Query != null)
552+
{
553+
hashCode = (hashCode * 59) + Query.GetHashCode();
554+
}
555555
if (Compositions != null)
556556
{
557557
hashCode = (hashCode * 59) + Compositions.GetHashCode();

0 commit comments

Comments
 (0)