/* * InfluxDB OSS API Service * * The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. * * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Threading; using RestSharp; using InfluxDB.Client.Api.Client; using InfluxDB.Client.Api.Domain; namespace InfluxDB.Client.Api.Service { /// /// Represents a collection of functions to interact with the API endpoints /// public interface IDeleteService : IApiAccessor { #region Synchronous Operations /// /// Delete data /// /// /// /// /// Thrown when fails to make API call /// Deletes data from an InfluxDB bucket. /// OpenTracing span context (optional) /// Specifies the organization to delete data from. (optional) /// Specifies the bucket to delete data from. (optional) /// Specifies the organization ID of the resource. (optional) /// Specifies the bucket ID to delete data from. (optional) /// void PostDelete(DeletePredicateRequest deletePredicateRequest, string zapTraceSpan = null, string org = null, string bucket = null, string orgID = null, string bucketID = null); /// /// Delete data /// /// /// /// /// Thrown when fails to make API call /// Deletes data from an InfluxDB bucket. /// OpenTracing span context (optional) /// Specifies the organization to delete data from. (optional) /// Specifies the bucket to delete data from. (optional) /// Specifies the organization ID of the resource. (optional) /// Specifies the bucket ID to delete data from. (optional) /// ApiResponse of Object(void) ApiResponse PostDeleteWithHttpInfo(DeletePredicateRequest deletePredicateRequest, string zapTraceSpan = null, string org = null, string bucket = null, string orgID = null, string bucketID = null); #endregion Synchronous Operations #region Asynchronous Operations /// /// Delete data /// /// /// /// /// Thrown when fails to make API call /// Deletes data from an InfluxDB bucket. /// OpenTracing span context (optional) /// Specifies the organization to delete data from. (optional) /// Specifies the bucket to delete data from. (optional) /// Specifies the organization ID of the resource. (optional) /// Specifies the bucket ID to delete data from. (optional) /// Cancellation token /// Task of void System.Threading.Tasks.Task PostDeleteAsync(DeletePredicateRequest deletePredicateRequest, string zapTraceSpan = null, string org = null, string bucket = null, string orgID = null, string bucketID = null, CancellationToken cancellationToken = default); /// /// Delete data /// /// /// /// /// Thrown when fails to make API call /// Deletes data from an InfluxDB bucket. /// OpenTracing span context (optional) /// Specifies the organization to delete data from. (optional) /// Specifies the bucket to delete data from. (optional) /// Specifies the organization ID of the resource. (optional) /// Specifies the bucket ID to delete data from. (optional) /// Cancellation token /// Task of ApiResponse System.Threading.Tasks.Task> PostDeleteAsyncWithHttpInfo( DeletePredicateRequest deletePredicateRequest, string zapTraceSpan = null, string org = null, string bucket = null, string orgID = null, string bucketID = null, CancellationToken cancellationToken = default); #endregion Asynchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// public partial class DeleteService : IDeleteService { private ExceptionFactory _exceptionFactory = (name, response) => null; /// /// Initializes a new instance of the class. /// /// public DeleteService(string basePath) { Configuration = new Configuration { BasePath = basePath }; ExceptionFactory = Configuration.DefaultExceptionFactory; } /// /// Initializes a new instance of the class /// using Configuration object /// /// An instance of Configuration /// public DeleteService(Configuration configuration = null) { if (configuration == null) // use the default one in Configuration { Configuration = Configuration.Default; } else { Configuration = configuration; } ExceptionFactory = Configuration.DefaultExceptionFactory; } /// /// Gets the base path of the API client. /// /// The base path public string GetBasePath() { return Configuration.ApiClient.RestClientOptions.BaseUrl.ToString(); } /// /// Sets the base path of the API client. /// /// The base path [Obsolete( "SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] public void SetBasePath(string basePath) { // do nothing } /// /// Gets or sets the configuration object /// /// An instance of the Configuration public Configuration Configuration { get; set; } /// /// Provides a factory method hook for the creation of exceptions. /// public ExceptionFactory ExceptionFactory { get { if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) { throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); } return _exceptionFactory; } set => _exceptionFactory = value; } /// /// Gets the default header. /// /// Dictionary of HTTP header [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] public IDictionary DefaultHeader() { return new ReadOnlyDictionary(Configuration.DefaultHeader); } /// /// Add default header. /// /// Header field name. /// Header field value. /// [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] public void AddDefaultHeader(string key, string value) { Configuration.AddDefaultHeader(key, value); } /// /// Delete data /// /// Thrown when fails to make API call /// Deletes data from an InfluxDB bucket. /// OpenTracing span context (optional) /// Specifies the organization to delete data from. (optional) /// Specifies the bucket to delete data from. (optional) /// Specifies the organization ID of the resource. (optional) /// Specifies the bucket ID to delete data from. (optional) /// public void PostDelete(DeletePredicateRequest deletePredicateRequest, string zapTraceSpan = null, string org = null, string bucket = null, string orgID = null, string bucketID = null) { PostDeleteWithHttpInfo(deletePredicateRequest, zapTraceSpan, org, bucket, orgID, bucketID); } /// /// Delete data /// /// Thrown when fails to make API call /// Deletes data from an InfluxDB bucket. /// OpenTracing span context (optional) /// Specifies the organization to delete data from. (optional) /// Specifies the bucket to delete data from. (optional) /// Specifies the organization ID of the resource. (optional) /// Specifies the bucket ID to delete data from. (optional) /// ApiResponse of Object(void) public ApiResponse PostDeleteWithHttpInfo(DeletePredicateRequest deletePredicateRequest, string zapTraceSpan = null, string org = null, string bucket = null, string orgID = null, string bucketID = null) { // verify the required parameter 'deletePredicateRequest' is set if (deletePredicateRequest == null) { throw new ApiException(400, "Missing required parameter 'deletePredicateRequest' when calling DeleteService->PostDelete"); } var localVarPath = "/api/v2/delete"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (org != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter } if (bucket != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "bucket", bucket)); // query parameter } if (orgID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter } if (bucketID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "bucketID", bucketID)); // query parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (deletePredicateRequest != null && deletePredicateRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(deletePredicateRequest); // http body (model) parameter } else { localVarPostBody = deletePredicateRequest; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostDelete", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Delete data /// /// Thrown when fails to make API call /// Deletes data from an InfluxDB bucket. /// OpenTracing span context (optional) /// Specifies the organization to delete data from. (optional) /// Specifies the bucket to delete data from. (optional) /// Specifies the organization ID of the resource. (optional) /// Specifies the bucket ID to delete data from. (optional) /// Cancellation token /// ApiResponse of Object(void) public async System.Threading.Tasks.Task PostDeleteWithIRestResponseAsync( DeletePredicateRequest deletePredicateRequest, string zapTraceSpan = null, string org = null, string bucket = null, string orgID = null, string bucketID = null, CancellationToken cancellationToken = default) { // verify the required parameter 'deletePredicateRequest' is set if (deletePredicateRequest == null) { throw new ApiException(400, "Missing required parameter 'deletePredicateRequest' when calling DeleteService->PostDelete"); } var localVarPath = "/api/v2/delete"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (org != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter } if (bucket != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "bucket", bucket)); // query parameter } if (orgID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter } if (bucketID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "bucketID", bucketID)); // query parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (deletePredicateRequest != null && deletePredicateRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(deletePredicateRequest); // http body (model) parameter } else { localVarPostBody = deletePredicateRequest; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostDelete", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete data /// /// Thrown when fails to make API call /// Deletes data from an InfluxDB bucket. /// OpenTracing span context (optional) /// Specifies the organization to delete data from. (optional) /// Specifies the bucket to delete data from. (optional) /// Specifies the organization ID of the resource. (optional) /// Specifies the bucket ID to delete data from. (optional) /// ApiResponse of Object(void) public RestResponse PostDeleteWithIRestResponse(DeletePredicateRequest deletePredicateRequest, string zapTraceSpan = null, string org = null, string bucket = null, string orgID = null, string bucketID = null) { // verify the required parameter 'deletePredicateRequest' is set if (deletePredicateRequest == null) { throw new ApiException(400, "Missing required parameter 'deletePredicateRequest' when calling DeleteService->PostDelete"); } var localVarPath = "/api/v2/delete"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (org != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter } if (bucket != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "bucket", bucket)); // query parameter } if (orgID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter } if (bucketID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "bucketID", bucketID)); // query parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (deletePredicateRequest != null && deletePredicateRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(deletePredicateRequest); // http body (model) parameter } else { localVarPostBody = deletePredicateRequest; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostDelete", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete data /// /// Thrown when fails to make API call /// Deletes data from an InfluxDB bucket. /// OpenTracing span context (optional) /// Specifies the organization to delete data from. (optional) /// Specifies the bucket to delete data from. (optional) /// Specifies the organization ID of the resource. (optional) /// Specifies the bucket ID to delete data from. (optional) /// ApiResponse of Object(void) public RestRequest PostDeleteWithRestRequest(DeletePredicateRequest deletePredicateRequest, string zapTraceSpan = null, string org = null, string bucket = null, string orgID = null, string bucketID = null) { // verify the required parameter 'deletePredicateRequest' is set if (deletePredicateRequest == null) { throw new ApiException(400, "Missing required parameter 'deletePredicateRequest' when calling DeleteService->PostDelete"); } var localVarPath = "/api/v2/delete"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (org != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter } if (bucket != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "bucket", bucket)); // query parameter } if (orgID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter } if (bucketID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "bucketID", bucketID)); // query parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (deletePredicateRequest != null && deletePredicateRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(deletePredicateRequest); // http body (model) parameter } else { localVarPostBody = deletePredicateRequest; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } return Configuration.ApiClient.PrepareRequest(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Delete data /// /// Thrown when fails to make API call /// Deletes data from an InfluxDB bucket. /// OpenTracing span context (optional) /// Specifies the organization to delete data from. (optional) /// Specifies the bucket to delete data from. (optional) /// Specifies the organization ID of the resource. (optional) /// Specifies the bucket ID to delete data from. (optional) /// Cancellation token /// Task of void public System.Threading.Tasks.Task PostDeleteAsync(DeletePredicateRequest deletePredicateRequest, string zapTraceSpan = null, string org = null, string bucket = null, string orgID = null, string bucketID = null, CancellationToken cancellationToken = default) { return PostDeleteAsyncWithHttpInfo(deletePredicateRequest, zapTraceSpan, org, bucket, orgID, bucketID, cancellationToken); } /// /// Delete data /// /// Thrown when fails to make API call /// Deletes data from an InfluxDB bucket. /// OpenTracing span context (optional) /// Specifies the organization to delete data from. (optional) /// Specifies the bucket to delete data from. (optional) /// Specifies the organization ID of the resource. (optional) /// Specifies the bucket ID to delete data from. (optional) /// Cancellation token /// Task of ApiResponse public async System.Threading.Tasks.Task> PostDeleteAsyncWithHttpInfo( DeletePredicateRequest deletePredicateRequest, string zapTraceSpan = null, string org = null, string bucket = null, string orgID = null, string bucketID = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PostDeleteAsyncWithIRestResponse(deletePredicateRequest, zapTraceSpan, org, bucket, orgID, bucketID, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostDelete", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Delete data /// /// Thrown when fails to make API call /// Deletes data from an InfluxDB bucket. /// OpenTracing span context (optional) /// Specifies the organization to delete data from. (optional) /// Specifies the bucket to delete data from. (optional) /// Specifies the organization ID of the resource. (optional) /// Specifies the bucket ID to delete data from. (optional) /// Cancellation token /// Task of RestResponse public async System.Threading.Tasks.Task PostDeleteAsyncWithIRestResponse( DeletePredicateRequest deletePredicateRequest, string zapTraceSpan = null, string org = null, string bucket = null, string orgID = null, string bucketID = null, CancellationToken cancellationToken = default) { // verify the required parameter 'deletePredicateRequest' is set if (deletePredicateRequest == null) { throw new ApiException(400, "Missing required parameter 'deletePredicateRequest' when calling DeleteService->PostDelete"); } var localVarPath = "/api/v2/delete"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (org != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter } if (bucket != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "bucket", bucket)); // query parameter } if (orgID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter } if (bucketID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "bucketID", bucketID)); // query parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (deletePredicateRequest != null && deletePredicateRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(deletePredicateRequest); // http body (model) parameter } else { localVarPostBody = deletePredicateRequest; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("PostDelete", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } } }