Skip to content

Commit cc9ced0

Browse files
feat(specs): add CT Query predicate property (generated)
algolia/api-clients-automation#4654 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Morgan Leroi <[email protected]>
1 parent 0e00e81 commit cc9ced0

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

algoliasearch/Models/Ingestion/SourceCommercetools.cs

+13
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ public SourceCommercetools(string url, string projectKey)
6464
[JsonPropertyName("fallbackIsInStockValue")]
6565
public bool? FallbackIsInStockValue { get; set; }
6666

67+
/// <summary>
68+
/// Predicate to filter out specific products when indexing. For more information, see [Query Predicate](https://docs.commercetools.com/api/predicates/query).
69+
/// </summary>
70+
/// <value>Predicate to filter out specific products when indexing. For more information, see [Query Predicate](https://docs.commercetools.com/api/predicates/query). </value>
71+
[JsonPropertyName("productQueryPredicate")]
72+
public string ProductQueryPredicate { get; set; }
73+
6774
/// <summary>
6875
/// Gets or Sets CustomFields
6976
/// </summary>
@@ -83,6 +90,7 @@ public override string ToString()
8390
sb.Append(" Url: ").Append(Url).Append("\n");
8491
sb.Append(" ProjectKey: ").Append(ProjectKey).Append("\n");
8592
sb.Append(" FallbackIsInStockValue: ").Append(FallbackIsInStockValue).Append("\n");
93+
sb.Append(" ProductQueryPredicate: ").Append(ProductQueryPredicate).Append("\n");
8694
sb.Append(" CustomFields: ").Append(CustomFields).Append("\n");
8795
sb.Append("}\n");
8896
return sb.ToString();
@@ -115,6 +123,7 @@ public override bool Equals(object obj)
115123
(Url == input.Url || (Url != null && Url.Equals(input.Url))) &&
116124
(ProjectKey == input.ProjectKey || (ProjectKey != null && ProjectKey.Equals(input.ProjectKey))) &&
117125
(FallbackIsInStockValue == input.FallbackIsInStockValue || FallbackIsInStockValue.Equals(input.FallbackIsInStockValue)) &&
126+
(ProductQueryPredicate == input.ProductQueryPredicate || (ProductQueryPredicate != null && ProductQueryPredicate.Equals(input.ProductQueryPredicate))) &&
118127
(CustomFields == input.CustomFields || (CustomFields != null && CustomFields.Equals(input.CustomFields)));
119128
}
120129

@@ -144,6 +153,10 @@ public override int GetHashCode()
144153
hashCode = (hashCode * 59) + ProjectKey.GetHashCode();
145154
}
146155
hashCode = (hashCode * 59) + FallbackIsInStockValue.GetHashCode();
156+
if (ProductQueryPredicate != null)
157+
{
158+
hashCode = (hashCode * 59) + ProductQueryPredicate.GetHashCode();
159+
}
147160
if (CustomFields != null)
148161
{
149162
hashCode = (hashCode * 59) + CustomFields.GetHashCode();

algoliasearch/Models/Ingestion/SourceUpdateCommercetools.cs

+13
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ public SourceUpdateCommercetools()
4949
[JsonPropertyName("fallbackIsInStockValue")]
5050
public bool? FallbackIsInStockValue { get; set; }
5151

52+
/// <summary>
53+
/// Predicate to filter out specific products when indexing. For more information, see [Query Predicate](https://docs.commercetools.com/api/predicates/query).
54+
/// </summary>
55+
/// <value>Predicate to filter out specific products when indexing. For more information, see [Query Predicate](https://docs.commercetools.com/api/predicates/query). </value>
56+
[JsonPropertyName("productQueryPredicate")]
57+
public string ProductQueryPredicate { get; set; }
58+
5259
/// <summary>
5360
/// Gets or Sets CustomFields
5461
/// </summary>
@@ -67,6 +74,7 @@ public override string ToString()
6774
sb.Append(" Locales: ").Append(Locales).Append("\n");
6875
sb.Append(" Url: ").Append(Url).Append("\n");
6976
sb.Append(" FallbackIsInStockValue: ").Append(FallbackIsInStockValue).Append("\n");
77+
sb.Append(" ProductQueryPredicate: ").Append(ProductQueryPredicate).Append("\n");
7078
sb.Append(" CustomFields: ").Append(CustomFields).Append("\n");
7179
sb.Append("}\n");
7280
return sb.ToString();
@@ -98,6 +106,7 @@ public override bool Equals(object obj)
98106
(Locales == input.Locales || Locales != null && input.Locales != null && Locales.SequenceEqual(input.Locales)) &&
99107
(Url == input.Url || (Url != null && Url.Equals(input.Url))) &&
100108
(FallbackIsInStockValue == input.FallbackIsInStockValue || FallbackIsInStockValue.Equals(input.FallbackIsInStockValue)) &&
109+
(ProductQueryPredicate == input.ProductQueryPredicate || (ProductQueryPredicate != null && ProductQueryPredicate.Equals(input.ProductQueryPredicate))) &&
101110
(CustomFields == input.CustomFields || (CustomFields != null && CustomFields.Equals(input.CustomFields)));
102111
}
103112

@@ -123,6 +132,10 @@ public override int GetHashCode()
123132
hashCode = (hashCode * 59) + Url.GetHashCode();
124133
}
125134
hashCode = (hashCode * 59) + FallbackIsInStockValue.GetHashCode();
135+
if (ProductQueryPredicate != null)
136+
{
137+
hashCode = (hashCode * 59) + ProductQueryPredicate.GetHashCode();
138+
}
126139
if (CustomFields != null)
127140
{
128141
hashCode = (hashCode * 59) + CustomFields.GetHashCode();

0 commit comments

Comments
 (0)