/// <summary> /// getRecordsForMachine /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="getRecordsForMachineDTO">getRecordsForMachineDTO</param> /// <returns>Task of MachineDataRecordsDTO</returns> public async System.Threading.Tasks.Task <MachineDataRecordsDTO> GetRecordsForMachineUsingPOSTAsync(GetRecordsForMachineDTO getRecordsForMachineDTO) { ApiResponse <MachineDataRecordsDTO> localVarResponse = await GetRecordsForMachineUsingPOSTAsyncWithHttpInfo(getRecordsForMachineDTO); return(localVarResponse.Data); }
/// <summary> /// getRecordsForMachine /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="getRecordsForMachineDTO">getRecordsForMachineDTO</param> /// <returns>Task of ApiResponse (MachineDataRecordsDTO)</returns> public async System.Threading.Tasks.Task <ApiResponse <MachineDataRecordsDTO> > GetRecordsForMachineUsingPOSTAsyncWithHttpInfo(GetRecordsForMachineDTO getRecordsForMachineDTO) { // verify the required parameter 'getRecordsForMachineDTO' is set if (getRecordsForMachineDTO == null) { throw new ApiException(400, "Missing required parameter 'getRecordsForMachineDTO' when calling ReaddatacontrollerApi->GetRecordsForMachineUsingPOST"); } var localVarPath = "/api/v1/data/machine"; var localVarPathParams = new Dictionary <String, String>(); var localVarQueryParams = new Dictionary <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); } // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json localVarPathParams.Add("format", "json"); if (getRecordsForMachineDTO != null && getRecordsForMachineDTO.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(getRecordsForMachineDTO); // http body (model) parameter } else { localVarPostBody = getRecordsForMachineDTO; // byte array } // 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("GetRecordsForMachineUsingPOST", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <MachineDataRecordsDTO>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (MachineDataRecordsDTO)Configuration.ApiClient.Deserialize(localVarResponse, typeof(MachineDataRecordsDTO)))); }
/// <summary> /// getRecordsForMachine /// </summary> /// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="getRecordsForMachineDTO">getRecordsForMachineDTO</param> /// <returns>MachineDataRecordsDTO</returns> public MachineDataRecordsDTO GetRecordsForMachineUsingPOST(GetRecordsForMachineDTO getRecordsForMachineDTO) { ApiResponse <MachineDataRecordsDTO> localVarResponse = GetRecordsForMachineUsingPOSTWithHttpInfo(getRecordsForMachineDTO); return(localVarResponse.Data); }