aggregateWithHttpInfo method
Future<Response>
aggregateWithHttpInfo(
- String tenantId,
- AggregationRequest aggregationRequest, [
- AggregateOptions? options
Aggregates documents by grouping them (if groupBy is provided) and applying multiple operations. Different operations (e.g. sum, countDistinct, avg, etc.) are supported.
Note: This method returns the HTTP Response.
Parameters:
-
String tenantId (required):
-
AggregationRequest aggregationRequest (required):
-
String parentTenantId:
-
bool includeStats:
Implementation
Future<Response> aggregateWithHttpInfo(String tenantId, AggregationRequest aggregationRequest, [ AggregateOptions? options ]) async {
final parentTenantId = options?.parentTenantId;
final includeStats = options?.includeStats;
// ignore: prefer_const_declarations
final path = r'/api/v1/aggregate';
// ignore: prefer_final_locals
Object? postBody = aggregationRequest;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
queryParams.addAll(_queryParams('', 'tenantId', tenantId));
if (parentTenantId != null) {
queryParams.addAll(_queryParams('', 'parentTenantId', parentTenantId));
}
if (includeStats != null) {
queryParams.addAll(_queryParams('', 'includeStats', includeStats));
}
const contentTypes = <String>['application/json'];
return apiClient.invokeAPI(
path,
'POST',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}