/* * 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 ISecretsService : IApiAccessor { #region Synchronous Operations /// /// Delete a secret from an organization /// /// /// /// /// Thrown when fails to make API call /// The organization ID. /// The secret ID. /// OpenTracing span context (optional) /// void DeleteOrgsIDSecretsID(string orgID, string secretID, string zapTraceSpan = null); /// /// Delete a secret from an organization /// /// /// /// /// Thrown when fails to make API call /// The organization ID. /// The secret ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) ApiResponse DeleteOrgsIDSecretsIDWithHttpInfo(string orgID, string secretID, string zapTraceSpan = null); /// /// List all secret keys for an organization /// /// /// /// /// Thrown when fails to make API call /// The organization ID. /// OpenTracing span context (optional) /// SecretKeysResponse SecretKeysResponse GetOrgsIDSecrets(string orgID, string zapTraceSpan = null); /// /// List all secret keys for an organization /// /// /// /// /// Thrown when fails to make API call /// The organization ID. /// OpenTracing span context (optional) /// ApiResponse of SecretKeysResponse ApiResponse GetOrgsIDSecretsWithHttpInfo(string orgID, string zapTraceSpan = null); /// /// Update secrets in an organization /// /// /// /// /// Thrown when fails to make API call /// The organization ID. /// Secret key value pairs to update/add /// OpenTracing span context (optional) /// void PatchOrgsIDSecrets(string orgID, Dictionary requestBody, string zapTraceSpan = null); /// /// Update secrets in an organization /// /// /// /// /// Thrown when fails to make API call /// The organization ID. /// Secret key value pairs to update/add /// OpenTracing span context (optional) /// ApiResponse of Object(void) ApiResponse PatchOrgsIDSecretsWithHttpInfo(string orgID, Dictionary requestBody, string zapTraceSpan = null); /// /// Delete secrets from an organization /// /// /// /// /// Thrown when fails to make API call /// The organization ID. /// Secret key to delete /// OpenTracing span context (optional) /// void PostOrgsIDSecrets(string orgID, SecretKeys secretKeys, string zapTraceSpan = null); /// /// Delete secrets from an organization /// /// /// /// /// Thrown when fails to make API call /// The organization ID. /// Secret key to delete /// OpenTracing span context (optional) /// ApiResponse of Object(void) ApiResponse PostOrgsIDSecretsWithHttpInfo(string orgID, SecretKeys secretKeys, string zapTraceSpan = null); #endregion Synchronous Operations #region Asynchronous Operations /// /// Delete a secret from an organization /// /// /// /// /// Thrown when fails to make API call /// The organization ID. /// The secret ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of void System.Threading.Tasks.Task DeleteOrgsIDSecretsIDAsync(string orgID, string secretID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Delete a secret from an organization /// /// /// /// /// Thrown when fails to make API call /// The organization ID. /// The secret ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse System.Threading.Tasks.Task> DeleteOrgsIDSecretsIDAsyncWithHttpInfo(string orgID, string secretID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// List all secret keys for an organization /// /// /// /// /// Thrown when fails to make API call /// The organization ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of SecretKeysResponse System.Threading.Tasks.Task GetOrgsIDSecretsAsync(string orgID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// List all secret keys for an organization /// /// /// /// /// Thrown when fails to make API call /// The organization ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (SecretKeysResponse) System.Threading.Tasks.Task> GetOrgsIDSecretsAsyncWithHttpInfo(string orgID, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Update secrets in an organization /// /// /// /// /// Thrown when fails to make API call /// The organization ID. /// Secret key value pairs to update/add /// OpenTracing span context (optional) /// Cancellation token /// Task of void System.Threading.Tasks.Task PatchOrgsIDSecretsAsync(string orgID, Dictionary requestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Update secrets in an organization /// /// /// /// /// Thrown when fails to make API call /// The organization ID. /// Secret key value pairs to update/add /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse System.Threading.Tasks.Task> PatchOrgsIDSecretsAsyncWithHttpInfo(string orgID, Dictionary requestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Delete secrets from an organization /// /// /// /// /// Thrown when fails to make API call /// The organization ID. /// Secret key to delete /// OpenTracing span context (optional) /// Cancellation token /// Task of void System.Threading.Tasks.Task PostOrgsIDSecretsAsync(string orgID, SecretKeys secretKeys, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Delete secrets from an organization /// /// /// /// /// Thrown when fails to make API call /// The organization ID. /// Secret key to delete /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse System.Threading.Tasks.Task> PostOrgsIDSecretsAsyncWithHttpInfo(string orgID, SecretKeys secretKeys, string zapTraceSpan = null, CancellationToken cancellationToken = default); #endregion Asynchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// public partial class SecretsService : ISecretsService { private ExceptionFactory _exceptionFactory = (name, response) => null; /// /// Initializes a new instance of the class. /// /// public SecretsService(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 SecretsService(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 secret from an organization /// /// Thrown when fails to make API call /// The organization ID. /// The secret ID. /// OpenTracing span context (optional) /// public void DeleteOrgsIDSecretsID(string orgID, string secretID, string zapTraceSpan = null) { DeleteOrgsIDSecretsIDWithHttpInfo(orgID, secretID, zapTraceSpan); } /// /// Delete a secret from an organization /// /// Thrown when fails to make API call /// The organization ID. /// The secret ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public ApiResponse DeleteOrgsIDSecretsIDWithHttpInfo(string orgID, string secretID, string zapTraceSpan = null) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->DeleteOrgsIDSecretsID"); } // verify the required parameter 'secretID' is set if (secretID == null) { throw new ApiException(400, "Missing required parameter 'secretID' when calling SecretsService->DeleteOrgsIDSecretsID"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets/{secretID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // path parameter } if (secretID != null) { localVarPathParams.Add("secretID", Configuration.ApiClient.ParameterToString(secretID)); // 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("DeleteOrgsIDSecretsID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Delete a secret from an organization /// /// Thrown when fails to make API call /// The organization ID. /// The secret ID. /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of Object(void) public async System.Threading.Tasks.Task DeleteOrgsIDSecretsIDWithIRestResponseAsync(string orgID, string secretID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->DeleteOrgsIDSecretsID"); } // verify the required parameter 'secretID' is set if (secretID == null) { throw new ApiException(400, "Missing required parameter 'secretID' when calling SecretsService->DeleteOrgsIDSecretsID"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets/{secretID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // path parameter } if (secretID != null) { localVarPathParams.Add("secretID", Configuration.ApiClient.ParameterToString(secretID)); // 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("DeleteOrgsIDSecretsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete a secret from an organization /// /// Thrown when fails to make API call /// The organization ID. /// The secret ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestResponse DeleteOrgsIDSecretsIDWithIRestResponse(string orgID, string secretID, string zapTraceSpan = null) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->DeleteOrgsIDSecretsID"); } // verify the required parameter 'secretID' is set if (secretID == null) { throw new ApiException(400, "Missing required parameter 'secretID' when calling SecretsService->DeleteOrgsIDSecretsID"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets/{secretID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // path parameter } if (secretID != null) { localVarPathParams.Add("secretID", Configuration.ApiClient.ParameterToString(secretID)); // 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("DeleteOrgsIDSecretsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete a secret from an organization /// /// Thrown when fails to make API call /// The organization ID. /// The secret ID. /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestRequest DeleteOrgsIDSecretsIDWithRestRequest(string orgID, string secretID, string zapTraceSpan = null) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->DeleteOrgsIDSecretsID"); } // verify the required parameter 'secretID' is set if (secretID == null) { throw new ApiException(400, "Missing required parameter 'secretID' when calling SecretsService->DeleteOrgsIDSecretsID"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets/{secretID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // path parameter } if (secretID != null) { localVarPathParams.Add("secretID", Configuration.ApiClient.ParameterToString(secretID)); // 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 secret from an organization /// /// Thrown when fails to make API call /// The organization ID. /// The secret ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of void public System.Threading.Tasks.Task DeleteOrgsIDSecretsIDAsync(string orgID, string secretID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { return DeleteOrgsIDSecretsIDAsyncWithHttpInfo(orgID, secretID, zapTraceSpan, cancellationToken); } /// /// Delete a secret from an organization /// /// Thrown when fails to make API call /// The organization ID. /// The secret ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse public async System.Threading.Tasks.Task> DeleteOrgsIDSecretsIDAsyncWithHttpInfo( string orgID, string secretID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await DeleteOrgsIDSecretsIDAsyncWithIRestResponse(orgID, secretID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("DeleteOrgsIDSecretsID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Delete a secret from an organization /// /// Thrown when fails to make API call /// The organization ID. /// The secret ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse public async System.Threading.Tasks.Task DeleteOrgsIDSecretsIDAsyncWithIRestResponse(string orgID, string secretID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->DeleteOrgsIDSecretsID"); } // verify the required parameter 'secretID' is set if (secretID == null) { throw new ApiException(400, "Missing required parameter 'secretID' when calling SecretsService->DeleteOrgsIDSecretsID"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets/{secretID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // path parameter } if (secretID != null) { localVarPathParams.Add("secretID", Configuration.ApiClient.ParameterToString(secretID)); // 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("DeleteOrgsIDSecretsID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all secret keys for an organization /// /// Thrown when fails to make API call /// The organization ID. /// OpenTracing span context (optional) /// SecretKeysResponse public SecretKeysResponse GetOrgsIDSecrets(string orgID, string zapTraceSpan = null) { var localVarResponse = GetOrgsIDSecretsWithHttpInfo(orgID, zapTraceSpan); return localVarResponse.Data; } /// /// List all secret keys for an organization /// /// Thrown when fails to make API call /// The organization ID. /// OpenTracing span context (optional) /// ApiResponse of SecretKeysResponse public ApiResponse GetOrgsIDSecretsWithHttpInfo(string orgID, string zapTraceSpan = null) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->GetOrgsIDSecrets"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // 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("GetOrgsIDSecrets", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (SecretKeysResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(SecretKeysResponse))); } /// /// List all secret keys for an organization /// /// Thrown when fails to make API call /// The organization ID. /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of SecretKeysResponse public async System.Threading.Tasks.Task GetOrgsIDSecretsWithIRestResponseAsync(string orgID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->GetOrgsIDSecrets"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // 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("GetOrgsIDSecrets", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all secret keys for an organization /// /// Thrown when fails to make API call /// The organization ID. /// OpenTracing span context (optional) /// ApiResponse of SecretKeysResponse public RestResponse GetOrgsIDSecretsWithIRestResponse(string orgID, string zapTraceSpan = null) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->GetOrgsIDSecrets"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // 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("GetOrgsIDSecrets", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// List all secret keys for an organization /// /// Thrown when fails to make API call /// The organization ID. /// OpenTracing span context (optional) /// ApiResponse of SecretKeysResponse public RestRequest GetOrgsIDSecretsWithRestRequest(string orgID, string zapTraceSpan = null) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->GetOrgsIDSecrets"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // 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 secret keys for an organization /// /// Thrown when fails to make API call /// The organization ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of SecretKeysResponse public async System.Threading.Tasks.Task GetOrgsIDSecretsAsync(string orgID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await GetOrgsIDSecretsAsyncWithHttpInfo(orgID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// List all secret keys for an organization /// /// Thrown when fails to make API call /// The organization ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (SecretKeysResponse) public async System.Threading.Tasks.Task> GetOrgsIDSecretsAsyncWithHttpInfo( string orgID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await GetOrgsIDSecretsAsyncWithIRestResponse(orgID, zapTraceSpan, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("GetOrgsIDSecrets", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (SecretKeysResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(SecretKeysResponse))); } /// /// List all secret keys for an organization /// /// Thrown when fails to make API call /// The organization ID. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (SecretKeysResponse) public async System.Threading.Tasks.Task GetOrgsIDSecretsAsyncWithIRestResponse(string orgID, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->GetOrgsIDSecrets"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // 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("GetOrgsIDSecrets", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Update secrets in an organization /// /// Thrown when fails to make API call /// The organization ID. /// Secret key value pairs to update/add /// OpenTracing span context (optional) /// public void PatchOrgsIDSecrets(string orgID, Dictionary requestBody, string zapTraceSpan = null) { PatchOrgsIDSecretsWithHttpInfo(orgID, requestBody, zapTraceSpan); } /// /// Update secrets in an organization /// /// Thrown when fails to make API call /// The organization ID. /// Secret key value pairs to update/add /// OpenTracing span context (optional) /// ApiResponse of Object(void) public ApiResponse PatchOrgsIDSecretsWithHttpInfo(string orgID, Dictionary requestBody, string zapTraceSpan = null) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->PatchOrgsIDSecrets"); } // verify the required parameter 'requestBody' is set if (requestBody == null) { throw new ApiException(400, "Missing required parameter 'requestBody' when calling SecretsService->PatchOrgsIDSecrets"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets"; 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 (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (requestBody != null && requestBody.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(requestBody); // http body (model) parameter } else { localVarPostBody = requestBody; // 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("PatchOrgsIDSecrets", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Update secrets in an organization /// /// Thrown when fails to make API call /// The organization ID. /// Secret key value pairs to update/add /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of Object(void) public async System.Threading.Tasks.Task PatchOrgsIDSecretsWithIRestResponseAsync(string orgID, Dictionary requestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->PatchOrgsIDSecrets"); } // verify the required parameter 'requestBody' is set if (requestBody == null) { throw new ApiException(400, "Missing required parameter 'requestBody' when calling SecretsService->PatchOrgsIDSecrets"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets"; 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 (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (requestBody != null && requestBody.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(requestBody); // http body (model) parameter } else { localVarPostBody = requestBody; // 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("PatchOrgsIDSecrets", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Update secrets in an organization /// /// Thrown when fails to make API call /// The organization ID. /// Secret key value pairs to update/add /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestResponse PatchOrgsIDSecretsWithIRestResponse(string orgID, Dictionary requestBody, string zapTraceSpan = null) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->PatchOrgsIDSecrets"); } // verify the required parameter 'requestBody' is set if (requestBody == null) { throw new ApiException(400, "Missing required parameter 'requestBody' when calling SecretsService->PatchOrgsIDSecrets"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets"; 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 (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (requestBody != null && requestBody.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(requestBody); // http body (model) parameter } else { localVarPostBody = requestBody; // 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("PatchOrgsIDSecrets", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Update secrets in an organization /// /// Thrown when fails to make API call /// The organization ID. /// Secret key value pairs to update/add /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestRequest PatchOrgsIDSecretsWithRestRequest(string orgID, Dictionary requestBody, string zapTraceSpan = null) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->PatchOrgsIDSecrets"); } // verify the required parameter 'requestBody' is set if (requestBody == null) { throw new ApiException(400, "Missing required parameter 'requestBody' when calling SecretsService->PatchOrgsIDSecrets"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets"; 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 (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (requestBody != null && requestBody.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(requestBody); // http body (model) parameter } else { localVarPostBody = requestBody; // 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 secrets in an organization /// /// Thrown when fails to make API call /// The organization ID. /// Secret key value pairs to update/add /// OpenTracing span context (optional) /// Cancellation token /// Task of void public System.Threading.Tasks.Task PatchOrgsIDSecretsAsync(string orgID, Dictionary requestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default) { return PatchOrgsIDSecretsAsyncWithHttpInfo(orgID, requestBody, zapTraceSpan, cancellationToken); } /// /// Update secrets in an organization /// /// Thrown when fails to make API call /// The organization ID. /// Secret key value pairs to update/add /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse public async System.Threading.Tasks.Task> PatchOrgsIDSecretsAsyncWithHttpInfo(string orgID, Dictionary requestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PatchOrgsIDSecretsAsyncWithIRestResponse(orgID, requestBody, zapTraceSpan, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PatchOrgsIDSecrets", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Update secrets in an organization /// /// Thrown when fails to make API call /// The organization ID. /// Secret key value pairs to update/add /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse public async System.Threading.Tasks.Task PatchOrgsIDSecretsAsyncWithIRestResponse(string orgID, Dictionary requestBody, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->PatchOrgsIDSecrets"); } // verify the required parameter 'requestBody' is set if (requestBody == null) { throw new ApiException(400, "Missing required parameter 'requestBody' when calling SecretsService->PatchOrgsIDSecrets"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets"; 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 (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (requestBody != null && requestBody.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(requestBody); // http body (model) parameter } else { localVarPostBody = requestBody; // 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("PatchOrgsIDSecrets", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete secrets from an organization /// /// Thrown when fails to make API call /// The organization ID. /// Secret key to delete /// OpenTracing span context (optional) /// public void PostOrgsIDSecrets(string orgID, SecretKeys secretKeys, string zapTraceSpan = null) { PostOrgsIDSecretsWithHttpInfo(orgID, secretKeys, zapTraceSpan); } /// /// Delete secrets from an organization /// /// Thrown when fails to make API call /// The organization ID. /// Secret key to delete /// OpenTracing span context (optional) /// ApiResponse of Object(void) public ApiResponse PostOrgsIDSecretsWithHttpInfo(string orgID, SecretKeys secretKeys, string zapTraceSpan = null) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->PostOrgsIDSecrets"); } // verify the required parameter 'secretKeys' is set if (secretKeys == null) { throw new ApiException(400, "Missing required parameter 'secretKeys' when calling SecretsService->PostOrgsIDSecrets"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets/delete"; 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 (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (secretKeys != null && secretKeys.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(secretKeys); // http body (model) parameter } else { localVarPostBody = secretKeys; // 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("PostOrgsIDSecrets", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Delete secrets from an organization /// /// Thrown when fails to make API call /// The organization ID. /// Secret key to delete /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of Object(void) public async System.Threading.Tasks.Task PostOrgsIDSecretsWithIRestResponseAsync(string orgID, SecretKeys secretKeys, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->PostOrgsIDSecrets"); } // verify the required parameter 'secretKeys' is set if (secretKeys == null) { throw new ApiException(400, "Missing required parameter 'secretKeys' when calling SecretsService->PostOrgsIDSecrets"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets/delete"; 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 (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (secretKeys != null && secretKeys.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(secretKeys); // http body (model) parameter } else { localVarPostBody = secretKeys; // 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("PostOrgsIDSecrets", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete secrets from an organization /// /// Thrown when fails to make API call /// The organization ID. /// Secret key to delete /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestResponse PostOrgsIDSecretsWithIRestResponse(string orgID, SecretKeys secretKeys, string zapTraceSpan = null) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->PostOrgsIDSecrets"); } // verify the required parameter 'secretKeys' is set if (secretKeys == null) { throw new ApiException(400, "Missing required parameter 'secretKeys' when calling SecretsService->PostOrgsIDSecrets"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets/delete"; 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 (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (secretKeys != null && secretKeys.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(secretKeys); // http body (model) parameter } else { localVarPostBody = secretKeys; // 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("PostOrgsIDSecrets", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Delete secrets from an organization /// /// Thrown when fails to make API call /// The organization ID. /// Secret key to delete /// OpenTracing span context (optional) /// ApiResponse of Object(void) public RestRequest PostOrgsIDSecretsWithRestRequest(string orgID, SecretKeys secretKeys, string zapTraceSpan = null) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->PostOrgsIDSecrets"); } // verify the required parameter 'secretKeys' is set if (secretKeys == null) { throw new ApiException(400, "Missing required parameter 'secretKeys' when calling SecretsService->PostOrgsIDSecrets"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets/delete"; 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 (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (secretKeys != null && secretKeys.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(secretKeys); // http body (model) parameter } else { localVarPostBody = secretKeys; // 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); } /// /// Delete secrets from an organization /// /// Thrown when fails to make API call /// The organization ID. /// Secret key to delete /// OpenTracing span context (optional) /// Cancellation token /// Task of void public System.Threading.Tasks.Task PostOrgsIDSecretsAsync(string orgID, SecretKeys secretKeys, string zapTraceSpan = null, CancellationToken cancellationToken = default) { return PostOrgsIDSecretsAsyncWithHttpInfo(orgID, secretKeys, zapTraceSpan, cancellationToken); } /// /// Delete secrets from an organization /// /// Thrown when fails to make API call /// The organization ID. /// Secret key to delete /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse public async System.Threading.Tasks.Task> PostOrgsIDSecretsAsyncWithHttpInfo(string orgID, SecretKeys secretKeys, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PostOrgsIDSecretsAsyncWithIRestResponse(orgID, secretKeys, zapTraceSpan, cancellationToken) .ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostOrgsIDSecrets", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Delete secrets from an organization /// /// Thrown when fails to make API call /// The organization ID. /// Secret key to delete /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse public async System.Threading.Tasks.Task PostOrgsIDSecretsAsyncWithIRestResponse(string orgID, SecretKeys secretKeys, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'orgID' is set if (orgID == null) { throw new ApiException(400, "Missing required parameter 'orgID' when calling SecretsService->PostOrgsIDSecrets"); } // verify the required parameter 'secretKeys' is set if (secretKeys == null) { throw new ApiException(400, "Missing required parameter 'secretKeys' when calling SecretsService->PostOrgsIDSecrets"); } var localVarPath = "/api/v2/orgs/{orgID}/secrets/delete"; 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 (orgID != null) { localVarPathParams.Add("orgID", Configuration.ApiClient.ParameterToString(orgID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (secretKeys != null && secretKeys.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(secretKeys); // http body (model) parameter } else { localVarPostBody = secretKeys; // 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("PostOrgsIDSecrets", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } } }