/* * 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 ILabelsService : IApiAccessor { #region Synchronous Operations /// /// Delete a label /// /// /// /// /// Thrown when fails to make API call /// The ID of the label to delete. /// OpenTracing span context (optional) /// void DeleteLabelsID(string labelID, string zapTraceSpan = null); /// /// Delete a label /// /// /// /// /// Thrown when fails to make API call /// The ID of the label to delete. /// OpenTracing span context (optional) /// ApiResponse of Object(void) ApiResponse DeleteLabelsIDWithHttpInfo(string labelID, string zapTraceSpan = null); /// /// List all labels /// /// /// /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID. (optional) /// LabelsResponse LabelsResponse GetLabels(string zapTraceSpan = null, string orgID = null); /// /// List all labels /// /// /// /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID. (optional) /// ApiResponse of LabelsResponse ApiResponse GetLabelsWithHttpInfo(string zapTraceSpan = null, string orgID = null); /// /// Retrieve a label /// /// /// /// /// Thrown when fails to make API call /// The ID of the label to update. /// OpenTracing span context (optional) /// LabelResponse LabelResponse GetLabelsID(string labelID, string zapTraceSpan = null); /// /// Retrieve a label /// /// /// /// /// Thrown when fails to make API call /// The ID of the label to update. /// OpenTracing span context (optional) /// ApiResponse of LabelResponse ApiResponse GetLabelsIDWithHttpInfo(string labelID, string zapTraceSpan = null); /// /// Update a label /// /// /// /// /// Thrown when fails to make API call /// The ID of the label to update. /// Label update /// OpenTracing span context (optional) /// LabelResponse LabelResponse PatchLabelsID(string labelID, LabelUpdate labelUpdate, string zapTraceSpan = null); /// /// Update a label /// /// /// /// /// Thrown when fails to make API call /// The ID of the label to update. /// Label update /// OpenTracing span context (optional) /// ApiResponse of LabelResponse ApiResponse PatchLabelsIDWithHttpInfo(string labelID, LabelUpdate labelUpdate, string zapTraceSpan = null); /// /// Create a label /// /// /// /// /// Thrown when fails to make API call /// Label to create /// LabelResponse LabelResponse PostLabels(LabelCreateRequest labelCreateRequest); /// /// Create a label /// /// /// /// /// Thrown when fails to make API call /// Label to create /// ApiResponse of LabelResponse ApiResponse PostLabelsWithHttpInfo(LabelCreateRequest labelCreateRequest); #endregion Synchronous Operations #region Asynchronous Operations /// /// Delete a label /// /// /// /// /// Thrown when fails to make API call /// The ID of the label to delete. /// OpenTracing span context (optional) /// Cancellation token /// Task of void System.Threading.Tasks.Task DeleteLabelsIDAsync(string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Delete a label /// /// /// /// /// Thrown when fails to make API call /// The ID of the label to delete. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse System.Threading.Tasks.Task> DeleteLabelsIDAsyncWithHttpInfo(string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// List all labels /// /// /// /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID. (optional) /// Cancellation token /// Task of LabelsResponse System.Threading.Tasks.Task GetLabelsAsync(string zapTraceSpan = null, string orgID = null, CancellationToken cancellationToken = default); /// /// List all labels /// /// /// /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID. (optional) /// Cancellation token /// Task of ApiResponse (LabelsResponse) System.Threading.Tasks.Task> GetLabelsAsyncWithHttpInfo(string zapTraceSpan = null, string orgID = null, CancellationToken cancellationToken = default); /// /// Retrieve a label /// /// /// /// /// Thrown when fails to make API call /// The ID of the label to update. /// OpenTracing span context (optional) /// Cancellation token /// Task of LabelResponse System.Threading.Tasks.Task GetLabelsIDAsync(string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Retrieve a label /// /// /// /// /// Thrown when fails to make API call /// The ID of the label to update. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (LabelResponse) System.Threading.Tasks.Task> GetLabelsIDAsyncWithHttpInfo(string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Update a label /// /// /// /// /// Thrown when fails to make API call /// The ID of the label to update. /// Label update /// OpenTracing span context (optional) /// Cancellation token /// Task of LabelResponse System.Threading.Tasks.Task PatchLabelsIDAsync(string labelID, LabelUpdate labelUpdate, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Update a label /// /// /// /// /// Thrown when fails to make API call /// The ID of the label to update. /// Label update /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (LabelResponse) System.Threading.Tasks.Task> PatchLabelsIDAsyncWithHttpInfo(string labelID, LabelUpdate labelUpdate, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Create a label /// /// /// /// /// Thrown when fails to make API call /// Label to create /// Cancellation token /// Task of LabelResponse System.Threading.Tasks.Task PostLabelsAsync(LabelCreateRequest labelCreateRequest, CancellationToken cancellationToken = default); /// /// Create a label /// /// /// /// /// Thrown when fails to make API call /// Label to create /// Cancellation token /// Task of ApiResponse (LabelResponse) System.Threading.Tasks.Task> PostLabelsAsyncWithHttpInfo( LabelCreateRequest labelCreateRequest, CancellationToken cancellationToken = default); #endregion Asynchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// public partial class LabelsService : ILabelsService { private ExceptionFactory _exceptionFactory = (name, response) => null; /// /// Initializes a new instance of the class. /// /// public LabelsService(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 LabelsService(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 label /// /// Thrown when fails to make API call /// The ID of the label to delete. /// OpenTracing span context (optional) /// public void DeleteLabelsID(string labelID, string zapTraceSpan = null) { DeleteLabelsIDWithHttpInfo(labelID, zapTraceSpan); } /// /// Delete a label /// /// Thrown when fails to make API call /// The ID of the label to delete. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public ApiResponse DeleteLabelsIDWithHttpInfo(string labelID, string zapTraceSpan = null) { // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling LabelsService->DeleteLabelsID"); } var localVarPath = "/api/v2/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 (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("DeleteLabelsID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Delete a label /// /// Thrown when fails to make API call /// The ID of the label to delete. /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of Object(void) public async System.Threading.Tasks.Task DeleteLabelsIDWithIRestResponseAsync(string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling LabelsService->DeleteLabelsID"); } var localVarPath = "/api/v2/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 (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("DeleteLabelsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete a label /// /// Thrown when fails to make API call /// The ID of the label to delete. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestResponse DeleteLabelsIDWithIRestResponse(string labelID, string zapTraceSpan = null) { // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling LabelsService->DeleteLabelsID"); } var localVarPath = "/api/v2/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 (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("DeleteLabelsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete a label /// /// Thrown when fails to make API call /// The ID of the label to delete. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestRequest DeleteLabelsIDWithRestRequest(string labelID, string zapTraceSpan = null) { // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling LabelsService->DeleteLabelsID"); } var localVarPath = "/api/v2/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 (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 /// /// Thrown when fails to make API call /// The ID of the label to delete. /// OpenTracing span context (optional) /// Cancellation token /// Task of void public System.Threading.Tasks.Task DeleteLabelsIDAsync(string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { return DeleteLabelsIDAsyncWithHttpInfo(labelID, zapTraceSpan, cancellationToken); } /// /// Delete a label /// /// Thrown when fails to make API call /// The ID of the label to delete. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse public async System.Threading.Tasks.Task> DeleteLabelsIDAsyncWithHttpInfo(string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await DeleteLabelsIDAsyncWithIRestResponse(labelID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteLabelsID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Delete a label /// /// Thrown when fails to make API call /// The ID of the label to delete. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse public async System.Threading.Tasks.Task DeleteLabelsIDAsyncWithIRestResponse(string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling LabelsService->DeleteLabelsID"); } var localVarPath = "/api/v2/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 (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("DeleteLabelsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all labels /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID. (optional) /// LabelsResponse public LabelsResponse GetLabels(string zapTraceSpan = null, string orgID = null) { var localVarResponse = GetLabelsWithHttpInfo(zapTraceSpan, orgID); return localVarResponse.Data; } /// /// List all labels /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID. (optional) /// ApiResponse of LabelsResponse public ApiResponse GetLabelsWithHttpInfo(string zapTraceSpan = null, string orgID = null) { var localVarPath = "/api/v2/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 (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("GetLabels", 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 /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID. (optional) /// Cancellation token /// ApiResponse of LabelsResponse public async System.Threading.Tasks.Task GetLabelsWithIRestResponseAsync( string zapTraceSpan = null, string orgID = null, CancellationToken cancellationToken = default) { var localVarPath = "/api/v2/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 (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("GetLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all labels /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID. (optional) /// ApiResponse of LabelsResponse public RestResponse GetLabelsWithIRestResponse(string zapTraceSpan = null, string orgID = null) { var localVarPath = "/api/v2/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 (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("GetLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all labels /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID. (optional) /// ApiResponse of LabelsResponse public RestRequest GetLabelsWithRestRequest(string zapTraceSpan = null, string orgID = null) { var localVarPath = "/api/v2/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 (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 labels /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID. (optional) /// Cancellation token /// Task of LabelsResponse public async System.Threading.Tasks.Task GetLabelsAsync(string zapTraceSpan = null, string orgID = null, CancellationToken cancellationToken = default) { var localVarResponse = await GetLabelsAsyncWithHttpInfo(zapTraceSpan, orgID, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// List all labels /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID. (optional) /// Cancellation token /// Task of ApiResponse (LabelsResponse) public async System.Threading.Tasks.Task> GetLabelsAsyncWithHttpInfo( string zapTraceSpan = null, string orgID = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await GetLabelsAsyncWithIRestResponse(zapTraceSpan, orgID, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetLabels", 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 /// /// Thrown when fails to make API call /// OpenTracing span context (optional) /// The organization ID. (optional) /// Cancellation token /// Task of RestResponse (LabelsResponse) public async System.Threading.Tasks.Task GetLabelsAsyncWithIRestResponse( string zapTraceSpan = null, string orgID = null, CancellationToken cancellationToken = default) { var localVarPath = "/api/v2/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 (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("GetLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Retrieve a label /// /// Thrown when fails to make API call /// The ID of the label to update. /// OpenTracing span context (optional) /// LabelResponse public LabelResponse GetLabelsID(string labelID, string zapTraceSpan = null) { var localVarResponse = GetLabelsIDWithHttpInfo(labelID, zapTraceSpan); return localVarResponse.Data; } /// /// Retrieve a label /// /// Thrown when fails to make API call /// The ID of the label to update. /// OpenTracing span context (optional) /// ApiResponse of LabelResponse public ApiResponse GetLabelsIDWithHttpInfo(string labelID, string zapTraceSpan = null) { // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling LabelsService->GetLabelsID"); } var localVarPath = "/api/v2/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 (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.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetLabelsID", 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))); } /// /// Retrieve a label /// /// Thrown when fails to make API call /// The ID of the label to update. /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of LabelResponse public async System.Threading.Tasks.Task GetLabelsIDWithIRestResponseAsync(string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling LabelsService->GetLabelsID"); } var localVarPath = "/api/v2/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 (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.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetLabelsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Retrieve a label /// /// Thrown when fails to make API call /// The ID of the label to update. /// OpenTracing span context (optional) /// ApiResponse of LabelResponse public RestResponse GetLabelsIDWithIRestResponse(string labelID, string zapTraceSpan = null) { // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling LabelsService->GetLabelsID"); } var localVarPath = "/api/v2/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 (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.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetLabelsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Retrieve a label /// /// Thrown when fails to make API call /// The ID of the label to update. /// OpenTracing span context (optional) /// ApiResponse of LabelResponse public RestRequest GetLabelsIDWithRestRequest(string labelID, string zapTraceSpan = null) { // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling LabelsService->GetLabelsID"); } var localVarPath = "/api/v2/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 (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.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Retrieve a label /// /// Thrown when fails to make API call /// The ID of the label to update. /// OpenTracing span context (optional) /// Cancellation token /// Task of LabelResponse public async System.Threading.Tasks.Task GetLabelsIDAsync(string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await GetLabelsIDAsyncWithHttpInfo(labelID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// Retrieve a label /// /// Thrown when fails to make API call /// The ID of the label to update. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (LabelResponse) public async System.Threading.Tasks.Task> GetLabelsIDAsyncWithHttpInfo( string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await GetLabelsIDAsyncWithIRestResponse(labelID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetLabelsID", 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))); } /// /// Retrieve a label /// /// Thrown when fails to make API call /// The ID of the label to update. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (LabelResponse) public async System.Threading.Tasks.Task GetLabelsIDAsyncWithIRestResponse(string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling LabelsService->GetLabelsID"); } var localVarPath = "/api/v2/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 (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.Get, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("GetLabelsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Update a label /// /// Thrown when fails to make API call /// The ID of the label to update. /// Label update /// OpenTracing span context (optional) /// LabelResponse public LabelResponse PatchLabelsID(string labelID, LabelUpdate labelUpdate, string zapTraceSpan = null) { var localVarResponse = PatchLabelsIDWithHttpInfo(labelID, labelUpdate, zapTraceSpan); return localVarResponse.Data; } /// /// Update a label /// /// Thrown when fails to make API call /// The ID of the label to update. /// Label update /// OpenTracing span context (optional) /// ApiResponse of LabelResponse public ApiResponse PatchLabelsIDWithHttpInfo(string labelID, LabelUpdate labelUpdate, string zapTraceSpan = null) { // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling LabelsService->PatchLabelsID"); } // verify the required parameter 'labelUpdate' is set if (labelUpdate == null) { throw new ApiException(400, "Missing required parameter 'labelUpdate' when calling LabelsService->PatchLabelsID"); } var localVarPath = "/api/v2/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[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); 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 } if (labelUpdate != null && labelUpdate.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelUpdate); // http body (model) parameter } else { localVarPostBody = labelUpdate; // 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.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PatchLabelsID", 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))); } /// /// Update a label /// /// Thrown when fails to make API call /// The ID of the label to update. /// Label update /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of LabelResponse public async System.Threading.Tasks.Task PatchLabelsIDWithIRestResponseAsync(string labelID, LabelUpdate labelUpdate, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling LabelsService->PatchLabelsID"); } // verify the required parameter 'labelUpdate' is set if (labelUpdate == null) { throw new ApiException(400, "Missing required parameter 'labelUpdate' when calling LabelsService->PatchLabelsID"); } var localVarPath = "/api/v2/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[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); 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 } if (labelUpdate != null && labelUpdate.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelUpdate); // http body (model) parameter } else { localVarPostBody = labelUpdate; // 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.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PatchLabelsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Update a label /// /// Thrown when fails to make API call /// The ID of the label to update. /// Label update /// OpenTracing span context (optional) /// ApiResponse of LabelResponse public RestResponse PatchLabelsIDWithIRestResponse(string labelID, LabelUpdate labelUpdate, string zapTraceSpan = null) { // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling LabelsService->PatchLabelsID"); } // verify the required parameter 'labelUpdate' is set if (labelUpdate == null) { throw new ApiException(400, "Missing required parameter 'labelUpdate' when calling LabelsService->PatchLabelsID"); } var localVarPath = "/api/v2/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[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); 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 } if (labelUpdate != null && labelUpdate.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelUpdate); // http body (model) parameter } else { localVarPostBody = labelUpdate; // 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.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PatchLabelsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Update a label /// /// Thrown when fails to make API call /// The ID of the label to update. /// Label update /// OpenTracing span context (optional) /// ApiResponse of LabelResponse public RestRequest PatchLabelsIDWithRestRequest(string labelID, LabelUpdate labelUpdate, string zapTraceSpan = null) { // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling LabelsService->PatchLabelsID"); } // verify the required parameter 'labelUpdate' is set if (labelUpdate == null) { throw new ApiException(400, "Missing required parameter 'labelUpdate' when calling LabelsService->PatchLabelsID"); } var localVarPath = "/api/v2/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[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); 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 } if (labelUpdate != null && labelUpdate.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelUpdate); // http body (model) parameter } else { localVarPostBody = labelUpdate; // 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.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Update a label /// /// Thrown when fails to make API call /// The ID of the label to update. /// Label update /// OpenTracing span context (optional) /// Cancellation token /// Task of LabelResponse public async System.Threading.Tasks.Task PatchLabelsIDAsync(string labelID, LabelUpdate labelUpdate, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await PatchLabelsIDAsyncWithHttpInfo(labelID, labelUpdate, zapTraceSpan, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// Update a label /// /// Thrown when fails to make API call /// The ID of the label to update. /// Label update /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (LabelResponse) public async System.Threading.Tasks.Task> PatchLabelsIDAsyncWithHttpInfo( string labelID, LabelUpdate labelUpdate, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PatchLabelsIDAsyncWithIRestResponse(labelID, labelUpdate, zapTraceSpan, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PatchLabelsID", 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))); } /// /// Update a label /// /// Thrown when fails to make API call /// The ID of the label to update. /// Label update /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (LabelResponse) public async System.Threading.Tasks.Task PatchLabelsIDAsyncWithIRestResponse(string labelID, LabelUpdate labelUpdate, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'labelID' is set if (labelID == null) { throw new ApiException(400, "Missing required parameter 'labelID' when calling LabelsService->PatchLabelsID"); } // verify the required parameter 'labelUpdate' is set if (labelUpdate == null) { throw new ApiException(400, "Missing required parameter 'labelUpdate' when calling LabelsService->PatchLabelsID"); } var localVarPath = "/api/v2/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[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); 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 } if (labelUpdate != null && labelUpdate.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelUpdate); // http body (model) parameter } else { localVarPostBody = labelUpdate; // 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.Patch, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("PatchLabelsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Create a label /// /// Thrown when fails to make API call /// Label to create /// LabelResponse public LabelResponse PostLabels(LabelCreateRequest labelCreateRequest) { var localVarResponse = PostLabelsWithHttpInfo(labelCreateRequest); return localVarResponse.Data; } /// /// Create a label /// /// Thrown when fails to make API call /// Label to create /// ApiResponse of LabelResponse public ApiResponse PostLabelsWithHttpInfo(LabelCreateRequest labelCreateRequest) { // verify the required parameter 'labelCreateRequest' is set if (labelCreateRequest == null) { throw new ApiException(400, "Missing required parameter 'labelCreateRequest' when calling LabelsService->PostLabels"); } var localVarPath = "/api/v2/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 (labelCreateRequest != null && labelCreateRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelCreateRequest); // http body (model) parameter } else { localVarPostBody = labelCreateRequest; // 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("PostLabels", 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))); } /// /// Create a label /// /// Thrown when fails to make API call /// Label to create /// Cancellation token /// ApiResponse of LabelResponse public async System.Threading.Tasks.Task PostLabelsWithIRestResponseAsync( LabelCreateRequest labelCreateRequest, CancellationToken cancellationToken = default) { // verify the required parameter 'labelCreateRequest' is set if (labelCreateRequest == null) { throw new ApiException(400, "Missing required parameter 'labelCreateRequest' when calling LabelsService->PostLabels"); } var localVarPath = "/api/v2/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 (labelCreateRequest != null && labelCreateRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelCreateRequest); // http body (model) parameter } else { localVarPostBody = labelCreateRequest; // 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("PostLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Create a label /// /// Thrown when fails to make API call /// Label to create /// ApiResponse of LabelResponse public RestResponse PostLabelsWithIRestResponse(LabelCreateRequest labelCreateRequest) { // verify the required parameter 'labelCreateRequest' is set if (labelCreateRequest == null) { throw new ApiException(400, "Missing required parameter 'labelCreateRequest' when calling LabelsService->PostLabels"); } var localVarPath = "/api/v2/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 (labelCreateRequest != null && labelCreateRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelCreateRequest); // http body (model) parameter } else { localVarPostBody = labelCreateRequest; // 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("PostLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Create a label /// /// Thrown when fails to make API call /// Label to create /// ApiResponse of LabelResponse public RestRequest PostLabelsWithRestRequest(LabelCreateRequest labelCreateRequest) { // verify the required parameter 'labelCreateRequest' is set if (labelCreateRequest == null) { throw new ApiException(400, "Missing required parameter 'labelCreateRequest' when calling LabelsService->PostLabels"); } var localVarPath = "/api/v2/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 (labelCreateRequest != null && labelCreateRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelCreateRequest); // http body (model) parameter } else { localVarPostBody = labelCreateRequest; // 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 label /// /// Thrown when fails to make API call /// Label to create /// Cancellation token /// Task of LabelResponse public async System.Threading.Tasks.Task PostLabelsAsync(LabelCreateRequest labelCreateRequest, CancellationToken cancellationToken = default) { var localVarResponse = await PostLabelsAsyncWithHttpInfo(labelCreateRequest, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// Create a label /// /// Thrown when fails to make API call /// Label to create /// Cancellation token /// Task of ApiResponse (LabelResponse) public async System.Threading.Tasks.Task> PostLabelsAsyncWithHttpInfo( LabelCreateRequest labelCreateRequest, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PostLabelsAsyncWithIRestResponse(labelCreateRequest, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostLabels", 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))); } /// /// Create a label /// /// Thrown when fails to make API call /// Label to create /// Cancellation token /// Task of RestResponse (LabelResponse) public async System.Threading.Tasks.Task PostLabelsAsyncWithIRestResponse( LabelCreateRequest labelCreateRequest, CancellationToken cancellationToken = default) { // verify the required parameter 'labelCreateRequest' is set if (labelCreateRequest == null) { throw new ApiException(400, "Missing required parameter 'labelCreateRequest' when calling LabelsService->PostLabels"); } var localVarPath = "/api/v2/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 (labelCreateRequest != null && labelCreateRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(labelCreateRequest); // http body (model) parameter } else { localVarPostBody = labelCreateRequest; // 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("PostLabels", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } } }