postDeleteWithHttpInfo method

Future<Response> postDeleteWithHttpInfo(
  1. DeletePredicateRequest deletePredicateRequest, {
  2. String? zapTraceSpan,
  3. String? org,
  4. String? bucket,
  5. String? orgID,
  6. String? bucketID,
})

Delete data

Note: This method returns the HTTP Response.

Parameters:

  • DeletePredicateRequest deletePredicateRequest (required): Deletes data from an InfluxDB bucket.

  • String zapTraceSpan: OpenTracing span context

  • String org: Specifies the organization to delete data from.

  • String bucket: Specifies the bucket to delete data from.

  • String orgID: Specifies the organization ID of the resource.

  • String bucketID: Specifies the bucket ID to delete data from.

Implementation

Future<Response> postDeleteWithHttpInfo(
  DeletePredicateRequest deletePredicateRequest, {
  String? zapTraceSpan,
  String? org,
  String? bucket,
  String? orgID,
  String? bucketID,
}) async {
  final path = r'/delete';

  // ignore: prefer_final_locals
  Object? postBody = deletePredicateRequest;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (org != null) {
    queryParams.addAll(_convertParametersForCollectionFormat('', 'org', org));
  }
  if (bucket != null) {
    queryParams
        .addAll(_convertParametersForCollectionFormat('', 'bucket', bucket));
  }
  if (orgID != null) {
    queryParams
        .addAll(_convertParametersForCollectionFormat('', 'orgID', orgID));
  }
  if (bucketID != null) {
    queryParams.addAll(
        _convertParametersForCollectionFormat('', 'bucketID', bucketID));
  }

  if (zapTraceSpan != null) {
    headerParams[r'Zap-Trace-Span'] = parameterToString(zapTraceSpan);
  }

  const authNames = <String>[
    'BasicAuthentication',
    'QuerystringAuthentication',
    'TokenAuthentication'
  ];
  const contentTypes = <String>['application/json'];

  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes[0],
    authNames,
  );
}