/* * 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 IQueryService : IApiAccessor { #region Synchronous Operations /// /// Retrieve query suggestions /// /// /// /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// FluxSuggestions FluxSuggestions GetQuerySuggestions(string zapTraceSpan = null); /// /// Retrieve query suggestions /// /// /// /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// ApiResponse of FluxSuggestions ApiResponse GetQuerySuggestionsWithHttpInfo(string zapTraceSpan = null); /// /// Retrieve query suggestions for a branching suggestion /// /// /// /// /// Thrown when fails to make API call /// The name of the branching suggestion. /// OpenTracing span context (optional) /// FluxSuggestion FluxSuggestion GetQuerySuggestionsName(string name, string zapTraceSpan = null); /// /// Retrieve query suggestions for a branching suggestion /// /// /// /// /// Thrown when fails to make API call /// The name of the branching suggestion. /// OpenTracing span context (optional) /// ApiResponse of FluxSuggestion ApiResponse GetQuerySuggestionsNameWithHttpInfo(string name, string zapTraceSpan = null); /// /// Query data /// /// /// Retrieves data from InfluxDB buckets. To query data, you need the following: - **organization** – _See [View organizations](https://docs.influxdata.com/influxdb/v2.1/organizations/view-orgs/#view-your-organization-id) for instructions on viewing your organization ID._ - **API token** – _See [View tokens](https://docs.influxdata.com/influxdb/v2.1/security/tokens/view-tokens/) for instructions on viewing your API token._ - **InfluxDB URL** – _See [InfluxDB URLs](https://docs.influxdata.com/influxdb/v2.1/reference/urls/)_. - **Flux query** – _See [Flux](https://docs.influxdata.com/flux/v0.x/)._ For more information and examples, see [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/v2.1/query-data/execute-queries/influx-api/). /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to identity) /// (optional) /// Specifies the name of the organization executing the query. Takes either the ID or Name. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Specifies the ID of the organization executing the query. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Flux query or specification to execute (optional) /// string string PostQuery(string zapTraceSpan = null, string acceptEncoding = null, string contentType = null, string org = null, string orgID = null, Query query = null); /// /// Query data /// /// /// Retrieves data from InfluxDB buckets. To query data, you need the following: - **organization** – _See [View organizations](https://docs.influxdata.com/influxdb/v2.1/organizations/view-orgs/#view-your-organization-id) for instructions on viewing your organization ID._ - **API token** – _See [View tokens](https://docs.influxdata.com/influxdb/v2.1/security/tokens/view-tokens/) for instructions on viewing your API token._ - **InfluxDB URL** – _See [InfluxDB URLs](https://docs.influxdata.com/influxdb/v2.1/reference/urls/)_. - **Flux query** – _See [Flux](https://docs.influxdata.com/flux/v0.x/)._ For more information and examples, see [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/v2.1/query-data/execute-queries/influx-api/). /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to identity) /// (optional) /// Specifies the name of the organization executing the query. Takes either the ID or Name. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Specifies the ID of the organization executing the query. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Flux query or specification to execute (optional) /// ApiResponse of string ApiResponse PostQueryWithHttpInfo(string zapTraceSpan = null, string acceptEncoding = null, string contentType = null, string org = null, string orgID = null, Query query = null); /// /// Analyze a Flux query /// /// /// /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Flux query to analyze (optional) /// AnalyzeQueryResponse AnalyzeQueryResponse PostQueryAnalyze(string zapTraceSpan = null, string contentType = null, Query query = null); /// /// Analyze a Flux query /// /// /// /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Flux query to analyze (optional) /// ApiResponse of AnalyzeQueryResponse ApiResponse PostQueryAnalyzeWithHttpInfo(string zapTraceSpan = null, string contentType = null, Query query = null); /// /// Generate an Abstract Syntax Tree (AST) from a query /// /// /// Analyzes flux query and generates a query specification. /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Analyzed Flux query to generate abstract syntax tree. (optional) /// ASTResponse ASTResponse PostQueryAst(string zapTraceSpan = null, string contentType = null, LanguageRequest languageRequest = null); /// /// Generate an Abstract Syntax Tree (AST) from a query /// /// /// Analyzes flux query and generates a query specification. /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Analyzed Flux query to generate abstract syntax tree. (optional) /// ApiResponse of ASTResponse ApiResponse PostQueryAstWithHttpInfo(string zapTraceSpan = null, string contentType = null, LanguageRequest languageRequest = null); #endregion Synchronous Operations #region Asynchronous Operations /// /// Retrieve query suggestions /// /// /// /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Cancellation token /// Task of FluxSuggestions System.Threading.Tasks.Task GetQuerySuggestionsAsync(string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Retrieve query suggestions /// /// /// /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (FluxSuggestions) System.Threading.Tasks.Task> GetQuerySuggestionsAsyncWithHttpInfo( string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Retrieve query suggestions for a branching suggestion /// /// /// /// /// Thrown when fails to make API call /// The name of the branching suggestion. /// OpenTracing span context (optional) /// Cancellation token /// Task of FluxSuggestion System.Threading.Tasks.Task GetQuerySuggestionsNameAsync(string name, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Retrieve query suggestions for a branching suggestion /// /// /// /// /// Thrown when fails to make API call /// The name of the branching suggestion. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (FluxSuggestion) System.Threading.Tasks.Task> GetQuerySuggestionsNameAsyncWithHttpInfo(string name, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Query data /// /// /// Retrieves data from InfluxDB buckets. To query data, you need the following: - **organization** – _See [View organizations](https://docs.influxdata.com/influxdb/v2.1/organizations/view-orgs/#view-your-organization-id) for instructions on viewing your organization ID._ - **API token** – _See [View tokens](https://docs.influxdata.com/influxdb/v2.1/security/tokens/view-tokens/) for instructions on viewing your API token._ - **InfluxDB URL** – _See [InfluxDB URLs](https://docs.influxdata.com/influxdb/v2.1/reference/urls/)_. - **Flux query** – _See [Flux](https://docs.influxdata.com/flux/v0.x/)._ For more information and examples, see [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/v2.1/query-data/execute-queries/influx-api/). /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to identity) /// (optional) /// Specifies the name of the organization executing the query. Takes either the ID or Name. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Specifies the ID of the organization executing the query. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Flux query or specification to execute (optional) /// Cancellation token /// Task of string System.Threading.Tasks.Task PostQueryAsync(string zapTraceSpan = null, string acceptEncoding = null, string contentType = null, string org = null, string orgID = null, Query query = null, CancellationToken cancellationToken = default); /// /// Query data /// /// /// Retrieves data from InfluxDB buckets. To query data, you need the following: - **organization** – _See [View organizations](https://docs.influxdata.com/influxdb/v2.1/organizations/view-orgs/#view-your-organization-id) for instructions on viewing your organization ID._ - **API token** – _See [View tokens](https://docs.influxdata.com/influxdb/v2.1/security/tokens/view-tokens/) for instructions on viewing your API token._ - **InfluxDB URL** – _See [InfluxDB URLs](https://docs.influxdata.com/influxdb/v2.1/reference/urls/)_. - **Flux query** – _See [Flux](https://docs.influxdata.com/flux/v0.x/)._ For more information and examples, see [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/v2.1/query-data/execute-queries/influx-api/). /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to identity) /// (optional) /// Specifies the name of the organization executing the query. Takes either the ID or Name. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Specifies the ID of the organization executing the query. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Flux query or specification to execute (optional) /// Cancellation token /// Task of ApiResponse (string) System.Threading.Tasks.Task> PostQueryAsyncWithHttpInfo(string zapTraceSpan = null, string acceptEncoding = null, string contentType = null, string org = null, string orgID = null, Query query = null, CancellationToken cancellationToken = default); /// /// Analyze a Flux query /// /// /// /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Flux query to analyze (optional) /// Cancellation token /// Task of AnalyzeQueryResponse System.Threading.Tasks.Task PostQueryAnalyzeAsync(string zapTraceSpan = null, string contentType = null, Query query = null, CancellationToken cancellationToken = default); /// /// Analyze a Flux query /// /// /// /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Flux query to analyze (optional) /// Cancellation token /// Task of ApiResponse (AnalyzeQueryResponse) System.Threading.Tasks.Task> PostQueryAnalyzeAsyncWithHttpInfo( string zapTraceSpan = null, string contentType = null, Query query = null, CancellationToken cancellationToken = default); /// /// Generate an Abstract Syntax Tree (AST) from a query /// /// /// Analyzes flux query and generates a query specification. /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Analyzed Flux query to generate abstract syntax tree. (optional) /// Cancellation token /// Task of ASTResponse System.Threading.Tasks.Task PostQueryAstAsync(string zapTraceSpan = null, string contentType = null, LanguageRequest languageRequest = null, CancellationToken cancellationToken = default); /// /// Generate an Abstract Syntax Tree (AST) from a query /// /// /// Analyzes flux query and generates a query specification. /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Analyzed Flux query to generate abstract syntax tree. (optional) /// Cancellation token /// Task of ApiResponse (ASTResponse) System.Threading.Tasks.Task> PostQueryAstAsyncWithHttpInfo(string zapTraceSpan = null, string contentType = null, LanguageRequest languageRequest = null, CancellationToken cancellationToken = default); #endregion Asynchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// public partial class QueryService : IQueryService { private ExceptionFactory _exceptionFactory = (name, response) => null; /// /// Initializes a new instance of the class. /// /// public QueryService(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 QueryService(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); } /// /// Retrieve query suggestions /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// FluxSuggestions public FluxSuggestions GetQuerySuggestions(string zapTraceSpan = null) { var localVarResponse = GetQuerySuggestionsWithHttpInfo(zapTraceSpan); return localVarResponse.Data; } /// /// Retrieve query suggestions /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// ApiResponse of FluxSuggestions public ApiResponse GetQuerySuggestionsWithHttpInfo(string zapTraceSpan = null) { var localVarPath = "/api/v2/query/suggestions"; 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[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // 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.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetQuerySuggestions", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (FluxSuggestions)Configuration.ApiClient.Deserialize(localVarResponse, typeof(FluxSuggestions))); } /// /// Retrieve query suggestions /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of FluxSuggestions public async System.Threading.Tasks.Task GetQuerySuggestionsWithIRestResponseAsync( string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarPath = "/api/v2/query/suggestions"; 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[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // 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.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetQuerySuggestions", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Retrieve query suggestions /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// ApiResponse of FluxSuggestions public RestResponse GetQuerySuggestionsWithIRestResponse(string zapTraceSpan = null) { var localVarPath = "/api/v2/query/suggestions"; 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[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // 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.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetQuerySuggestions", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Retrieve query suggestions /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// ApiResponse of FluxSuggestions public RestRequest GetQuerySuggestionsWithRestRequest(string zapTraceSpan = null) { var localVarPath = "/api/v2/query/suggestions"; 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[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // 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.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Retrieve query suggestions /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Cancellation token /// Task of FluxSuggestions public async System.Threading.Tasks.Task GetQuerySuggestionsAsync(string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await GetQuerySuggestionsAsyncWithHttpInfo(zapTraceSpan, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// Retrieve query suggestions /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (FluxSuggestions) public async System.Threading.Tasks.Task> GetQuerySuggestionsAsyncWithHttpInfo( string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await GetQuerySuggestionsAsyncWithIRestResponse(zapTraceSpan, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetQuerySuggestions", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (FluxSuggestions)Configuration.ApiClient.Deserialize(localVarResponse, typeof(FluxSuggestions))); } /// /// Retrieve query suggestions /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (FluxSuggestions) public async System.Threading.Tasks.Task GetQuerySuggestionsAsyncWithIRestResponse( string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarPath = "/api/v2/query/suggestions"; 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[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // 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.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("GetQuerySuggestions", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Retrieve query suggestions for a branching suggestion /// /// Thrown when fails to make API call /// The name of the branching suggestion. /// OpenTracing span context (optional) /// FluxSuggestion public FluxSuggestion GetQuerySuggestionsName(string name, string zapTraceSpan = null) { var localVarResponse = GetQuerySuggestionsNameWithHttpInfo(name, zapTraceSpan); return localVarResponse.Data; } /// /// Retrieve query suggestions for a branching suggestion /// /// Thrown when fails to make API call /// The name of the branching suggestion. /// OpenTracing span context (optional) /// ApiResponse of FluxSuggestion public ApiResponse GetQuerySuggestionsNameWithHttpInfo(string name, string zapTraceSpan = null) { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing required parameter 'name' when calling QueryService->GetQuerySuggestionsName"); } var localVarPath = "/api/v2/query/suggestions/{name}"; 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[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (name != null) { localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // 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.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetQuerySuggestionsName", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (FluxSuggestion)Configuration.ApiClient.Deserialize(localVarResponse, typeof(FluxSuggestion))); } /// /// Retrieve query suggestions for a branching suggestion /// /// Thrown when fails to make API call /// The name of the branching suggestion. /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of FluxSuggestion public async System.Threading.Tasks.Task GetQuerySuggestionsNameWithIRestResponseAsync( string name, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing required parameter 'name' when calling QueryService->GetQuerySuggestionsName"); } var localVarPath = "/api/v2/query/suggestions/{name}"; 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[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (name != null) { localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // 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.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetQuerySuggestionsName", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Retrieve query suggestions for a branching suggestion /// /// Thrown when fails to make API call /// The name of the branching suggestion. /// OpenTracing span context (optional) /// ApiResponse of FluxSuggestion public RestResponse GetQuerySuggestionsNameWithIRestResponse(string name, string zapTraceSpan = null) { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing required parameter 'name' when calling QueryService->GetQuerySuggestionsName"); } var localVarPath = "/api/v2/query/suggestions/{name}"; 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[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (name != null) { localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // 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.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetQuerySuggestionsName", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Retrieve query suggestions for a branching suggestion /// /// Thrown when fails to make API call /// The name of the branching suggestion. /// OpenTracing span context (optional) /// ApiResponse of FluxSuggestion public RestRequest GetQuerySuggestionsNameWithRestRequest(string name, string zapTraceSpan = null) { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing required parameter 'name' when calling QueryService->GetQuerySuggestionsName"); } var localVarPath = "/api/v2/query/suggestions/{name}"; 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[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (name != null) { localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // 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.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Retrieve query suggestions for a branching suggestion /// /// Thrown when fails to make API call /// The name of the branching suggestion. /// OpenTracing span context (optional) /// Cancellation token /// Task of FluxSuggestion public async System.Threading.Tasks.Task GetQuerySuggestionsNameAsync(string name, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await GetQuerySuggestionsNameAsyncWithHttpInfo(name, zapTraceSpan, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// Retrieve query suggestions for a branching suggestion /// /// Thrown when fails to make API call /// The name of the branching suggestion. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (FluxSuggestion) public async System.Threading.Tasks.Task> GetQuerySuggestionsNameAsyncWithHttpInfo( string name, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await GetQuerySuggestionsNameAsyncWithIRestResponse(name, zapTraceSpan, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetQuerySuggestionsName", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (FluxSuggestion)Configuration.ApiClient.Deserialize(localVarResponse, typeof(FluxSuggestion))); } /// /// Retrieve query suggestions for a branching suggestion /// /// Thrown when fails to make API call /// The name of the branching suggestion. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (FluxSuggestion) public async System.Threading.Tasks.Task GetQuerySuggestionsNameAsyncWithIRestResponse( string name, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'name' is set if (name == null) { throw new ApiException(400, "Missing required parameter 'name' when calling QueryService->GetQuerySuggestionsName"); } var localVarPath = "/api/v2/query/suggestions/{name}"; 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[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (name != null) { localVarPathParams.Add("name", Configuration.ApiClient.ParameterToString(name)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } // 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.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("GetQuerySuggestionsName", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Query data Retrieves data from InfluxDB buckets. To query data, you need the following: - **organization** – _See [View organizations](https://docs.influxdata.com/influxdb/v2.1/organizations/view-orgs/#view-your-organization-id) for instructions on viewing your organization ID._ - **API token** – _See [View tokens](https://docs.influxdata.com/influxdb/v2.1/security/tokens/view-tokens/) for instructions on viewing your API token._ - **InfluxDB URL** – _See [InfluxDB URLs](https://docs.influxdata.com/influxdb/v2.1/reference/urls/)_. - **Flux query** – _See [Flux](https://docs.influxdata.com/flux/v0.x/)._ For more information and examples, see [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/v2.1/query-data/execute-queries/influx-api/). /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to identity) /// (optional) /// Specifies the name of the organization executing the query. Takes either the ID or Name. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Specifies the ID of the organization executing the query. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Flux query or specification to execute (optional) /// string public string PostQuery(string zapTraceSpan = null, string acceptEncoding = null, string contentType = null, string org = null, string orgID = null, Query query = null) { var localVarResponse = PostQueryWithHttpInfo(zapTraceSpan, acceptEncoding, contentType, org, orgID, query); return localVarResponse.Data; } /// /// Query data Retrieves data from InfluxDB buckets. To query data, you need the following: - **organization** – _See [View organizations](https://docs.influxdata.com/influxdb/v2.1/organizations/view-orgs/#view-your-organization-id) for instructions on viewing your organization ID._ - **API token** – _See [View tokens](https://docs.influxdata.com/influxdb/v2.1/security/tokens/view-tokens/) for instructions on viewing your API token._ - **InfluxDB URL** – _See [InfluxDB URLs](https://docs.influxdata.com/influxdb/v2.1/reference/urls/)_. - **Flux query** – _See [Flux](https://docs.influxdata.com/flux/v0.x/)._ For more information and examples, see [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/v2.1/query-data/execute-queries/influx-api/). /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to identity) /// (optional) /// Specifies the name of the organization executing the query. Takes either the ID or Name. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Specifies the ID of the organization executing the query. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Flux query or specification to execute (optional) /// ApiResponse of string public ApiResponse PostQueryWithHttpInfo(string zapTraceSpan = null, string acceptEncoding = null, string contentType = null, string org = null, string orgID = null, Query query = null) { var localVarPath = "/api/v2/query"; 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", "application/vnd.flux" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (org != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter } if (orgID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (acceptEncoding != null) { localVarHeaderParams.Add("Accept-Encoding", Configuration.ApiClient.ParameterToString(acceptEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (query != null && query.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(query); // http body (model) parameter } else { localVarPostBody = query; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "text/csv", "application/vnd.influx.arrow", "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("PostQuery", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (string)Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } /// /// Query data Retrieves data from InfluxDB buckets. To query data, you need the following: - **organization** – _See [View organizations](https://docs.influxdata.com/influxdb/v2.1/organizations/view-orgs/#view-your-organization-id) for instructions on viewing your organization ID._ - **API token** – _See [View tokens](https://docs.influxdata.com/influxdb/v2.1/security/tokens/view-tokens/) for instructions on viewing your API token._ - **InfluxDB URL** – _See [InfluxDB URLs](https://docs.influxdata.com/influxdb/v2.1/reference/urls/)_. - **Flux query** – _See [Flux](https://docs.influxdata.com/flux/v0.x/)._ For more information and examples, see [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/v2.1/query-data/execute-queries/influx-api/). /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to identity) /// (optional) /// Specifies the name of the organization executing the query. Takes either the ID or Name. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Specifies the ID of the organization executing the query. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Flux query or specification to execute (optional) /// Cancellation token /// ApiResponse of string public async System.Threading.Tasks.Task PostQueryWithIRestResponseAsync( string zapTraceSpan = null, string acceptEncoding = null, string contentType = null, string org = null, string orgID = null, Query query = null, CancellationToken cancellationToken = default) { var localVarPath = "/api/v2/query"; 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", "application/vnd.flux" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (org != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter } if (orgID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (acceptEncoding != null) { localVarHeaderParams.Add("Accept-Encoding", Configuration.ApiClient.ParameterToString(acceptEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (query != null && query.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(query); // http body (model) parameter } else { localVarPostBody = query; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "text/csv", "application/vnd.influx.arrow", "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("PostQuery", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Query data Retrieves data from InfluxDB buckets. To query data, you need the following: - **organization** – _See [View organizations](https://docs.influxdata.com/influxdb/v2.1/organizations/view-orgs/#view-your-organization-id) for instructions on viewing your organization ID._ - **API token** – _See [View tokens](https://docs.influxdata.com/influxdb/v2.1/security/tokens/view-tokens/) for instructions on viewing your API token._ - **InfluxDB URL** – _See [InfluxDB URLs](https://docs.influxdata.com/influxdb/v2.1/reference/urls/)_. - **Flux query** – _See [Flux](https://docs.influxdata.com/flux/v0.x/)._ For more information and examples, see [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/v2.1/query-data/execute-queries/influx-api/). /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to identity) /// (optional) /// Specifies the name of the organization executing the query. Takes either the ID or Name. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Specifies the ID of the organization executing the query. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Flux query or specification to execute (optional) /// ApiResponse of string public RestResponse PostQueryWithIRestResponse(string zapTraceSpan = null, string acceptEncoding = null, string contentType = null, string org = null, string orgID = null, Query query = null) { var localVarPath = "/api/v2/query"; 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", "application/vnd.flux" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (org != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter } if (orgID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (acceptEncoding != null) { localVarHeaderParams.Add("Accept-Encoding", Configuration.ApiClient.ParameterToString(acceptEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (query != null && query.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(query); // http body (model) parameter } else { localVarPostBody = query; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "text/csv", "application/vnd.influx.arrow", "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("PostQuery", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Query data Retrieves data from InfluxDB buckets. To query data, you need the following: - **organization** – _See [View organizations](https://docs.influxdata.com/influxdb/v2.1/organizations/view-orgs/#view-your-organization-id) for instructions on viewing your organization ID._ - **API token** – _See [View tokens](https://docs.influxdata.com/influxdb/v2.1/security/tokens/view-tokens/) for instructions on viewing your API token._ - **InfluxDB URL** – _See [InfluxDB URLs](https://docs.influxdata.com/influxdb/v2.1/reference/urls/)_. - **Flux query** – _See [Flux](https://docs.influxdata.com/flux/v0.x/)._ For more information and examples, see [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/v2.1/query-data/execute-queries/influx-api/). /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to identity) /// (optional) /// Specifies the name of the organization executing the query. Takes either the ID or Name. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Specifies the ID of the organization executing the query. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Flux query or specification to execute (optional) /// ApiResponse of string public RestRequest PostQueryWithRestRequest(string zapTraceSpan = null, string acceptEncoding = null, string contentType = null, string org = null, string orgID = null, Query query = null) { var localVarPath = "/api/v2/query"; 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", "application/vnd.flux" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (org != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter } if (orgID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (acceptEncoding != null) { localVarHeaderParams.Add("Accept-Encoding", Configuration.ApiClient.ParameterToString(acceptEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (query != null && query.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(query); // http body (model) parameter } else { localVarPostBody = query; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "text/csv", "application/vnd.influx.arrow", "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); } /// /// Query data Retrieves data from InfluxDB buckets. To query data, you need the following: - **organization** – _See [View organizations](https://docs.influxdata.com/influxdb/v2.1/organizations/view-orgs/#view-your-organization-id) for instructions on viewing your organization ID._ - **API token** – _See [View tokens](https://docs.influxdata.com/influxdb/v2.1/security/tokens/view-tokens/) for instructions on viewing your API token._ - **InfluxDB URL** – _See [InfluxDB URLs](https://docs.influxdata.com/influxdb/v2.1/reference/urls/)_. - **Flux query** – _See [Flux](https://docs.influxdata.com/flux/v0.x/)._ For more information and examples, see [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/v2.1/query-data/execute-queries/influx-api/). /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to identity) /// (optional) /// Specifies the name of the organization executing the query. Takes either the ID or Name. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Specifies the ID of the organization executing the query. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Flux query or specification to execute (optional) /// Cancellation token /// Task of string public async System.Threading.Tasks.Task PostQueryAsync(string zapTraceSpan = null, string acceptEncoding = null, string contentType = null, string org = null, string orgID = null, Query query = null, CancellationToken cancellationToken = default) { var localVarResponse = await PostQueryAsyncWithHttpInfo(zapTraceSpan, acceptEncoding, contentType, org, orgID, query, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Query data Retrieves data from InfluxDB buckets. To query data, you need the following: - **organization** – _See [View organizations](https://docs.influxdata.com/influxdb/v2.1/organizations/view-orgs/#view-your-organization-id) for instructions on viewing your organization ID._ - **API token** – _See [View tokens](https://docs.influxdata.com/influxdb/v2.1/security/tokens/view-tokens/) for instructions on viewing your API token._ - **InfluxDB URL** – _See [InfluxDB URLs](https://docs.influxdata.com/influxdb/v2.1/reference/urls/)_. - **Flux query** – _See [Flux](https://docs.influxdata.com/flux/v0.x/)._ For more information and examples, see [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/v2.1/query-data/execute-queries/influx-api/). /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to identity) /// (optional) /// Specifies the name of the organization executing the query. Takes either the ID or Name. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Specifies the ID of the organization executing the query. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Flux query or specification to execute (optional) /// Cancellation token /// Task of ApiResponse (string) public async System.Threading.Tasks.Task> PostQueryAsyncWithHttpInfo( string zapTraceSpan = null, string acceptEncoding = null, string contentType = null, string org = null, string orgID = null, Query query = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PostQueryAsyncWithIRestResponse(zapTraceSpan, acceptEncoding, contentType, org, orgID, query, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostQuery", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (string)Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } /// /// Query data Retrieves data from InfluxDB buckets. To query data, you need the following: - **organization** – _See [View organizations](https://docs.influxdata.com/influxdb/v2.1/organizations/view-orgs/#view-your-organization-id) for instructions on viewing your organization ID._ - **API token** – _See [View tokens](https://docs.influxdata.com/influxdb/v2.1/security/tokens/view-tokens/) for instructions on viewing your API token._ - **InfluxDB URL** – _See [InfluxDB URLs](https://docs.influxdata.com/influxdb/v2.1/reference/urls/)_. - **Flux query** – _See [Flux](https://docs.influxdata.com/flux/v0.x/)._ For more information and examples, see [Query with the InfluxDB API](https://docs.influxdata.com/influxdb/v2.1/query-data/execute-queries/influx-api/). /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// Indicates the content encoding (usually a compression algorithm) that the client can understand. (optional, default to identity) /// (optional) /// Specifies the name of the organization executing the query. Takes either the ID or Name. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Specifies the ID of the organization executing the query. If both `orgID` and `org` are specified, `org` takes precedence. (optional) /// Flux query or specification to execute (optional) /// Cancellation token /// Task of RestResponse (string) public async System.Threading.Tasks.Task PostQueryAsyncWithIRestResponse( string zapTraceSpan = null, string acceptEncoding = null, string contentType = null, string org = null, string orgID = null, Query query = null, CancellationToken cancellationToken = default) { var localVarPath = "/api/v2/query"; 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", "application/vnd.flux" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (org != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter } if (orgID != null) { localVarQueryParams.AddRange( Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (acceptEncoding != null) { localVarHeaderParams.Add("Accept-Encoding", Configuration.ApiClient.ParameterToString(acceptEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (query != null && query.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(query); // http body (model) parameter } else { localVarPostBody = query; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "text/csv", "application/vnd.influx.arrow", "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("PostQuery", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Analyze a Flux query /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Flux query to analyze (optional) /// AnalyzeQueryResponse public AnalyzeQueryResponse PostQueryAnalyze(string zapTraceSpan = null, string contentType = null, Query query = null) { var localVarResponse = PostQueryAnalyzeWithHttpInfo(zapTraceSpan, contentType, query); return localVarResponse.Data; } /// /// Analyze a Flux query /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Flux query to analyze (optional) /// ApiResponse of AnalyzeQueryResponse public ApiResponse PostQueryAnalyzeWithHttpInfo(string zapTraceSpan = null, string contentType = null, Query query = null) { var localVarPath = "/api/v2/query/analyze"; 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 (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (query != null && query.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(query); // http body (model) parameter } else { localVarPostBody = query; // 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("PostQueryAnalyze", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (AnalyzeQueryResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(AnalyzeQueryResponse))); } /// /// Analyze a Flux query /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Flux query to analyze (optional) /// Cancellation token /// ApiResponse of AnalyzeQueryResponse public async System.Threading.Tasks.Task PostQueryAnalyzeWithIRestResponseAsync( string zapTraceSpan = null, string contentType = null, Query query = null, CancellationToken cancellationToken = default) { var localVarPath = "/api/v2/query/analyze"; 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 (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (query != null && query.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(query); // http body (model) parameter } else { localVarPostBody = query; // 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("PostQueryAnalyze", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Analyze a Flux query /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Flux query to analyze (optional) /// ApiResponse of AnalyzeQueryResponse public RestResponse PostQueryAnalyzeWithIRestResponse(string zapTraceSpan = null, string contentType = null, Query query = null) { var localVarPath = "/api/v2/query/analyze"; 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 (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (query != null && query.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(query); // http body (model) parameter } else { localVarPostBody = query; // 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("PostQueryAnalyze", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Analyze a Flux query /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Flux query to analyze (optional) /// ApiResponse of AnalyzeQueryResponse public RestRequest PostQueryAnalyzeWithRestRequest(string zapTraceSpan = null, string contentType = null, Query query = null) { var localVarPath = "/api/v2/query/analyze"; 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 (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (query != null && query.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(query); // http body (model) parameter } else { localVarPostBody = query; // 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); } /// /// Analyze a Flux query /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Flux query to analyze (optional) /// Cancellation token /// Task of AnalyzeQueryResponse public async System.Threading.Tasks.Task PostQueryAnalyzeAsync(string zapTraceSpan = null, string contentType = null, Query query = null, CancellationToken cancellationToken = default) { var localVarResponse = await PostQueryAnalyzeAsyncWithHttpInfo(zapTraceSpan, contentType, query, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// Analyze a Flux query /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Flux query to analyze (optional) /// Cancellation token /// Task of ApiResponse (AnalyzeQueryResponse) public async System.Threading.Tasks.Task> PostQueryAnalyzeAsyncWithHttpInfo( string zapTraceSpan = null, string contentType = null, Query query = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PostQueryAnalyzeAsyncWithIRestResponse(zapTraceSpan, contentType, query, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostQueryAnalyze", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (AnalyzeQueryResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(AnalyzeQueryResponse))); } /// /// Analyze a Flux query /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Flux query to analyze (optional) /// Cancellation token /// Task of RestResponse (AnalyzeQueryResponse) public async System.Threading.Tasks.Task PostQueryAnalyzeAsyncWithIRestResponse( string zapTraceSpan = null, string contentType = null, Query query = null, CancellationToken cancellationToken = default) { var localVarPath = "/api/v2/query/analyze"; 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 (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (query != null && query.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(query); // http body (model) parameter } else { localVarPostBody = query; // 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("PostQueryAnalyze", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Generate an Abstract Syntax Tree (AST) from a query Analyzes flux query and generates a query specification. /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Analyzed Flux query to generate abstract syntax tree. (optional) /// ASTResponse public ASTResponse PostQueryAst(string zapTraceSpan = null, string contentType = null, LanguageRequest languageRequest = null) { var localVarResponse = PostQueryAstWithHttpInfo(zapTraceSpan, contentType, languageRequest); return localVarResponse.Data; } /// /// Generate an Abstract Syntax Tree (AST) from a query Analyzes flux query and generates a query specification. /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Analyzed Flux query to generate abstract syntax tree. (optional) /// ApiResponse of ASTResponse public ApiResponse PostQueryAstWithHttpInfo(string zapTraceSpan = null, string contentType = null, LanguageRequest languageRequest = null) { var localVarPath = "/api/v2/query/ast"; 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 (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (languageRequest != null && languageRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(languageRequest); // http body (model) parameter } else { localVarPostBody = languageRequest; // 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("PostQueryAst", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (ASTResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(ASTResponse))); } /// /// Generate an Abstract Syntax Tree (AST) from a query Analyzes flux query and generates a query specification. /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Analyzed Flux query to generate abstract syntax tree. (optional) /// Cancellation token /// ApiResponse of ASTResponse public async System.Threading.Tasks.Task PostQueryAstWithIRestResponseAsync( string zapTraceSpan = null, string contentType = null, LanguageRequest languageRequest = null, CancellationToken cancellationToken = default) { var localVarPath = "/api/v2/query/ast"; 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 (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (languageRequest != null && languageRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(languageRequest); // http body (model) parameter } else { localVarPostBody = languageRequest; // 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("PostQueryAst", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Generate an Abstract Syntax Tree (AST) from a query Analyzes flux query and generates a query specification. /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Analyzed Flux query to generate abstract syntax tree. (optional) /// ApiResponse of ASTResponse public RestResponse PostQueryAstWithIRestResponse(string zapTraceSpan = null, string contentType = null, LanguageRequest languageRequest = null) { var localVarPath = "/api/v2/query/ast"; 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 (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (languageRequest != null && languageRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(languageRequest); // http body (model) parameter } else { localVarPostBody = languageRequest; // 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("PostQueryAst", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Generate an Abstract Syntax Tree (AST) from a query Analyzes flux query and generates a query specification. /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Analyzed Flux query to generate abstract syntax tree. (optional) /// ApiResponse of ASTResponse public RestRequest PostQueryAstWithRestRequest(string zapTraceSpan = null, string contentType = null, LanguageRequest languageRequest = null) { var localVarPath = "/api/v2/query/ast"; 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 (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (languageRequest != null && languageRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(languageRequest); // http body (model) parameter } else { localVarPostBody = languageRequest; // 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); } /// /// Generate an Abstract Syntax Tree (AST) from a query Analyzes flux query and generates a query specification. /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Analyzed Flux query to generate abstract syntax tree. (optional) /// Cancellation token /// Task of ASTResponse public async System.Threading.Tasks.Task PostQueryAstAsync(string zapTraceSpan = null, string contentType = null, LanguageRequest languageRequest = null, CancellationToken cancellationToken = default) { var localVarResponse = await PostQueryAstAsyncWithHttpInfo(zapTraceSpan, contentType, languageRequest, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// Generate an Abstract Syntax Tree (AST) from a query Analyzes flux query and generates a query specification. /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Analyzed Flux query to generate abstract syntax tree. (optional) /// Cancellation token /// Task of ApiResponse (ASTResponse) public async System.Threading.Tasks.Task> PostQueryAstAsyncWithHttpInfo( string zapTraceSpan = null, string contentType = null, LanguageRequest languageRequest = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PostQueryAstAsyncWithIRestResponse(zapTraceSpan, contentType, languageRequest, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostQueryAst", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (ASTResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(ASTResponse))); } /// /// Generate an Abstract Syntax Tree (AST) from a query Analyzes flux query and generates a query specification. /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// (optional) /// Analyzed Flux query to generate abstract syntax tree. (optional) /// Cancellation token /// Task of RestResponse (ASTResponse) public async System.Threading.Tasks.Task PostQueryAstAsyncWithIRestResponse( string zapTraceSpan = null, string contentType = null, LanguageRequest languageRequest = null, CancellationToken cancellationToken = default) { var localVarPath = "/api/v2/query/ast"; 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 (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (languageRequest != null && languageRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(languageRequest); // http body (model) parameter } else { localVarPostBody = languageRequest; // 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("PostQueryAst", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } } }