aggregateWithHttpInfo method

Future<Response> aggregateWithHttpInfo(
  1. String tenantId,
  2. AggregationRequest aggregationRequest, {
  3. String? parentTenantId,
  4. bool? includeStats,
})

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:

Implementation

Future<Response> aggregateWithHttpInfo(String tenantId, AggregationRequest aggregationRequest, { String? parentTenantId, bool? includeStats, }) async {
  // 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,
  );
}