/*
* 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 IVariablesService : IApiAccessor
{
#region Synchronous Operations
///
/// Delete a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
///
void DeleteVariablesID(string variableID, string zapTraceSpan = null);
///
/// Delete a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
ApiResponse DeleteVariablesIDWithHttpInfo(string variableID, string zapTraceSpan = null);
///
/// Delete a label from a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// The label ID to delete.
/// OpenTracing span context (optional)
///
void DeleteVariablesIDLabelsID(string variableID, string labelID, string zapTraceSpan = null);
///
/// Delete a label from a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// The label ID to delete.
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
ApiResponse DeleteVariablesIDLabelsIDWithHttpInfo(string variableID, string labelID,
string zapTraceSpan = null);
///
/// List all variables
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// The name of the organization. (optional)
/// The organization ID. (optional)
/// Variables
Variables GetVariables(string zapTraceSpan = null, string org = null, string orgID = null);
///
/// List all variables
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// The name of the organization. (optional)
/// The organization ID. (optional)
/// ApiResponse of Variables
ApiResponse GetVariablesWithHttpInfo(string zapTraceSpan = null, string org = null,
string orgID = null);
///
/// Retrieve a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Variable
Variable GetVariablesID(string variableID, string zapTraceSpan = null);
///
/// Retrieve a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// ApiResponse of Variable
ApiResponse GetVariablesIDWithHttpInfo(string variableID, string zapTraceSpan = null);
///
/// List all labels for a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// LabelsResponse
LabelsResponse GetVariablesIDLabels(string variableID, string zapTraceSpan = null);
///
/// List all labels for a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// ApiResponse of LabelsResponse
ApiResponse GetVariablesIDLabelsWithHttpInfo(string variableID, string zapTraceSpan = null);
///
/// Update a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// Variable update to apply
/// OpenTracing span context (optional)
/// Variable
Variable PatchVariablesID(string variableID, Variable variable, string zapTraceSpan = null);
///
/// Update a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// Variable update to apply
/// OpenTracing span context (optional)
/// ApiResponse of Variable
ApiResponse PatchVariablesIDWithHttpInfo(string variableID, Variable variable,
string zapTraceSpan = null);
///
/// Create a variable
///
///
///
///
/// Thrown when fails to make API call
/// Variable to create
/// OpenTracing span context (optional)
/// Variable
Variable PostVariables(Variable variable, string zapTraceSpan = null);
///
/// Create a variable
///
///
///
///
/// Thrown when fails to make API call
/// Variable to create
/// OpenTracing span context (optional)
/// ApiResponse of Variable
ApiResponse PostVariablesWithHttpInfo(Variable variable, string zapTraceSpan = null);
///
/// Add a label to a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// Label to add
/// OpenTracing span context (optional)
/// LabelResponse
LabelResponse PostVariablesIDLabels(string variableID, LabelMapping labelMapping, string zapTraceSpan = null);
///
/// Add a label to a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// Label to add
/// OpenTracing span context (optional)
/// ApiResponse of LabelResponse
ApiResponse PostVariablesIDLabelsWithHttpInfo(string variableID, LabelMapping labelMapping,
string zapTraceSpan = null);
///
/// Replace a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// Variable to replace
/// OpenTracing span context (optional)
/// Variable
Variable PutVariablesID(string variableID, Variable variable, string zapTraceSpan = null);
///
/// Replace a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// Variable to replace
/// OpenTracing span context (optional)
/// ApiResponse of Variable
ApiResponse PutVariablesIDWithHttpInfo(string variableID, Variable variable,
string zapTraceSpan = null);
#endregion Synchronous Operations
#region Asynchronous Operations
///
/// Delete a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of void
System.Threading.Tasks.Task DeleteVariablesIDAsync(string variableID, string zapTraceSpan = null,
CancellationToken cancellationToken = default);
///
/// Delete a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse
System.Threading.Tasks.Task> DeleteVariablesIDAsyncWithHttpInfo(string variableID,
string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// Delete a label from a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// The label ID to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of void
System.Threading.Tasks.Task DeleteVariablesIDLabelsIDAsync(string variableID, string labelID,
string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// Delete a label from a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// The label ID to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse
System.Threading.Tasks.Task> DeleteVariablesIDLabelsIDAsyncWithHttpInfo(string variableID,
string labelID, string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// List all variables
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// The name of the organization. (optional)
/// The organization ID. (optional)
/// Cancellation token
/// Task of Variables
System.Threading.Tasks.Task GetVariablesAsync(string zapTraceSpan = null, string org = null,
string orgID = null, CancellationToken cancellationToken = default);
///
/// List all variables
///
///
///
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// The name of the organization. (optional)
/// The organization ID. (optional)
/// Cancellation token
/// Task of ApiResponse (Variables)
System.Threading.Tasks.Task> GetVariablesAsyncWithHttpInfo(string zapTraceSpan = null,
string org = null, string orgID = null, CancellationToken cancellationToken = default);
///
/// Retrieve a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of Variable
System.Threading.Tasks.Task GetVariablesIDAsync(string variableID, string zapTraceSpan = null,
CancellationToken cancellationToken = default);
///
/// Retrieve a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (Variable)
System.Threading.Tasks.Task> GetVariablesIDAsyncWithHttpInfo(string variableID,
string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// List all labels for a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of LabelsResponse
System.Threading.Tasks.Task GetVariablesIDLabelsAsync(string variableID,
string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// List all labels for a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (LabelsResponse)
System.Threading.Tasks.Task> GetVariablesIDLabelsAsyncWithHttpInfo(
string variableID, string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// Update a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// Variable update to apply
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of Variable
System.Threading.Tasks.Task PatchVariablesIDAsync(string variableID, Variable variable,
string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// Update a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// Variable update to apply
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (Variable)
System.Threading.Tasks.Task> PatchVariablesIDAsyncWithHttpInfo(string variableID,
Variable variable, string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// Create a variable
///
///
///
///
/// Thrown when fails to make API call
/// Variable to create
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of Variable
System.Threading.Tasks.Task PostVariablesAsync(Variable variable, string zapTraceSpan = null,
CancellationToken cancellationToken = default);
///
/// Create a variable
///
///
///
///
/// Thrown when fails to make API call
/// Variable to create
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (Variable)
System.Threading.Tasks.Task> PostVariablesAsyncWithHttpInfo(Variable variable,
string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// Add a label to a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// Label to add
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of LabelResponse
System.Threading.Tasks.Task PostVariablesIDLabelsAsync(string variableID,
LabelMapping labelMapping, string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// Add a label to a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// Label to add
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (LabelResponse)
System.Threading.Tasks.Task> PostVariablesIDLabelsAsyncWithHttpInfo(
string variableID, LabelMapping labelMapping, string zapTraceSpan = null,
CancellationToken cancellationToken = default);
///
/// Replace a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// Variable to replace
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of Variable
System.Threading.Tasks.Task PutVariablesIDAsync(string variableID, Variable variable,
string zapTraceSpan = null, CancellationToken cancellationToken = default);
///
/// Replace a variable
///
///
///
///
/// Thrown when fails to make API call
/// The variable ID.
/// Variable to replace
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (Variable)
System.Threading.Tasks.Task> PutVariablesIDAsyncWithHttpInfo(string variableID,
Variable variable, string zapTraceSpan = null, CancellationToken cancellationToken = default);
#endregion Asynchronous Operations
}
///
/// Represents a collection of functions to interact with the API endpoints
///
public partial class VariablesService : IVariablesService
{
private ExceptionFactory _exceptionFactory = (name, response) => null;
///
/// Initializes a new instance of the class.
///
///
public VariablesService(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 VariablesService(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 variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
///
public void DeleteVariablesID(string variableID, string zapTraceSpan = null)
{
DeleteVariablesIDWithHttpInfo(variableID, zapTraceSpan);
}
///
/// Delete a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
public ApiResponse DeleteVariablesIDWithHttpInfo(string variableID, string zapTraceSpan = null)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->DeleteVariablesID");
}
var localVarPath = "/api/v2/variables/{variableID}";
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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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("DeleteVariablesID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
null);
}
///
/// Delete a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// ApiResponse of Object(void)
public async System.Threading.Tasks.Task DeleteVariablesIDWithIRestResponseAsync(
string variableID, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->DeleteVariablesID");
}
var localVarPath = "/api/v2/variables/{variableID}";
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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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("DeleteVariablesID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Delete a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
public RestResponse DeleteVariablesIDWithIRestResponse(string variableID, string zapTraceSpan = null)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->DeleteVariablesID");
}
var localVarPath = "/api/v2/variables/{variableID}";
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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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("DeleteVariablesID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Delete a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
public RestRequest DeleteVariablesIDWithRestRequest(string variableID, string zapTraceSpan = null)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->DeleteVariablesID");
}
var localVarPath = "/api/v2/variables/{variableID}";
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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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 variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of void
public System.Threading.Tasks.Task DeleteVariablesIDAsync(string variableID, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
return DeleteVariablesIDAsyncWithHttpInfo(variableID, zapTraceSpan, cancellationToken);
}
///
/// Delete a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse
public async System.Threading.Tasks.Task> DeleteVariablesIDAsyncWithHttpInfo(
string variableID, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse =
await DeleteVariablesIDAsyncWithIRestResponse(variableID, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("DeleteVariablesID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
null);
}
///
/// Delete a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of RestResponse
public async System.Threading.Tasks.Task DeleteVariablesIDAsyncWithIRestResponse(
string variableID, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->DeleteVariablesID");
}
var localVarPath = "/api/v2/variables/{variableID}";
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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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("DeleteVariablesID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Delete a label from a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// The label ID to delete.
/// OpenTracing span context (optional)
///
public void DeleteVariablesIDLabelsID(string variableID, string labelID, string zapTraceSpan = null)
{
DeleteVariablesIDLabelsIDWithHttpInfo(variableID, labelID, zapTraceSpan);
}
///
/// Delete a label from a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// The label ID to delete.
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
public ApiResponse DeleteVariablesIDLabelsIDWithHttpInfo(string variableID, string labelID,
string zapTraceSpan = null)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->DeleteVariablesIDLabelsID");
}
// verify the required parameter 'labelID' is set
if (labelID == null)
{
throw new ApiException(400,
"Missing required parameter 'labelID' when calling VariablesService->DeleteVariablesIDLabelsID");
}
var localVarPath = "/api/v2/variables/{variableID}/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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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("DeleteVariablesIDLabelsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
null);
}
///
/// Delete a label from a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// The label ID to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// ApiResponse of Object(void)
public async System.Threading.Tasks.Task DeleteVariablesIDLabelsIDWithIRestResponseAsync(
string variableID, string labelID, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->DeleteVariablesIDLabelsID");
}
// verify the required parameter 'labelID' is set
if (labelID == null)
{
throw new ApiException(400,
"Missing required parameter 'labelID' when calling VariablesService->DeleteVariablesIDLabelsID");
}
var localVarPath = "/api/v2/variables/{variableID}/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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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("DeleteVariablesIDLabelsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Delete a label from a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// The label ID to delete.
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
public RestResponse DeleteVariablesIDLabelsIDWithIRestResponse(string variableID, string labelID,
string zapTraceSpan = null)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->DeleteVariablesIDLabelsID");
}
// verify the required parameter 'labelID' is set
if (labelID == null)
{
throw new ApiException(400,
"Missing required parameter 'labelID' when calling VariablesService->DeleteVariablesIDLabelsID");
}
var localVarPath = "/api/v2/variables/{variableID}/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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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("DeleteVariablesIDLabelsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Delete a label from a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// The label ID to delete.
/// OpenTracing span context (optional)
/// ApiResponse of Object(void)
public RestRequest DeleteVariablesIDLabelsIDWithRestRequest(string variableID, string labelID,
string zapTraceSpan = null)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->DeleteVariablesIDLabelsID");
}
// verify the required parameter 'labelID' is set
if (labelID == null)
{
throw new ApiException(400,
"Missing required parameter 'labelID' when calling VariablesService->DeleteVariablesIDLabelsID");
}
var localVarPath = "/api/v2/variables/{variableID}/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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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 variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// The label ID to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of void
public System.Threading.Tasks.Task DeleteVariablesIDLabelsIDAsync(string variableID, string labelID,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
return DeleteVariablesIDLabelsIDAsyncWithHttpInfo(variableID, labelID, zapTraceSpan, cancellationToken);
}
///
/// Delete a label from a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// The label ID to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse
public async System.Threading.Tasks.Task> DeleteVariablesIDLabelsIDAsyncWithHttpInfo(
string variableID, string labelID, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse =
await DeleteVariablesIDLabelsIDAsyncWithIRestResponse(variableID, labelID, zapTraceSpan,
cancellationToken).ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("DeleteVariablesIDLabelsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
null);
}
///
/// Delete a label from a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// The label ID to delete.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of RestResponse
public async System.Threading.Tasks.Task DeleteVariablesIDLabelsIDAsyncWithIRestResponse(
string variableID, string labelID, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->DeleteVariablesIDLabelsID");
}
// verify the required parameter 'labelID' is set
if (labelID == null)
{
throw new ApiException(400,
"Missing required parameter 'labelID' when calling VariablesService->DeleteVariablesIDLabelsID");
}
var localVarPath = "/api/v2/variables/{variableID}/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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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("DeleteVariablesIDLabelsID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// List all variables
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// The name of the organization. (optional)
/// The organization ID. (optional)
/// Variables
public Variables GetVariables(string zapTraceSpan = null, string org = null, string orgID = null)
{
var localVarResponse = GetVariablesWithHttpInfo(zapTraceSpan, org, orgID);
return localVarResponse.Data;
}
///
/// List all variables
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// The name of the organization. (optional)
/// The organization ID. (optional)
/// ApiResponse of Variables
public ApiResponse GetVariablesWithHttpInfo(string zapTraceSpan = null, string org = null,
string orgID = null)
{
var localVarPath = "/api/v2/variables";
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 (org != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter
}
if (orgID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// 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("GetVariables", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Variables)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Variables)));
}
///
/// List all variables
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// The name of the organization. (optional)
/// The organization ID. (optional)
/// Cancellation token
/// ApiResponse of Variables
public async System.Threading.Tasks.Task GetVariablesWithIRestResponseAsync(
string zapTraceSpan = null, string org = null, string orgID = null,
CancellationToken cancellationToken = default)
{
var localVarPath = "/api/v2/variables";
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 (org != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter
}
if (orgID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// 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("GetVariables", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// List all variables
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// The name of the organization. (optional)
/// The organization ID. (optional)
/// ApiResponse of Variables
public RestResponse GetVariablesWithIRestResponse(string zapTraceSpan = null, string org = null,
string orgID = null)
{
var localVarPath = "/api/v2/variables";
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 (org != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter
}
if (orgID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// 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("GetVariables", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// List all variables
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// The name of the organization. (optional)
/// The organization ID. (optional)
/// ApiResponse of Variables
public RestRequest GetVariablesWithRestRequest(string zapTraceSpan = null, string org = null,
string orgID = null)
{
var localVarPath = "/api/v2/variables";
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 (org != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter
}
if (orgID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// 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 variables
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// The name of the organization. (optional)
/// The organization ID. (optional)
/// Cancellation token
/// Task of Variables
public async System.Threading.Tasks.Task GetVariablesAsync(string zapTraceSpan = null,
string org = null, string orgID = null, CancellationToken cancellationToken = default)
{
var localVarResponse = await GetVariablesAsyncWithHttpInfo(zapTraceSpan, org, orgID, cancellationToken)
.ConfigureAwait(false);
return localVarResponse.Data;
}
///
/// List all variables
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// The name of the organization. (optional)
/// The organization ID. (optional)
/// Cancellation token
/// Task of ApiResponse (Variables)
public async System.Threading.Tasks.Task> GetVariablesAsyncWithHttpInfo(
string zapTraceSpan = null, string org = null, string orgID = null,
CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse = await GetVariablesAsyncWithIRestResponse(zapTraceSpan, org, orgID, cancellationToken)
.ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetVariables", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Variables)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Variables)));
}
///
/// List all variables
///
/// Thrown when fails to make API call
/// OpenTracing span context (optional)
/// The name of the organization. (optional)
/// The organization ID. (optional)
/// Cancellation token
/// Task of RestResponse (Variables)
public async System.Threading.Tasks.Task GetVariablesAsyncWithIRestResponse(
string zapTraceSpan = null, string org = null, string orgID = null,
CancellationToken cancellationToken = default)
{
var localVarPath = "/api/v2/variables";
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 (org != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "org", org)); // query parameter
}
if (orgID != null)
{
localVarQueryParams.AddRange(
Configuration.ApiClient.ParameterToKeyValuePairs("", "orgID", orgID)); // query parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
// 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("GetVariables", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Retrieve a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Variable
public Variable GetVariablesID(string variableID, string zapTraceSpan = null)
{
var localVarResponse = GetVariablesIDWithHttpInfo(variableID, zapTraceSpan);
return localVarResponse.Data;
}
///
/// Retrieve a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// ApiResponse of Variable
public ApiResponse GetVariablesIDWithHttpInfo(string variableID, string zapTraceSpan = null)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->GetVariablesID");
}
var localVarPath = "/api/v2/variables/{variableID}";
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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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("GetVariablesID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Variable)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Variable)));
}
///
/// Retrieve a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// ApiResponse of Variable
public async System.Threading.Tasks.Task GetVariablesIDWithIRestResponseAsync(string variableID,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->GetVariablesID");
}
var localVarPath = "/api/v2/variables/{variableID}";
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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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("GetVariablesID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Retrieve a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// ApiResponse of Variable
public RestResponse GetVariablesIDWithIRestResponse(string variableID, string zapTraceSpan = null)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->GetVariablesID");
}
var localVarPath = "/api/v2/variables/{variableID}";
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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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("GetVariablesID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Retrieve a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// ApiResponse of Variable
public RestRequest GetVariablesIDWithRestRequest(string variableID, string zapTraceSpan = null)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->GetVariablesID");
}
var localVarPath = "/api/v2/variables/{variableID}";
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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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 variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of Variable
public async System.Threading.Tasks.Task GetVariablesIDAsync(string variableID,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
var localVarResponse = await GetVariablesIDAsyncWithHttpInfo(variableID, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
return localVarResponse.Data;
}
///
/// Retrieve a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (Variable)
public async System.Threading.Tasks.Task> GetVariablesIDAsyncWithHttpInfo(
string variableID, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse =
await GetVariablesIDAsyncWithIRestResponse(variableID, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetVariablesID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Variable)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Variable)));
}
///
/// Retrieve a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of RestResponse (Variable)
public async System.Threading.Tasks.Task GetVariablesIDAsyncWithIRestResponse(string variableID,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->GetVariablesID");
}
var localVarPath = "/api/v2/variables/{variableID}";
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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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("GetVariablesID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// List all labels for a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// LabelsResponse
public LabelsResponse GetVariablesIDLabels(string variableID, string zapTraceSpan = null)
{
var localVarResponse = GetVariablesIDLabelsWithHttpInfo(variableID, zapTraceSpan);
return localVarResponse.Data;
}
///
/// List all labels for a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// ApiResponse of LabelsResponse
public ApiResponse GetVariablesIDLabelsWithHttpInfo(string variableID,
string zapTraceSpan = null)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->GetVariablesIDLabels");
}
var localVarPath = "/api/v2/variables/{variableID}/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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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("GetVariablesIDLabels", 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 variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// ApiResponse of LabelsResponse
public async System.Threading.Tasks.Task GetVariablesIDLabelsWithIRestResponseAsync(
string variableID, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->GetVariablesIDLabels");
}
var localVarPath = "/api/v2/variables/{variableID}/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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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("GetVariablesIDLabels", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// List all labels for a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// ApiResponse of LabelsResponse
public RestResponse GetVariablesIDLabelsWithIRestResponse(string variableID, string zapTraceSpan = null)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->GetVariablesIDLabels");
}
var localVarPath = "/api/v2/variables/{variableID}/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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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("GetVariablesIDLabels", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// List all labels for a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// ApiResponse of LabelsResponse
public RestRequest GetVariablesIDLabelsWithRestRequest(string variableID, string zapTraceSpan = null)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->GetVariablesIDLabels");
}
var localVarPath = "/api/v2/variables/{variableID}/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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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 variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of LabelsResponse
public async System.Threading.Tasks.Task GetVariablesIDLabelsAsync(string variableID,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
var localVarResponse =
await GetVariablesIDLabelsAsyncWithHttpInfo(variableID, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
return localVarResponse.Data;
}
///
/// List all labels for a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (LabelsResponse)
public async System.Threading.Tasks.Task> GetVariablesIDLabelsAsyncWithHttpInfo(
string variableID, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse =
await GetVariablesIDLabelsAsyncWithIRestResponse(variableID, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("GetVariablesIDLabels", 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 variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of RestResponse (LabelsResponse)
public async System.Threading.Tasks.Task GetVariablesIDLabelsAsyncWithIRestResponse(
string variableID, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->GetVariablesIDLabels");
}
var localVarPath = "/api/v2/variables/{variableID}/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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // 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("GetVariablesIDLabels", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Update a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// Variable update to apply
/// OpenTracing span context (optional)
/// Variable
public Variable PatchVariablesID(string variableID, Variable variable, string zapTraceSpan = null)
{
var localVarResponse = PatchVariablesIDWithHttpInfo(variableID, variable, zapTraceSpan);
return localVarResponse.Data;
}
///
/// Update a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// Variable update to apply
/// OpenTracing span context (optional)
/// ApiResponse of Variable
public ApiResponse PatchVariablesIDWithHttpInfo(string variableID, Variable variable,
string zapTraceSpan = null)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->PatchVariablesID");
}
// verify the required parameter 'variable' is set
if (variable == null)
{
throw new ApiException(400,
"Missing required parameter 'variable' when calling VariablesService->PatchVariablesID");
}
var localVarPath = "/api/v2/variables/{variableID}";
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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (variable != null && variable.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(variable); // http body (model) parameter
}
else
{
localVarPostBody = variable; // 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("PatchVariablesID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Variable)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Variable)));
}
///
/// Update a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// Variable update to apply
/// OpenTracing span context (optional)
/// Cancellation token
/// ApiResponse of Variable
public async System.Threading.Tasks.Task PatchVariablesIDWithIRestResponseAsync(string variableID,
Variable variable, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->PatchVariablesID");
}
// verify the required parameter 'variable' is set
if (variable == null)
{
throw new ApiException(400,
"Missing required parameter 'variable' when calling VariablesService->PatchVariablesID");
}
var localVarPath = "/api/v2/variables/{variableID}";
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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (variable != null && variable.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(variable); // http body (model) parameter
}
else
{
localVarPostBody = variable; // 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("PatchVariablesID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Update a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// Variable update to apply
/// OpenTracing span context (optional)
/// ApiResponse of Variable
public RestResponse PatchVariablesIDWithIRestResponse(string variableID, Variable variable,
string zapTraceSpan = null)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->PatchVariablesID");
}
// verify the required parameter 'variable' is set
if (variable == null)
{
throw new ApiException(400,
"Missing required parameter 'variable' when calling VariablesService->PatchVariablesID");
}
var localVarPath = "/api/v2/variables/{variableID}";
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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (variable != null && variable.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(variable); // http body (model) parameter
}
else
{
localVarPostBody = variable; // 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("PatchVariablesID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Update a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// Variable update to apply
/// OpenTracing span context (optional)
/// ApiResponse of Variable
public RestRequest PatchVariablesIDWithRestRequest(string variableID, Variable variable,
string zapTraceSpan = null)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->PatchVariablesID");
}
// verify the required parameter 'variable' is set
if (variable == null)
{
throw new ApiException(400,
"Missing required parameter 'variable' when calling VariablesService->PatchVariablesID");
}
var localVarPath = "/api/v2/variables/{variableID}";
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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (variable != null && variable.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(variable); // http body (model) parameter
}
else
{
localVarPostBody = variable; // 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 variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// Variable update to apply
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of Variable
public async System.Threading.Tasks.Task PatchVariablesIDAsync(string variableID, Variable variable,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
var localVarResponse =
await PatchVariablesIDAsyncWithHttpInfo(variableID, variable, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
return localVarResponse.Data;
}
///
/// Update a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// Variable update to apply
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (Variable)
public async System.Threading.Tasks.Task> PatchVariablesIDAsyncWithHttpInfo(
string variableID, Variable variable, string zapTraceSpan = null,
CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse =
await PatchVariablesIDAsyncWithIRestResponse(variableID, variable, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PatchVariablesID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Variable)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Variable)));
}
///
/// Update a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// Variable update to apply
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of RestResponse (Variable)
public async System.Threading.Tasks.Task PatchVariablesIDAsyncWithIRestResponse(string variableID,
Variable variable, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->PatchVariablesID");
}
// verify the required parameter 'variable' is set
if (variable == null)
{
throw new ApiException(400,
"Missing required parameter 'variable' when calling VariablesService->PatchVariablesID");
}
var localVarPath = "/api/v2/variables/{variableID}";
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 (variableID != null)
{
localVarPathParams.Add("variableID",
Configuration.ApiClient.ParameterToString(variableID)); // path parameter
}
if (zapTraceSpan != null)
{
localVarHeaderParams.Add("Zap-Trace-Span",
Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter
}
if (variable != null && variable.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(variable); // http body (model) parameter
}
else
{
localVarPostBody = variable; // 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("PatchVariablesID", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Create a variable
///
/// Thrown when fails to make API call
/// Variable to create
/// OpenTracing span context (optional)
/// Variable
public Variable PostVariables(Variable variable, string zapTraceSpan = null)
{
var localVarResponse = PostVariablesWithHttpInfo(variable, zapTraceSpan);
return localVarResponse.Data;
}
///
/// Create a variable
///
/// Thrown when fails to make API call
/// Variable to create
/// OpenTracing span context (optional)
/// ApiResponse of Variable
public ApiResponse PostVariablesWithHttpInfo(Variable variable, string zapTraceSpan = null)
{
// verify the required parameter 'variable' is set
if (variable == null)
{
throw new ApiException(400,
"Missing required parameter 'variable' when calling VariablesService->PostVariables");
}
var localVarPath = "/api/v2/variables";
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 (variable != null && variable.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(variable); // http body (model) parameter
}
else
{
localVarPostBody = variable; // 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("PostVariables", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Variable)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Variable)));
}
///
/// Create a variable
///
/// Thrown when fails to make API call
/// Variable to create
/// OpenTracing span context (optional)
/// Cancellation token
/// ApiResponse of Variable
public async System.Threading.Tasks.Task PostVariablesWithIRestResponseAsync(Variable variable,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'variable' is set
if (variable == null)
{
throw new ApiException(400,
"Missing required parameter 'variable' when calling VariablesService->PostVariables");
}
var localVarPath = "/api/v2/variables";
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 (variable != null && variable.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(variable); // http body (model) parameter
}
else
{
localVarPostBody = variable; // 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("PostVariables", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Create a variable
///
/// Thrown when fails to make API call
/// Variable to create
/// OpenTracing span context (optional)
/// ApiResponse of Variable
public RestResponse PostVariablesWithIRestResponse(Variable variable, string zapTraceSpan = null)
{
// verify the required parameter 'variable' is set
if (variable == null)
{
throw new ApiException(400,
"Missing required parameter 'variable' when calling VariablesService->PostVariables");
}
var localVarPath = "/api/v2/variables";
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 (variable != null && variable.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(variable); // http body (model) parameter
}
else
{
localVarPostBody = variable; // 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("PostVariables", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Create a variable
///
/// Thrown when fails to make API call
/// Variable to create
/// OpenTracing span context (optional)
/// ApiResponse of Variable
public RestRequest PostVariablesWithRestRequest(Variable variable, string zapTraceSpan = null)
{
// verify the required parameter 'variable' is set
if (variable == null)
{
throw new ApiException(400,
"Missing required parameter 'variable' when calling VariablesService->PostVariables");
}
var localVarPath = "/api/v2/variables";
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 (variable != null && variable.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(variable); // http body (model) parameter
}
else
{
localVarPostBody = variable; // 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 variable
///
/// Thrown when fails to make API call
/// Variable to create
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of Variable
public async System.Threading.Tasks.Task PostVariablesAsync(Variable variable,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
var localVarResponse = await PostVariablesAsyncWithHttpInfo(variable, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
return localVarResponse.Data;
}
///
/// Create a variable
///
/// Thrown when fails to make API call
/// Variable to create
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of ApiResponse (Variable)
public async System.Threading.Tasks.Task> PostVariablesAsyncWithHttpInfo(
Variable variable, string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// make the HTTP request
var localVarResponse = await PostVariablesAsyncWithIRestResponse(variable, zapTraceSpan, cancellationToken)
.ConfigureAwait(false);
var localVarStatusCode = (int)localVarResponse.StatusCode;
if (ExceptionFactory != null)
{
var exception = ExceptionFactory("PostVariables", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return new ApiResponse(localVarStatusCode,
localVarResponse.Headers.Select(h => (h.Name, h.Value)),
(Variable)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Variable)));
}
///
/// Create a variable
///
/// Thrown when fails to make API call
/// Variable to create
/// OpenTracing span context (optional)
/// Cancellation token
/// Task of RestResponse (Variable)
public async System.Threading.Tasks.Task PostVariablesAsyncWithIRestResponse(Variable variable,
string zapTraceSpan = null, CancellationToken cancellationToken = default)
{
// verify the required parameter 'variable' is set
if (variable == null)
{
throw new ApiException(400,
"Missing required parameter 'variable' when calling VariablesService->PostVariables");
}
var localVarPath = "/api/v2/variables";
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 (variable != null && variable.GetType() != typeof(byte[]))
{
localVarPostBody = Configuration.ApiClient.Serialize(variable); // http body (model) parameter
}
else
{
localVarPostBody = variable; // 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("PostVariables", localVarResponse);
if (exception != null)
{
throw exception;
}
}
return localVarResponse;
}
///
/// Add a label to a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// Label to add
/// OpenTracing span context (optional)
/// LabelResponse
public LabelResponse PostVariablesIDLabels(string variableID, LabelMapping labelMapping,
string zapTraceSpan = null)
{
var localVarResponse = PostVariablesIDLabelsWithHttpInfo(variableID, labelMapping, zapTraceSpan);
return localVarResponse.Data;
}
///
/// Add a label to a variable
///
/// Thrown when fails to make API call
/// The variable ID.
/// Label to add
/// OpenTracing span context (optional)
/// ApiResponse of LabelResponse
public ApiResponse PostVariablesIDLabelsWithHttpInfo(string variableID,
LabelMapping labelMapping, string zapTraceSpan = null)
{
// verify the required parameter 'variableID' is set
if (variableID == null)
{
throw new ApiException(400,
"Missing required parameter 'variableID' when calling VariablesService->PostVariablesIDLabels");
}
// verify the required parameter 'labelMapping' is set
if (labelMapping == null)
{
throw new ApiException(400,
"Missing required parameter 'labelMapping' when calling VariablesService->PostVariablesIDLabels");
}
var localVarPath = "/api/v2/variables/{variableID}/labels";
var localVarPathParams = new Dictionary();
var localVarQueryParams = new List>();
var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader);
var localVarFormParams = new Dictionary();
var localVarFileParams = new Dictionary