Skip to content

Commit 5929d04

Browse files
committed
Merge branch 'main' into feat/guides-gen
2 parents 8639c26 + 20b147d commit 5929d04

File tree

128 files changed

+4460
-296
lines changed

Some content is hidden

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

128 files changed

+4460
-296
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Do not edit files in this repository
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopen
9+
branches:
10+
- 'main'
11+
12+
jobs:
13+
auto_close_pr:
14+
name: Close PR
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Close PR
20+
env:
21+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
PR_NUMBER: ${{ github.event.pull_request.number }}
23+
run: |
24+
gh pr close "${PR_NUMBER}" -d -c "Thanks for contributing to our API clients! Sorry to close your PR, but this repository is fully generated, you can port your changes to [the API Clients Automation repository](https://github.com/algolia/api-clients-automation). If you need some guidance, feel free to [open an issue](https://github.com/algolia/api-clients-automation/issues) or [read our contribution guide](https://api-clients-automation.netlify.app/docs/introduction)."

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

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,40 @@ namespace Algolia.Search.Clients;
2121
/// </summary>
2222
public interface IRecommendClient
2323
{
24+
/// <summary>
25+
/// Create or update a batch of Recommend Rules Each Recommend Rule is created or updated, depending on whether a Recommend Rule with the same `objectID` already exists. You may also specify `true` for `clearExistingRules`, in which case the batch will atomically replace all the existing Recommend Rules. Recommend Rules are similar to Search Rules, except that the conditions and consequences apply to a [source item](/doc/guides/algolia-recommend/overview/#recommend-models) instead of a query. The main differences are the following: - Conditions `pattern` and `anchoring` are unavailable. - Condition `filters` triggers if the source item matches the specified filters. - Condition `filters` accepts numeric filters. - Consequence `params` only covers filtering parameters. - Consequence `automaticFacetFilters` doesn't require a facet value placeholder (it tries to match the data source item's attributes instead).
26+
/// </summary>
27+
///
28+
/// Required API Key ACLs:
29+
/// - editSettings
30+
/// <param name="indexName">Name of the index on which to perform the operation.</param>
31+
/// <param name="model">[Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models). </param>
32+
/// <param name="recommendRule"> (optional)</param>
33+
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
34+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
35+
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
36+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
37+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
38+
/// <returns>Task of RecommendUpdatedAtResponse</returns>
39+
Task<RecommendUpdatedAtResponse> BatchRecommendRulesAsync(string indexName, RecommendModels model, List<RecommendRule> recommendRule = default, RequestOptions options = null, CancellationToken cancellationToken = default);
40+
41+
/// <summary>
42+
/// Create or update a batch of Recommend Rules Each Recommend Rule is created or updated, depending on whether a Recommend Rule with the same `objectID` already exists. You may also specify `true` for `clearExistingRules`, in which case the batch will atomically replace all the existing Recommend Rules. Recommend Rules are similar to Search Rules, except that the conditions and consequences apply to a [source item](/doc/guides/algolia-recommend/overview/#recommend-models) instead of a query. The main differences are the following: - Conditions `pattern` and `anchoring` are unavailable. - Condition `filters` triggers if the source item matches the specified filters. - Condition `filters` accepts numeric filters. - Consequence `params` only covers filtering parameters. - Consequence `automaticFacetFilters` doesn't require a facet value placeholder (it tries to match the data source item's attributes instead). (Synchronous version)
43+
/// </summary>
44+
///
45+
/// Required API Key ACLs:
46+
/// - editSettings
47+
/// <param name="indexName">Name of the index on which to perform the operation.</param>
48+
/// <param name="model">[Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models). </param>
49+
/// <param name="recommendRule"> (optional)</param>
50+
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
51+
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
52+
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
53+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
54+
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
55+
/// <returns>RecommendUpdatedAtResponse</returns>
56+
RecommendUpdatedAtResponse BatchRecommendRules(string indexName, RecommendModels model, List<RecommendRule> recommendRule = default, RequestOptions options = null, CancellationToken cancellationToken = default);
57+
2458
/// <summary>
2559
/// This method allow you to send requests to the Algolia REST API.
2660
/// </summary>
@@ -374,6 +408,29 @@ public void SetClientApiKey(string apiKey)
374408

375409

376410

411+
/// <inheritdoc />
412+
public async Task<RecommendUpdatedAtResponse> BatchRecommendRulesAsync(string indexName, RecommendModels model, List<RecommendRule> recommendRule = default, RequestOptions options = null, CancellationToken cancellationToken = default)
413+
{
414+
415+
if (indexName == null)
416+
throw new ArgumentException("Parameter `indexName` is required when calling `BatchRecommendRules`.");
417+
418+
419+
var requestOptions = new InternalRequestOptions(options);
420+
421+
requestOptions.PathParameters.Add("indexName", QueryStringHelper.ParameterToString(indexName));
422+
requestOptions.PathParameters.Add("model", QueryStringHelper.ParameterToString(model));
423+
424+
requestOptions.Data = recommendRule;
425+
return await _transport.ExecuteRequestAsync<RecommendUpdatedAtResponse>(new HttpMethod("POST"), "/1/indexes/{indexName}/{model}/recommend/rules/batch", requestOptions, cancellationToken).ConfigureAwait(false);
426+
}
427+
428+
429+
/// <inheritdoc />
430+
public RecommendUpdatedAtResponse BatchRecommendRules(string indexName, RecommendModels model, List<RecommendRule> recommendRule = default, RequestOptions options = null, CancellationToken cancellationToken = default) =>
431+
AsyncHelper.RunSync(() => BatchRecommendRulesAsync(indexName, model, recommendRule, options, cancellationToken));
432+
433+
377434
/// <inheritdoc />
378435
public async Task<object> CustomDeleteAsync(string path, Dictionary<string, object> parameters = default, RequestOptions options = null, CancellationToken cancellationToken = default)
379436
{

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ public partial interface ISearchClient
694694
DeletedAtResponse DeleteSynonym(string indexName, string objectID, bool? forwardToReplicas = default, RequestOptions options = null, CancellationToken cancellationToken = default);
695695

696696
/// <summary>
697-
/// Gets the permissions and restrictions of an API key. When authenticating with the admin API key, you can request information for any of your application's keys. When authenticating with other API keys, you can only retrieve information for that key.
697+
/// Gets the permissions and restrictions of an API key. When authenticating with the admin API key, you can request information for any of your application's keys. When authenticating with other API keys, you can only retrieve information for that key, with the description replaced by `<redacted>`.
698698
/// </summary>
699699
/// <param name="key">API key.</param>
700700
/// <param name="options">Add extra http header or query parameters to Algolia.</param>
@@ -706,7 +706,7 @@ public partial interface ISearchClient
706706
Task<GetApiKeyResponse> GetApiKeyAsync(string key, RequestOptions options = null, CancellationToken cancellationToken = default);
707707

708708
/// <summary>
709-
/// Gets the permissions and restrictions of an API key. When authenticating with the admin API key, you can request information for any of your application's keys. When authenticating with other API keys, you can only retrieve information for that key. (Synchronous version)
709+
/// Gets the permissions and restrictions of an API key. When authenticating with the admin API key, you can request information for any of your application's keys. When authenticating with other API keys, you can only retrieve information for that key, with the description replaced by `<redacted>`. (Synchronous version)
710710
/// </summary>
711711
/// <param name="key">API key.</param>
712712
/// <param name="options">Add extra http header or query parameters to Algolia.</param>

clients/algoliasearch-client-csharp/algoliasearch/Models/Recommend/RecommendRule.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ public RecommendRule()
6262
[JsonPropertyName("enabled")]
6363
public bool? Enabled { get; set; }
6464

65+
/// <summary>
66+
/// Time periods when the rule is active.
67+
/// </summary>
68+
/// <value>Time periods when the rule is active.</value>
69+
[JsonPropertyName("validity")]
70+
public List<TimeRange> Validity { get; set; }
71+
6572
/// <summary>
6673
/// Returns the string presentation of the object
6774
/// </summary>
@@ -76,6 +83,7 @@ public override string ToString()
7683
sb.Append(" Consequence: ").Append(Consequence).Append("\n");
7784
sb.Append(" Description: ").Append(Description).Append("\n");
7885
sb.Append(" Enabled: ").Append(Enabled).Append("\n");
86+
sb.Append(" Validity: ").Append(Validity).Append("\n");
7987
sb.Append("}\n");
8088
return sb.ToString();
8189
}
@@ -107,7 +115,8 @@ public override bool Equals(object obj)
107115
(Condition == input.Condition || (Condition != null && Condition.Equals(input.Condition))) &&
108116
(Consequence == input.Consequence || (Consequence != null && Consequence.Equals(input.Consequence))) &&
109117
(Description == input.Description || (Description != null && Description.Equals(input.Description))) &&
110-
(Enabled == input.Enabled || Enabled.Equals(input.Enabled));
118+
(Enabled == input.Enabled || Enabled.Equals(input.Enabled)) &&
119+
(Validity == input.Validity || Validity != null && input.Validity != null && Validity.SequenceEqual(input.Validity));
111120
}
112121

113122
/// <summary>
@@ -140,6 +149,10 @@ public override int GetHashCode()
140149
hashCode = (hashCode * 59) + Description.GetHashCode();
141150
}
142151
hashCode = (hashCode * 59) + Enabled.GetHashCode();
152+
if (Validity != null)
153+
{
154+
hashCode = (hashCode * 59) + Validity.GetHashCode();
155+
}
143156
return hashCode;
144157
}
145158
}
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
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.Text;
6+
using System.Linq;
7+
using System.Text.Json.Serialization;
8+
using System.Collections.Generic;
9+
using Algolia.Search.Serializer;
10+
using System.Text.Json;
11+
12+
namespace Algolia.Search.Models.Recommend;
13+
14+
/// <summary>
15+
/// Response, taskID, and update timestamp.
16+
/// </summary>
17+
public partial class RecommendUpdatedAtResponse
18+
{
19+
/// <summary>
20+
/// Initializes a new instance of the RecommendUpdatedAtResponse class.
21+
/// </summary>
22+
[JsonConstructor]
23+
public RecommendUpdatedAtResponse() { }
24+
/// <summary>
25+
/// Initializes a new instance of the RecommendUpdatedAtResponse class.
26+
/// </summary>
27+
/// <param name="taskID">Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task&#39;s progress with the [&#x60;task&#x60; operation](#tag/Indices/operation/getTask) and this &#x60;taskID&#x60;. (required).</param>
28+
/// <param name="updatedAt">Date and time when the object was updated, in RFC 3339 format. (required).</param>
29+
public RecommendUpdatedAtResponse(long taskID, string updatedAt)
30+
{
31+
TaskID = taskID;
32+
UpdatedAt = updatedAt ?? throw new ArgumentNullException(nameof(updatedAt));
33+
}
34+
35+
/// <summary>
36+
/// Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task's progress with the [`task` operation](#tag/Indices/operation/getTask) and this `taskID`.
37+
/// </summary>
38+
/// <value>Unique identifier of a task. A successful API response means that a task was added to a queue. It might not run immediately. You can check the task's progress with the [`task` operation](#tag/Indices/operation/getTask) and this `taskID`. </value>
39+
[JsonPropertyName("taskID")]
40+
public long TaskID { get; set; }
41+
42+
/// <summary>
43+
/// Date and time when the object was updated, in RFC 3339 format.
44+
/// </summary>
45+
/// <value>Date and time when the object was updated, in RFC 3339 format.</value>
46+
[JsonPropertyName("updatedAt")]
47+
public string UpdatedAt { get; set; }
48+
49+
/// <summary>
50+
/// Returns the string presentation of the object
51+
/// </summary>
52+
/// <returns>String presentation of the object</returns>
53+
public override string ToString()
54+
{
55+
StringBuilder sb = new StringBuilder();
56+
sb.Append("class RecommendUpdatedAtResponse {\n");
57+
sb.Append(" TaskID: ").Append(TaskID).Append("\n");
58+
sb.Append(" UpdatedAt: ").Append(UpdatedAt).Append("\n");
59+
sb.Append("}\n");
60+
return sb.ToString();
61+
}
62+
63+
/// <summary>
64+
/// Returns the JSON string presentation of the object
65+
/// </summary>
66+
/// <returns>JSON string presentation of the object</returns>
67+
public virtual string ToJson()
68+
{
69+
return JsonSerializer.Serialize(this, JsonConfig.Options);
70+
}
71+
72+
/// <summary>
73+
/// Returns true if objects are equal
74+
/// </summary>
75+
/// <param name="obj">Object to be compared</param>
76+
/// <returns>Boolean</returns>
77+
public override bool Equals(object obj)
78+
{
79+
if (obj is not RecommendUpdatedAtResponse input)
80+
{
81+
return false;
82+
}
83+
84+
return
85+
(TaskID == input.TaskID || TaskID.Equals(input.TaskID)) &&
86+
(UpdatedAt == input.UpdatedAt || (UpdatedAt != null && UpdatedAt.Equals(input.UpdatedAt)));
87+
}
88+
89+
/// <summary>
90+
/// Gets the hash code
91+
/// </summary>
92+
/// <returns>Hash code</returns>
93+
public override int GetHashCode()
94+
{
95+
unchecked // Overflow is fine, just wrap
96+
{
97+
int hashCode = 41;
98+
hashCode = (hashCode * 59) + TaskID.GetHashCode();
99+
if (UpdatedAt != null)
100+
{
101+
hashCode = (hashCode * 59) + UpdatedAt.GetHashCode();
102+
}
103+
return hashCode;
104+
}
105+
}
106+
107+
}
108+
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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.Text;
6+
using System.Linq;
7+
using System.Text.Json.Serialization;
8+
using System.Collections.Generic;
9+
using Algolia.Search.Serializer;
10+
using System.Text.Json;
11+
12+
namespace Algolia.Search.Models.Recommend;
13+
14+
/// <summary>
15+
/// TimeRange
16+
/// </summary>
17+
public partial class TimeRange
18+
{
19+
/// <summary>
20+
/// Initializes a new instance of the TimeRange class.
21+
/// </summary>
22+
[JsonConstructor]
23+
public TimeRange() { }
24+
/// <summary>
25+
/// Initializes a new instance of the TimeRange class.
26+
/// </summary>
27+
/// <param name="from">When the rule should start to be active, in Unix epoch time. (required).</param>
28+
/// <param name="until">When the rule should stop to be active, in Unix epoch time. (required).</param>
29+
public TimeRange(int from, int until)
30+
{
31+
From = from;
32+
Until = until;
33+
}
34+
35+
/// <summary>
36+
/// When the rule should start to be active, in Unix epoch time.
37+
/// </summary>
38+
/// <value>When the rule should start to be active, in Unix epoch time.</value>
39+
[JsonPropertyName("from")]
40+
public int From { get; set; }
41+
42+
/// <summary>
43+
/// When the rule should stop to be active, in Unix epoch time.
44+
/// </summary>
45+
/// <value>When the rule should stop to be active, in Unix epoch time.</value>
46+
[JsonPropertyName("until")]
47+
public int Until { get; set; }
48+
49+
/// <summary>
50+
/// Returns the string presentation of the object
51+
/// </summary>
52+
/// <returns>String presentation of the object</returns>
53+
public override string ToString()
54+
{
55+
StringBuilder sb = new StringBuilder();
56+
sb.Append("class TimeRange {\n");
57+
sb.Append(" From: ").Append(From).Append("\n");
58+
sb.Append(" Until: ").Append(Until).Append("\n");
59+
sb.Append("}\n");
60+
return sb.ToString();
61+
}
62+
63+
/// <summary>
64+
/// Returns the JSON string presentation of the object
65+
/// </summary>
66+
/// <returns>JSON string presentation of the object</returns>
67+
public virtual string ToJson()
68+
{
69+
return JsonSerializer.Serialize(this, JsonConfig.Options);
70+
}
71+
72+
/// <summary>
73+
/// Returns true if objects are equal
74+
/// </summary>
75+
/// <param name="obj">Object to be compared</param>
76+
/// <returns>Boolean</returns>
77+
public override bool Equals(object obj)
78+
{
79+
if (obj is not TimeRange input)
80+
{
81+
return false;
82+
}
83+
84+
return
85+
(From == input.From || From.Equals(input.From)) &&
86+
(Until == input.Until || Until.Equals(input.Until));
87+
}
88+
89+
/// <summary>
90+
/// Gets the hash code
91+
/// </summary>
92+
/// <returns>Hash code</returns>
93+
public override int GetHashCode()
94+
{
95+
unchecked // Overflow is fine, just wrap
96+
{
97+
int hashCode = 41;
98+
hashCode = (hashCode * 59) + From.GetHashCode();
99+
hashCode = (hashCode * 59) + Until.GetHashCode();
100+
return hashCode;
101+
}
102+
}
103+
104+
}
105+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Do not edit files in this repository
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopen
9+
branches:
10+
- 'main'
11+
12+
jobs:
13+
auto_close_pr:
14+
name: Close PR
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Close PR
20+
env:
21+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
PR_NUMBER: ${{ github.event.pull_request.number }}
23+
run: |
24+
gh pr close "${PR_NUMBER}" -d -c "Thanks for contributing to our API clients! Sorry to close your PR, but this repository is fully generated, you can port your changes to [the API Clients Automation repository](https://github.com/algolia/api-clients-automation). If you need some guidance, feel free to [open an issue](https://github.com/algolia/api-clients-automation/issues) or [read our contribution guide](https://api-clients-automation.netlify.app/docs/introduction)."

0 commit comments

Comments
 (0)