/// <summary> /// Set up initial user, org and bucket Post an onboarding request to set up initial user, org and bucket. /// </summary> /// <exception cref="InfluxDB.Client.Api.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="onboardingRequest">Source to create</param> /// <param name="zapTraceSpan">OpenTracing span context (optional)</param> /// <returns>ApiResponse of OnboardingResponse</returns> public RestRequest PostSetupWithRestRequest(OnboardingRequest onboardingRequest, string zapTraceSpan = null) { // verify the required parameter 'onboardingRequest' is set if (onboardingRequest == null) { throw new ApiException(400, "Missing required parameter 'onboardingRequest' when calling SetupService->PostSetup"); } var localVarPath = "/api/v2/setup"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new List <KeyValuePair <String, String> >(); var localVarHeaderParams = new Dictionary <String, String>(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary <String, String>(); var localVarFileParams = new Dictionary <String, FileParameter>(); Object localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", this.Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (onboardingRequest != null && onboardingRequest.GetType() != typeof(byte[])) { localVarPostBody = this.Configuration.ApiClient.Serialize(onboardingRequest); // http body (model) parameter } else { localVarPostBody = onboardingRequest; // byte array } // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json" }; String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } return(this.Configuration.ApiClient.PrepareRequest(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType)); }
/// <summary> /// Set up initial user, org and bucket Post an onboarding request to set up initial user, org and bucket. /// </summary> /// <exception cref="InfluxDB.Client.Api.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="onboardingRequest">Source to create</param> /// <param name="zapTraceSpan">OpenTracing span context (optional)</param> /// <returns>ApiResponse of OnboardingResponse</returns> public async System.Threading.Tasks.Task <IRestResponse> PostSetupWithIRestResponseAsync(OnboardingRequest onboardingRequest, string zapTraceSpan = null) { // verify the required parameter 'onboardingRequest' is set if (onboardingRequest == null) { throw new ApiException(400, "Missing required parameter 'onboardingRequest' when calling SetupService->PostSetup"); } var localVarPath = "/api/v2/setup"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new List <KeyValuePair <String, String> >(); var localVarHeaderParams = new Dictionary <String, String>(this.Configuration.DefaultHeader); var localVarFormParams = new Dictionary <String, String>(); var localVarFileParams = new Dictionary <String, FileParameter>(); Object localVarPostBody = null; // to determine the Content-Type header String[] localVarHttpContentTypes = new String[] { "application/json" }; String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", this.Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (onboardingRequest != null && onboardingRequest.GetType() != typeof(byte[])) { localVarPostBody = this.Configuration.ApiClient.Serialize(onboardingRequest); // http body (model) parameter } else { localVarPostBody = onboardingRequest; // byte array } // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json" }; String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("PostSetup", localVarResponse); if (exception != null) { throw exception; } } return(localVarResponse); }