Skip to content

Commit 3e90919

Browse files
algolia-botmillotp
andcommitted
fix(specs): getObject return object (#3446) (generated) [skip ci]
Co-authored-by: Pierre Millot <[email protected]>
1 parent 8fbbd5e commit 3e90919

File tree

13 files changed

+47
-60
lines changed

13 files changed

+47
-60
lines changed

clients/algoliasearch-client-csharp/algoliasearch/Clients/SearchClient.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -724,8 +724,8 @@ public interface ISearchClient
724724
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
725725
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
726726
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
727-
/// <returns>Task of Dictionary{string, string}</returns>
728-
Task<Dictionary<string, string>> GetObjectAsync(string indexName, string objectID, List<string> attributesToRetrieve = default, RequestOptions options = null, CancellationToken cancellationToken = default);
727+
/// <returns>Task of object</returns>
728+
Task<object> GetObjectAsync(string indexName, string objectID, List<string> attributesToRetrieve = default, RequestOptions options = null, CancellationToken cancellationToken = default);
729729

730730
/// <summary>
731731
/// Retrieves one record by its object ID. To retrieve more than one record, use the [`objects` operation](#tag/Records/operation/getObjects). (Synchronous version)
@@ -738,8 +738,8 @@ public interface ISearchClient
738738
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
739739
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
740740
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
741-
/// <returns>Dictionary{string, string}</returns>
742-
Dictionary<string, string> GetObject(string indexName, string objectID, List<string> attributesToRetrieve = default, RequestOptions options = null, CancellationToken cancellationToken = default);
741+
/// <returns>object</returns>
742+
object GetObject(string indexName, string objectID, List<string> attributesToRetrieve = default, RequestOptions options = null, CancellationToken cancellationToken = default);
743743

744744
/// <summary>
745745
/// Retrieves one or more records, potentially from different indices. Records are returned in the same order as the requests.
@@ -2929,8 +2929,8 @@ public GetLogsResponse GetLogs(int? offset = default, int? length = default, str
29292929
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
29302930
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
29312931
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
2932-
/// <returns>Task of Dictionary{string, string}</returns>
2933-
public async Task<Dictionary<string, string>> GetObjectAsync(string indexName, string objectID, List<string> attributesToRetrieve = default, RequestOptions options = null, CancellationToken cancellationToken = default)
2932+
/// <returns>Task of object</returns>
2933+
public async Task<object> GetObjectAsync(string indexName, string objectID, List<string> attributesToRetrieve = default, RequestOptions options = null, CancellationToken cancellationToken = default)
29342934
{
29352935

29362936
if (indexName == null)
@@ -2946,7 +2946,7 @@ public async Task<Dictionary<string, string>> GetObjectAsync(string indexName, s
29462946
requestOptions.PathParameters.Add("objectID", QueryStringHelper.ParameterToString(objectID));
29472947

29482948
requestOptions.AddQueryParameter("attributesToRetrieve", attributesToRetrieve);
2949-
return await _transport.ExecuteRequestAsync<Dictionary<string, string>>(new HttpMethod("GET"), "/1/indexes/{indexName}/{objectID}", requestOptions, cancellationToken).ConfigureAwait(false);
2949+
return await _transport.ExecuteRequestAsync<object>(new HttpMethod("GET"), "/1/indexes/{indexName}/{objectID}", requestOptions, cancellationToken).ConfigureAwait(false);
29502950
}
29512951

29522952

@@ -2964,8 +2964,8 @@ public async Task<Dictionary<string, string>> GetObjectAsync(string indexName, s
29642964
/// <exception cref="ArgumentException">Thrown when arguments are not correct</exception>
29652965
/// <exception cref="Algolia.Search.Exceptions.AlgoliaApiException">Thrown when the API call was rejected by Algolia</exception>
29662966
/// <exception cref="Algolia.Search.Exceptions.AlgoliaUnreachableHostException">Thrown when the client failed to call the endpoint</exception>
2967-
/// <returns>Dictionary{string, string}</returns>
2968-
public Dictionary<string, string> GetObject(string indexName, string objectID, List<string> attributesToRetrieve = default, RequestOptions options = null, CancellationToken cancellationToken = default) =>
2967+
/// <returns>object</returns>
2968+
public object GetObject(string indexName, string objectID, List<string> attributesToRetrieve = default, RequestOptions options = null, CancellationToken cancellationToken = default) =>
29692969
AsyncHelper.RunSync(() => GetObjectAsync(indexName, objectID, attributesToRetrieve, options, cancellationToken));
29702970

29712971

clients/algoliasearch-client-dart/packages/client_search/lib/src/api/search_client.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ final class SearchClient implements ApiClient {
10511051
/// * [objectID] Unique record identifier.
10521052
/// * [attributesToRetrieve] Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned. `objectID` is always retrieved. Attributes included in `unretrievableAttributes` won't be retrieved unless the request is authenticated with the admin API key.
10531053
/// * [requestOptions] additional request configuration.
1054-
Future<Map<String, String>> getObject({
1054+
Future<Object> getObject({
10551055
required String indexName,
10561056
required String objectID,
10571057
List<String>? attributesToRetrieve,
@@ -1081,9 +1081,9 @@ final class SearchClient implements ApiClient {
10811081
request: request,
10821082
options: requestOptions,
10831083
);
1084-
return deserialize<Map<String, String>, String>(
1084+
return deserialize<Object, Object>(
10851085
response,
1086-
'Map<String, String>',
1086+
'Object',
10871087
growable: true,
10881088
);
10891089
}

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

Lines changed: 3 additions & 3 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/api/SearchClient.java

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2383,7 +2383,7 @@ public CompletableFuture<GetLogsResponse> getLogsAsync() throws AlgoliaRuntimeEx
23832383
* the transporter requestOptions.
23842384
* @throws AlgoliaRuntimeException If it fails to process the API call
23852385
*/
2386-
public Map<String, String> getObject(
2386+
public Object getObject(
23872387
@Nonnull String indexName,
23882388
@Nonnull String objectID,
23892389
List<String> attributesToRetrieve,
@@ -2404,7 +2404,7 @@ public Map<String, String> getObject(
24042404
* won't be retrieved unless the request is authenticated with the admin API key. (optional)
24052405
* @throws AlgoliaRuntimeException If it fails to process the API call
24062406
*/
2407-
public Map<String, String> getObject(@Nonnull String indexName, @Nonnull String objectID, List<String> attributesToRetrieve)
2407+
public Object getObject(@Nonnull String indexName, @Nonnull String objectID, List<String> attributesToRetrieve)
24082408
throws AlgoliaRuntimeException {
24092409
return this.getObject(indexName, objectID, attributesToRetrieve, null);
24102410
}
@@ -2419,7 +2419,7 @@ public Map<String, String> getObject(@Nonnull String indexName, @Nonnull String
24192419
* the transporter requestOptions.
24202420
* @throws AlgoliaRuntimeException If it fails to process the API call
24212421
*/
2422-
public Map<String, String> getObject(@Nonnull String indexName, @Nonnull String objectID, RequestOptions requestOptions)
2422+
public Object getObject(@Nonnull String indexName, @Nonnull String objectID, RequestOptions requestOptions)
24232423
throws AlgoliaRuntimeException {
24242424
return this.getObject(indexName, objectID, null, requestOptions);
24252425
}
@@ -2432,7 +2432,7 @@ public Map<String, String> getObject(@Nonnull String indexName, @Nonnull String
24322432
* @param objectID Unique record identifier. (required)
24332433
* @throws AlgoliaRuntimeException If it fails to process the API call
24342434
*/
2435-
public Map<String, String> getObject(@Nonnull String indexName, @Nonnull String objectID) throws AlgoliaRuntimeException {
2435+
public Object getObject(@Nonnull String indexName, @Nonnull String objectID) throws AlgoliaRuntimeException {
24362436
return this.getObject(indexName, objectID, null, null);
24372437
}
24382438

@@ -2450,7 +2450,7 @@ public Map<String, String> getObject(@Nonnull String indexName, @Nonnull String
24502450
* the transporter requestOptions.
24512451
* @throws AlgoliaRuntimeException If it fails to process the API call
24522452
*/
2453-
public CompletableFuture<Map<String, String>> getObjectAsync(
2453+
public CompletableFuture<Object> getObjectAsync(
24542454
@Nonnull String indexName,
24552455
@Nonnull String objectID,
24562456
List<String> attributesToRetrieve,
@@ -2465,7 +2465,7 @@ public CompletableFuture<Map<String, String>> getObjectAsync(
24652465
.setMethod("GET")
24662466
.addQueryParameter("attributesToRetrieve", attributesToRetrieve)
24672467
.build();
2468-
return executeAsync(request, requestOptions, new TypeReference<Map<String, String>>() {});
2468+
return executeAsync(request, requestOptions, new TypeReference<Object>() {});
24692469
}
24702470

24712471
/**
@@ -2480,11 +2480,8 @@ public CompletableFuture<Map<String, String>> getObjectAsync(
24802480
* won't be retrieved unless the request is authenticated with the admin API key. (optional)
24812481
* @throws AlgoliaRuntimeException If it fails to process the API call
24822482
*/
2483-
public CompletableFuture<Map<String, String>> getObjectAsync(
2484-
@Nonnull String indexName,
2485-
@Nonnull String objectID,
2486-
List<String> attributesToRetrieve
2487-
) throws AlgoliaRuntimeException {
2483+
public CompletableFuture<Object> getObjectAsync(@Nonnull String indexName, @Nonnull String objectID, List<String> attributesToRetrieve)
2484+
throws AlgoliaRuntimeException {
24882485
return this.getObjectAsync(indexName, objectID, attributesToRetrieve, null);
24892486
}
24902487

@@ -2498,11 +2495,8 @@ public CompletableFuture<Map<String, String>> getObjectAsync(
24982495
* the transporter requestOptions.
24992496
* @throws AlgoliaRuntimeException If it fails to process the API call
25002497
*/
2501-
public CompletableFuture<Map<String, String>> getObjectAsync(
2502-
@Nonnull String indexName,
2503-
@Nonnull String objectID,
2504-
RequestOptions requestOptions
2505-
) throws AlgoliaRuntimeException {
2498+
public CompletableFuture<Object> getObjectAsync(@Nonnull String indexName, @Nonnull String objectID, RequestOptions requestOptions)
2499+
throws AlgoliaRuntimeException {
25062500
return this.getObjectAsync(indexName, objectID, null, requestOptions);
25072501
}
25082502

@@ -2514,8 +2508,7 @@ public CompletableFuture<Map<String, String>> getObjectAsync(
25142508
* @param objectID Unique record identifier. (required)
25152509
* @throws AlgoliaRuntimeException If it fails to process the API call
25162510
*/
2517-
public CompletableFuture<Map<String, String>> getObjectAsync(@Nonnull String indexName, @Nonnull String objectID)
2518-
throws AlgoliaRuntimeException {
2511+
public CompletableFuture<Object> getObjectAsync(@Nonnull String indexName, @Nonnull String objectID) throws AlgoliaRuntimeException {
25192512
return this.getObjectAsync(indexName, objectID, null, null);
25202513
}
25212514

clients/algoliasearch-client-javascript/packages/client-search/src/searchClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,7 @@ export function createSearchClient({
18371837
getObject(
18381838
{ indexName, objectID, attributesToRetrieve }: GetObjectProps,
18391839
requestOptions?: RequestOptions
1840-
): Promise<Record<string, string>> {
1840+
): Promise<Record<string, any>> {
18411841
if (!indexName) {
18421842
throw new Error(
18431843
'Parameter `indexName` is required when calling `getObject`.'

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/api/SearchClient.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ public class SearchClient(
630630
* @param attributesToRetrieve Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned. `objectID` is always retrieved. Attributes included in `unretrievableAttributes` won't be retrieved unless the request is authenticated with the admin API key.
631631
* @param requestOptions additional request configuration.
632632
*/
633-
public suspend fun getObject(indexName: String, objectID: String, attributesToRetrieve: List<String>? = null, requestOptions: RequestOptions? = null): Map<kotlin.String, String> {
633+
public suspend fun getObject(indexName: String, objectID: String, attributesToRetrieve: List<String>? = null, requestOptions: RequestOptions? = null): JsonObject {
634634
require(indexName.isNotBlank()) { "Parameter `indexName` is required when calling `getObject`." }
635635
require(objectID.isNotBlank()) { "Parameter `objectID` is required when calling `getObject`." }
636636
val requestConfig = RequestConfig(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ public function getLogs($offset = null, $length = null, $indexName = null, $type
12631263
* @param array $attributesToRetrieve Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned. &#x60;objectID&#x60; is always retrieved. Attributes included in &#x60;unretrievableAttributes&#x60; won&#39;t be retrieved unless the request is authenticated with the admin API key. (optional)
12641264
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
12651265
*
1266-
* @return array<string, mixed>|array<string,string>
1266+
* @return array<string, mixed>|object
12671267
*/
12681268
public function getObject($indexName, $objectID, $attributesToRetrieve = null, $requestOptions = [])
12691269
{

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2606,7 +2606,7 @@ async def get_object(
26062606
),
26072607
] = None,
26082608
request_options: Optional[Union[dict, RequestOptions]] = None,
2609-
) -> Dict[str, str]:
2609+
) -> object:
26102610
"""
26112611
Retrieves one record by its object ID. To retrieve more than one record, use the [`objects` operation](#tag/Records/operation/getObjects).
26122612
@@ -2620,13 +2620,13 @@ async def get_object(
26202620
:param attributes_to_retrieve: Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned. `objectID` is always retrieved. Attributes included in `unretrievableAttributes` won't be retrieved unless the request is authenticated with the admin API key.
26212621
:type attributes_to_retrieve: List[str]
26222622
:param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
2623-
:return: Returns the deserialized response in a 'Dict[str, str]' result object.
2623+
:return: Returns the deserialized response in a 'object' result object.
26242624
"""
26252625
return (
26262626
await self.get_object_with_http_info(
26272627
index_name, object_id, attributes_to_retrieve, request_options
26282628
)
2629-
).deserialize(Dict[str, str])
2629+
).deserialize(object)
26302630

26312631
async def get_objects_with_http_info(
26322632
self,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,10 +1389,10 @@ def get_object_with_http_info(index_name, object_id, attributes_to_retrieve = ni
13891389
# @param object_id [String] Unique record identifier. (required)
13901390
# @param attributes_to_retrieve [Array<String>] Attributes to include with the records in the response. This is useful to reduce the size of the API response. By default, all retrievable attributes are returned. &#x60;objectID&#x60; is always retrieved. Attributes included in &#x60;unretrievableAttributes&#x60; won&#39;t be retrieved unless the request is authenticated with the admin API key.
13911391
# @param request_options: The request options to send along with the query, they will be merged with the transporter base parameters (headers, query params, timeouts, etc.). (optional)
1392-
# @return [Hash<String, String>]
1392+
# @return [Object]
13931393
def get_object(index_name, object_id, attributes_to_retrieve = nil, request_options = {})
13941394
response = get_object_with_http_info(index_name, object_id, attributes_to_retrieve, request_options)
1395-
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Search::Hash<String, String>")
1395+
@api_client.deserialize(response.body, request_options[:debug_return_type] || "Search::Object")
13961396
end
13971397

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

clients/algoliasearch-client-scala/src/main/scala/algoliasearch/api/SearchClient.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ class SearchClient(
826826
objectID: String,
827827
attributesToRetrieve: Option[Seq[String]] = None,
828828
requestOptions: Option[RequestOptions] = None
829-
)(implicit ec: ExecutionContext): Future[Map[String, String]] = Future {
829+
)(implicit ec: ExecutionContext): Future[Any] = Future {
830830
requireNotNull(indexName, "Parameter `indexName` is required when calling `getObject`.")
831831
requireNotNull(objectID, "Parameter `objectID` is required when calling `getObject`.")
832832

@@ -836,7 +836,7 @@ class SearchClient(
836836
.withPath(s"/1/indexes/${escape(indexName)}/${escape(objectID)}")
837837
.withQueryParameter("attributesToRetrieve", attributesToRetrieve)
838838
.build()
839-
execute[Map[String, String]](request, requestOptions)
839+
execute[Any](request, requestOptions)
840840
}
841841

842842
/** Retrieves one or more records, potentially from different indices. Records are returned in the same order as the

0 commit comments

Comments
 (0)