Skip to content

Commit 0fc6f86

Browse files
committed
fix(ruby): only prefix model by client:: (#3923) (generated) [skip ci]
Co-authored-by: Pierre Millot <[email protected]>
1 parent 8b343d2 commit 0fc6f86

File tree

23 files changed

+393
-3
lines changed

23 files changed

+393
-3
lines changed

clients/algoliasearch-client-ruby/lib/algolia/api/monitoring_client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ def get_reachability_with_http_info(clusters, request_options = {})
489489
# @return [Hash<String, Hash>]
490490
def get_reachability(clusters, request_options = {})
491491
response = get_reachability_with_http_info(clusters, request_options)
492-
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Monitoring::Hash<String, Hash>")
492+
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Hash<String, Hash>")
493493
end
494494

495495
# Retrieves the servers that belong to clusters. The response depends on whether you authenticate your API request: - With authentication, the response lists the servers assigned to your Algolia application&#39;s cluster. - Without authentication, the response lists the servers for all Algolia clusters.

clients/algoliasearch-client-ruby/lib/algolia/api/search_client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,7 +1245,7 @@ def get_dictionary_languages_with_http_info(request_options = {})
12451245
# @return [Hash<String, Languages>]
12461246
def get_dictionary_languages(request_options = {})
12471247
response = get_dictionary_languages_with_http_info(request_options)
1248-
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Search::Hash<String, Languages>")
1248+
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Hash<String, Languages>")
12491249
end
12501250

12511251
# Retrieves the languages for which standard dictionary entries are turned off.
@@ -1400,7 +1400,7 @@ def get_object_with_http_info(index_name, object_id, attributes_to_retrieve = ni
14001400
# @return [Object]
14011401
def get_object(index_name, object_id, attributes_to_retrieve = nil, request_options = {})
14021402
response = get_object_with_http_info(index_name, object_id, attributes_to_retrieve, request_options)
1403-
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Search::Object")
1403+
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Object")
14041404
end
14051405

14061406
# Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.

tests/output/csharp/src/generated/e2e/Search.test.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,27 @@ public async Task BrowseTest()
6666
}
6767
}
6868

69+
[Fact(DisplayName = "search with a real object")]
70+
public async Task GetObjectTest1()
71+
{
72+
try
73+
{
74+
var resp = await client.GetObjectAsync("cts_e2e_browse", "Batman and Robin");
75+
// Check status code 200
76+
Assert.NotNull(resp);
77+
78+
JsonAssert.EqualOverrideDefault(
79+
"{\"objectID\":\"Batman and Robin\",\"title\":\"Batman and Robin\",\"year\":1949,\"cast\":[\"Robert Lowery\",\"Johnny Duncan\",\"Jane Adams\"]}",
80+
JsonSerializer.Serialize(resp, JsonConfig.Options),
81+
new JsonDiffConfig(true)
82+
);
83+
}
84+
catch (Exception e)
85+
{
86+
Assert.Fail("An exception was thrown: " + e.Message);
87+
}
88+
}
89+
6990
[Fact(DisplayName = "getRule")]
7091
public async Task GetRuleTest()
7192
{

tests/output/csharp/src/generated/requests/Search.test.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,17 @@ public async Task GetObjectTest()
12371237
}
12381238
}
12391239

1240+
[Fact(DisplayName = "search with a real object")]
1241+
public async Task GetObjectTest1()
1242+
{
1243+
await client.GetObjectAsync("cts_e2e_browse", "Batman and Robin");
1244+
1245+
var req = _echo.LastResponse;
1246+
Assert.Equal("/1/indexes/cts_e2e_browse/Batman%20and%20Robin", req.Path);
1247+
Assert.Equal("GET", req.Method.ToString());
1248+
Assert.Null(req.Body);
1249+
}
1250+
12401251
[Fact(DisplayName = "getObjects")]
12411252
public async Task GetObjectsTest()
12421253
{

tests/output/dart/test/requests/search_test.dart

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,28 @@ void main() {
14681468
),
14691469
);
14701470

1471+
// getObject
1472+
test(
1473+
'search with a real object',
1474+
() => runTest(
1475+
builder: (requester) => SearchClient(
1476+
appId: 'appId',
1477+
apiKey: 'apiKey',
1478+
options: ClientOptions(requester: requester),
1479+
),
1480+
call: (client) => client.getObject(
1481+
indexName: "cts_e2e_browse",
1482+
objectID: "Batman and Robin",
1483+
),
1484+
intercept: (request) {
1485+
expectPath(
1486+
request.path, '/1/indexes/cts_e2e_browse/Batman%20and%20Robin');
1487+
expect(request.method, 'get');
1488+
expect(request.body, null);
1489+
},
1490+
),
1491+
);
1492+
14711493
// getObjects
14721494
test(
14731495
'getObjects',

tests/output/go/tests/e2e/search_test.go

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

tests/output/go/tests/requests/search_test.go

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

tests/output/java/src/test/java/com/algolia/e2e/Search.test.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,21 @@ void browseTest() {
5050
);
5151
}
5252

53+
@Test
54+
@DisplayName("search with a real object")
55+
void getObjectTest1() {
56+
Object res = client.getObject("cts_e2e_browse", "Batman and Robin");
57+
assertDoesNotThrow(() ->
58+
JSONAssert.assertEquals(
59+
"{\"objectID\":\"Batman and Robin\",\"title\":\"Batman and" +
60+
" Robin\",\"year\":1949,\"cast\":[\"Robert Lowery\",\"Johnny Duncan\",\"Jane" +
61+
" Adams\"]}",
62+
json.writeValueAsString(res),
63+
JSONCompareMode.LENIENT
64+
)
65+
);
66+
}
67+
5368
@Test
5469
@DisplayName("getRule")
5570
void getRuleTest() {

tests/output/java/src/test/java/com/algolia/requests/Search.test.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,18 @@ void getObjectTest() {
14251425
}
14261426
}
14271427

1428+
@Test
1429+
@DisplayName("search with a real object")
1430+
void getObjectTest1() {
1431+
assertDoesNotThrow(() -> {
1432+
client.getObject("cts_e2e_browse", "Batman and Robin");
1433+
});
1434+
EchoResponse req = echo.getLastResponse();
1435+
assertEquals("/1/indexes/cts_e2e_browse/Batman%20and%20Robin", req.path);
1436+
assertEquals("GET", req.method);
1437+
assertNull(req.body);
1438+
}
1439+
14281440
@Test
14291441
@DisplayName("getObjects")
14301442
void getObjectsTest() {

tests/output/javascript/src/e2e/search.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ describe('browse', () => {
2828
});
2929
});
3030

31+
describe('getObject', () => {
32+
test('search with a real object', async () => {
33+
const resp = await client.getObject({ indexName: 'cts_e2e_browse', objectID: 'Batman and Robin' });
34+
35+
const expectedBody = {
36+
objectID: 'Batman and Robin',
37+
title: 'Batman and Robin',
38+
year: 1949,
39+
cast: ['Robert Lowery', 'Johnny Duncan', 'Jane Adams'],
40+
};
41+
42+
expect(expectedBody).toEqual(union(expectedBody, resp));
43+
});
44+
});
45+
3146
describe('getRule', () => {
3247
test('getRule', async () => {
3348
const resp = await client.getRule({ indexName: 'cts_e2e_browse', objectID: 'qr-1725004648916' });

tests/output/javascript/src/requests/search.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,18 @@ describe('getObject', () => {
765765
expect(req.data).toEqual(undefined);
766766
expect(req.searchParams).toStrictEqual({ attributesToRetrieve: 'attr1%2Cattr2' });
767767
});
768+
769+
test('search with a real object', async () => {
770+
const req = (await client.getObject({
771+
indexName: 'cts_e2e_browse',
772+
objectID: 'Batman and Robin',
773+
})) as unknown as EchoResponse;
774+
775+
expect(req.path).toEqual('/1/indexes/cts_e2e_browse/Batman%20and%20Robin');
776+
expect(req.method).toEqual('GET');
777+
expect(req.data).toEqual(undefined);
778+
expect(req.searchParams).toStrictEqual(undefined);
779+
});
768780
});
769781

770782
describe('getObjects', () => {

tests/output/kotlin/src/commonTest/kotlin/com/algolia/e2e/SearchTest.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,21 @@ class SearchTest {
4242
)
4343
}
4444

45+
@Test
46+
fun `search with a real object1`() = runTest {
47+
client.runTest(
48+
call = {
49+
getObject(
50+
indexName = "cts_e2e_browse",
51+
objectID = "Batman and Robin",
52+
)
53+
},
54+
response = {
55+
JSONAssert.assertEquals("{\"objectID\":\"Batman and Robin\",\"title\":\"Batman and Robin\",\"year\":1949,\"cast\":[\"Robert Lowery\",\"Johnny Duncan\",\"Jane Adams\"]}", Json.encodeToString(it), JSONCompareMode.LENIENT)
56+
},
57+
)
58+
}
59+
4560
@Test
4661
fun `getRule`() = runTest {
4762
client.runTest(

tests/output/kotlin/src/commonTest/kotlin/com/algolia/requests/SearchTest.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,23 @@ class SearchTest {
12981298
)
12991299
}
13001300

1301+
@Test
1302+
fun `search with a real object1`() = runTest {
1303+
client.runTest(
1304+
call = {
1305+
getObject(
1306+
indexName = "cts_e2e_browse",
1307+
objectID = "Batman and Robin",
1308+
)
1309+
},
1310+
intercept = {
1311+
assertEquals("/1/indexes/cts_e2e_browse/Batman%20and%20Robin".toPathSegments(), it.url.pathSegments)
1312+
assertEquals(HttpMethod.parse("GET"), it.method)
1313+
assertNoBody(it.body)
1314+
},
1315+
)
1316+
}
1317+
13011318
// getObjects
13021319

13031320
@Test

tests/output/php/src/e2e/SearchTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ public function testBrowse(): void
3737
$this->assertEquals($this->union($expected, $resp), $expected);
3838
}
3939

40+
#[TestDox('search with a real object')]
41+
public function testGetObject1(): void
42+
{
43+
$client = $this->getClient();
44+
$resp = $client->getObject(
45+
'cts_e2e_browse',
46+
'Batman and Robin',
47+
);
48+
49+
$expected = json_decode('{"objectID":"Batman and Robin","title":"Batman and Robin","year":1949,"cast":["Robert Lowery","Johnny Duncan","Jane Adams"]}', true);
50+
51+
$this->assertEquals($this->union($expected, $resp), $expected);
52+
}
53+
4054
#[TestDox('getRule')]
4155
public function testGetRule(): void
4256
{

tests/output/php/src/requests/SearchTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,24 @@ public function testGetObject(): void
12311231
]);
12321232
}
12331233

1234+
#[TestDox('search with a real object')]
1235+
public function testGetObject1(): void
1236+
{
1237+
$client = $this->getClient();
1238+
$client->getObject(
1239+
'cts_e2e_browse',
1240+
'Batman and Robin',
1241+
);
1242+
1243+
$this->assertRequests([
1244+
[
1245+
'path' => '/1/indexes/cts_e2e_browse/Batman%20and%20Robin',
1246+
'method' => 'GET',
1247+
'body' => null,
1248+
],
1249+
]);
1250+
}
1251+
12341252
#[TestDox('getObjects')]
12351253
public function testGetObjects(): void
12361254
{

tests/output/python/tests/e2e/search_test.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,30 @@ async def test_browse_(self):
4343
== _expected_body
4444
)
4545

46+
async def test_get_object_1(self):
47+
"""
48+
search with a real object
49+
"""
50+
raw_resp = await SearchClient(
51+
self._e2e_app_id, self._e2e_api_key
52+
).get_object_with_http_info(
53+
index_name="cts_e2e_browse",
54+
object_id="Batman and Robin",
55+
)
56+
assert raw_resp.status_code == 200
57+
58+
resp = await SearchClient(self._e2e_app_id, self._e2e_api_key).get_object(
59+
index_name="cts_e2e_browse",
60+
object_id="Batman and Robin",
61+
)
62+
_expected_body = loads(
63+
"""{"objectID":"Batman and Robin","title":"Batman and Robin","year":1949,"cast":["Robert Lowery","Johnny Duncan","Jane Adams"]}"""
64+
)
65+
assert (
66+
self._helpers.union(_expected_body, self._helpers.unwrap(resp))
67+
== _expected_body
68+
)
69+
4670
async def test_get_rule_(self):
4771
"""
4872
getRule
@@ -470,6 +494,30 @@ def test_browse_(self):
470494
== _expected_body
471495
)
472496

497+
def test_get_object_1(self):
498+
"""
499+
search with a real object
500+
"""
501+
raw_resp = SearchClientSync(
502+
self._e2e_app_id, self._e2e_api_key
503+
).get_object_with_http_info(
504+
index_name="cts_e2e_browse",
505+
object_id="Batman and Robin",
506+
)
507+
assert raw_resp.status_code == 200
508+
509+
resp = SearchClientSync(self._e2e_app_id, self._e2e_api_key).get_object(
510+
index_name="cts_e2e_browse",
511+
object_id="Batman and Robin",
512+
)
513+
_expected_body = loads(
514+
"""{"objectID":"Batman and Robin","title":"Batman and Robin","year":1949,"cast":["Robert Lowery","Johnny Duncan","Jane Adams"]}"""
515+
)
516+
assert (
517+
self._helpers.union(_expected_body, self._helpers.unwrap(resp))
518+
== _expected_body
519+
)
520+
473521
def test_get_rule_(self):
474522
"""
475523
getRule

0 commit comments

Comments
 (0)