Skip to content

Commit c1e5a57

Browse files
committed
Merge branch 'main' into feat/selfser-969
2 parents d666b88 + 0e98f08 commit c1e5a57

File tree

1,836 files changed

+156803
-23714
lines changed

Some content is hidden

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

1,836 files changed

+156803
-23714
lines changed

clients/algoliasearch-client-csharp/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
## [7.13.0](https://github.com/algolia/algoliasearch-client-csharp/compare/7.12.0...7.13.0)
2+
3+
- [5aa57630d6](https://github.com/algolia/api-clients-automation/commit/5aa57630d6) feat(specs): only use shortname in the source input ([#4287](https://github.com/algolia/api-clients-automation/pull/4287)) by [@millotp](https://github.com/millotp/)
4+
- [1e847f4caf](https://github.com/algolia/api-clients-automation/commit/1e847f4caf) fix(specs): move customRanking and keepDiacriticsOnCharacters to indexSettings ([#4324](https://github.com/algolia/api-clients-automation/pull/4324)) by [@millotp](https://github.com/millotp/)
5+
- [57d528a481](https://github.com/algolia/api-clients-automation/commit/57d528a481) feat(clients): endpoint level timeout part 2 ([#4318](https://github.com/algolia/api-clients-automation/pull/4318)) by [@Fluf22](https://github.com/Fluf22/)
6+
- [58cc5449f5](https://github.com/algolia/api-clients-automation/commit/58cc5449f5) fix(specs): optionalFilters additional explanation ([#4353](https://github.com/algolia/api-clients-automation/pull/4353)) by [@kai687](https://github.com/kai687/)
7+
- [700441942e](https://github.com/algolia/api-clients-automation/commit/700441942e) fix(specs): deprecate task v1 ([#4327](https://github.com/algolia/api-clients-automation/pull/4327)) by [@millotp](https://github.com/millotp/)
8+
- [3b129e01df](https://github.com/algolia/api-clients-automation/commit/3b129e01df) fix(specs): ingestion expected and received events type ([#4356](https://github.com/algolia/api-clients-automation/pull/4356)) by [@shortcuts](https://github.com/shortcuts/)
9+
- [22167b8e68](https://github.com/algolia/api-clients-automation/commit/22167b8e68) fix(specs): extend Analytics descriptions ([#4360](https://github.com/algolia/api-clients-automation/pull/4360)) by [@gazconroy](https://github.com/gazconroy/)
10+
- [5b14906c1e](https://github.com/algolia/api-clients-automation/commit/5b14906c1e) fix(specs): remove the processing outcome ([#4359](https://github.com/algolia/api-clients-automation/pull/4359)) by [@millotp](https://github.com/millotp/)
11+
- [952639f0fb](https://github.com/algolia/api-clients-automation/commit/952639f0fb) fix(specs): adjust style for banner descriptions ([#4362](https://github.com/algolia/api-clients-automation/pull/4362)) by [@kai687](https://github.com/kai687/)
12+
- [4ae9ccd89f](https://github.com/algolia/api-clients-automation/commit/4ae9ccd89f) chore(deps): dependencies 2025-01-20 ([#4365](https://github.com/algolia/api-clients-automation/pull/4365)) by [@algolia-bot](https://github.com/algolia-bot/)
13+
- [83f188d333](https://github.com/algolia/api-clients-automation/commit/83f188d333) feat(specs): rename composition to composition-full (private) and add composition (public) ([#4357](https://github.com/algolia/api-clients-automation/pull/4357)) by [@e-krebs](https://github.com/e-krebs/)
14+
- [eb83e3bc8a](https://github.com/algolia/api-clients-automation/commit/eb83e3bc8a) docs: lot of guides ([#4355](https://github.com/algolia/api-clients-automation/pull/4355)) by [@shortcuts](https://github.com/shortcuts/)
15+
116
## [7.12.0](https://github.com/algolia/algoliasearch-client-csharp/compare/7.11.2...7.12.0)
217

318
- [b569646304](https://github.com/algolia/api-clients-automation/commit/b569646304) fix(specs): drop singer from ingestion specs ([#4281](https://github.com/algolia/api-clients-automation/pull/4281)) by [@shortcuts](https://github.com/shortcuts/)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<RepositoryUrl>https://github.com/algolia/algoliasearch-client-csharp</RepositoryUrl>
2121
<RepositoryType>git</RepositoryType>
2222
<RequireLicenseAcceptance>false</RequireLicenseAcceptance>
23-
<Version>7.12.0</Version>
23+
<Version>7.13.0</Version>
2424
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2525
<TargetFrameworks>netstandard2.1;netstandard2.0</TargetFrameworks>
2626
<IncludeSymbols>true</IncludeSymbols>

clients/algoliasearch-client-csharp/algoliasearch/Clients/AbtestingConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public sealed class AbtestingConfig : AlgoliaConfig
2828
/// <param name="appId">Your application ID</param>
2929
/// <param name="apiKey">Your API Key</param>
3030
/// <param name="region">Targeted region (optional)</param>
31-
public AbtestingConfig(string appId, string apiKey, string region = null) : base(appId, apiKey, "Abtesting", "7.12.0")
31+
public AbtestingConfig(string appId, string apiKey, string region = null) : base(appId, apiKey, "Abtesting", "7.13.0")
3232
{
3333
DefaultHosts = GetDefaultHosts(region);
3434
Compression = CompressionType.None;

clients/algoliasearch-client-csharp/algoliasearch/Clients/AnalyticsConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public sealed class AnalyticsConfig : AlgoliaConfig
2828
/// <param name="appId">Your application ID</param>
2929
/// <param name="apiKey">Your API Key</param>
3030
/// <param name="region">Targeted region (optional)</param>
31-
public AnalyticsConfig(string appId, string apiKey, string region = null) : base(appId, apiKey, "Analytics", "7.12.0")
31+
public AnalyticsConfig(string appId, string apiKey, string region = null) : base(appId, apiKey, "Analytics", "7.13.0")
3232
{
3333
DefaultHosts = GetDefaultHosts(region);
3434
Compression = CompressionType.None;
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
//
2+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.
3+
//
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Net.Http;
7+
using System.Threading;
8+
using System.Threading.Tasks;
9+
using Algolia.Search.Models.Composition;
10+
using Algolia.Search.Transport;
11+
using Algolia.Search.Http;
12+
using Algolia.Search.Utils;
13+
using Microsoft.Extensions.Logging;
14+
using Microsoft.Extensions.Logging.Abstractions;
15+
16+
namespace Algolia.Search.Clients;
17+
18+
19+
/// <summary>
20+
/// Represents a collection of functions to interact with the API endpoints
21+
/// </summary>
22+
public interface ICompositionClient
23+
{
24+
/// <summary>
25+
/// Runs a query on a single composition and returns matching results.
26+
/// </summary>
27+
///
28+
/// Required API Key ACLs:
29+
/// - search
30+
/// <param name="compositionID">Unique Composition ObjectID.</param>
31+
/// <param name="requestBody"></param>
32+
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
33+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
34+
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
35+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
36+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
37+
/// <returns>Task of SearchResponse{T}</returns>
38+
Task<SearchResponse<T>> SearchAsync<T>(string compositionID, RequestBody requestBody, RequestOptions options = null, CancellationToken cancellationToken = default);
39+
40+
/// <summary>
41+
/// Runs a query on a single composition and returns matching results. (Synchronous version)
42+
/// </summary>
43+
///
44+
/// Required API Key ACLs:
45+
/// - search
46+
/// <param name="compositionID">Unique Composition ObjectID.</param>
47+
/// <param name="requestBody"></param>
48+
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
49+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
50+
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
51+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
52+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
53+
/// <returns>SearchResponse{T}</returns>
54+
SearchResponse<T> Search<T>(string compositionID, RequestBody requestBody, RequestOptions options = null, CancellationToken cancellationToken = default);
55+
56+
/// <summary>
57+
/// Searches for values of a specified facet attribute on the composition's main source's index. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn't work if you have **more than 65 searchable facets and searchable attributes combined**.
58+
/// </summary>
59+
///
60+
/// Required API Key ACLs:
61+
/// - search
62+
/// <param name="compositionID">Unique Composition ObjectID.</param>
63+
/// <param name="facetName">Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier. </param>
64+
/// <param name="searchForFacetValuesRequest"> (optional)</param>
65+
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
66+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
67+
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
68+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
69+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
70+
/// <returns>Task of SearchForFacetValuesResponse</returns>
71+
Task<SearchForFacetValuesResponse> SearchForFacetValuesAsync(string compositionID, string facetName, SearchForFacetValuesRequest searchForFacetValuesRequest = default, RequestOptions options = null, CancellationToken cancellationToken = default);
72+
73+
/// <summary>
74+
/// Searches for values of a specified facet attribute on the composition's main source's index. - By default, facet values are sorted by decreasing count. You can adjust this with the `sortFacetValueBy` parameter. - Searching for facet values doesn't work if you have **more than 65 searchable facets and searchable attributes combined**. (Synchronous version)
75+
/// </summary>
76+
///
77+
/// Required API Key ACLs:
78+
/// - search
79+
/// <param name="compositionID">Unique Composition ObjectID.</param>
80+
/// <param name="facetName">Facet attribute in which to search for values. This attribute must be included in the `attributesForFaceting` index setting with the `searchable()` modifier. </param>
81+
/// <param name="searchForFacetValuesRequest"> (optional)</param>
82+
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
83+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
84+
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
85+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
86+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
87+
/// <returns>SearchForFacetValuesResponse</returns>
88+
SearchForFacetValuesResponse SearchForFacetValues(string compositionID, string facetName, SearchForFacetValuesRequest searchForFacetValuesRequest = default, RequestOptions options = null, CancellationToken cancellationToken = default);
89+
90+
}
91+
92+
93+
94+
/// <summary>
95+
/// Represents a collection of functions to interact with the API endpoints
96+
/// </summary>
97+
public partial class CompositionClient : ICompositionClient
98+
{
99+
internal HttpTransport _transport;
100+
private readonly ILogger<CompositionClient> _logger;
101+
102+
/// <summary>
103+
/// Create a new Composition client for the given appID and apiKey.
104+
/// </summary>
105+
/// <param name="applicationId">Your application</param>
106+
/// <param name="apiKey">Your API key</param>
107+
/// <param name="loggerFactory">Logger factory</param>
108+
109+
public CompositionClient(string applicationId, string apiKey, ILoggerFactory loggerFactory = null) : this(new CompositionConfig(applicationId, apiKey), new AlgoliaHttpRequester(loggerFactory), loggerFactory)
110+
{
111+
}
112+
113+
/// <summary>
114+
/// Initialize a client with custom config
115+
/// </summary>
116+
/// <param name="config">Algolia configuration</param>
117+
/// <param name="loggerFactory">Logger factory</param>
118+
public CompositionClient(CompositionConfig config, ILoggerFactory loggerFactory = null) : this(config, new AlgoliaHttpRequester(loggerFactory), loggerFactory)
119+
{
120+
}
121+
122+
/// <summary>
123+
/// Initialize the client with custom config and custom Requester
124+
/// </summary>
125+
/// <param name="config">Algolia Config</param>
126+
/// <param name="httpRequester">Your Http requester implementation of <see cref="IHttpRequester"/></param>
127+
/// <param name="loggerFactory">Logger factory</param>
128+
public CompositionClient(CompositionConfig config, IHttpRequester httpRequester, ILoggerFactory loggerFactory = null)
129+
{
130+
if (httpRequester == null)
131+
{
132+
throw new ArgumentException("An httpRequester is required");
133+
}
134+
if (config == null)
135+
{
136+
throw new ArgumentException("A config is required");
137+
}
138+
if (string.IsNullOrWhiteSpace(config.AppId))
139+
{
140+
throw new ArgumentException("`AppId` is missing.");
141+
}
142+
if (string.IsNullOrWhiteSpace(config.ApiKey))
143+
{
144+
throw new ArgumentException("`ApiKey` is missing.");
145+
}
146+
147+
var factory = loggerFactory ?? NullLoggerFactory.Instance;
148+
_transport = new HttpTransport(config, httpRequester, factory);
149+
_logger = factory.CreateLogger<CompositionClient>();
150+
151+
if (_logger.IsEnabled(Microsoft.Extensions.Logging.LogLevel.Information))
152+
{
153+
_logger.LogInformation("Algolia Composition client is initialized.");
154+
}
155+
}
156+
157+
/// <summary>
158+
/// Helper to switch the API key sent with each request
159+
/// </summary>
160+
/// <param name="apiKey">Your new API Key</param>
161+
/// <returns></returns>
162+
public void SetClientApiKey(string apiKey)
163+
{
164+
_transport._algoliaConfig.SetClientApiKey(apiKey);
165+
}
166+
167+
168+
169+
/// <inheritdoc />
170+
public async Task<SearchResponse<T>> SearchAsync<T>(string compositionID, RequestBody requestBody, RequestOptions options = null, CancellationToken cancellationToken = default)
171+
{
172+
173+
if (compositionID == null)
174+
throw new ArgumentException("Parameter `compositionID` is required when calling `Search`.");
175+
176+
177+
if (requestBody == null)
178+
throw new ArgumentException("Parameter `requestBody` is required when calling `Search`.");
179+
180+
var requestOptions = new InternalRequestOptions(options);
181+
182+
requestOptions.PathParameters.Add("compositionID", QueryStringHelper.ParameterToString(compositionID));
183+
184+
requestOptions.Data = requestBody;
185+
requestOptions.UseReadTransporter = true;
186+
return await _transport.ExecuteRequestAsync<SearchResponse<T>>(new HttpMethod("POST"), "/1/compositions/{compositionID}/run", requestOptions, cancellationToken).ConfigureAwait(false);
187+
}
188+
189+
190+
/// <inheritdoc />
191+
public SearchResponse<T> Search<T>(string compositionID, RequestBody requestBody, RequestOptions options = null, CancellationToken cancellationToken = default) =>
192+
AsyncHelper.RunSync(() => SearchAsync<T>(compositionID, requestBody, options, cancellationToken));
193+
194+
195+
/// <inheritdoc />
196+
public async Task<SearchForFacetValuesResponse> SearchForFacetValuesAsync(string compositionID, string facetName, SearchForFacetValuesRequest searchForFacetValuesRequest = default, RequestOptions options = null, CancellationToken cancellationToken = default)
197+
{
198+
199+
if (compositionID == null)
200+
throw new ArgumentException("Parameter `compositionID` is required when calling `SearchForFacetValues`.");
201+
202+
203+
if (facetName == null)
204+
throw new ArgumentException("Parameter `facetName` is required when calling `SearchForFacetValues`.");
205+
206+
var requestOptions = new InternalRequestOptions(options);
207+
208+
requestOptions.PathParameters.Add("compositionID", QueryStringHelper.ParameterToString(compositionID));
209+
requestOptions.PathParameters.Add("facetName", QueryStringHelper.ParameterToString(facetName));
210+
211+
requestOptions.Data = searchForFacetValuesRequest;
212+
requestOptions.UseReadTransporter = true;
213+
return await _transport.ExecuteRequestAsync<SearchForFacetValuesResponse>(new HttpMethod("POST"), "/1/compositions/{compositionID}/facets/{facetName}/query", requestOptions, cancellationToken).ConfigureAwait(false);
214+
}
215+
216+
217+
/// <inheritdoc />
218+
public SearchForFacetValuesResponse SearchForFacetValues(string compositionID, string facetName, SearchForFacetValuesRequest searchForFacetValuesRequest = default, RequestOptions options = null, CancellationToken cancellationToken = default) =>
219+
AsyncHelper.RunSync(() => SearchForFacetValuesAsync(compositionID, facetName, searchForFacetValuesRequest, options, cancellationToken));
220+
221+
}
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
* Composition API
3+
*
4+
* Composition API.
5+
*
6+
* The version of the OpenAPI document: 1.0.0
7+
* Generated by: https://github.com/openapitools/openapi-generator.git
8+
*/
9+
10+
11+
using System;
12+
using System.Collections.Generic;
13+
using Algolia.Search.Models.Common;
14+
using Algolia.Search.Transport;
15+
using Algolia.Search.Utils;
16+
17+
namespace Algolia.Search.Clients;
18+
19+
/// <summary>
20+
/// Composition client configuration
21+
/// </summary>
22+
public sealed class CompositionConfig : AlgoliaConfig
23+
{
24+
/// <summary>
25+
/// The configuration of the Composition client
26+
/// A client should have it's own configuration ie on configuration per client instance
27+
/// </summary>
28+
/// <param name="appId">Your application ID</param>
29+
/// <param name="apiKey">Your API Key</param>
30+
public CompositionConfig(string appId, string apiKey) : base(appId, apiKey, "Composition", "7.13.0")
31+
{
32+
DefaultHosts = GetDefaultHosts(appId);
33+
Compression = CompressionType.None;
34+
ReadTimeout = TimeSpan.FromMilliseconds(5000);
35+
WriteTimeout = TimeSpan.FromMilliseconds(30000);
36+
ConnectTimeout = TimeSpan.FromMilliseconds(2000);
37+
}
38+
private static List<StatefulHost> GetDefaultHosts(string appId)
39+
{
40+
var hosts = new List<StatefulHost>
41+
{
42+
new()
43+
{
44+
Url = $"{appId}-dsn.algolia.net",
45+
Up = true,
46+
LastUse = DateTime.UtcNow,
47+
Accept = CallType.Read
48+
},
49+
new()
50+
{
51+
Url = $"{appId}.algolia.net", Up = true, LastUse = DateTime.UtcNow, Accept = CallType.Write,
52+
}
53+
};
54+
55+
var commonHosts = new List<StatefulHost>
56+
{
57+
new()
58+
{
59+
Url = $"{appId}-1.algolianet.com",
60+
Up = true,
61+
LastUse = DateTime.UtcNow,
62+
Accept = CallType.Read | CallType.Write,
63+
},
64+
new()
65+
{
66+
Url = $"{appId}-2.algolianet.com",
67+
Up = true,
68+
LastUse = DateTime.UtcNow,
69+
Accept = CallType.Read | CallType.Write,
70+
},
71+
new()
72+
{
73+
Url = $"{appId}-3.algolianet.com",
74+
Up = true,
75+
LastUse = DateTime.UtcNow,
76+
Accept = CallType.Read | CallType.Write,
77+
}
78+
}.Shuffle();
79+
80+
hosts.AddRange(commonHosts);
81+
return hosts;
82+
}
83+
}

clients/algoliasearch-client-csharp/algoliasearch/Clients/IngestionConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public sealed class IngestionConfig : AlgoliaConfig
2828
/// <param name="appId">Your application ID</param>
2929
/// <param name="apiKey">Your API Key</param>
3030
/// <param name="region">Targeted region </param>
31-
public IngestionConfig(string appId, string apiKey, string region) : base(appId, apiKey, "Ingestion", "7.12.0")
31+
public IngestionConfig(string appId, string apiKey, string region) : base(appId, apiKey, "Ingestion", "7.13.0")
3232
{
3333
DefaultHosts = GetDefaultHosts(region);
3434
Compression = CompressionType.None;

clients/algoliasearch-client-csharp/algoliasearch/Clients/InsightsConfiguration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public sealed class InsightsConfig : AlgoliaConfig
2828
/// <param name="appId">Your application ID</param>
2929
/// <param name="apiKey">Your API Key</param>
3030
/// <param name="region">Targeted region (optional)</param>
31-
public InsightsConfig(string appId, string apiKey, string region = null) : base(appId, apiKey, "Insights", "7.12.0")
31+
public InsightsConfig(string appId, string apiKey, string region = null) : base(appId, apiKey, "Insights", "7.13.0")
3232
{
3333
DefaultHosts = GetDefaultHosts(region);
3434
Compression = CompressionType.None;

0 commit comments

Comments
 (0)