Skip to content

Commit 5e81034

Browse files
algolia-botClaraMullermillotp
committed
feat(specs): add facets query parameter available at run time (generated)
algolia/api-clients-automation#5486 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clara Muller <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 40e3fb3 commit 5e81034

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

algoliasearch/Models/Composition/FacetOrdering.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public FacetOrdering() { }
2525
/// Gets or Sets Facets
2626
/// </summary>
2727
[JsonPropertyName("facets")]
28-
public Facets Facets { get; set; }
28+
public IndexSettingsFacets Facets { get; set; }
2929

3030
/// <summary>
3131
/// Order of facet values. One object for each facet.

algoliasearch/Models/Composition/Facets.cs renamed to algoliasearch/Models/Composition/IndexSettingsFacets.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ namespace Algolia.Search.Models.Composition;
1414
/// <summary>
1515
/// Order of facet names.
1616
/// </summary>
17-
public partial class Facets
17+
public partial class IndexSettingsFacets
1818
{
1919
/// <summary>
20-
/// Initializes a new instance of the Facets class.
20+
/// Initializes a new instance of the IndexSettingsFacets class.
2121
/// </summary>
22-
public Facets() { }
22+
public IndexSettingsFacets() { }
2323

2424
/// <summary>
2525
/// Explicit order of facets or facet values. This setting lets you always show specific facets or facet values at the top of the list.
@@ -35,7 +35,7 @@ public Facets() { }
3535
public override string ToString()
3636
{
3737
StringBuilder sb = new StringBuilder();
38-
sb.Append("class Facets {\n");
38+
sb.Append("class IndexSettingsFacets {\n");
3939
sb.Append(" Order: ").Append(Order).Append("\n");
4040
sb.Append("}\n");
4141
return sb.ToString();
@@ -57,7 +57,7 @@ public virtual string ToJson()
5757
/// <returns>Boolean</returns>
5858
public override bool Equals(object obj)
5959
{
60-
if (obj is not Facets input)
60+
if (obj is not IndexSettingsFacets input)
6161
{
6262
return false;
6363
}

algoliasearch/Models/Composition/Params.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ public Params() { }
5656
[JsonPropertyName("relevancyStrictness")]
5757
public int? RelevancyStrictness { get; set; }
5858

59+
/// <summary>
60+
/// Facets for which to retrieve facet values that match the search criteria and the number of matching facet values To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts).
61+
/// </summary>
62+
/// <value>Facets for which to retrieve facet values that match the search criteria and the number of matching facet values To retrieve all facets, use the wildcard character `*`. For more information, see [facets](https://www.algolia.com/doc/guides/managing-results/refine-results/faceting/#contextual-facet-values-and-counts). </value>
63+
[JsonPropertyName("facets")]
64+
public List<string> Facets { get; set; }
65+
5966
/// <summary>
6067
/// Gets or Sets FacetFilters
6168
/// </summary>
@@ -217,6 +224,7 @@ public override string ToString()
217224
sb.Append(" Page: ").Append(Page).Append("\n");
218225
sb.Append(" GetRankingInfo: ").Append(GetRankingInfo).Append("\n");
219226
sb.Append(" RelevancyStrictness: ").Append(RelevancyStrictness).Append("\n");
227+
sb.Append(" Facets: ").Append(Facets).Append("\n");
220228
sb.Append(" FacetFilters: ").Append(FacetFilters).Append("\n");
221229
sb.Append(" OptionalFilters: ").Append(OptionalFilters).Append("\n");
222230
sb.Append(" NumericFilters: ").Append(NumericFilters).Append("\n");
@@ -272,6 +280,10 @@ public override bool Equals(object obj)
272280
RelevancyStrictness == input.RelevancyStrictness
273281
|| RelevancyStrictness.Equals(input.RelevancyStrictness)
274282
)
283+
&& (
284+
Facets == input.Facets
285+
|| Facets != null && input.Facets != null && Facets.SequenceEqual(input.Facets)
286+
)
275287
&& (
276288
FacetFilters == input.FacetFilters
277289
|| (FacetFilters != null && FacetFilters.Equals(input.FacetFilters))
@@ -373,6 +385,10 @@ public override int GetHashCode()
373385
hashCode = (hashCode * 59) + Page.GetHashCode();
374386
hashCode = (hashCode * 59) + GetRankingInfo.GetHashCode();
375387
hashCode = (hashCode * 59) + RelevancyStrictness.GetHashCode();
388+
if (Facets != null)
389+
{
390+
hashCode = (hashCode * 59) + Facets.GetHashCode();
391+
}
376392
if (FacetFilters != null)
377393
{
378394
hashCode = (hashCode * 59) + FacetFilters.GetHashCode();

0 commit comments

Comments
 (0)