/// <summary> /// Add Penalty Add a penalty which can be added as an option to a work order and applied during the approval process to lower the amount paid to the provider pending a condition is met. /// </summary> /// <exception cref="FieldNation.SDK.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="penalty">JSON Model</param> /// <returns>Task of PayModifier</returns> public async System.Threading.Tasks.Task <PayModifier> AddPenaltyAsync(PayModifier penalty) { ApiResponse <PayModifier> localVarResponse = await AddPenaltyAsyncWithHttpInfo(penalty); return(localVarResponse.Data); }
/// <summary> /// Add Penalty Add a penalty which can be added as an option to a work order and applied during the approval process to lower the amount paid to the provider pending a condition is met. /// </summary> /// <exception cref="FieldNation.SDK.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="penalty">JSON Model</param> /// <returns>Task of ApiResponse (PayModifier)</returns> public async System.Threading.Tasks.Task <ApiResponse <PayModifier> > AddPenaltyAsyncWithHttpInfo(PayModifier penalty) { // verify the required parameter 'penalty' is set if (penalty == null) { throw new ApiException(400, "Missing required parameter 'penalty' when calling PenaltyApi->AddPenalty"); } var localVarPath = "/penalties"; 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", "application/x-www-form-urlencoded", "multipart/form-data" }; 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 (penalty != null && penalty.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(penalty); // http body (model) parameter } else { localVarPostBody = penalty; // 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("AddPenalty", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <PayModifier>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (PayModifier)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PayModifier)))); }
/// <summary> /// Add Penalty Add a penalty which can be added as an option to a work order and applied during the approval process to lower the amount paid to the provider pending a condition is met. /// </summary> /// <exception cref="FieldNation.SDK.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="penalty">JSON Model</param> /// <returns>PayModifier</returns> public PayModifier AddPenalty(PayModifier penalty) { ApiResponse <PayModifier> localVarResponse = AddPenaltyWithHttpInfo(penalty); return(localVarResponse.Data); }