Skip to content

Commit 28182ef

Browse files
algolia-botkai687
andcommitted
fix(specs): body is not required in multiple batch request (#3454) (generated) [skip ci]
Co-authored-by: Kai Welke <[email protected]>
1 parent 7af1e75 commit 28182ef

File tree

37 files changed

+125
-106
lines changed

37 files changed

+125
-106
lines changed

clients/algoliasearch-client-csharp/algoliasearch/Models/Search/MultipleBatchRequest.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ public MultipleBatchRequest() { }
3131
/// Initializes a new instance of the MultipleBatchRequest class.
3232
/// </summary>
3333
/// <param name="action">action (required).</param>
34-
/// <param name="body">Operation arguments (varies with specified &#x60;action&#x60;). (required).</param>
3534
/// <param name="indexName">Index name (case-sensitive). (required).</param>
36-
public MultipleBatchRequest(Action? action, object body, string indexName)
35+
public MultipleBatchRequest(Action? action, string indexName)
3736
{
3837
Action = action;
39-
Body = body ?? throw new ArgumentNullException(nameof(body));
4038
IndexName = indexName ?? throw new ArgumentNullException(nameof(indexName));
4139
}
4240

clients/algoliasearch-client-dart/packages/client_search/lib/src/model/multiple_batch_request.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ final class MultipleBatchRequest {
1111
/// Returns a new [MultipleBatchRequest] instance.
1212
const MultipleBatchRequest({
1313
required this.action,
14-
required this.body,
14+
this.body,
1515
required this.indexName,
1616
});
1717

@@ -20,7 +20,7 @@ final class MultipleBatchRequest {
2020

2121
/// Operation arguments (varies with specified `action`).
2222
@JsonKey(name: r'body')
23-
final Object body;
23+
final Object? body;
2424

2525
/// Index name (case-sensitive).
2626
@JsonKey(name: r'indexName')

clients/algoliasearch-client-dart/packages/client_search/lib/src/model/multiple_batch_request.g.dart

Lines changed: 16 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/algoliasearch-client-go/algolia/search/model_multiple_batch_request.go

Lines changed: 28 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/algoliasearch-client-java/algoliasearch/src/main/java/com/algolia/model/search/MultipleBatchRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public MultipleBatchRequest setBody(Object body) {
3636
}
3737

3838
/** Operation arguments (varies with specified `action`). */
39-
@javax.annotation.Nonnull
39+
@javax.annotation.Nullable
4040
public Object getBody() {
4141
return body;
4242
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export type MultipleBatchRequest = {
88
/**
99
* Operation arguments (varies with specified `action`).
1010
*/
11-
body: Record<string, any>;
11+
body?: Record<string, any>;
1212

1313
/**
1414
* Index name (case-sensitive).

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/search/MultipleBatchRequest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ import kotlinx.serialization.json.*
88
* MultipleBatchRequest
99
*
1010
* @param action
11-
* @param body Operation arguments (varies with specified `action`).
1211
* @param indexName Index name (case-sensitive).
12+
* @param body Operation arguments (varies with specified `action`).
1313
*/
1414
@Serializable
1515
public data class MultipleBatchRequest(
1616

1717
@SerialName(value = "action") val action: Action,
1818

19-
/** Operation arguments (varies with specified `action`). */
20-
@SerialName(value = "body") val body: JsonObject,
21-
2219
/** Index name (case-sensitive). */
2320
@SerialName(value = "indexName") val indexName: String,
21+
22+
/** Operation arguments (varies with specified `action`). */
23+
@SerialName(value = "body") val body: JsonObject? = null,
2424
)

clients/algoliasearch-client-php/lib/Model/Search/MultipleBatchRequest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,6 @@ public function listInvalidProperties()
157157
if (!isset($this->container['action']) || null === $this->container['action']) {
158158
$invalidProperties[] = "'action' can't be null";
159159
}
160-
if (!isset($this->container['body']) || null === $this->container['body']) {
161-
$invalidProperties[] = "'body' can't be null";
162-
}
163160
if (!isset($this->container['indexName']) || null === $this->container['indexName']) {
164161
$invalidProperties[] = "'indexName' can't be null";
165162
}
@@ -205,7 +202,7 @@ public function setAction($action)
205202
/**
206203
* Gets body.
207204
*
208-
* @return object
205+
* @return null|object
209206
*/
210207
public function getBody()
211208
{
@@ -215,7 +212,7 @@ public function getBody()
215212
/**
216213
* Sets body.
217214
*
218-
* @param object $body operation arguments (varies with specified `action`)
215+
* @param null|object $body operation arguments (varies with specified `action`)
219216
*
220217
* @return self
221218
*/

clients/algoliasearch-client-python/algoliasearch/search/models/multiple_batch_request.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from __future__ import annotations
88

99
from json import loads
10-
from typing import Any, Dict, Self
10+
from typing import Any, Dict, Optional, Self
1111

1212
from pydantic import BaseModel, ConfigDict, Field, StrictStr
1313

@@ -20,8 +20,9 @@ class MultipleBatchRequest(BaseModel):
2020
"""
2121

2222
action: Action
23-
body: Dict[str, Any] = Field(
24-
description="Operation arguments (varies with specified `action`)."
23+
body: Optional[Dict[str, Any]] = Field(
24+
default=None,
25+
description="Operation arguments (varies with specified `action`).",
2526
)
2627
index_name: StrictStr = Field(
2728
description="Index name (case-sensitive).", alias="indexName"

clients/algoliasearch-client-ruby/lib/algolia/models/search/multiple_batch_request.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,6 @@ def initialize(attributes = {})
9797

9898
if attributes.key?(:body)
9999
self.body = attributes[:body]
100-
else
101-
self.body = nil
102100
end
103101

104102
if attributes.key?(:index_name)

0 commit comments

Comments
 (0)