/// <summary> /// Register a Root CA Register a root CA as a secret. /// </summary> /// <exception cref="DevOpsVault.SDK.Core.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="body"> (optional)</param> /// <returns>Task of ApiResponse (SecretResponse)</returns> public async System.Threading.Tasks.Task <DevOpsVault.SDK.Core.Client.ApiResponse <SecretResponse> > RegisterRootAsyncWithHttpInfo(RootCASecret body = default(RootCASecret)) { DevOpsVault.SDK.Core.Client.RequestOptions localVarRequestOptions = new DevOpsVault.SDK.Core.Client.RequestOptions(); String[] _contentTypes = new String[] { "application/json" }; // to determine the Accept header String[] _accepts = new String[] { "application/json" }; foreach (var _contentType in _contentTypes) { localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); } foreach (var _accept in _accepts) { localVarRequestOptions.HeaderParameters.Add("Accept", _accept); } localVarRequestOptions.Data = body; // authentication (Bearer) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var localVarResponse = await this.AsynchronousClient.PostAsync <SecretResponse>("/pki/register", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("RegisterRoot", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// Register a Root CA Register a root CA as a secret. /// </summary> /// <exception cref="DevOpsVault.SDK.Core.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="body"> (optional)</param> /// <returns>ApiResponse of SecretResponse</returns> public DevOpsVault.SDK.Core.Client.ApiResponse <SecretResponse> RegisterRootWithHttpInfo(RootCASecret body = default(RootCASecret)) { DevOpsVault.SDK.Core.Client.RequestOptions localVarRequestOptions = new DevOpsVault.SDK.Core.Client.RequestOptions(); String[] _contentTypes = new String[] { "application/json" }; // to determine the Accept header String[] _accepts = new String[] { "application/json" }; var localVarContentType = DevOpsVault.SDK.Core.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = DevOpsVault.SDK.Core.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.Data = body; // authentication (Bearer) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var localVarResponse = this.Client.Post <SecretResponse>("/pki/register", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("RegisterRoot", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// Register a Root CA Register a root CA as a secret. /// </summary> /// <exception cref="DevOpsVault.SDK.Core.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="body"> (optional)</param> /// <returns>Task of SecretResponse</returns> public async System.Threading.Tasks.Task <SecretResponse> RegisterRootAsync(RootCASecret body = default(RootCASecret)) { DevOpsVault.SDK.Core.Client.ApiResponse <SecretResponse> localVarResponse = await RegisterRootAsyncWithHttpInfo(body); return(localVarResponse.Data); }
/// <summary> /// Register a Root CA Register a root CA as a secret. /// </summary> /// <exception cref="DevOpsVault.SDK.Core.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="body"> (optional)</param> /// <returns>SecretResponse</returns> public SecretResponse RegisterRoot(RootCASecret body = default(RootCASecret)) { DevOpsVault.SDK.Core.Client.ApiResponse <SecretResponse> localVarResponse = RegisterRootWithHttpInfo(body); return(localVarResponse.Data); }