Skip to content

Commit 09a6b34

Browse files
chore: generated code for commit d68089e. [skip ci]
Co-authored-by: Ben Greenbank <[email protected]>
1 parent d68089e commit 09a6b34

File tree

9 files changed

+23
-26
lines changed

9 files changed

+23
-26
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
public class PredictClient extends ApiClient {
2222

23-
private static final String[] allowedRegions = { "ue", "ew" };
23+
private static final String[] allowedRegions = { "eu", "us" };
2424

2525
public PredictClient(String appId, String apiKey, String region) {
2626
this(appId, apiKey, region, null);
@@ -52,10 +52,10 @@ private static List<StatefulHost> getDefaultHosts(String region) throws AlgoliaR
5252
}
5353

5454
if (region == null || !found) {
55-
throw new AlgoliaRuntimeException("`region` is required and must be one of the following: ue, ew");
55+
throw new AlgoliaRuntimeException("`region` is required and must be one of the following: eu, us");
5656
}
5757

58-
String url = "predict-api-432xa6wemq-{region}.a.run.app".replace("{region}", region);
58+
String url = "predict.{region}.algolia.com".replace("{region}", region);
5959

6060
hosts.add(new StatefulHost(url, "https", EnumSet.of(CallType.READ, CallType.WRITE)));
6161
return hosts;

clients/algoliasearch-client-javascript/packages/predict/src/predictClient.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,11 @@ import type { UserProfile } from '../model/userProfile';
2929

3030
export const apiClientVersion = '1.0.0-alpha.17';
3131

32-
export const REGIONS = ['ue', 'ew'] as const;
32+
export const REGIONS = ['eu', 'us'] as const;
3333
export type Region = typeof REGIONS[number];
3434

3535
function getDefaultHosts(region: Region): Host[] {
36-
const url = 'predict-api-432xa6wemq-{region}.a.run.app'.replace(
37-
'{region}',
38-
region
39-
);
36+
const url = 'predict.{region}.algolia.com'.replace('{region}', region);
4037

4138
return [{ url, accept: 'readWrite', protocol: 'https' }];
4239
}

specs/bundled/predict.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,17 +312,17 @@ components:
312312
schema:
313313
$ref: '#/components/schemas/ErrorBase'
314314
servers:
315-
- url: https://predict-api-432xa6wemq-{region}.a.run.app
315+
- url: https://predict.{region}.algolia.com
316316
variables:
317317
region:
318318
enum:
319-
- ue
320-
- ew
321-
default: ew
319+
- eu
320+
- us
321+
default: eu
322322
description: |
323323
Region where your Predict data is stored and processed:
324-
* `ew` - europe-west
325-
* `ue` - us-east.
324+
* `eu` - Europe
325+
* `us` - United States.
326326
security:
327327
- appId: []
328328
apiKey: []

tests/output/java/src/test/java/com/algolia/client/Predict.test.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void init() {
3030
}
3131

3232
PredictClient createClient() {
33-
return new PredictClient("appId", "apiKey", "ew", new ClientOptions().setRequester(requester));
33+
return new PredictClient("appId", "apiKey", "eu", new ClientOptions().setRequester(requester));
3434
}
3535

3636
@Test
@@ -94,7 +94,7 @@ void parametersTest0() {
9494
PredictClient $client = new PredictClient("my-app-id", "my-api-key", "", new ClientOptions().setRequester(requester));
9595
}
9696
);
97-
assertEquals("`region` is required and must be one of the following: ue, ew", exception.getMessage());
97+
assertEquals("`region` is required and must be one of the following: eu, us", exception.getMessage());
9898
}
9999
}
100100

@@ -108,13 +108,13 @@ void parametersTest1() {
108108
PredictClient $client = new PredictClient("my-app-id", "my-api-key", "not_a_region", new ClientOptions().setRequester(requester));
109109
}
110110
);
111-
assertEquals("`region` is required and must be one of the following: ue, ew", exception.getMessage());
111+
assertEquals("`region` is required and must be one of the following: eu, us", exception.getMessage());
112112
}
113113
}
114114

115115
@Test
116116
@DisplayName("does not throw when region is given")
117117
void parametersTest2() {
118-
PredictClient $client = new PredictClient("my-app-id", "my-api-key", "ew", new ClientOptions().setRequester(requester));
118+
PredictClient $client = new PredictClient("my-app-id", "my-api-key", "eu", new ClientOptions().setRequester(requester));
119119
}
120120
}

tests/output/java/src/test/java/com/algolia/methods/requests/Predict.test.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void init() {
3737
HttpRequester requester = new HttpRequester();
3838
echo = new EchoInterceptor();
3939
requester.addInterceptor(echo.getEchoInterceptor());
40-
client = new PredictClient("appId", "apiKey", "ew", new ClientOptions().setRequester(requester));
40+
client = new PredictClient("appId", "apiKey", "eu", new ClientOptions().setRequester(requester));
4141
}
4242

4343
@Test

tests/output/javascript/src/client/predict.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const appId = 'test-app-id';
99
const apiKey = 'test-api-key';
1010

1111
function createClient(): PredictClient {
12-
return predictClient(appId, apiKey, 'ew', { requester: echoRequester() });
12+
return predictClient(appId, apiKey, 'eu', { requester: echoRequester() });
1313
}
1414

1515
describe('commonApi', () => {
@@ -60,7 +60,7 @@ describe('parameters', () => {
6060
throw new Error('test is expected to throw error');
6161
} catch (e) {
6262
expect((e as Error).message).toMatch(
63-
'`region` is required and must be one of the following: ue, ew'
63+
'`region` is required and must be one of the following: eu, us'
6464
);
6565
}
6666
});
@@ -74,13 +74,13 @@ describe('parameters', () => {
7474
throw new Error('test is expected to throw error');
7575
} catch (e) {
7676
expect((e as Error).message).toMatch(
77-
'`region` is required and must be one of the following: ue, ew'
77+
'`region` is required and must be one of the following: eu, us'
7878
);
7979
}
8080
});
8181

8282
test('does not throw when region is given', async () => {
83-
const $client = predictClient('my-app-id', 'my-api-key', 'ew', {
83+
const $client = predictClient('my-app-id', 'my-api-key', 'eu', {
8484
requester: echoRequester(),
8585
});
8686
});

tests/output/javascript/src/methods/requests/predict.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { echoRequester } from '@algolia/requester-node-http';
55
const appId = process.env.ALGOLIA_APPLICATION_ID || 'test_app_id';
66
const apiKey = process.env.ALGOLIA_SEARCH_KEY || 'test_api_key';
77

8-
const client = predictClient(appId, apiKey, 'ew', {
8+
const client = predictClient(appId, apiKey, 'eu', {
99
requester: echoRequester(),
1010
});
1111

tests/output/php/src/client/RecommendTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class RecommendTest extends TestCase implements HttpClientInterface
2727
/**
2828
* @return RecommendClient
2929
*/
30-
private function createClient($appId, $apiKey, $region = 'us')
30+
private function createClient($appId, $apiKey, $region = '')
3131
{
3232
$config = RecommendConfig::create($appId, $apiKey);
3333
$clusterHosts = ClusterHosts::createFromAppId($appId);

tests/output/php/src/client/SearchTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SearchTest extends TestCase implements HttpClientInterface
2727
/**
2828
* @return SearchClient
2929
*/
30-
private function createClient($appId, $apiKey, $region = 'us')
30+
private function createClient($appId, $apiKey, $region = '')
3131
{
3232
$config = SearchConfig::create($appId, $apiKey);
3333
$clusterHosts = ClusterHosts::createFromAppId($appId);

0 commit comments

Comments
 (0)