Skip to content

Commit 1e837f8

Browse files
chore: generated code for commit 005f9ed. [skip ci]
Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 005f9ed commit 1e837f8

File tree

9 files changed

+132
-143
lines changed

9 files changed

+132
-143
lines changed

clients/algoliasearch-client-java-2/algoliasearch-core/src/main/java/com/algolia/api/SearchClient.java

Lines changed: 52 additions & 52 deletions
Large diffs are not rendered by default.

clients/algoliasearch-client-javascript/packages/client-search/model/clientMethodProps.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,9 +426,9 @@ export type PartialUpdateObjectProps = {
426426
*/
427427
objectID: string;
428428
/**
429-
* List of attributes to update.
429+
* Map of attribute(s) to update.
430430
*/
431-
attributeToUpdate: Array<Record<string, AttributeToUpdate>>;
431+
attributesToUpdate: Record<string, AttributeToUpdate>;
432432
/**
433433
* Creates the record if it does not exist yet.
434434
*/
@@ -542,7 +542,7 @@ export type SaveRulesProps = {
542542
* The index in which to perform the request.
543543
*/
544544
indexName: string;
545-
rule: Rule[];
545+
rules: Rule[];
546546
/**
547547
* When true, changes are also propagated to replicas of the given indexName.
548548
*/

clients/algoliasearch-client-javascript/packages/client-search/src/searchClient.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,15 +1952,15 @@ export function createSearchClient({
19521952
* @param partialUpdateObject - The partialUpdateObject object.
19531953
* @param partialUpdateObject.indexName - The index in which to perform the request.
19541954
* @param partialUpdateObject.objectID - Unique identifier of an object.
1955-
* @param partialUpdateObject.attributeToUpdate - List of attributes to update.
1955+
* @param partialUpdateObject.attributesToUpdate - Map of attribute(s) to update.
19561956
* @param partialUpdateObject.createIfNotExists - Creates the record if it does not exist yet.
19571957
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
19581958
*/
19591959
partialUpdateObject(
19601960
{
19611961
indexName,
19621962
objectID,
1963-
attributeToUpdate,
1963+
attributesToUpdate,
19641964
createIfNotExists,
19651965
}: PartialUpdateObjectProps,
19661966
requestOptions?: RequestOptions
@@ -1977,9 +1977,9 @@ export function createSearchClient({
19771977
);
19781978
}
19791979

1980-
if (!attributeToUpdate) {
1980+
if (!attributesToUpdate) {
19811981
throw new Error(
1982-
'Parameter `attributeToUpdate` is required when calling `partialUpdateObject`.'
1982+
'Parameter `attributesToUpdate` is required when calling `partialUpdateObject`.'
19831983
);
19841984
}
19851985

@@ -1998,7 +1998,7 @@ export function createSearchClient({
19981998
path: requestPath,
19991999
queryParameters,
20002000
headers,
2001-
data: attributeToUpdate,
2001+
data: attributesToUpdate,
20022002
};
20032003

20042004
return transporter.request(request, requestOptions);
@@ -2282,15 +2282,15 @@ export function createSearchClient({
22822282
* @summary Save a batch of rules.
22832283
* @param saveRules - The saveRules object.
22842284
* @param saveRules.indexName - The index in which to perform the request.
2285-
* @param saveRules.rule - The rule object.
2285+
* @param saveRules.rules - The rules object.
22862286
* @param saveRules.forwardToReplicas - When true, changes are also propagated to replicas of the given indexName.
22872287
* @param saveRules.clearExistingRules - When true, existing Rules are cleared before adding this batch. When false, existing Rules are kept.
22882288
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
22892289
*/
22902290
saveRules(
22912291
{
22922292
indexName,
2293-
rule,
2293+
rules,
22942294
forwardToReplicas,
22952295
clearExistingRules,
22962296
}: SaveRulesProps,
@@ -2302,9 +2302,9 @@ export function createSearchClient({
23022302
);
23032303
}
23042304

2305-
if (!rule) {
2305+
if (!rules) {
23062306
throw new Error(
2307-
'Parameter `rule` is required when calling `saveRules`.'
2307+
'Parameter `rules` is required when calling `saveRules`.'
23082308
);
23092309
}
23102310

@@ -2328,7 +2328,7 @@ export function createSearchClient({
23282328
path: requestPath,
23292329
queryParameters,
23302330
headers,
2331-
data: rule,
2331+
data: rules,
23322332
};
23332333

23342334
return transporter.request(request, requestOptions);

clients/algoliasearch-client-php/lib/Api/SearchClient.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,7 +1906,7 @@ public function operationIndex(
19061906
*
19071907
* @param string $indexName The index in which to perform the request. (required)
19081908
* @param string $objectID Unique identifier of an object. (required)
1909-
* @param array $attributeToUpdate List of attributes to update. (required)
1909+
* @param array $attributesToUpdate Map of attribute(s) to update. (required)
19101910
* @param bool $createIfNotExists Creates the record if it does not exist yet. (optional, default to true)
19111911
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
19121912
*
@@ -1915,7 +1915,7 @@ public function operationIndex(
19151915
public function partialUpdateObject(
19161916
$indexName,
19171917
$objectID,
1918-
$attributeToUpdate,
1918+
$attributesToUpdate,
19191919
$createIfNotExists = null,
19201920
$requestOptions = []
19211921
) {
@@ -1931,17 +1931,17 @@ public function partialUpdateObject(
19311931
'Parameter `objectID` is required when calling `partialUpdateObject`.'
19321932
);
19331933
}
1934-
// verify the required parameter 'attributeToUpdate' is set
1935-
if (!isset($attributeToUpdate)) {
1934+
// verify the required parameter 'attributesToUpdate' is set
1935+
if (!isset($attributesToUpdate)) {
19361936
throw new \InvalidArgumentException(
1937-
'Parameter `attributeToUpdate` is required when calling `partialUpdateObject`.'
1937+
'Parameter `attributesToUpdate` is required when calling `partialUpdateObject`.'
19381938
);
19391939
}
19401940

19411941
$resourcePath = '/1/indexes/{indexName}/{objectID}/partial';
19421942
$queryParameters = [];
19431943
$headers = [];
1944-
$httpBody = $attributeToUpdate;
1944+
$httpBody = $attributesToUpdate;
19451945

19461946
if ($createIfNotExists !== null) {
19471947
$queryParameters['createIfNotExists'] = $createIfNotExists;
@@ -2323,7 +2323,7 @@ public function saveRule(
23232323
* Save a batch of rules.
23242324
*
23252325
* @param string $indexName The index in which to perform the request. (required)
2326-
* @param array $rule rule (required)
2326+
* @param array $rules rules (required)
23272327
* @param bool $forwardToReplicas When true, changes are also propagated to replicas of the given indexName. (optional)
23282328
* @param bool $clearExistingRules When true, existing Rules are cleared before adding this batch. When false, existing Rules are kept. (optional)
23292329
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
@@ -2332,7 +2332,7 @@ public function saveRule(
23322332
*/
23332333
public function saveRules(
23342334
$indexName,
2335-
$rule,
2335+
$rules,
23362336
$forwardToReplicas = null,
23372337
$clearExistingRules = null,
23382338
$requestOptions = []
@@ -2343,17 +2343,17 @@ public function saveRules(
23432343
'Parameter `indexName` is required when calling `saveRules`.'
23442344
);
23452345
}
2346-
// verify the required parameter 'rule' is set
2347-
if (!isset($rule)) {
2346+
// verify the required parameter 'rules' is set
2347+
if (!isset($rules)) {
23482348
throw new \InvalidArgumentException(
2349-
'Parameter `rule` is required when calling `saveRules`.'
2349+
'Parameter `rules` is required when calling `saveRules`.'
23502350
);
23512351
}
23522352

23532353
$resourcePath = '/1/indexes/{indexName}/rules/batch';
23542354
$queryParameters = [];
23552355
$headers = [];
2356-
$httpBody = $rule;
2356+
$httpBody = $rules;
23572357

23582358
if ($forwardToReplicas !== null) {
23592359
$queryParameters['forwardToReplicas'] = $forwardToReplicas;

specs/bundled/algoliasearch.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,11 +2032,6 @@ components:
20322032
- objectID
20332033
- updatedAt
20342034
- taskID
2035-
rules:
2036-
type: array
2037-
description: Rules to add.
2038-
items:
2039-
$ref: '#/components/schemas/rule'
20402035
parameters_query:
20412036
type: string
20422037
description: Full text query.

specs/bundled/search.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,11 +2032,6 @@ components:
20322032
- objectID
20332033
- updatedAt
20342034
- taskID
2035-
rules:
2036-
type: array
2037-
description: Rules to add.
2038-
items:
2039-
$ref: '#/components/schemas/rule'
20402035
parameters_query:
20412036
type: string
20422037
description: Full text query.
@@ -2987,6 +2982,7 @@ paths:
29872982
- search
29882983
operationId: partialUpdateObject
29892984
summary: Partially update an object.
2985+
x-codegen-request-body-name: attributesToUpdate
29902986
description: >
29912987
Update one or more attributes of an existing object.
29922988
@@ -3008,16 +3004,14 @@ paths:
30083004
default: true
30093005
requestBody:
30103006
required: true
3011-
description: List of attributes to update.
3007+
description: Map of attribute(s) to update.
30123008
content:
30133009
application/json:
30143010
schema:
3015-
type: array
3016-
items:
3017-
type: object
3018-
description: Attribute to update.
3019-
additionalProperties:
3020-
$ref: '#/components/schemas/attributeToUpdate'
3011+
type: object
3012+
description: Attribute(s) to update.
3013+
additionalProperties:
3014+
$ref: '#/components/schemas/attributeToUpdate'
30213015
responses:
30223016
'200':
30233017
$ref: '#/components/responses/UpdatedAtWithObjectId'
@@ -3730,6 +3724,7 @@ paths:
37303724
operationId: saveRules
37313725
summary: Save a batch of rules.
37323726
description: Create/update multiple rules objects at once.
3727+
x-codegen-request-body-name: rules
37333728
parameters:
37343729
- $ref: '#/components/parameters/IndexName'
37353730
- $ref: '#/components/parameters/ForwardToReplicas'
@@ -3739,7 +3734,10 @@ paths:
37393734
content:
37403735
application/json:
37413736
schema:
3742-
$ref: '#/components/schemas/rules'
3737+
type: array
3738+
description: Rules to add.
3739+
items:
3740+
$ref: '#/components/schemas/rule'
37433741
responses:
37443742
'200':
37453743
$ref: '#/components/responses/UpdatedAt'

0 commit comments

Comments
 (0)