Skip to content

Commit 475a404

Browse files
algolia-botkai687shortcutsmillotp
committed
fix(specs): partial update operation (generated)
algolia/api-clients-automation#3486 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Kai Welke <[email protected]> Co-authored-by: shortcuts <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent 5357563 commit 475a404

File tree

11 files changed

+1018
-8
lines changed

11 files changed

+1018
-8
lines changed

algoliasearch/Clients/SearchClient.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ public interface ISearchClient
11061106
UpdatedAtResponse OperationIndex(string indexName, OperationIndexParams operationIndexParams, RequestOptions options = null, CancellationToken cancellationToken = default);
11071107

11081108
/// <summary>
1109-
/// Adds new attributes to a record, or update existing ones. - If a record with the specified object ID doesn't exist, a new record is added to the index **if** `createIfNotExists` is true. - If the index doesn't exist yet, this method creates a new index. - You can use any first-level attribute but not nested attributes. If you specify a nested attribute, the engine treats it as a replacement for its first-level ancestor.
1109+
/// Adds new attributes to a record, or update existing ones. - If a record with the specified object ID doesn't exist, a new record is added to the index **if** `createIfNotExists` is true. - If the index doesn't exist yet, this method creates a new index. - You can use any first-level attribute but not nested attributes. If you specify a nested attribute, the engine treats it as a replacement for its first-level ancestor. To update an attribute without pushing the entire record, you can use these built-in operations. These operations can be helpful if you don't have access to your initial data. - Increment: increment a numeric attribute - Decrement: decrement a numeric attribute - Add: append a number or string element to an array attribute - Remove: remove all matching number or string elements from an array attribute made of numbers or strings - AddUnique: add a number or string element to an array attribute made of numbers or strings only if it's not already present - IncrementFrom: increment a numeric integer attribute only if the provided value matches the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementFrom value of 2 for the version attribute, but the current value of the attribute is 1, the engine ignores the update. If the object doesn't exist, the engine only creates it if you pass an IncrementFrom value of 0. - IncrementSet: increment a numeric integer attribute only if the provided value is greater than the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementSet value of 2 for the version attribute, and the current value of the attribute is 1, the engine updates the object. If the object doesn't exist yet, the engine only creates it if you pass an IncrementSet value that's greater than 0. You can specify an operation by providing an object with the attribute to update as the key and its value being an object with the following properties: - _operation: the operation to apply on the attribute - value: the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove.
11101110
/// </summary>
11111111
/// <param name="indexName">Name of the index on which to perform the operation.</param>
11121112
/// <param name="objectID">Unique record identifier.</param>
@@ -1118,10 +1118,10 @@ public interface ISearchClient
11181118
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
11191119
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
11201120
/// <returns>Task of UpdatedAtWithObjectIdResponse</returns>
1121-
Task<UpdatedAtWithObjectIdResponse> PartialUpdateObjectAsync(string indexName, string objectID, Dictionary<string, AttributeToUpdate> attributesToUpdate, bool? createIfNotExists = default, RequestOptions options = null, CancellationToken cancellationToken = default);
1121+
Task<UpdatedAtWithObjectIdResponse> PartialUpdateObjectAsync(string indexName, string objectID, object attributesToUpdate, bool? createIfNotExists = default, RequestOptions options = null, CancellationToken cancellationToken = default);
11221122

11231123
/// <summary>
1124-
/// Adds new attributes to a record, or update existing ones. - If a record with the specified object ID doesn't exist, a new record is added to the index **if** `createIfNotExists` is true. - If the index doesn't exist yet, this method creates a new index. - You can use any first-level attribute but not nested attributes. If you specify a nested attribute, the engine treats it as a replacement for its first-level ancestor. (Synchronous version)
1124+
/// Adds new attributes to a record, or update existing ones. - If a record with the specified object ID doesn't exist, a new record is added to the index **if** `createIfNotExists` is true. - If the index doesn't exist yet, this method creates a new index. - You can use any first-level attribute but not nested attributes. If you specify a nested attribute, the engine treats it as a replacement for its first-level ancestor. To update an attribute without pushing the entire record, you can use these built-in operations. These operations can be helpful if you don't have access to your initial data. - Increment: increment a numeric attribute - Decrement: decrement a numeric attribute - Add: append a number or string element to an array attribute - Remove: remove all matching number or string elements from an array attribute made of numbers or strings - AddUnique: add a number or string element to an array attribute made of numbers or strings only if it's not already present - IncrementFrom: increment a numeric integer attribute only if the provided value matches the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementFrom value of 2 for the version attribute, but the current value of the attribute is 1, the engine ignores the update. If the object doesn't exist, the engine only creates it if you pass an IncrementFrom value of 0. - IncrementSet: increment a numeric integer attribute only if the provided value is greater than the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementSet value of 2 for the version attribute, and the current value of the attribute is 1, the engine updates the object. If the object doesn't exist yet, the engine only creates it if you pass an IncrementSet value that's greater than 0. You can specify an operation by providing an object with the attribute to update as the key and its value being an object with the following properties: - _operation: the operation to apply on the attribute - value: the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove. (Synchronous version)
11251125
/// </summary>
11261126
/// <param name="indexName">Name of the index on which to perform the operation.</param>
11271127
/// <param name="objectID">Unique record identifier.</param>
@@ -1133,7 +1133,7 @@ public interface ISearchClient
11331133
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
11341134
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
11351135
/// <returns>UpdatedAtWithObjectIdResponse</returns>
1136-
UpdatedAtWithObjectIdResponse PartialUpdateObject(string indexName, string objectID, Dictionary<string, AttributeToUpdate> attributesToUpdate, bool? createIfNotExists = default, RequestOptions options = null, CancellationToken cancellationToken = default);
1136+
UpdatedAtWithObjectIdResponse PartialUpdateObject(string indexName, string objectID, object attributesToUpdate, bool? createIfNotExists = default, RequestOptions options = null, CancellationToken cancellationToken = default);
11371137

11381138
/// <summary>
11391139
/// Deletes a user ID and its associated data from the clusters.
@@ -3616,7 +3616,7 @@ public UpdatedAtResponse OperationIndex(string indexName, OperationIndexParams o
36163616

36173617

36183618
/// <summary>
3619-
/// Adds new attributes to a record, or update existing ones. - If a record with the specified object ID doesn't exist, a new record is added to the index **if** `createIfNotExists` is true. - If the index doesn't exist yet, this method creates a new index. - You can use any first-level attribute but not nested attributes. If you specify a nested attribute, the engine treats it as a replacement for its first-level ancestor.
3619+
/// Adds new attributes to a record, or update existing ones. - If a record with the specified object ID doesn't exist, a new record is added to the index **if** `createIfNotExists` is true. - If the index doesn't exist yet, this method creates a new index. - You can use any first-level attribute but not nested attributes. If you specify a nested attribute, the engine treats it as a replacement for its first-level ancestor. To update an attribute without pushing the entire record, you can use these built-in operations. These operations can be helpful if you don't have access to your initial data. - Increment: increment a numeric attribute - Decrement: decrement a numeric attribute - Add: append a number or string element to an array attribute - Remove: remove all matching number or string elements from an array attribute made of numbers or strings - AddUnique: add a number or string element to an array attribute made of numbers or strings only if it's not already present - IncrementFrom: increment a numeric integer attribute only if the provided value matches the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementFrom value of 2 for the version attribute, but the current value of the attribute is 1, the engine ignores the update. If the object doesn't exist, the engine only creates it if you pass an IncrementFrom value of 0. - IncrementSet: increment a numeric integer attribute only if the provided value is greater than the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementSet value of 2 for the version attribute, and the current value of the attribute is 1, the engine updates the object. If the object doesn't exist yet, the engine only creates it if you pass an IncrementSet value that's greater than 0. You can specify an operation by providing an object with the attribute to update as the key and its value being an object with the following properties: - _operation: the operation to apply on the attribute - value: the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove.
36203620
/// </summary>
36213621
///
36223622
/// Required API Key ACLs:
@@ -3631,7 +3631,7 @@ public UpdatedAtResponse OperationIndex(string indexName, OperationIndexParams o
36313631
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
36323632
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
36333633
/// <returns>Task of UpdatedAtWithObjectIdResponse</returns>
3634-
public async Task<UpdatedAtWithObjectIdResponse> PartialUpdateObjectAsync(string indexName, string objectID, Dictionary<string, AttributeToUpdate> attributesToUpdate, bool? createIfNotExists = default, RequestOptions options = null, CancellationToken cancellationToken = default)
3634+
public async Task<UpdatedAtWithObjectIdResponse> PartialUpdateObjectAsync(string indexName, string objectID, object attributesToUpdate, bool? createIfNotExists = default, RequestOptions options = null, CancellationToken cancellationToken = default)
36353635
{
36363636

36373637
if (indexName == null)
@@ -3657,7 +3657,7 @@ public async Task<UpdatedAtWithObjectIdResponse> PartialUpdateObjectAsync(string
36573657

36583658

36593659
/// <summary>
3660-
/// Adds new attributes to a record, or update existing ones. - If a record with the specified object ID doesn't exist, a new record is added to the index **if** `createIfNotExists` is true. - If the index doesn't exist yet, this method creates a new index. - You can use any first-level attribute but not nested attributes. If you specify a nested attribute, the engine treats it as a replacement for its first-level ancestor. (Synchronous version)
3660+
/// Adds new attributes to a record, or update existing ones. - If a record with the specified object ID doesn't exist, a new record is added to the index **if** `createIfNotExists` is true. - If the index doesn't exist yet, this method creates a new index. - You can use any first-level attribute but not nested attributes. If you specify a nested attribute, the engine treats it as a replacement for its first-level ancestor. To update an attribute without pushing the entire record, you can use these built-in operations. These operations can be helpful if you don't have access to your initial data. - Increment: increment a numeric attribute - Decrement: decrement a numeric attribute - Add: append a number or string element to an array attribute - Remove: remove all matching number or string elements from an array attribute made of numbers or strings - AddUnique: add a number or string element to an array attribute made of numbers or strings only if it's not already present - IncrementFrom: increment a numeric integer attribute only if the provided value matches the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementFrom value of 2 for the version attribute, but the current value of the attribute is 1, the engine ignores the update. If the object doesn't exist, the engine only creates it if you pass an IncrementFrom value of 0. - IncrementSet: increment a numeric integer attribute only if the provided value is greater than the current value, and otherwise ignore the whole object update. For example, if you pass an IncrementSet value of 2 for the version attribute, and the current value of the attribute is 1, the engine updates the object. If the object doesn't exist yet, the engine only creates it if you pass an IncrementSet value that's greater than 0. You can specify an operation by providing an object with the attribute to update as the key and its value being an object with the following properties: - _operation: the operation to apply on the attribute - value: the right-hand side argument to the operation, for example, increment or decrement step, value to add or remove. (Synchronous version)
36613661
/// </summary>
36623662
///
36633663
/// Required API Key ACLs:
@@ -3672,7 +3672,7 @@ public async Task<UpdatedAtWithObjectIdResponse> PartialUpdateObjectAsync(string
36723672
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
36733673
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
36743674
/// <returns>UpdatedAtWithObjectIdResponse</returns>
3675-
public UpdatedAtWithObjectIdResponse PartialUpdateObject(string indexName, string objectID, Dictionary<string, AttributeToUpdate> attributesToUpdate, bool? createIfNotExists = default, RequestOptions options = null, CancellationToken cancellationToken = default) =>
3675+
public UpdatedAtWithObjectIdResponse PartialUpdateObject(string indexName, string objectID, object attributesToUpdate, bool? createIfNotExists = default, RequestOptions options = null, CancellationToken cancellationToken = default) =>
36763676
AsyncHelper.RunSync(() => PartialUpdateObjectAsync(indexName, objectID, attributesToUpdate, createIfNotExists, options, cancellationToken));
36773677

36783678

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
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.Abtesting;
13+
14+
/// <summary>
15+
/// Error.
16+
/// </summary>
17+
public partial class ErrorBase
18+
{
19+
/// <summary>
20+
/// Initializes a new instance of the ErrorBase class.
21+
/// </summary>
22+
public ErrorBase()
23+
{
24+
AdditionalProperties = new Dictionary<string, object>();
25+
}
26+
27+
/// <summary>
28+
/// Gets or Sets Message
29+
/// </summary>
30+
[JsonPropertyName("message")]
31+
public string Message { get; set; }
32+
33+
/// <summary>
34+
/// Gets or Sets additional properties
35+
/// </summary>
36+
[JsonExtensionData]
37+
public IDictionary<string, object> AdditionalProperties { get; set; }
38+
39+
/// <summary>
40+
/// Returns the string presentation of the object
41+
/// </summary>
42+
/// <returns>String presentation of the object</returns>
43+
public override string ToString()
44+
{
45+
StringBuilder sb = new StringBuilder();
46+
sb.Append("class ErrorBase {\n");
47+
sb.Append(" Message: ").Append(Message).Append("\n");
48+
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
49+
sb.Append("}\n");
50+
return sb.ToString();
51+
}
52+
53+
/// <summary>
54+
/// Returns the JSON string presentation of the object
55+
/// </summary>
56+
/// <returns>JSON string presentation of the object</returns>
57+
public virtual string ToJson()
58+
{
59+
return JsonSerializer.Serialize(this, JsonConfig.Options);
60+
}
61+
62+
/// <summary>
63+
/// Returns true if objects are equal
64+
/// </summary>
65+
/// <param name="obj">Object to be compared</param>
66+
/// <returns>Boolean</returns>
67+
public override bool Equals(object obj)
68+
{
69+
if (obj is not ErrorBase input)
70+
{
71+
return false;
72+
}
73+
74+
return
75+
(Message == input.Message || (Message != null && Message.Equals(input.Message)))
76+
&& (AdditionalProperties.Count == input.AdditionalProperties.Count && !AdditionalProperties.Except(input.AdditionalProperties).Any());
77+
}
78+
79+
/// <summary>
80+
/// Gets the hash code
81+
/// </summary>
82+
/// <returns>Hash code</returns>
83+
public override int GetHashCode()
84+
{
85+
unchecked // Overflow is fine, just wrap
86+
{
87+
int hashCode = 41;
88+
if (Message != null)
89+
{
90+
hashCode = (hashCode * 59) + Message.GetHashCode();
91+
}
92+
if (AdditionalProperties != null)
93+
{
94+
hashCode = (hashCode * 59) + AdditionalProperties.GetHashCode();
95+
}
96+
return hashCode;
97+
}
98+
}
99+
100+
}
101+

0 commit comments

Comments
 (0)