Skip to content

Commit 7303840

Browse files
algolia-botClaraMullerFluf22
committed
feat(specs): add sortBy trigger on Composition Rules (generated)
algolia/api-clients-automation#5707 Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com> Co-authored-by: Clara Muller <5667350+ClaraMuller@users.noreply.github.com> Co-authored-by: Thomas Raffray <Fluf22@users.noreply.github.com>
1 parent fd50dbe commit 7303840

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

algoliasearch/Models/Composition/Condition.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ public Condition() { }
4848
[JsonPropertyName("filters")]
4949
public string Filters { get; set; }
5050

51+
/// <summary>
52+
/// Sort criteria that trigger the rule. You can trigger composition rules based on the selected sorting strategy set by the parameter `sortBy`. The rule will trigger if the value passed to `sortBy` matches the one defined in the condition.
53+
/// </summary>
54+
/// <value>Sort criteria that trigger the rule. You can trigger composition rules based on the selected sorting strategy set by the parameter `sortBy`. The rule will trigger if the value passed to `sortBy` matches the one defined in the condition. </value>
55+
[JsonPropertyName("sortBy")]
56+
public string SortBy { get; set; }
57+
5158
/// <summary>
5259
/// Returns the string presentation of the object
5360
/// </summary>
@@ -60,6 +67,7 @@ public override string ToString()
6067
sb.Append(" Anchoring: ").Append(Anchoring).Append("\n");
6168
sb.Append(" Context: ").Append(Context).Append("\n");
6269
sb.Append(" Filters: ").Append(Filters).Append("\n");
70+
sb.Append(" SortBy: ").Append(SortBy).Append("\n");
6371
sb.Append("}\n");
6472
return sb.ToString();
6573
}
@@ -88,7 +96,8 @@ public override bool Equals(object obj)
8896
return (Pattern == input.Pattern || (Pattern != null && Pattern.Equals(input.Pattern)))
8997
&& (Anchoring == input.Anchoring || Anchoring.Equals(input.Anchoring))
9098
&& (Context == input.Context || (Context != null && Context.Equals(input.Context)))
91-
&& (Filters == input.Filters || (Filters != null && Filters.Equals(input.Filters)));
99+
&& (Filters == input.Filters || (Filters != null && Filters.Equals(input.Filters)))
100+
&& (SortBy == input.SortBy || (SortBy != null && SortBy.Equals(input.SortBy)));
92101
}
93102

94103
/// <summary>
@@ -113,6 +122,10 @@ public override int GetHashCode()
113122
{
114123
hashCode = (hashCode * 59) + Filters.GetHashCode();
115124
}
125+
if (SortBy != null)
126+
{
127+
hashCode = (hashCode * 59) + SortBy.GetHashCode();
128+
}
116129
return hashCode;
117130
}
118131
}

0 commit comments

Comments
 (0)