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' });

0 commit comments

Comments
 (0)