public SimulateOrderErpResponse SimulateOrder(SimulateOrderErpRequest request) { var payLoad = new SimulateOrderRequestRoot(request); var backup = new BackupLogEntry(payLoad, nameof(SimulateOrder)); LogRequest(payLoad, nameof(SimulateOrder)); var result = _erpApi.SimulateOrderPost(payLoad); backup.AddResponse(result); _repository.InsertOne(backup); LogResponse(result); return(result.ToResponse()); }
/// <summary> /// SimulateOrderProcess /// </summary> /// <exception cref="ApiException">Thrown when fails to make API call</exception> /// <param name="simulateOrderRequest2"></param> /// <returns>Task of SimulateOrderResponseRoot</returns> public async System.Threading.Tasks.Task <SimulateOrderResponseRoot> SimulateOrderPostAsync(SimulateOrderRequestRoot simulateOrderRequest2) { ApiResponse <SimulateOrderResponseRoot> localVarResponse = await SimulateOrderPostAsyncWithHttpInfo(simulateOrderRequest2); return(localVarResponse.Data); }
/// <summary> /// SimulateOrderProcess /// </summary> /// <exception cref="ApiException">Thrown when fails to make API call</exception> /// <param name="simulateOrderRequest2"></param> /// <returns>Task of ApiResponse (SimulateOrderResponseRoot)</returns> public async System.Threading.Tasks.Task <ApiResponse <SimulateOrderResponseRoot> > SimulateOrderPostAsyncWithHttpInfo(SimulateOrderRequestRoot simulateOrderRequest2) { // verify the required parameter 'simulateOrderRequest2' is set if (simulateOrderRequest2 == null) { throw new ApiException(400, "Missing required parameter 'simulateOrderRequest2' when calling ErpApi->SimulateOrderPost"); } var localVarPath = "/simulateOrder"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new List <KeyValuePair <String, String> >(); var localVarHeaderParams = new Dictionary <String, String>(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header String[] localVarHttpHeaderAccepts = new String[] { "application/json" }; String localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } if (simulateOrderRequest2 != null && simulateOrderRequest2.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(simulateOrderRequest2); // http body (model) parameter } else { localVarPostBody = simulateOrderRequest2; // byte array } // authentication (basic) required // http basic authentication required if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password)) { localVarHeaderParams["Authorization"] = "Basic " + ApiClient.Base64Encode(Configuration.Username + ":" + Configuration.Password); } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("SimulateOrderPost", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <SimulateOrderResponseRoot>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (SimulateOrderResponseRoot)Configuration.ApiClient.Deserialize(localVarResponse, typeof(SimulateOrderResponseRoot)))); }
/// <summary> /// SimulateOrderProcess /// </summary> /// <exception cref="ApiException">Thrown when fails to make API call</exception> /// <param name="simulateOrderRequest2"></param> /// <returns>SimulateOrderResponseRoot</returns> public SimulateOrderResponseRoot SimulateOrderPost(SimulateOrderRequestRoot simulateOrderRequest2) { ApiResponse <SimulateOrderResponseRoot> localVarResponse = SimulateOrderPostWithHttpInfo(simulateOrderRequest2); return(localVarResponse.Data); }