Skip to content

Commit 95f4e19

Browse files
authored
Merge branch 'main' into feat/add-chopper-requester-package
2 parents 7c53cd3 + 441febb commit 95f4e19

File tree

380 files changed

+8765
-15224
lines changed

Some content is hidden

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

380 files changed

+8765
-15224
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ jobs:
431431
type: minimal
432432
language: swift
433433

434-
- run: yarn cli cts run swift ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).toRun }}
434+
- run: yarn cli cts run swift ${{ fromJSON(needs.setup.outputs.SWIFT_DATA).toRun }} -v
435435

436436
- name: Set output
437437
id: setoutput

clients/algoliasearch-client-csharp/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [7.0.0-beta.10](https://github.com/algolia/algoliasearch-client-csharp/compare/7.0.0-beta.9...7.0.0-beta.10)
2+
3+
- [280037178](https://github.com/algolia/api-clients-automation/commit/280037178) fix(specs): update shopify feature flags ([#3380](https://github.com/algolia/api-clients-automation/pull/3380)) by [@millotp](https://github.com/millotp/)
4+
- [a68907d1c](https://github.com/algolia/api-clients-automation/commit/a68907d1c) feat(clients): add api key helper test ([#3338](https://github.com/algolia/api-clients-automation/pull/3338)) by [@Fluf22](https://github.com/Fluf22/)
5+
- [31ba7f6d0](https://github.com/algolia/api-clients-automation/commit/31ba7f6d0) fix(specs): recommend non required parameters ([#3355](https://github.com/algolia/api-clients-automation/pull/3355)) by [@shortcuts](https://github.com/shortcuts/)
6+
- [337eea93e](https://github.com/algolia/api-clients-automation/commit/337eea93e) fix(specs): results is required in GetRecommendationsResponse ([#3357](https://github.com/algolia/api-clients-automation/pull/3357)) by [@millotp](https://github.com/millotp/)
7+
18
## [7.0.0-beta.9](https://github.com/algolia/algoliasearch-client-csharp/compare/7.0.0-beta.8...7.0.0-beta.9)
29

310
- [a009967f6](https://github.com/algolia/api-clients-automation/commit/a009967f6) fix(specs): browse response required properties ([#3348](https://github.com/algolia/api-clients-automation/pull/3348)) by [@millotp](https://github.com/millotp/)

clients/algoliasearch-client-csharp/algoliasearch/Algolia.Search.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<RepositoryType>git</RepositoryType>
2222
<RequireLicenseAcceptance>false</RequireLicenseAcceptance>
2323
<Copyright>Copyright 2019 Algolia</Copyright>
24-
<Version>7.0.0-beta.9</Version>
24+
<Version>7.0.0-beta.10</Version>
2525
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2626
<TargetFrameworks>netstandard2.1;netstandard2.0</TargetFrameworks>
2727
<IncludeSymbols>true</IncludeSymbols>

clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/SourceShopify.cs

Lines changed: 10 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -31,53 +31,11 @@ public SourceShopify(string shopURL)
3131
}
3232

3333
/// <summary>
34-
/// Whether to index collection IDs. If your store has `has_collection_search_page` set to true, collection IDs will be indexed even if `collectionIDIndexing` is false.
34+
/// Feature flags for the Shopify source.
3535
/// </summary>
36-
/// <value>Whether to index collection IDs. If your store has `has_collection_search_page` set to true, collection IDs will be indexed even if `collectionIDIndexing` is false. </value>
37-
[JsonPropertyName("collectionIDIndexing")]
38-
public bool? CollectionIDIndexing { get; set; }
39-
40-
/// <summary>
41-
/// Whether to increase the number of indexed collections per product. If true, Algolia indexes 200 collections per product. If false, 100 collections per product are indexed.
42-
/// </summary>
43-
/// <value>Whether to increase the number of indexed collections per product. If true, Algolia indexes 200 collections per product. If false, 100 collections per product are indexed. </value>
44-
[JsonPropertyName("increaseProductCollectionLimit")]
45-
public bool? IncreaseProductCollectionLimit { get; set; }
46-
47-
/// <summary>
48-
/// Whether to set the default price ratio to 1 if no sale price is present. The price ratio is determined by the ratio: `sale_price` / `regular_price`. If no sale price is present, the price ratio would be 0. If `defaultPriceRatioAsOne` is true, the price ratio is indexed as 1 instead.
49-
/// </summary>
50-
/// <value>Whether to set the default price ratio to 1 if no sale price is present. The price ratio is determined by the ratio: `sale_price` / `regular_price`. If no sale price is present, the price ratio would be 0. If `defaultPriceRatioAsOne` is true, the price ratio is indexed as 1 instead. </value>
51-
[JsonPropertyName("defaultPriceRatioAsOne")]
52-
public bool? DefaultPriceRatioAsOne { get; set; }
53-
54-
/// <summary>
55-
/// Whether to exclude out-of-stock variants when determining the `max_variant_price` and `min_variant_price` attributes.
56-
/// </summary>
57-
/// <value>Whether to exclude out-of-stock variants when determining the `max_variant_price` and `min_variant_price` attributes. </value>
58-
[JsonPropertyName("excludeOOSVariantsForPriceAtTRS")]
59-
public bool? ExcludeOOSVariantsForPriceAtTRS { get; set; }
60-
61-
/// <summary>
62-
/// Whether to include an inventory with every variant for every product record.
63-
/// </summary>
64-
/// <value>Whether to include an inventory with every variant for every product record. </value>
65-
[JsonPropertyName("includeVariantsInventory")]
66-
public bool? IncludeVariantsInventory { get; set; }
67-
68-
/// <summary>
69-
/// Whether to include collection IDs and handles in the product records.
70-
/// </summary>
71-
/// <value>Whether to include collection IDs and handles in the product records. </value>
72-
[JsonPropertyName("hasCollectionSearchPage")]
73-
public bool? HasCollectionSearchPage { get; set; }
74-
75-
/// <summary>
76-
/// Whether to convert tags on products to named tags. To learn more, see [Named tags](https://www.algolia.com/doc/integration/shopify/sending-and-managing-data/named-tags).
77-
/// </summary>
78-
/// <value>Whether to convert tags on products to named tags. To learn more, see [Named tags](https://www.algolia.com/doc/integration/shopify/sending-and-managing-data/named-tags). </value>
79-
[JsonPropertyName("productNamedTags")]
80-
public bool? ProductNamedTags { get; set; }
36+
/// <value>Feature flags for the Shopify source.</value>
37+
[JsonPropertyName("featureFlags")]
38+
public Dictionary<string, object> FeatureFlags { get; set; }
8139

8240
/// <summary>
8341
/// URL of the Shopify store.
@@ -94,13 +52,7 @@ public override string ToString()
9452
{
9553
StringBuilder sb = new StringBuilder();
9654
sb.Append("class SourceShopify {\n");
97-
sb.Append(" CollectionIDIndexing: ").Append(CollectionIDIndexing).Append("\n");
98-
sb.Append(" IncreaseProductCollectionLimit: ").Append(IncreaseProductCollectionLimit).Append("\n");
99-
sb.Append(" DefaultPriceRatioAsOne: ").Append(DefaultPriceRatioAsOne).Append("\n");
100-
sb.Append(" ExcludeOOSVariantsForPriceAtTRS: ").Append(ExcludeOOSVariantsForPriceAtTRS).Append("\n");
101-
sb.Append(" IncludeVariantsInventory: ").Append(IncludeVariantsInventory).Append("\n");
102-
sb.Append(" HasCollectionSearchPage: ").Append(HasCollectionSearchPage).Append("\n");
103-
sb.Append(" ProductNamedTags: ").Append(ProductNamedTags).Append("\n");
55+
sb.Append(" FeatureFlags: ").Append(FeatureFlags).Append("\n");
10456
sb.Append(" ShopURL: ").Append(ShopURL).Append("\n");
10557
sb.Append("}\n");
10658
return sb.ToString();
@@ -128,13 +80,7 @@ public override bool Equals(object obj)
12880
}
12981

13082
return
131-
(CollectionIDIndexing == input.CollectionIDIndexing || CollectionIDIndexing.Equals(input.CollectionIDIndexing)) &&
132-
(IncreaseProductCollectionLimit == input.IncreaseProductCollectionLimit || IncreaseProductCollectionLimit.Equals(input.IncreaseProductCollectionLimit)) &&
133-
(DefaultPriceRatioAsOne == input.DefaultPriceRatioAsOne || DefaultPriceRatioAsOne.Equals(input.DefaultPriceRatioAsOne)) &&
134-
(ExcludeOOSVariantsForPriceAtTRS == input.ExcludeOOSVariantsForPriceAtTRS || ExcludeOOSVariantsForPriceAtTRS.Equals(input.ExcludeOOSVariantsForPriceAtTRS)) &&
135-
(IncludeVariantsInventory == input.IncludeVariantsInventory || IncludeVariantsInventory.Equals(input.IncludeVariantsInventory)) &&
136-
(HasCollectionSearchPage == input.HasCollectionSearchPage || HasCollectionSearchPage.Equals(input.HasCollectionSearchPage)) &&
137-
(ProductNamedTags == input.ProductNamedTags || ProductNamedTags.Equals(input.ProductNamedTags)) &&
83+
(FeatureFlags == input.FeatureFlags || FeatureFlags != null && input.FeatureFlags != null && FeatureFlags.SequenceEqual(input.FeatureFlags)) &&
13884
(ShopURL == input.ShopURL || (ShopURL != null && ShopURL.Equals(input.ShopURL)));
13985
}
14086

@@ -147,13 +93,10 @@ public override int GetHashCode()
14793
unchecked // Overflow is fine, just wrap
14894
{
14995
int hashCode = 41;
150-
hashCode = (hashCode * 59) + CollectionIDIndexing.GetHashCode();
151-
hashCode = (hashCode * 59) + IncreaseProductCollectionLimit.GetHashCode();
152-
hashCode = (hashCode * 59) + DefaultPriceRatioAsOne.GetHashCode();
153-
hashCode = (hashCode * 59) + ExcludeOOSVariantsForPriceAtTRS.GetHashCode();
154-
hashCode = (hashCode * 59) + IncludeVariantsInventory.GetHashCode();
155-
hashCode = (hashCode * 59) + HasCollectionSearchPage.GetHashCode();
156-
hashCode = (hashCode * 59) + ProductNamedTags.GetHashCode();
96+
if (FeatureFlags != null)
97+
{
98+
hashCode = (hashCode * 59) + FeatureFlags.GetHashCode();
99+
}
157100
if (ShopURL != null)
158101
{
159102
hashCode = (hashCode * 59) + ShopURL.GetHashCode();

clients/algoliasearch-client-csharp/algoliasearch/Models/Ingestion/SourceUpdateShopify.cs

Lines changed: 10 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -24,53 +24,11 @@ public SourceUpdateShopify()
2424
}
2525

2626
/// <summary>
27-
/// Whether to index collection IDs. If your store has `has_collection_search_page` set to true, collection IDs will be indexed even if `collectionIDIndexing` is false.
27+
/// Feature flags for the Shopify source.
2828
/// </summary>
29-
/// <value>Whether to index collection IDs. If your store has `has_collection_search_page` set to true, collection IDs will be indexed even if `collectionIDIndexing` is false. </value>
30-
[JsonPropertyName("collectionIDIndexing")]
31-
public bool? CollectionIDIndexing { get; set; }
32-
33-
/// <summary>
34-
/// Whether to increase the number of indexed collections per product. If true, Algolia indexes 200 collections per product. If false, 100 collections per product are indexed.
35-
/// </summary>
36-
/// <value>Whether to increase the number of indexed collections per product. If true, Algolia indexes 200 collections per product. If false, 100 collections per product are indexed. </value>
37-
[JsonPropertyName("increaseProductCollectionLimit")]
38-
public bool? IncreaseProductCollectionLimit { get; set; }
39-
40-
/// <summary>
41-
/// Whether to set the default price ratio to 1 if no sale price is present. The price ratio is determined by the ratio: `sale_price` / `regular_price`. If no sale price is present, the price ratio would be 0. If `defaultPriceRatioAsOne` is true, the price ratio is indexed as 1 instead.
42-
/// </summary>
43-
/// <value>Whether to set the default price ratio to 1 if no sale price is present. The price ratio is determined by the ratio: `sale_price` / `regular_price`. If no sale price is present, the price ratio would be 0. If `defaultPriceRatioAsOne` is true, the price ratio is indexed as 1 instead. </value>
44-
[JsonPropertyName("defaultPriceRatioAsOne")]
45-
public bool? DefaultPriceRatioAsOne { get; set; }
46-
47-
/// <summary>
48-
/// Whether to exclude out-of-stock variants when determining the `max_variant_price` and `min_variant_price` attributes.
49-
/// </summary>
50-
/// <value>Whether to exclude out-of-stock variants when determining the `max_variant_price` and `min_variant_price` attributes. </value>
51-
[JsonPropertyName("excludeOOSVariantsForPriceAtTRS")]
52-
public bool? ExcludeOOSVariantsForPriceAtTRS { get; set; }
53-
54-
/// <summary>
55-
/// Whether to include an inventory with every variant for every product record.
56-
/// </summary>
57-
/// <value>Whether to include an inventory with every variant for every product record. </value>
58-
[JsonPropertyName("includeVariantsInventory")]
59-
public bool? IncludeVariantsInventory { get; set; }
60-
61-
/// <summary>
62-
/// Whether to include collection IDs and handles in the product records.
63-
/// </summary>
64-
/// <value>Whether to include collection IDs and handles in the product records. </value>
65-
[JsonPropertyName("hasCollectionSearchPage")]
66-
public bool? HasCollectionSearchPage { get; set; }
67-
68-
/// <summary>
69-
/// Whether to convert tags on products to named tags. To learn more, see [Named tags](https://www.algolia.com/doc/integration/shopify/sending-and-managing-data/named-tags).
70-
/// </summary>
71-
/// <value>Whether to convert tags on products to named tags. To learn more, see [Named tags](https://www.algolia.com/doc/integration/shopify/sending-and-managing-data/named-tags). </value>
72-
[JsonPropertyName("productNamedTags")]
73-
public bool? ProductNamedTags { get; set; }
29+
/// <value>Feature flags for the Shopify source.</value>
30+
[JsonPropertyName("featureFlags")]
31+
public Dictionary<string, object> FeatureFlags { get; set; }
7432

7533
/// <summary>
7634
/// Returns the string presentation of the object
@@ -80,13 +38,7 @@ public override string ToString()
8038
{
8139
StringBuilder sb = new StringBuilder();
8240
sb.Append("class SourceUpdateShopify {\n");
83-
sb.Append(" CollectionIDIndexing: ").Append(CollectionIDIndexing).Append("\n");
84-
sb.Append(" IncreaseProductCollectionLimit: ").Append(IncreaseProductCollectionLimit).Append("\n");
85-
sb.Append(" DefaultPriceRatioAsOne: ").Append(DefaultPriceRatioAsOne).Append("\n");
86-
sb.Append(" ExcludeOOSVariantsForPriceAtTRS: ").Append(ExcludeOOSVariantsForPriceAtTRS).Append("\n");
87-
sb.Append(" IncludeVariantsInventory: ").Append(IncludeVariantsInventory).Append("\n");
88-
sb.Append(" HasCollectionSearchPage: ").Append(HasCollectionSearchPage).Append("\n");
89-
sb.Append(" ProductNamedTags: ").Append(ProductNamedTags).Append("\n");
41+
sb.Append(" FeatureFlags: ").Append(FeatureFlags).Append("\n");
9042
sb.Append("}\n");
9143
return sb.ToString();
9244
}
@@ -113,13 +65,7 @@ public override bool Equals(object obj)
11365
}
11466

11567
return
116-
(CollectionIDIndexing == input.CollectionIDIndexing || CollectionIDIndexing.Equals(input.CollectionIDIndexing)) &&
117-
(IncreaseProductCollectionLimit == input.IncreaseProductCollectionLimit || IncreaseProductCollectionLimit.Equals(input.IncreaseProductCollectionLimit)) &&
118-
(DefaultPriceRatioAsOne == input.DefaultPriceRatioAsOne || DefaultPriceRatioAsOne.Equals(input.DefaultPriceRatioAsOne)) &&
119-
(ExcludeOOSVariantsForPriceAtTRS == input.ExcludeOOSVariantsForPriceAtTRS || ExcludeOOSVariantsForPriceAtTRS.Equals(input.ExcludeOOSVariantsForPriceAtTRS)) &&
120-
(IncludeVariantsInventory == input.IncludeVariantsInventory || IncludeVariantsInventory.Equals(input.IncludeVariantsInventory)) &&
121-
(HasCollectionSearchPage == input.HasCollectionSearchPage || HasCollectionSearchPage.Equals(input.HasCollectionSearchPage)) &&
122-
(ProductNamedTags == input.ProductNamedTags || ProductNamedTags.Equals(input.ProductNamedTags));
68+
(FeatureFlags == input.FeatureFlags || FeatureFlags != null && input.FeatureFlags != null && FeatureFlags.SequenceEqual(input.FeatureFlags));
12369
}
12470

12571
/// <summary>
@@ -131,13 +77,10 @@ public override int GetHashCode()
13177
unchecked // Overflow is fine, just wrap
13278
{
13379
int hashCode = 41;
134-
hashCode = (hashCode * 59) + CollectionIDIndexing.GetHashCode();
135-
hashCode = (hashCode * 59) + IncreaseProductCollectionLimit.GetHashCode();
136-
hashCode = (hashCode * 59) + DefaultPriceRatioAsOne.GetHashCode();
137-
hashCode = (hashCode * 59) + ExcludeOOSVariantsForPriceAtTRS.GetHashCode();
138-
hashCode = (hashCode * 59) + IncludeVariantsInventory.GetHashCode();
139-
hashCode = (hashCode * 59) + HasCollectionSearchPage.GetHashCode();
140-
hashCode = (hashCode * 59) + ProductNamedTags.GetHashCode();
80+
if (FeatureFlags != null)
81+
{
82+
hashCode = (hashCode * 59) + FeatureFlags.GetHashCode();
83+
}
14184
return hashCode;
14285
}
14386
}

clients/algoliasearch-client-csharp/algoliasearch/Utils/SearchClientExtensions.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,15 @@ public GetTaskResponse WaitForAppTask(long taskId, int maxRetries = DefaultMaxRe
7676
/// <summary>
7777
/// Helper method that waits for an API key task to be processed.
7878
/// </summary>
79-
/// <param name="operation">The `operation` that was done on a `key`.</param>
8079
/// <param name="key">The key that has been added, deleted or updated.</param>
80+
/// <param name="operation">The `operation` that was done on a `key`.</param>
8181
/// <param name="apiKey">Necessary to know if an `update` operation has been processed, compare fields of the response with it. (optional - mandatory if operation is UPDATE)</param>
8282
/// <param name="maxRetries">The maximum number of retry. 50 by default. (optional)</param>
8383
/// <param name="timeout">The function to decide how long to wait between retries. Math.Min(retryCount * 200, 5000) by default. (optional)</param>
8484
/// <param name="requestOptions">The requestOptions to send along with the query, they will be merged with the transporter requestOptions. (optional)</param>
8585
/// <param name="ct">Cancellation token (optional)</param>
86-
public async Task<GetApiKeyResponse> WaitForApiKeyAsync(ApiKeyOperation operation, string key,
86+
public async Task<GetApiKeyResponse> WaitForApiKeyAsync(string key,
87+
ApiKeyOperation operation,
8788
ApiKey apiKey = default, int maxRetries = DefaultMaxRetries, Func<int, int> timeout = null,
8889
RequestOptions requestOptions = null, CancellationToken ct = default)
8990
{
@@ -112,36 +113,35 @@ public async Task<GetApiKeyResponse> WaitForApiKeyAsync(ApiKeyOperation operatio
112113
}, maxRetries, timeout, ct).ConfigureAwait(false);
113114
}
114115

115-
var addedKey = new GetApiKeyResponse();
116-
117-
// check the status of the getApiKey method
118-
await RetryUntil(async () =>
116+
return await RetryUntil(async () =>
119117
{
120118
try
121119
{
122-
addedKey = await GetApiKeyAsync(key, requestOptions, ct).ConfigureAwait(false);
123-
// magic number to signify we found the key
124-
return -2;
120+
return await GetApiKeyAsync(key, requestOptions, ct).ConfigureAwait(false);
125121
}
126122
catch (AlgoliaApiException e)
127123
{
128-
return e.HttpErrorCode;
124+
if (e.HttpErrorCode is 404)
125+
{
126+
return null;
127+
}
128+
129+
throw;
129130
}
130-
}, (status) =>
131+
}, (response) =>
131132
{
132133
return operation switch
133134
{
134135
ApiKeyOperation.Add =>
135136
// stop either when the key is created or when we don't receive 404
136-
status is -2 or not 404 and not 0,
137+
response is not null,
137138
ApiKeyOperation.Delete =>
138139
// stop when the key is not found
139-
status == 404,
140+
response is null,
140141
_ => false
141142
};
142143
},
143144
maxRetries, timeout, ct);
144-
return addedKey;
145145
}
146146

147147
/// <summary>
@@ -154,10 +154,10 @@ await RetryUntil(async () =>
154154
/// <param name="timeout">The function to decide how long to wait between retries. Math.Min(retryCount * 200, 5000) by default. (optional)</param>
155155
/// <param name="requestOptions">The requestOptions to send along with the query, they will be merged with the transporter requestOptions. (optional)</param>
156156
/// <param name="ct">Cancellation token (optional)</param>
157-
public GetApiKeyResponse WaitForApiKey(ApiKeyOperation operation, string key, ApiKey apiKey = default,
157+
public GetApiKeyResponse WaitForApiKey(string key, ApiKeyOperation operation, ApiKey apiKey = default,
158158
int maxRetries = DefaultMaxRetries, Func<int, int> timeout = null, RequestOptions requestOptions = null,
159159
CancellationToken ct = default) =>
160-
AsyncHelper.RunSync(() => WaitForApiKeyAsync(operation, key, apiKey, maxRetries, timeout, requestOptions, ct));
160+
AsyncHelper.RunSync(() => WaitForApiKeyAsync(key, operation, apiKey, maxRetries, timeout, requestOptions, ct));
161161

162162

163163
/// <summary>

0 commit comments

Comments
 (0)