/* * 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 ITelegrafsService : IApiAccessor { #region Synchronous Operations /// /// Delete a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// void DeleteTelegrafsID(string telegrafID, string zapTraceSpan = null); /// /// Delete a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) ApiResponse DeleteTelegrafsIDWithHttpInfo(string telegrafID, string zapTraceSpan = null); /// /// Delete a label from a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// The label ID. /// OpenTracing span context (optional) /// void DeleteTelegrafsIDLabelsID(string telegrafID, string labelID, string zapTraceSpan = null); /// /// Delete a label from a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// The label ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) ApiResponse DeleteTelegrafsIDLabelsIDWithHttpInfo(string telegrafID, string labelID, string zapTraceSpan = null); /// /// Remove a member from a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The ID of the member to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// void DeleteTelegrafsIDMembersID(string userID, string telegrafID, string zapTraceSpan = null); /// /// Remove a member from a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The ID of the member to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) ApiResponse DeleteTelegrafsIDMembersIDWithHttpInfo(string userID, string telegrafID, string zapTraceSpan = null); /// /// Remove an owner from a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The ID of the owner to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// void DeleteTelegrafsIDOwnersID(string userID, string telegrafID, string zapTraceSpan = null); /// /// Remove an owner from a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The ID of the owner to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) ApiResponse DeleteTelegrafsIDOwnersIDWithHttpInfo(string userID, string telegrafID, string zapTraceSpan = null); /// /// List all Telegraf configurations /// /// /// /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID the Telegraf config belongs to. (optional) /// Telegrafs Telegrafs GetTelegrafs(string zapTraceSpan = null, string orgID = null); /// /// List all Telegraf configurations /// /// /// /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID the Telegraf config belongs to. (optional) /// ApiResponse of Telegrafs ApiResponse GetTelegrafsWithHttpInfo(string zapTraceSpan = null, string orgID = null); /// /// Retrieve a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// (optional, default to application/toml) /// string string GetTelegrafsID(string telegrafID, string zapTraceSpan = null, string accept = null); /// /// Retrieve a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// (optional, default to application/toml) /// ApiResponse of string ApiResponse GetTelegrafsIDWithHttpInfo(string telegrafID, string zapTraceSpan = null, string accept = null); /// /// List all labels for a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// LabelsResponse LabelsResponse GetTelegrafsIDLabels(string telegrafID, string zapTraceSpan = null); /// /// List all labels for a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// ApiResponse of LabelsResponse ApiResponse GetTelegrafsIDLabelsWithHttpInfo(string telegrafID, string zapTraceSpan = null); /// /// List all users with member privileges for a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// ResourceMembers ResourceMembers GetTelegrafsIDMembers(string telegrafID, string zapTraceSpan = null); /// /// List all users with member privileges for a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// ApiResponse of ResourceMembers ApiResponse GetTelegrafsIDMembersWithHttpInfo(string telegrafID, string zapTraceSpan = null); /// /// List all owners of a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// ResourceOwners ResourceOwners GetTelegrafsIDOwners(string telegrafID, string zapTraceSpan = null); /// /// List all owners of a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// ApiResponse of ResourceOwners ApiResponse GetTelegrafsIDOwnersWithHttpInfo(string telegrafID, string zapTraceSpan = null); /// /// Create a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// Telegraf configuration to create /// OpenTracing span context (optional) /// Telegraf Telegraf PostTelegrafs(TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null); /// /// Create a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// Telegraf configuration to create /// OpenTracing span context (optional) /// ApiResponse of Telegraf ApiResponse PostTelegrafsWithHttpInfo(TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null); /// /// Add a label to a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Label to add /// OpenTracing span context (optional) /// LabelResponse LabelResponse PostTelegrafsIDLabels(string telegrafID, LabelMapping labelMapping, string zapTraceSpan = null); /// /// Add a label to a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Label to add /// OpenTracing span context (optional) /// ApiResponse of LabelResponse ApiResponse PostTelegrafsIDLabelsWithHttpInfo(string telegrafID, LabelMapping labelMapping, string zapTraceSpan = null); /// /// Add a member to a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// User to add as member /// OpenTracing span context (optional) /// ResourceMember ResourceMember PostTelegrafsIDMembers(string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null); /// /// Add a member to a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// User to add as member /// OpenTracing span context (optional) /// ApiResponse of ResourceMember ApiResponse PostTelegrafsIDMembersWithHttpInfo(string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null); /// /// Add an owner to a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// User to add as owner /// OpenTracing span context (optional) /// ResourceOwner ResourceOwner PostTelegrafsIDOwners(string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null); /// /// Add an owner to a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// User to add as owner /// OpenTracing span context (optional) /// ApiResponse of ResourceOwner ApiResponse PostTelegrafsIDOwnersWithHttpInfo(string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null); /// /// Update a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Telegraf configuration update to apply /// OpenTracing span context (optional) /// Telegraf Telegraf PutTelegrafsID(string telegrafID, TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null); /// /// Update a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Telegraf configuration update to apply /// OpenTracing span context (optional) /// ApiResponse of Telegraf ApiResponse PutTelegrafsIDWithHttpInfo(string telegrafID, TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null); #endregion Synchronous Operations #region Asynchronous Operations /// /// Delete a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of void System.Threading.Tasks.Task DeleteTelegrafsIDAsync(string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Delete a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse System.Threading.Tasks.Task> DeleteTelegrafsIDAsyncWithHttpInfo(string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Delete a label from a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// The label ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of void System.Threading.Tasks.Task DeleteTelegrafsIDLabelsIDAsync(string telegrafID, string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Delete a label from a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// The label ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse System.Threading.Tasks.Task> DeleteTelegrafsIDLabelsIDAsyncWithHttpInfo(string telegrafID, string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Remove a member from a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The ID of the member to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of void System.Threading.Tasks.Task DeleteTelegrafsIDMembersIDAsync(string userID, string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Remove a member from a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The ID of the member to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse System.Threading.Tasks.Task> DeleteTelegrafsIDMembersIDAsyncWithHttpInfo(string userID, string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Remove an owner from a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The ID of the owner to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of void System.Threading.Tasks.Task DeleteTelegrafsIDOwnersIDAsync(string userID, string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Remove an owner from a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The ID of the owner to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse System.Threading.Tasks.Task> DeleteTelegrafsIDOwnersIDAsyncWithHttpInfo(string userID, string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// List all Telegraf configurations /// /// /// /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID the Telegraf config belongs to. (optional) /// Cancellation token /// Task of Telegrafs System.Threading.Tasks.Task GetTelegrafsAsync(string zapTraceSpan = null, string orgID = null, CancellationToken cancellationToken = default); /// /// List all Telegraf configurations /// /// /// /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID the Telegraf config belongs to. (optional) /// Cancellation token /// Task of ApiResponse (Telegrafs) System.Threading.Tasks.Task> GetTelegrafsAsyncWithHttpInfo(string zapTraceSpan = null, string orgID = null, CancellationToken cancellationToken = default); /// /// Retrieve a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// (optional, default to application/toml) /// Cancellation token /// Task of string System.Threading.Tasks.Task GetTelegrafsIDAsync(string telegrafID, string zapTraceSpan = null, string accept = null, CancellationToken cancellationToken = default); /// /// Retrieve a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// (optional, default to application/toml) /// Cancellation token /// Task of ApiResponse (string) System.Threading.Tasks.Task> GetTelegrafsIDAsyncWithHttpInfo(string telegrafID, string zapTraceSpan = null, string accept = null, CancellationToken cancellationToken = default); /// /// List all labels for a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of LabelsResponse System.Threading.Tasks.Task GetTelegrafsIDLabelsAsync(string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// List all labels for a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (LabelsResponse) System.Threading.Tasks.Task> GetTelegrafsIDLabelsAsyncWithHttpInfo( string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// List all users with member privileges for a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ResourceMembers System.Threading.Tasks.Task GetTelegrafsIDMembersAsync(string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// List all users with member privileges for a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (ResourceMembers) System.Threading.Tasks.Task> GetTelegrafsIDMembersAsyncWithHttpInfo( string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// List all owners of a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ResourceOwners System.Threading.Tasks.Task GetTelegrafsIDOwnersAsync(string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// List all owners of a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (ResourceOwners) System.Threading.Tasks.Task> GetTelegrafsIDOwnersAsyncWithHttpInfo( string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Create a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// Telegraf configuration to create /// OpenTracing span context (optional) /// Cancellation token /// Task of Telegraf System.Threading.Tasks.Task PostTelegrafsAsync(TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Create a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// Telegraf configuration to create /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (Telegraf) System.Threading.Tasks.Task> PostTelegrafsAsyncWithHttpInfo( TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Add a label to a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Label to add /// OpenTracing span context (optional) /// Cancellation token /// Task of LabelResponse System.Threading.Tasks.Task PostTelegrafsIDLabelsAsync(string telegrafID, LabelMapping labelMapping, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Add a label to a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Label to add /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (LabelResponse) System.Threading.Tasks.Task> PostTelegrafsIDLabelsAsyncWithHttpInfo( string telegrafID, LabelMapping labelMapping, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Add a member to a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// User to add as member /// OpenTracing span context (optional) /// Cancellation token /// Task of ResourceMember System.Threading.Tasks.Task PostTelegrafsIDMembersAsync(string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Add a member to a Telegraf config /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// User to add as member /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (ResourceMember) System.Threading.Tasks.Task> PostTelegrafsIDMembersAsyncWithHttpInfo( string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Add an owner to a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// User to add as owner /// OpenTracing span context (optional) /// Cancellation token /// Task of ResourceOwner System.Threading.Tasks.Task PostTelegrafsIDOwnersAsync(string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Add an owner to a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// User to add as owner /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (ResourceOwner) System.Threading.Tasks.Task> PostTelegrafsIDOwnersAsyncWithHttpInfo( string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Update a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Telegraf configuration update to apply /// OpenTracing span context (optional) /// Cancellation token /// Task of Telegraf System.Threading.Tasks.Task PutTelegrafsIDAsync(string telegrafID, TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Update a Telegraf configuration /// /// /// /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Telegraf configuration update to apply /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (Telegraf) System.Threading.Tasks.Task> PutTelegrafsIDAsyncWithHttpInfo(string telegrafID, TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null, CancellationToken cancellationToken = default); #endregion Asynchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// public partial class TelegrafsService : ITelegrafsService { private ExceptionFactory _exceptionFactory = (name, response) => null; /// /// Initializes a new instance of the class. /// /// public TelegrafsService(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 TelegrafsService(Configuration configuration = null) { if (configuration == null) // use the default one in Configuration { Configuration = Configuration.Default; } else { Configuration = configuration; } ExceptionFactory = Configuration.DefaultExceptionFactory; } /// /// Gets the base path of the API client. /// /// The base path public string GetBasePath() { return Configuration.ApiClient.RestClientOptions.BaseUrl.ToString(); } /// /// Sets the base path of the API client. /// /// The base path [Obsolete( "SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] public void SetBasePath(string basePath) { // do nothing } /// /// Gets or sets the configuration object /// /// An instance of the Configuration public Configuration Configuration { get; set; } /// /// Provides a factory method hook for the creation of exceptions. /// public ExceptionFactory ExceptionFactory { get { if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) { throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); } return _exceptionFactory; } set => _exceptionFactory = value; } /// /// Gets the default header. /// /// Dictionary of HTTP header [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] public IDictionary DefaultHeader() { return new ReadOnlyDictionary(Configuration.DefaultHeader); } /// /// Add default header. /// /// Header field name. /// Header field value. /// [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] public void AddDefaultHeader(string key, string value) { Configuration.AddDefaultHeader(key, value); } /// /// Delete a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// public void DeleteTelegrafsID(string telegrafID, string zapTraceSpan = null) { DeleteTelegrafsIDWithHttpInfo(telegrafID, zapTraceSpan); } /// /// Delete a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public ApiResponse DeleteTelegrafsIDWithHttpInfo(string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Delete a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of Object(void) public async System.Threading.Tasks.Task DeleteTelegrafsIDWithIRestResponseAsync( string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestResponse DeleteTelegrafsIDWithIRestResponse(string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestRequest DeleteTelegrafsIDWithRestRequest(string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Delete a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of void public System.Threading.Tasks.Task DeleteTelegrafsIDAsync(string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { return DeleteTelegrafsIDAsyncWithHttpInfo(telegrafID, zapTraceSpan, cancellationToken); } /// /// Delete a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse public async System.Threading.Tasks.Task> DeleteTelegrafsIDAsyncWithHttpInfo( string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await DeleteTelegrafsIDAsyncWithIRestResponse(telegrafID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Delete a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse public async System.Threading.Tasks.Task DeleteTelegrafsIDAsyncWithIRestResponse( string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete a label from a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// The label ID. /// OpenTracing span context (optional) /// public void DeleteTelegrafsIDLabelsID(string telegrafID, string labelID, string zapTraceSpan = null) { DeleteTelegrafsIDLabelsIDWithHttpInfo(telegrafID, labelID, zapTraceSpan); } /// /// Delete a label from a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// The label ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public ApiResponse DeleteTelegrafsIDLabelsIDWithHttpInfo(string telegrafID, string labelID, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsIDLabelsID"); } // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling TelegrafsService->DeleteTelegrafsIDLabelsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/labels/{labelID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (labelID != null) { localVarPathParams.Add("labelID", Configuration.ApiClient.ParameterToString(labelID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsIDLabelsID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Delete a label from a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// The label ID. /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of Object(void) public async System.Threading.Tasks.Task DeleteTelegrafsIDLabelsIDWithIRestResponseAsync( string telegrafID, string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsIDLabelsID"); } // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling TelegrafsService->DeleteTelegrafsIDLabelsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/labels/{labelID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (labelID != null) { localVarPathParams.Add("labelID", Configuration.ApiClient.ParameterToString(labelID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsIDLabelsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete a label from a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// The label ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestResponse DeleteTelegrafsIDLabelsIDWithIRestResponse(string telegrafID, string labelID, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsIDLabelsID"); } // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling TelegrafsService->DeleteTelegrafsIDLabelsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/labels/{labelID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (labelID != null) { localVarPathParams.Add("labelID", Configuration.ApiClient.ParameterToString(labelID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsIDLabelsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete a label from a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// The label ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestRequest DeleteTelegrafsIDLabelsIDWithRestRequest(string telegrafID, string labelID, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsIDLabelsID"); } // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling TelegrafsService->DeleteTelegrafsIDLabelsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/labels/{labelID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (labelID != null) { localVarPathParams.Add("labelID", Configuration.ApiClient.ParameterToString(labelID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Delete a label from a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// The label ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of void public System.Threading.Tasks.Task DeleteTelegrafsIDLabelsIDAsync(string telegrafID, string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { return DeleteTelegrafsIDLabelsIDAsyncWithHttpInfo(telegrafID, labelID, zapTraceSpan, cancellationToken); } /// /// Delete a label from a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// The label ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse public async System.Threading.Tasks.Task> DeleteTelegrafsIDLabelsIDAsyncWithHttpInfo( string telegrafID, string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await DeleteTelegrafsIDLabelsIDAsyncWithIRestResponse(telegrafID, labelID, zapTraceSpan, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsIDLabelsID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Delete a label from a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// The label ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse public async System.Threading.Tasks.Task DeleteTelegrafsIDLabelsIDAsyncWithIRestResponse( string telegrafID, string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsIDLabelsID"); } // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling TelegrafsService->DeleteTelegrafsIDLabelsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/labels/{labelID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (labelID != null) { localVarPathParams.Add("labelID", Configuration.ApiClient.ParameterToString(labelID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsIDLabelsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Remove a member from a Telegraf config /// /// Thrown when fails to make API call /// The ID of the member to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// public void DeleteTelegrafsIDMembersID(string userID, string telegrafID, string zapTraceSpan = null) { DeleteTelegrafsIDMembersIDWithHttpInfo(userID, telegrafID, zapTraceSpan); } /// /// Remove a member from a Telegraf config /// /// Thrown when fails to make API call /// The ID of the member to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public ApiResponse DeleteTelegrafsIDMembersIDWithHttpInfo(string userID, string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'userID' is set if (userID == null) { throw new ApiException(400, "Missing required parameter 'userID' when calling TelegrafsService->DeleteTelegrafsIDMembersID"); } // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsIDMembersID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/members/{userID}"; 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 (userID != null) { localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // path parameter } if (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsIDMembersID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Remove a member from a Telegraf config /// /// Thrown when fails to make API call /// The ID of the member to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of Object(void) public async System.Threading.Tasks.Task DeleteTelegrafsIDMembersIDWithIRestResponseAsync( string userID, string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'userID' is set if (userID == null) { throw new ApiException(400, "Missing required parameter 'userID' when calling TelegrafsService->DeleteTelegrafsIDMembersID"); } // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsIDMembersID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/members/{userID}"; 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 (userID != null) { localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // path parameter } if (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsIDMembersID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Remove a member from a Telegraf config /// /// Thrown when fails to make API call /// The ID of the member to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestResponse DeleteTelegrafsIDMembersIDWithIRestResponse(string userID, string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'userID' is set if (userID == null) { throw new ApiException(400, "Missing required parameter 'userID' when calling TelegrafsService->DeleteTelegrafsIDMembersID"); } // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsIDMembersID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/members/{userID}"; 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 (userID != null) { localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // path parameter } if (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsIDMembersID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Remove a member from a Telegraf config /// /// Thrown when fails to make API call /// The ID of the member to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestRequest DeleteTelegrafsIDMembersIDWithRestRequest(string userID, string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'userID' is set if (userID == null) { throw new ApiException(400, "Missing required parameter 'userID' when calling TelegrafsService->DeleteTelegrafsIDMembersID"); } // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsIDMembersID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/members/{userID}"; 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 (userID != null) { localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // path parameter } if (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Remove a member from a Telegraf config /// /// Thrown when fails to make API call /// The ID of the member to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of void public System.Threading.Tasks.Task DeleteTelegrafsIDMembersIDAsync(string userID, string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { return DeleteTelegrafsIDMembersIDAsyncWithHttpInfo(userID, telegrafID, zapTraceSpan, cancellationToken); } /// /// Remove a member from a Telegraf config /// /// Thrown when fails to make API call /// The ID of the member to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse public async System.Threading.Tasks.Task> DeleteTelegrafsIDMembersIDAsyncWithHttpInfo( string userID, string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await DeleteTelegrafsIDMembersIDAsyncWithIRestResponse(userID, telegrafID, zapTraceSpan, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsIDMembersID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Remove a member from a Telegraf config /// /// Thrown when fails to make API call /// The ID of the member to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse public async System.Threading.Tasks.Task DeleteTelegrafsIDMembersIDAsyncWithIRestResponse( string userID, string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'userID' is set if (userID == null) { throw new ApiException(400, "Missing required parameter 'userID' when calling TelegrafsService->DeleteTelegrafsIDMembersID"); } // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsIDMembersID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/members/{userID}"; 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 (userID != null) { localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // path parameter } if (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsIDMembersID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Remove an owner from a Telegraf config /// /// Thrown when fails to make API call /// The ID of the owner to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// public void DeleteTelegrafsIDOwnersID(string userID, string telegrafID, string zapTraceSpan = null) { DeleteTelegrafsIDOwnersIDWithHttpInfo(userID, telegrafID, zapTraceSpan); } /// /// Remove an owner from a Telegraf config /// /// Thrown when fails to make API call /// The ID of the owner to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public ApiResponse DeleteTelegrafsIDOwnersIDWithHttpInfo(string userID, string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'userID' is set if (userID == null) { throw new ApiException(400, "Missing required parameter 'userID' when calling TelegrafsService->DeleteTelegrafsIDOwnersID"); } // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsIDOwnersID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/owners/{userID}"; 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 (userID != null) { localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // path parameter } if (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsIDOwnersID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Remove an owner from a Telegraf config /// /// Thrown when fails to make API call /// The ID of the owner to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of Object(void) public async System.Threading.Tasks.Task DeleteTelegrafsIDOwnersIDWithIRestResponseAsync( string userID, string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'userID' is set if (userID == null) { throw new ApiException(400, "Missing required parameter 'userID' when calling TelegrafsService->DeleteTelegrafsIDOwnersID"); } // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsIDOwnersID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/owners/{userID}"; 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 (userID != null) { localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // path parameter } if (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsIDOwnersID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Remove an owner from a Telegraf config /// /// Thrown when fails to make API call /// The ID of the owner to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestResponse DeleteTelegrafsIDOwnersIDWithIRestResponse(string userID, string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'userID' is set if (userID == null) { throw new ApiException(400, "Missing required parameter 'userID' when calling TelegrafsService->DeleteTelegrafsIDOwnersID"); } // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsIDOwnersID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/owners/{userID}"; 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 (userID != null) { localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // path parameter } if (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsIDOwnersID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Remove an owner from a Telegraf config /// /// Thrown when fails to make API call /// The ID of the owner to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestRequest DeleteTelegrafsIDOwnersIDWithRestRequest(string userID, string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'userID' is set if (userID == null) { throw new ApiException(400, "Missing required parameter 'userID' when calling TelegrafsService->DeleteTelegrafsIDOwnersID"); } // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsIDOwnersID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/owners/{userID}"; 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 (userID != null) { localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // path parameter } if (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Remove an owner from a Telegraf config /// /// Thrown when fails to make API call /// The ID of the owner to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of void public System.Threading.Tasks.Task DeleteTelegrafsIDOwnersIDAsync(string userID, string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { return DeleteTelegrafsIDOwnersIDAsyncWithHttpInfo(userID, telegrafID, zapTraceSpan, cancellationToken); } /// /// Remove an owner from a Telegraf config /// /// Thrown when fails to make API call /// The ID of the owner to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse public async System.Threading.Tasks.Task> DeleteTelegrafsIDOwnersIDAsyncWithHttpInfo( string userID, string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await DeleteTelegrafsIDOwnersIDAsyncWithIRestResponse(userID, telegrafID, zapTraceSpan, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsIDOwnersID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Remove an owner from a Telegraf config /// /// Thrown when fails to make API call /// The ID of the owner to remove. /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse public async System.Threading.Tasks.Task DeleteTelegrafsIDOwnersIDAsyncWithIRestResponse( string userID, string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'userID' is set if (userID == null) { throw new ApiException(400, "Missing required parameter 'userID' when calling TelegrafsService->DeleteTelegrafsIDOwnersID"); } // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->DeleteTelegrafsIDOwnersID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/owners/{userID}"; 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 (userID != null) { localVarPathParams.Add("userID", Configuration.ApiClient.ParameterToString(userID)); // path parameter } if (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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.Delete, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteTelegrafsIDOwnersID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all Telegraf configurations /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID the Telegraf config belongs to. (optional) /// Telegrafs public Telegrafs GetTelegrafs(string zapTraceSpan = null, string orgID = null) { var localVarResponse = GetTelegrafsWithHttpInfo(zapTraceSpan, orgID); return localVarResponse.Data; } /// /// List all Telegraf configurations /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID the Telegraf config belongs to. (optional) /// ApiResponse of Telegrafs public ApiResponse GetTelegrafsWithHttpInfo(string zapTraceSpan = null, string orgID = null) { var localVarPath = "/api/v2/telegrafs"; 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 (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 } // 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("GetTelegrafs", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (Telegrafs)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Telegrafs))); } /// /// List all Telegraf configurations /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID the Telegraf config belongs to. (optional) /// Cancellation token /// ApiResponse of Telegrafs public async System.Threading.Tasks.Task GetTelegrafsWithIRestResponseAsync( string zapTraceSpan = null, string orgID = null, CancellationToken cancellationToken = default) { var localVarPath = "/api/v2/telegrafs"; 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 (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 } // 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("GetTelegrafs", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all Telegraf configurations /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID the Telegraf config belongs to. (optional) /// ApiResponse of Telegrafs public RestResponse GetTelegrafsWithIRestResponse(string zapTraceSpan = null, string orgID = null) { var localVarPath = "/api/v2/telegrafs"; 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 (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 } // 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("GetTelegrafs", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all Telegraf configurations /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID the Telegraf config belongs to. (optional) /// ApiResponse of Telegrafs public RestRequest GetTelegrafsWithRestRequest(string zapTraceSpan = null, string orgID = null) { var localVarPath = "/api/v2/telegrafs"; 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 (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 } // 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); } /// /// List all Telegraf configurations /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID the Telegraf config belongs to. (optional) /// Cancellation token /// Task of Telegrafs public async System.Threading.Tasks.Task GetTelegrafsAsync(string zapTraceSpan = null, string orgID = null, CancellationToken cancellationToken = default) { var localVarResponse = await GetTelegrafsAsyncWithHttpInfo(zapTraceSpan, orgID, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// List all Telegraf configurations /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID the Telegraf config belongs to. (optional) /// Cancellation token /// Task of ApiResponse (Telegrafs) public async System.Threading.Tasks.Task> GetTelegrafsAsyncWithHttpInfo( string zapTraceSpan = null, string orgID = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await GetTelegrafsAsyncWithIRestResponse(zapTraceSpan, orgID, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetTelegrafs", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (Telegrafs)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Telegrafs))); } /// /// List all Telegraf configurations /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID the Telegraf config belongs to. (optional) /// Cancellation token /// Task of RestResponse (Telegrafs) public async System.Threading.Tasks.Task GetTelegrafsAsyncWithIRestResponse( string zapTraceSpan = null, string orgID = null, CancellationToken cancellationToken = default) { var localVarPath = "/api/v2/telegrafs"; 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 (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 } // 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("GetTelegrafs", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Retrieve a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// (optional, default to application/toml) /// string public string GetTelegrafsID(string telegrafID, string zapTraceSpan = null, string accept = null) { var localVarResponse = GetTelegrafsIDWithHttpInfo(telegrafID, zapTraceSpan, accept); return localVarResponse.Data; } /// /// Retrieve a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// (optional, default to application/toml) /// ApiResponse of string public ApiResponse GetTelegrafsIDWithHttpInfo(string telegrafID, string zapTraceSpan = null, string accept = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (accept != null) { localVarHeaderParams.Add("Accept", Configuration.ApiClient.ParameterToString(accept)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/toml", "application/json", "application/octet-stream" }; 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("GetTelegrafsID", 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))); } /// /// Retrieve a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// (optional, default to application/toml) /// Cancellation token /// ApiResponse of string public async System.Threading.Tasks.Task GetTelegrafsIDWithIRestResponseAsync(string telegrafID, string zapTraceSpan = null, string accept = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (accept != null) { localVarHeaderParams.Add("Accept", Configuration.ApiClient.ParameterToString(accept)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/toml", "application/json", "application/octet-stream" }; 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("GetTelegrafsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Retrieve a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// (optional, default to application/toml) /// ApiResponse of string public RestResponse GetTelegrafsIDWithIRestResponse(string telegrafID, string zapTraceSpan = null, string accept = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (accept != null) { localVarHeaderParams.Add("Accept", Configuration.ApiClient.ParameterToString(accept)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/toml", "application/json", "application/octet-stream" }; 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("GetTelegrafsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Retrieve a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// (optional, default to application/toml) /// ApiResponse of string public RestRequest GetTelegrafsIDWithRestRequest(string telegrafID, string zapTraceSpan = null, string accept = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (accept != null) { localVarHeaderParams.Add("Accept", Configuration.ApiClient.ParameterToString(accept)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/toml", "application/json", "application/octet-stream" }; 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 a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// (optional, default to application/toml) /// Cancellation token /// Task of string public async System.Threading.Tasks.Task GetTelegrafsIDAsync(string telegrafID, string zapTraceSpan = null, string accept = null, CancellationToken cancellationToken = default) { var localVarResponse = await GetTelegrafsIDAsyncWithHttpInfo(telegrafID, zapTraceSpan, accept, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// Retrieve a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// (optional, default to application/toml) /// Cancellation token /// Task of ApiResponse (string) public async System.Threading.Tasks.Task> GetTelegrafsIDAsyncWithHttpInfo(string telegrafID, string zapTraceSpan = null, string accept = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await GetTelegrafsIDAsyncWithIRestResponse(telegrafID, zapTraceSpan, accept, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetTelegrafsID", 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))); } /// /// Retrieve a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// (optional, default to application/toml) /// Cancellation token /// Task of RestResponse (string) public async System.Threading.Tasks.Task GetTelegrafsIDAsyncWithIRestResponse(string telegrafID, string zapTraceSpan = null, string accept = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (accept != null) { localVarHeaderParams.Add("Accept", Configuration.ApiClient.ParameterToString(accept)); // header parameter } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/toml", "application/json", "application/octet-stream" }; 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("GetTelegrafsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all labels for a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// LabelsResponse public LabelsResponse GetTelegrafsIDLabels(string telegrafID, string zapTraceSpan = null) { var localVarResponse = GetTelegrafsIDLabelsWithHttpInfo(telegrafID, zapTraceSpan); return localVarResponse.Data; } /// /// List all labels for a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// ApiResponse of LabelsResponse public ApiResponse GetTelegrafsIDLabelsWithHttpInfo(string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsIDLabels"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/labels"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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("GetTelegrafsIDLabels", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (LabelsResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(LabelsResponse))); } /// /// List all labels for a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of LabelsResponse public async System.Threading.Tasks.Task GetTelegrafsIDLabelsWithIRestResponseAsync( string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsIDLabels"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/labels"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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("GetTelegrafsIDLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all labels for a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// ApiResponse of LabelsResponse public RestResponse GetTelegrafsIDLabelsWithIRestResponse(string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsIDLabels"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/labels"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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("GetTelegrafsIDLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all labels for a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// ApiResponse of LabelsResponse public RestRequest GetTelegrafsIDLabelsWithRestRequest(string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsIDLabels"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/labels"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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); } /// /// List all labels for a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of LabelsResponse public async System.Threading.Tasks.Task GetTelegrafsIDLabelsAsync(string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await GetTelegrafsIDLabelsAsyncWithHttpInfo(telegrafID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// List all labels for a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (LabelsResponse) public async System.Threading.Tasks.Task> GetTelegrafsIDLabelsAsyncWithHttpInfo( string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await GetTelegrafsIDLabelsAsyncWithIRestResponse(telegrafID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetTelegrafsIDLabels", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (LabelsResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(LabelsResponse))); } /// /// List all labels for a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (LabelsResponse) public async System.Threading.Tasks.Task GetTelegrafsIDLabelsAsyncWithIRestResponse( string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsIDLabels"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/labels"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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("GetTelegrafsIDLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all users with member privileges for a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// ResourceMembers public ResourceMembers GetTelegrafsIDMembers(string telegrafID, string zapTraceSpan = null) { var localVarResponse = GetTelegrafsIDMembersWithHttpInfo(telegrafID, zapTraceSpan); return localVarResponse.Data; } /// /// List all users with member privileges for a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// ApiResponse of ResourceMembers public ApiResponse GetTelegrafsIDMembersWithHttpInfo(string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsIDMembers"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/members"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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("GetTelegrafsIDMembers", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (ResourceMembers)Configuration.ApiClient.Deserialize(localVarResponse, typeof(ResourceMembers))); } /// /// List all users with member privileges for a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of ResourceMembers public async System.Threading.Tasks.Task GetTelegrafsIDMembersWithIRestResponseAsync( string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsIDMembers"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/members"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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("GetTelegrafsIDMembers", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all users with member privileges for a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// ApiResponse of ResourceMembers public RestResponse GetTelegrafsIDMembersWithIRestResponse(string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsIDMembers"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/members"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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("GetTelegrafsIDMembers", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all users with member privileges for a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// ApiResponse of ResourceMembers public RestRequest GetTelegrafsIDMembersWithRestRequest(string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsIDMembers"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/members"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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); } /// /// List all users with member privileges for a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ResourceMembers public async System.Threading.Tasks.Task GetTelegrafsIDMembersAsync(string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await GetTelegrafsIDMembersAsyncWithHttpInfo(telegrafID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// List all users with member privileges for a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (ResourceMembers) public async System.Threading.Tasks.Task> GetTelegrafsIDMembersAsyncWithHttpInfo( string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await GetTelegrafsIDMembersAsyncWithIRestResponse(telegrafID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetTelegrafsIDMembers", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (ResourceMembers)Configuration.ApiClient.Deserialize(localVarResponse, typeof(ResourceMembers))); } /// /// List all users with member privileges for a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (ResourceMembers) public async System.Threading.Tasks.Task GetTelegrafsIDMembersAsyncWithIRestResponse( string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsIDMembers"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/members"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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("GetTelegrafsIDMembers", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all owners of a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// ResourceOwners public ResourceOwners GetTelegrafsIDOwners(string telegrafID, string zapTraceSpan = null) { var localVarResponse = GetTelegrafsIDOwnersWithHttpInfo(telegrafID, zapTraceSpan); return localVarResponse.Data; } /// /// List all owners of a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// ApiResponse of ResourceOwners public ApiResponse GetTelegrafsIDOwnersWithHttpInfo(string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsIDOwners"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/owners"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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("GetTelegrafsIDOwners", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (ResourceOwners)Configuration.ApiClient.Deserialize(localVarResponse, typeof(ResourceOwners))); } /// /// List all owners of a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of ResourceOwners public async System.Threading.Tasks.Task GetTelegrafsIDOwnersWithIRestResponseAsync( string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsIDOwners"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/owners"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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("GetTelegrafsIDOwners", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all owners of a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// ApiResponse of ResourceOwners public RestResponse GetTelegrafsIDOwnersWithIRestResponse(string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsIDOwners"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/owners"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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("GetTelegrafsIDOwners", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all owners of a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// ApiResponse of ResourceOwners public RestRequest GetTelegrafsIDOwnersWithRestRequest(string telegrafID, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsIDOwners"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/owners"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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); } /// /// List all owners of a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ResourceOwners public async System.Threading.Tasks.Task GetTelegrafsIDOwnersAsync(string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await GetTelegrafsIDOwnersAsyncWithHttpInfo(telegrafID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// List all owners of a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (ResourceOwners) public async System.Threading.Tasks.Task> GetTelegrafsIDOwnersAsyncWithHttpInfo( string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await GetTelegrafsIDOwnersAsyncWithIRestResponse(telegrafID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetTelegrafsIDOwners", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (ResourceOwners)Configuration.ApiClient.Deserialize(localVarResponse, typeof(ResourceOwners))); } /// /// List all owners of a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (ResourceOwners) public async System.Threading.Tasks.Task GetTelegrafsIDOwnersAsyncWithIRestResponse( string telegrafID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->GetTelegrafsIDOwners"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/owners"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // 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("GetTelegrafsIDOwners", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Create a Telegraf configuration /// /// Thrown when fails to make API call /// Telegraf configuration to create /// OpenTracing span context (optional) /// Telegraf public Telegraf PostTelegrafs(TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null) { var localVarResponse = PostTelegrafsWithHttpInfo(telegrafPluginRequest, zapTraceSpan); return localVarResponse.Data; } /// /// Create a Telegraf configuration /// /// Thrown when fails to make API call /// Telegraf configuration to create /// OpenTracing span context (optional) /// ApiResponse of Telegraf public ApiResponse PostTelegrafsWithHttpInfo(TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null) { // verify the required parameter 'telegrafPluginRequest' is set if (telegrafPluginRequest == null) { throw new ApiException(400, "Missing required parameter 'telegrafPluginRequest' when calling TelegrafsService->PostTelegrafs"); } var localVarPath = "/api/v2/telegrafs"; 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 (telegrafPluginRequest != null && telegrafPluginRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(telegrafPluginRequest); // http body (model) parameter } else { localVarPostBody = telegrafPluginRequest; // 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("PostTelegrafs", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (Telegraf)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Telegraf))); } /// /// Create a Telegraf configuration /// /// Thrown when fails to make API call /// Telegraf configuration to create /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of Telegraf public async System.Threading.Tasks.Task PostTelegrafsWithIRestResponseAsync( TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafPluginRequest' is set if (telegrafPluginRequest == null) { throw new ApiException(400, "Missing required parameter 'telegrafPluginRequest' when calling TelegrafsService->PostTelegrafs"); } var localVarPath = "/api/v2/telegrafs"; 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 (telegrafPluginRequest != null && telegrafPluginRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(telegrafPluginRequest); // http body (model) parameter } else { localVarPostBody = telegrafPluginRequest; // 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("PostTelegrafs", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Create a Telegraf configuration /// /// Thrown when fails to make API call /// Telegraf configuration to create /// OpenTracing span context (optional) /// ApiResponse of Telegraf public RestResponse PostTelegrafsWithIRestResponse(TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null) { // verify the required parameter 'telegrafPluginRequest' is set if (telegrafPluginRequest == null) { throw new ApiException(400, "Missing required parameter 'telegrafPluginRequest' when calling TelegrafsService->PostTelegrafs"); } var localVarPath = "/api/v2/telegrafs"; 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 (telegrafPluginRequest != null && telegrafPluginRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(telegrafPluginRequest); // http body (model) parameter } else { localVarPostBody = telegrafPluginRequest; // 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("PostTelegrafs", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Create a Telegraf configuration /// /// Thrown when fails to make API call /// Telegraf configuration to create /// OpenTracing span context (optional) /// ApiResponse of Telegraf public RestRequest PostTelegrafsWithRestRequest(TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null) { // verify the required parameter 'telegrafPluginRequest' is set if (telegrafPluginRequest == null) { throw new ApiException(400, "Missing required parameter 'telegrafPluginRequest' when calling TelegrafsService->PostTelegrafs"); } var localVarPath = "/api/v2/telegrafs"; 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 (telegrafPluginRequest != null && telegrafPluginRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(telegrafPluginRequest); // http body (model) parameter } else { localVarPostBody = telegrafPluginRequest; // 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); } /// /// Create a Telegraf configuration /// /// Thrown when fails to make API call /// Telegraf configuration to create /// OpenTracing span context (optional) /// Cancellation token /// Task of Telegraf public async System.Threading.Tasks.Task PostTelegrafsAsync( TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await PostTelegrafsAsyncWithHttpInfo(telegrafPluginRequest, zapTraceSpan, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// Create a Telegraf configuration /// /// Thrown when fails to make API call /// Telegraf configuration to create /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (Telegraf) public async System.Threading.Tasks.Task> PostTelegrafsAsyncWithHttpInfo( TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PostTelegrafsAsyncWithIRestResponse(telegrafPluginRequest, zapTraceSpan, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostTelegrafs", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (Telegraf)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Telegraf))); } /// /// Create a Telegraf configuration /// /// Thrown when fails to make API call /// Telegraf configuration to create /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (Telegraf) public async System.Threading.Tasks.Task PostTelegrafsAsyncWithIRestResponse( TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafPluginRequest' is set if (telegrafPluginRequest == null) { throw new ApiException(400, "Missing required parameter 'telegrafPluginRequest' when calling TelegrafsService->PostTelegrafs"); } var localVarPath = "/api/v2/telegrafs"; 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 (telegrafPluginRequest != null && telegrafPluginRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(telegrafPluginRequest); // http body (model) parameter } else { localVarPostBody = telegrafPluginRequest; // 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("PostTelegrafs", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Add a label to a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Label to add /// OpenTracing span context (optional) /// LabelResponse public LabelResponse PostTelegrafsIDLabels(string telegrafID, LabelMapping labelMapping, string zapTraceSpan = null) { var localVarResponse = PostTelegrafsIDLabelsWithHttpInfo(telegrafID, labelMapping, zapTraceSpan); return localVarResponse.Data; } /// /// Add a label to a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Label to add /// OpenTracing span context (optional) /// ApiResponse of LabelResponse public ApiResponse PostTelegrafsIDLabelsWithHttpInfo(string telegrafID, LabelMapping labelMapping, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PostTelegrafsIDLabels"); } // verify the required parameter 'labelMapping' is set if (labelMapping == null) { throw new ApiException(400, "Missing required parameter 'labelMapping' when calling TelegrafsService->PostTelegrafsIDLabels"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/labels"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (labelMapping != null && labelMapping.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelMapping); // http body (model) parameter } else { localVarPostBody = labelMapping; // 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("PostTelegrafsIDLabels", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (LabelResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(LabelResponse))); } /// /// Add a label to a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Label to add /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of LabelResponse public async System.Threading.Tasks.Task PostTelegrafsIDLabelsWithIRestResponseAsync( string telegrafID, LabelMapping labelMapping, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PostTelegrafsIDLabels"); } // verify the required parameter 'labelMapping' is set if (labelMapping == null) { throw new ApiException(400, "Missing required parameter 'labelMapping' when calling TelegrafsService->PostTelegrafsIDLabels"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/labels"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (labelMapping != null && labelMapping.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelMapping); // http body (model) parameter } else { localVarPostBody = labelMapping; // 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("PostTelegrafsIDLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Add a label to a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Label to add /// OpenTracing span context (optional) /// ApiResponse of LabelResponse public RestResponse PostTelegrafsIDLabelsWithIRestResponse(string telegrafID, LabelMapping labelMapping, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PostTelegrafsIDLabels"); } // verify the required parameter 'labelMapping' is set if (labelMapping == null) { throw new ApiException(400, "Missing required parameter 'labelMapping' when calling TelegrafsService->PostTelegrafsIDLabels"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/labels"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (labelMapping != null && labelMapping.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelMapping); // http body (model) parameter } else { localVarPostBody = labelMapping; // 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("PostTelegrafsIDLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Add a label to a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Label to add /// OpenTracing span context (optional) /// ApiResponse of LabelResponse public RestRequest PostTelegrafsIDLabelsWithRestRequest(string telegrafID, LabelMapping labelMapping, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PostTelegrafsIDLabels"); } // verify the required parameter 'labelMapping' is set if (labelMapping == null) { throw new ApiException(400, "Missing required parameter 'labelMapping' when calling TelegrafsService->PostTelegrafsIDLabels"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/labels"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (labelMapping != null && labelMapping.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelMapping); // http body (model) parameter } else { localVarPostBody = labelMapping; // 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); } /// /// Add a label to a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Label to add /// OpenTracing span context (optional) /// Cancellation token /// Task of LabelResponse public async System.Threading.Tasks.Task PostTelegrafsIDLabelsAsync(string telegrafID, LabelMapping labelMapping, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await PostTelegrafsIDLabelsAsyncWithHttpInfo(telegrafID, labelMapping, zapTraceSpan, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// Add a label to a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Label to add /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (LabelResponse) public async System.Threading.Tasks.Task> PostTelegrafsIDLabelsAsyncWithHttpInfo( string telegrafID, LabelMapping labelMapping, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PostTelegrafsIDLabelsAsyncWithIRestResponse(telegrafID, labelMapping, zapTraceSpan, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostTelegrafsIDLabels", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (LabelResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(LabelResponse))); } /// /// Add a label to a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Label to add /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (LabelResponse) public async System.Threading.Tasks.Task PostTelegrafsIDLabelsAsyncWithIRestResponse( string telegrafID, LabelMapping labelMapping, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PostTelegrafsIDLabels"); } // verify the required parameter 'labelMapping' is set if (labelMapping == null) { throw new ApiException(400, "Missing required parameter 'labelMapping' when calling TelegrafsService->PostTelegrafsIDLabels"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/labels"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (labelMapping != null && labelMapping.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelMapping); // http body (model) parameter } else { localVarPostBody = labelMapping; // 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("PostTelegrafsIDLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Add a member to a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// User to add as member /// OpenTracing span context (optional) /// ResourceMember public ResourceMember PostTelegrafsIDMembers(string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null) { var localVarResponse = PostTelegrafsIDMembersWithHttpInfo(telegrafID, addResourceMemberRequestBody, zapTraceSpan); return localVarResponse.Data; } /// /// Add a member to a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// User to add as member /// OpenTracing span context (optional) /// ApiResponse of ResourceMember public ApiResponse PostTelegrafsIDMembersWithHttpInfo(string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PostTelegrafsIDMembers"); } // verify the required parameter 'addResourceMemberRequestBody' is set if (addResourceMemberRequestBody == null) { throw new ApiException(400, "Missing required parameter 'addResourceMemberRequestBody' when calling TelegrafsService->PostTelegrafsIDMembers"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/members"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (addResourceMemberRequestBody != null && addResourceMemberRequestBody.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(addResourceMemberRequestBody); // http body (model) parameter } else { localVarPostBody = addResourceMemberRequestBody; // 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("PostTelegrafsIDMembers", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (ResourceMember)Configuration.ApiClient.Deserialize(localVarResponse, typeof(ResourceMember))); } /// /// Add a member to a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// User to add as member /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of ResourceMember public async System.Threading.Tasks.Task PostTelegrafsIDMembersWithIRestResponseAsync( string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PostTelegrafsIDMembers"); } // verify the required parameter 'addResourceMemberRequestBody' is set if (addResourceMemberRequestBody == null) { throw new ApiException(400, "Missing required parameter 'addResourceMemberRequestBody' when calling TelegrafsService->PostTelegrafsIDMembers"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/members"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (addResourceMemberRequestBody != null && addResourceMemberRequestBody.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(addResourceMemberRequestBody); // http body (model) parameter } else { localVarPostBody = addResourceMemberRequestBody; // 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("PostTelegrafsIDMembers", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Add a member to a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// User to add as member /// OpenTracing span context (optional) /// ApiResponse of ResourceMember public RestResponse PostTelegrafsIDMembersWithIRestResponse(string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PostTelegrafsIDMembers"); } // verify the required parameter 'addResourceMemberRequestBody' is set if (addResourceMemberRequestBody == null) { throw new ApiException(400, "Missing required parameter 'addResourceMemberRequestBody' when calling TelegrafsService->PostTelegrafsIDMembers"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/members"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (addResourceMemberRequestBody != null && addResourceMemberRequestBody.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(addResourceMemberRequestBody); // http body (model) parameter } else { localVarPostBody = addResourceMemberRequestBody; // 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("PostTelegrafsIDMembers", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Add a member to a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// User to add as member /// OpenTracing span context (optional) /// ApiResponse of ResourceMember public RestRequest PostTelegrafsIDMembersWithRestRequest(string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PostTelegrafsIDMembers"); } // verify the required parameter 'addResourceMemberRequestBody' is set if (addResourceMemberRequestBody == null) { throw new ApiException(400, "Missing required parameter 'addResourceMemberRequestBody' when calling TelegrafsService->PostTelegrafsIDMembers"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/members"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (addResourceMemberRequestBody != null && addResourceMemberRequestBody.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(addResourceMemberRequestBody); // http body (model) parameter } else { localVarPostBody = addResourceMemberRequestBody; // 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); } /// /// Add a member to a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// User to add as member /// OpenTracing span context (optional) /// Cancellation token /// Task of ResourceMember public async System.Threading.Tasks.Task PostTelegrafsIDMembersAsync(string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await PostTelegrafsIDMembersAsyncWithHttpInfo(telegrafID, addResourceMemberRequestBody, zapTraceSpan, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Add a member to a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// User to add as member /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (ResourceMember) public async System.Threading.Tasks.Task> PostTelegrafsIDMembersAsyncWithHttpInfo( string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PostTelegrafsIDMembersAsyncWithIRestResponse(telegrafID, addResourceMemberRequestBody, zapTraceSpan, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostTelegrafsIDMembers", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (ResourceMember)Configuration.ApiClient.Deserialize(localVarResponse, typeof(ResourceMember))); } /// /// Add a member to a Telegraf config /// /// Thrown when fails to make API call /// The Telegraf config ID. /// User to add as member /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (ResourceMember) public async System.Threading.Tasks.Task PostTelegrafsIDMembersAsyncWithIRestResponse( string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PostTelegrafsIDMembers"); } // verify the required parameter 'addResourceMemberRequestBody' is set if (addResourceMemberRequestBody == null) { throw new ApiException(400, "Missing required parameter 'addResourceMemberRequestBody' when calling TelegrafsService->PostTelegrafsIDMembers"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/members"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (addResourceMemberRequestBody != null && addResourceMemberRequestBody.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(addResourceMemberRequestBody); // http body (model) parameter } else { localVarPostBody = addResourceMemberRequestBody; // 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("PostTelegrafsIDMembers", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Add an owner to a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// User to add as owner /// OpenTracing span context (optional) /// ResourceOwner public ResourceOwner PostTelegrafsIDOwners(string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null) { var localVarResponse = PostTelegrafsIDOwnersWithHttpInfo(telegrafID, addResourceMemberRequestBody, zapTraceSpan); return localVarResponse.Data; } /// /// Add an owner to a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// User to add as owner /// OpenTracing span context (optional) /// ApiResponse of ResourceOwner public ApiResponse PostTelegrafsIDOwnersWithHttpInfo(string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PostTelegrafsIDOwners"); } // verify the required parameter 'addResourceMemberRequestBody' is set if (addResourceMemberRequestBody == null) { throw new ApiException(400, "Missing required parameter 'addResourceMemberRequestBody' when calling TelegrafsService->PostTelegrafsIDOwners"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/owners"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (addResourceMemberRequestBody != null && addResourceMemberRequestBody.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(addResourceMemberRequestBody); // http body (model) parameter } else { localVarPostBody = addResourceMemberRequestBody; // 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("PostTelegrafsIDOwners", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (ResourceOwner)Configuration.ApiClient.Deserialize(localVarResponse, typeof(ResourceOwner))); } /// /// Add an owner to a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// User to add as owner /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of ResourceOwner public async System.Threading.Tasks.Task PostTelegrafsIDOwnersWithIRestResponseAsync( string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PostTelegrafsIDOwners"); } // verify the required parameter 'addResourceMemberRequestBody' is set if (addResourceMemberRequestBody == null) { throw new ApiException(400, "Missing required parameter 'addResourceMemberRequestBody' when calling TelegrafsService->PostTelegrafsIDOwners"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/owners"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (addResourceMemberRequestBody != null && addResourceMemberRequestBody.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(addResourceMemberRequestBody); // http body (model) parameter } else { localVarPostBody = addResourceMemberRequestBody; // 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("PostTelegrafsIDOwners", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Add an owner to a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// User to add as owner /// OpenTracing span context (optional) /// ApiResponse of ResourceOwner public RestResponse PostTelegrafsIDOwnersWithIRestResponse(string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PostTelegrafsIDOwners"); } // verify the required parameter 'addResourceMemberRequestBody' is set if (addResourceMemberRequestBody == null) { throw new ApiException(400, "Missing required parameter 'addResourceMemberRequestBody' when calling TelegrafsService->PostTelegrafsIDOwners"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/owners"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (addResourceMemberRequestBody != null && addResourceMemberRequestBody.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(addResourceMemberRequestBody); // http body (model) parameter } else { localVarPostBody = addResourceMemberRequestBody; // 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("PostTelegrafsIDOwners", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Add an owner to a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// User to add as owner /// OpenTracing span context (optional) /// ApiResponse of ResourceOwner public RestRequest PostTelegrafsIDOwnersWithRestRequest(string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PostTelegrafsIDOwners"); } // verify the required parameter 'addResourceMemberRequestBody' is set if (addResourceMemberRequestBody == null) { throw new ApiException(400, "Missing required parameter 'addResourceMemberRequestBody' when calling TelegrafsService->PostTelegrafsIDOwners"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/owners"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (addResourceMemberRequestBody != null && addResourceMemberRequestBody.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(addResourceMemberRequestBody); // http body (model) parameter } else { localVarPostBody = addResourceMemberRequestBody; // 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); } /// /// Add an owner to a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// User to add as owner /// OpenTracing span context (optional) /// Cancellation token /// Task of ResourceOwner public async System.Threading.Tasks.Task PostTelegrafsIDOwnersAsync(string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await PostTelegrafsIDOwnersAsyncWithHttpInfo(telegrafID, addResourceMemberRequestBody, zapTraceSpan, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Add an owner to a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// User to add as owner /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (ResourceOwner) public async System.Threading.Tasks.Task> PostTelegrafsIDOwnersAsyncWithHttpInfo( string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PostTelegrafsIDOwnersAsyncWithIRestResponse(telegrafID, addResourceMemberRequestBody, zapTraceSpan, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostTelegrafsIDOwners", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (ResourceOwner)Configuration.ApiClient.Deserialize(localVarResponse, typeof(ResourceOwner))); } /// /// Add an owner to a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf configuration ID. /// User to add as owner /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (ResourceOwner) public async System.Threading.Tasks.Task PostTelegrafsIDOwnersAsyncWithIRestResponse( string telegrafID, AddResourceMemberRequestBody addResourceMemberRequestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PostTelegrafsIDOwners"); } // verify the required parameter 'addResourceMemberRequestBody' is set if (addResourceMemberRequestBody == null) { throw new ApiException(400, "Missing required parameter 'addResourceMemberRequestBody' when calling TelegrafsService->PostTelegrafsIDOwners"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}/owners"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (addResourceMemberRequestBody != null && addResourceMemberRequestBody.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(addResourceMemberRequestBody); // http body (model) parameter } else { localVarPostBody = addResourceMemberRequestBody; // 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("PostTelegrafsIDOwners", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Update a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Telegraf configuration update to apply /// OpenTracing span context (optional) /// Telegraf public Telegraf PutTelegrafsID(string telegrafID, TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null) { var localVarResponse = PutTelegrafsIDWithHttpInfo(telegrafID, telegrafPluginRequest, zapTraceSpan); return localVarResponse.Data; } /// /// Update a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Telegraf configuration update to apply /// OpenTracing span context (optional) /// ApiResponse of Telegraf public ApiResponse PutTelegrafsIDWithHttpInfo(string telegrafID, TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PutTelegrafsID"); } // verify the required parameter 'telegrafPluginRequest' is set if (telegrafPluginRequest == null) { throw new ApiException(400, "Missing required parameter 'telegrafPluginRequest' when calling TelegrafsService->PutTelegrafsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (telegrafPluginRequest != null && telegrafPluginRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(telegrafPluginRequest); // http body (model) parameter } else { localVarPostBody = telegrafPluginRequest; // 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.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PutTelegrafsID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (Telegraf)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Telegraf))); } /// /// Update a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Telegraf configuration update to apply /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of Telegraf public async System.Threading.Tasks.Task PutTelegrafsIDWithIRestResponseAsync(string telegrafID, TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PutTelegrafsID"); } // verify the required parameter 'telegrafPluginRequest' is set if (telegrafPluginRequest == null) { throw new ApiException(400, "Missing required parameter 'telegrafPluginRequest' when calling TelegrafsService->PutTelegrafsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (telegrafPluginRequest != null && telegrafPluginRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(telegrafPluginRequest); // http body (model) parameter } else { localVarPostBody = telegrafPluginRequest; // 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.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PutTelegrafsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Update a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Telegraf configuration update to apply /// OpenTracing span context (optional) /// ApiResponse of Telegraf public RestResponse PutTelegrafsIDWithIRestResponse(string telegrafID, TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PutTelegrafsID"); } // verify the required parameter 'telegrafPluginRequest' is set if (telegrafPluginRequest == null) { throw new ApiException(400, "Missing required parameter 'telegrafPluginRequest' when calling TelegrafsService->PutTelegrafsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (telegrafPluginRequest != null && telegrafPluginRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(telegrafPluginRequest); // http body (model) parameter } else { localVarPostBody = telegrafPluginRequest; // 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.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PutTelegrafsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Update a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Telegraf configuration update to apply /// OpenTracing span context (optional) /// ApiResponse of Telegraf public RestRequest PutTelegrafsIDWithRestRequest(string telegrafID, TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PutTelegrafsID"); } // verify the required parameter 'telegrafPluginRequest' is set if (telegrafPluginRequest == null) { throw new ApiException(400, "Missing required parameter 'telegrafPluginRequest' when calling TelegrafsService->PutTelegrafsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (telegrafPluginRequest != null && telegrafPluginRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(telegrafPluginRequest); // http body (model) parameter } else { localVarPostBody = telegrafPluginRequest; // 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.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Update a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Telegraf configuration update to apply /// OpenTracing span context (optional) /// Cancellation token /// Task of Telegraf public async System.Threading.Tasks.Task PutTelegrafsIDAsync(string telegrafID, TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await PutTelegrafsIDAsyncWithHttpInfo(telegrafID, telegrafPluginRequest, zapTraceSpan, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Update a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Telegraf configuration update to apply /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (Telegraf) public async System.Threading.Tasks.Task> PutTelegrafsIDAsyncWithHttpInfo( string telegrafID, TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PutTelegrafsIDAsyncWithIRestResponse(telegrafID, telegrafPluginRequest, zapTraceSpan, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PutTelegrafsID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (Telegraf)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Telegraf))); } /// /// Update a Telegraf configuration /// /// Thrown when fails to make API call /// The Telegraf config ID. /// Telegraf configuration update to apply /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (Telegraf) public async System.Threading.Tasks.Task PutTelegrafsIDAsyncWithIRestResponse(string telegrafID, TelegrafPluginRequest telegrafPluginRequest, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'telegrafID' is set if (telegrafID == null) { throw new ApiException(400, "Missing required parameter 'telegrafID' when calling TelegrafsService->PutTelegrafsID"); } // verify the required parameter 'telegrafPluginRequest' is set if (telegrafPluginRequest == null) { throw new ApiException(400, "Missing required parameter 'telegrafPluginRequest' when calling TelegrafsService->PutTelegrafsID"); } var localVarPath = "/api/v2/telegrafs/{telegrafID}"; 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 (telegrafID != null) { localVarPathParams.Add("telegrafID", Configuration.ApiClient.ParameterToString(telegrafID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (telegrafPluginRequest != null && telegrafPluginRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(telegrafPluginRequest); // http body (model) parameter } else { localVarPostBody = telegrafPluginRequest; // 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.Put, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("PutTelegrafsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } } }