Skip to content

Commit 7e9d7d9

Browse files
shortcutsalgolia-botmillotpdamcou
authored andcommitted
chore: generated code for commit 97c1aaf. (#364)
Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Pierre Millot <[email protected]> Co-authored-by: Damien Couchez <[email protected]>
1 parent 20a2d66 commit 7e9d7d9

File tree

224 files changed

+75284
-175
lines changed

Some content is hidden

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

224 files changed

+75284
-175
lines changed

clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiClient.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.algolia.exceptions.*;
44
import com.algolia.utils.Requester;
5+
import com.algolia.utils.UserAgent;
56
import java.io.IOException;
67
import java.io.UnsupportedEncodingException;
78
import java.lang.reflect.Type;
@@ -28,8 +29,21 @@ public class ApiClient {
2829
/*
2930
* Constructor for ApiClient with custom Requester
3031
*/
31-
public ApiClient(String appId, String apiKey, Requester requester) {
32-
setUserAgent("OpenAPI-Generator/0.1.0/java");
32+
public ApiClient(
33+
String appId,
34+
String apiKey,
35+
Requester requester,
36+
String clientName,
37+
UserAgent.Segment[] segments
38+
) {
39+
UserAgent ua = new UserAgent("0.0.1");
40+
ua.addSegment(new UserAgent.Segment(clientName, "0.0.1"));
41+
if (segments != null) {
42+
for (UserAgent.Segment segment : segments) {
43+
ua.addSegment(segment);
44+
}
45+
}
46+
setUserAgent(ua.toString());
3347

3448
this.appId = appId;
3549
this.apiKey = apiKey;

clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/search/SearchApi.java

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,33 @@
2626
public class SearchApi extends ApiClient {
2727

2828
public SearchApi(String appId, String apiKey) {
29-
super(appId, apiKey, new HttpRequester(getDefaultHosts(appId)));
29+
this(appId, apiKey, new HttpRequester(getDefaultHosts(appId)), null);
30+
}
31+
32+
public SearchApi(
33+
String appId,
34+
String apiKey,
35+
UserAgent.Segment[] userAgentSegments
36+
) {
37+
this(
38+
appId,
39+
apiKey,
40+
new HttpRequester(getDefaultHosts(appId)),
41+
userAgentSegments
42+
);
3043
}
3144

3245
public SearchApi(String appId, String apiKey, Requester requester) {
33-
super(appId, apiKey, requester);
46+
this(appId, apiKey, requester, null);
47+
}
48+
49+
public SearchApi(
50+
String appId,
51+
String apiKey,
52+
Requester requester,
53+
UserAgent.Segment[] userAgentSegments
54+
) {
55+
super(appId, apiKey, requester, "Search", userAgentSegments);
3456
}
3557

3658
private static List<StatefulHost> getDefaultHosts(String appId) {

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

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static function create($appId = null, $apiKey = null, $region = null)
5454
}
5555

5656
/**
57-
* Instantiate the client with congiguration
57+
* Instantiate the client with configuration
5858
*
5959
* @param AbtestingConfig $config Configuration
6060
*/
@@ -90,8 +90,13 @@ public function getClientConfig()
9090
* Creates a new A/B test with provided configuration.
9191
*
9292
* @param array $addABTestsRequest addABTestsRequest (required)
93+
* - $addABTestsRequest['name'] => (string) A/B test name. (required)
94+
* - $addABTestsRequest['variant'] => (array) List of 2 variants for the A/B test. (required)
95+
* - $addABTestsRequest['endAt'] => (string) End date for the A/B test expressed as YYYY-MM-DDThh:mm:ssZ. (required)
9396
*
94-
* @return array<string, mixed>
97+
* @see \Algolia\AlgoliaSearch\Model\Abtesting\AddABTestsRequest
98+
*
99+
* @return array<string, mixed>|\Algolia\AlgoliaSearch\Model\Abtesting\ABTestResponse
95100
*/
96101
public function addABTests($addABTestsRequest)
97102
{
@@ -120,7 +125,7 @@ public function addABTests($addABTestsRequest)
120125
* @param array $parameters Query parameters to be applied to the current query. (optional)
121126
* @param array $body The parameters to send with the custom request. (optional)
122127
*
123-
* @return array<string, mixed>
128+
* @return array<string, mixed>|object
124129
*/
125130
public function del($path, $parameters = null, $body = null)
126131
{
@@ -149,7 +154,7 @@ public function del($path, $parameters = null, $body = null)
149154
if ($path !== null) {
150155
$resourcePath = str_replace(
151156
'{path}',
152-
path,
157+
$path,
153158
$resourcePath
154159
);
155160
}
@@ -166,7 +171,7 @@ public function del($path, $parameters = null, $body = null)
166171
*
167172
* @param int $id The A/B test ID. (required)
168173
*
169-
* @return array<string, mixed>
174+
* @return array<string, mixed>|\Algolia\AlgoliaSearch\Model\Abtesting\ABTestResponse
170175
*/
171176
public function deleteABTest($id)
172177
{
@@ -199,7 +204,7 @@ public function deleteABTest($id)
199204
* @param string $path The path of the API endpoint to target, anything after the /1 needs to be specified. (required)
200205
* @param array $parameters Query parameters to be applied to the current query. (optional)
201206
*
202-
* @return array<string, mixed>
207+
* @return array<string, mixed>|object
203208
*/
204209
public function get($path, $parameters = null)
205210
{
@@ -228,7 +233,7 @@ public function get($path, $parameters = null)
228233
if ($path !== null) {
229234
$resourcePath = str_replace(
230235
'{path}',
231-
path,
236+
$path,
232237
$resourcePath
233238
);
234239
}
@@ -241,7 +246,7 @@ public function get($path, $parameters = null)
241246
*
242247
* @param int $id The A/B test ID. (required)
243248
*
244-
* @return array<string, mixed>
249+
* @return array<string, mixed>|\Algolia\AlgoliaSearch\Model\Abtesting\ABTest
245250
*/
246251
public function getABTest($id)
247252
{
@@ -274,7 +279,7 @@ public function getABTest($id)
274279
* @param int $offset Position of the starting record. Used for paging. 0 is the first record. (optional, default to 0)
275280
* @param int $limit Number of records to return. Limit is the size of the page. (optional, default to 10)
276281
*
277-
* @return array<string, mixed>
282+
* @return array<string, mixed>|\Algolia\AlgoliaSearch\Model\Abtesting\ListABTestsResponse
278283
*/
279284
public function listABTests($offset = 0, $limit = 10)
280285
{
@@ -312,7 +317,7 @@ public function listABTests($offset = 0, $limit = 10)
312317
* @param array $parameters Query parameters to be applied to the current query. (optional)
313318
* @param array $body The parameters to send with the custom request. (optional)
314319
*
315-
* @return array<string, mixed>
320+
* @return array<string, mixed>|object
316321
*/
317322
public function post($path, $parameters = null, $body = null)
318323
{
@@ -341,7 +346,7 @@ public function post($path, $parameters = null, $body = null)
341346
if ($path !== null) {
342347
$resourcePath = str_replace(
343348
'{path}',
344-
path,
349+
$path,
345350
$resourcePath
346351
);
347352
}
@@ -360,7 +365,7 @@ public function post($path, $parameters = null, $body = null)
360365
* @param array $parameters Query parameters to be applied to the current query. (optional)
361366
* @param array $body The parameters to send with the custom request. (optional)
362367
*
363-
* @return array<string, mixed>
368+
* @return array<string, mixed>|object
364369
*/
365370
public function put($path, $parameters = null, $body = null)
366371
{
@@ -389,7 +394,7 @@ public function put($path, $parameters = null, $body = null)
389394
if ($path !== null) {
390395
$resourcePath = str_replace(
391396
'{path}',
392-
path,
397+
$path,
393398
$resourcePath
394399
);
395400
}
@@ -406,7 +411,7 @@ public function put($path, $parameters = null, $body = null)
406411
*
407412
* @param int $id The A/B test ID. (required)
408413
*
409-
* @return array<string, mixed>
414+
* @return array<string, mixed>|\Algolia\AlgoliaSearch\Model\Abtesting\ABTestResponse
410415
*/
411416
public function stopABTest($id)
412417
{

0 commit comments

Comments
 (0)