/*
* 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;
namespace InfluxDB.Client.Api.Service
{
///
/// Represents a collection of functions to interact with the API endpoints
///
public interface IPingService : IApiAccessor
{
#region Synchronous Operations
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
///
///
///
/// Thrown when fails to make API call
///
void GetPing();
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
///
///
///
/// Thrown when fails to make API call
/// ApiResponse of Object(void)
ApiResponse GetPingWithHttpInfo();
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
///
///
///
/// Thrown when fails to make API call
///
void HeadPing();
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
///
///
///
/// Thrown when fails to make API call
/// ApiResponse of Object(void)
ApiResponse HeadPingWithHttpInfo();
#endregion Synchronous Operations
#region Asynchronous Operations
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
///
///
///
/// Thrown when fails to make API call
/// Cancellation token
/// Task of void
System.Threading.Tasks.Task GetPingAsync(CancellationToken cancellationToken = default);
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
///
///
///
/// Thrown when fails to make API call
/// Cancellation token
/// Task of ApiResponse
System.Threading.Tasks.Task> GetPingAsyncWithHttpInfo(
CancellationToken cancellationToken = default);
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
///
///
///
/// Thrown when fails to make API call
/// Cancellation token
/// Task of void
System.Threading.Tasks.Task HeadPingAsync(CancellationToken cancellationToken = default);
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
///
///
///
/// Thrown when fails to make API call
/// Cancellation token
/// Task of ApiResponse
System.Threading.Tasks.Task> HeadPingAsyncWithHttpInfo(
CancellationToken cancellationToken = default);
#endregion Asynchronous Operations
}
///
/// Represents a collection of functions to interact with the API endpoints
///
public partial class PingService : IPingService
{
private ExceptionFactory _exceptionFactory = (name, response) => null;
///
/// Initializes a new instance of the class.
///
///
public PingService(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 PingService(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);
}
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
/// Thrown when fails to make API call
///
public void GetPing()
{
GetPingWithHttpInfo();
}
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
/// Thrown when fails to make API call
/// ApiResponse of Object(void)
public ApiResponse GetPingWithHttpInfo()
{
var localVarPath = "/ping";
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);
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
};
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("GetPing", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
null);
}
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
/// Thrown when fails to make API call
/// Cancellation token
/// ApiResponse of Object(void)
public async System.Threading.Tasks.Task GetPingWithIRestResponseAsync(
CancellationToken cancellationToken = default)
{
var localVarPath = "/ping";
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);
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
};
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("GetPing", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
/// Thrown when fails to make API call
/// ApiResponse of Object(void)
public RestResponse GetPingWithIRestResponse()
{
var localVarPath = "/ping";
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);
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
};
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("GetPing", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
/// Thrown when fails to make API call
/// ApiResponse of Object(void)
public RestRequest GetPingWithRestRequest()
{
var localVarPath = "/ping";
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);
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
};
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);
}
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
/// Thrown when fails to make API call
/// Cancellation token
/// Task of void
public System.Threading.Tasks.Task GetPingAsync(CancellationToken cancellationToken = default)
{
return GetPingAsyncWithHttpInfo(cancellationToken);
}
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
/// Thrown when fails to make API call
/// Cancellation token
/// Task of ApiResponse
public async System.Threading.Tasks.Task> GetPingAsyncWithHttpInfo(
CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse = await GetPingAsyncWithIRestResponse(cancellationToken).ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetPing", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
null);
}
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
/// Thrown when fails to make API call
/// Cancellation token
/// Task of RestResponse
public async System.Threading.Tasks.Task GetPingAsyncWithIRestResponse(
CancellationToken cancellationToken = default)
{
var localVarPath = "/ping";
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);
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
};
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("GetPing", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
/// Thrown when fails to make API call
///
public void HeadPing()
{
HeadPingWithHttpInfo();
}
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
/// Thrown when fails to make API call
/// ApiResponse of Object(void)
public ApiResponse HeadPingWithHttpInfo()
{
var localVarPath = "/ping";
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);
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
};
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.Head, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("HeadPing", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
null);
}
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
/// Thrown when fails to make API call
/// Cancellation token
/// ApiResponse of Object(void)
public async System.Threading.Tasks.Task HeadPingWithIRestResponseAsync(
CancellationToken cancellationToken = default)
{
var localVarPath = "/ping";
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);
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
};
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.Head, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("HeadPing", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
/// Thrown when fails to make API call
/// ApiResponse of Object(void)
public RestResponse HeadPingWithIRestResponse()
{
var localVarPath = "/ping";
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);
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
};
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.Head, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("HeadPing", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
/// Thrown when fails to make API call
/// ApiResponse of Object(void)
public RestRequest HeadPingWithRestRequest()
{
var localVarPath = "/ping";
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);
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
};
var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept"))
{
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
}
return Configuration.ApiClient.PrepareRequest(localVarPath,
Method.Head, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType);
}
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
/// Thrown when fails to make API call
/// Cancellation token
/// Task of void
public System.Threading.Tasks.Task HeadPingAsync(CancellationToken cancellationToken = default)
{
return HeadPingAsyncWithHttpInfo(cancellationToken);
}
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
/// Thrown when fails to make API call
/// Cancellation token
/// Task of ApiResponse
public async System.Threading.Tasks.Task> HeadPingAsyncWithHttpInfo(
CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse = await HeadPingAsyncWithIRestResponse(cancellationToken).ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("HeadPing", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
null);
}
///
/// Checks the status of InfluxDB instance and version of InfluxDB.
///
/// Thrown when fails to make API call
/// Cancellation token
/// Task of RestResponse
public async System.Threading.Tasks.Task HeadPingAsyncWithIRestResponse(
CancellationToken cancellationToken = default)
{
var localVarPath = "/ping";
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);
// to determine the Accept header
var localVarHttpHeaderAccepts = new string[]
{
};
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.Head, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams,
localVarFileParams,
localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false);
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("HeadPing", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
}
}