feat(server): add /search/statistics resource (#18885)

This commit is contained in:
Jonathan Gilbert 2025-06-07 11:12:53 +10:00 committed by GitHub
parent ecb16d9907
commit fb4be6e231
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 954 additions and 16 deletions

View file

@ -193,6 +193,53 @@ class SearchApi {
return null;
}
/// Performs an HTTP 'POST /search/statistics' operation and returns the [Response].
/// Parameters:
///
/// * [StatisticsSearchDto] statisticsSearchDto (required):
Future<Response> searchAssetStatisticsWithHttpInfo(StatisticsSearchDto statisticsSearchDto,) async {
// ignore: prefer_const_declarations
final apiPath = r'/search/statistics';
// ignore: prefer_final_locals
Object? postBody = statisticsSearchDto;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
apiPath,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}
/// Parameters:
///
/// * [StatisticsSearchDto] statisticsSearchDto (required):
Future<SearchStatisticsResponseDto?> searchAssetStatistics(StatisticsSearchDto statisticsSearchDto,) async {
final response = await searchAssetStatisticsWithHttpInfo(statisticsSearchDto,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'SearchStatisticsResponseDto',) as SearchStatisticsResponseDto;
}
return null;
}
/// Performs an HTTP 'POST /search/metadata' operation and returns the [Response].
/// Parameters:
///