|
40 | 40 | import com.pandadoc.client.models.DocumentStatusResponse; |
41 | 41 | import com.pandadoc.client.models.DocumentTransferAllOwnershipRequest; |
42 | 42 | import com.pandadoc.client.models.DocumentTransferOwnershipRequest; |
| 43 | +import com.pandadoc.client.models.DocumentUpdateRequest; |
43 | 44 | import java.io.File; |
44 | 45 | import com.pandadoc.client.models.LinkedObjectCreateRequest; |
45 | 46 | import com.pandadoc.client.models.LinkedObjectCreateResponse; |
@@ -2523,4 +2524,157 @@ public okhttp3.Call transferDocumentOwnershipAsync(String id, DocumentTransferOw |
2523 | 2524 | localVarApiClient.executeAsync(localVarCall, _callback); |
2524 | 2525 | return localVarCall; |
2525 | 2526 | } |
| 2527 | + /** |
| 2528 | + * Build call for updateDocument |
| 2529 | + * @param id Document ID (required) |
| 2530 | + * @param documentUpdateRequest (required) |
| 2531 | + * @param _callback Callback for upload/download progress |
| 2532 | + * @return Call to execute |
| 2533 | + * @throws ApiException If fail to serialize the request body object |
| 2534 | + * @http.response.details |
| 2535 | + <table summary="Response Details" border="1"> |
| 2536 | + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 2537 | + <tr><td> 204 </td><td> No content </td><td> - </td></tr> |
| 2538 | + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> |
| 2539 | + <tr><td> 401 </td><td> Authentication error </td><td> - </td></tr> |
| 2540 | + <tr><td> 403 </td><td> Permission error </td><td> - </td></tr> |
| 2541 | + <tr><td> 404 </td><td> Not found </td><td> - </td></tr> |
| 2542 | + <tr><td> 429 </td><td> Too Many Requests </td><td> - </td></tr> |
| 2543 | + </table> |
| 2544 | + */ |
| 2545 | + public okhttp3.Call updateDocumentCall(String id, DocumentUpdateRequest documentUpdateRequest, final ApiCallback _callback) throws ApiException { |
| 2546 | + String basePath = null; |
| 2547 | + |
| 2548 | + // Operation Servers |
| 2549 | + String[] localBasePaths = new String[] { }; |
| 2550 | + |
| 2551 | + // Determine Base Path to Use |
| 2552 | + if (localCustomBaseUrl != null){ |
| 2553 | + basePath = localCustomBaseUrl; |
| 2554 | + } else if ( localBasePaths.length > 0 ) { |
| 2555 | + basePath = localBasePaths[localHostIndex]; |
| 2556 | + } else { |
| 2557 | + basePath = null; |
| 2558 | + } |
| 2559 | + |
| 2560 | + Object localVarPostBody = documentUpdateRequest; |
| 2561 | + |
| 2562 | + // create path and map variables |
| 2563 | + String localVarPath = "/public/v1/documents/{id}" |
| 2564 | + .replaceAll("\\{" + "id" + "\\}", localVarApiClient.escapeString(id.toString())); |
| 2565 | + |
| 2566 | + List<Pair> localVarQueryParams = new ArrayList<Pair>(); |
| 2567 | + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); |
| 2568 | + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); |
| 2569 | + Map<String, String> localVarCookieParams = new HashMap<String, String>(); |
| 2570 | + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); |
| 2571 | + |
| 2572 | + final String[] localVarAccepts = { |
| 2573 | + "application/json" |
| 2574 | + }; |
| 2575 | + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); |
| 2576 | + if (localVarAccept != null) { |
| 2577 | + localVarHeaderParams.put("Accept", localVarAccept); |
| 2578 | + } |
| 2579 | + |
| 2580 | + final String[] localVarContentTypes = { |
| 2581 | + "application/json" |
| 2582 | + }; |
| 2583 | + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); |
| 2584 | + if (localVarContentType != null) { |
| 2585 | + localVarHeaderParams.put("Content-Type", localVarContentType); |
| 2586 | + } |
| 2587 | + |
| 2588 | + String[] localVarAuthNames = new String[] { "apiKey", "oauth2" }; |
| 2589 | + return localVarApiClient.buildCall(basePath, localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); |
| 2590 | + } |
| 2591 | + |
| 2592 | + @SuppressWarnings("rawtypes") |
| 2593 | + private okhttp3.Call updateDocumentValidateBeforeCall(String id, DocumentUpdateRequest documentUpdateRequest, final ApiCallback _callback) throws ApiException { |
| 2594 | + |
| 2595 | + // verify the required parameter 'id' is set |
| 2596 | + if (id == null) { |
| 2597 | + throw new ApiException("Missing the required parameter 'id' when calling updateDocument(Async)"); |
| 2598 | + } |
| 2599 | + |
| 2600 | + // verify the required parameter 'documentUpdateRequest' is set |
| 2601 | + if (documentUpdateRequest == null) { |
| 2602 | + throw new ApiException("Missing the required parameter 'documentUpdateRequest' when calling updateDocument(Async)"); |
| 2603 | + } |
| 2604 | + |
| 2605 | + |
| 2606 | + okhttp3.Call localVarCall = updateDocumentCall(id, documentUpdateRequest, _callback); |
| 2607 | + return localVarCall; |
| 2608 | + |
| 2609 | + } |
| 2610 | + |
| 2611 | + /** |
| 2612 | + * Update Document only in the draft status |
| 2613 | + * |
| 2614 | + * @param id Document ID (required) |
| 2615 | + * @param documentUpdateRequest (required) |
| 2616 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 2617 | + * @http.response.details |
| 2618 | + <table summary="Response Details" border="1"> |
| 2619 | + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 2620 | + <tr><td> 204 </td><td> No content </td><td> - </td></tr> |
| 2621 | + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> |
| 2622 | + <tr><td> 401 </td><td> Authentication error </td><td> - </td></tr> |
| 2623 | + <tr><td> 403 </td><td> Permission error </td><td> - </td></tr> |
| 2624 | + <tr><td> 404 </td><td> Not found </td><td> - </td></tr> |
| 2625 | + <tr><td> 429 </td><td> Too Many Requests </td><td> - </td></tr> |
| 2626 | + </table> |
| 2627 | + */ |
| 2628 | + public void updateDocument(String id, DocumentUpdateRequest documentUpdateRequest) throws ApiException { |
| 2629 | + updateDocumentWithHttpInfo(id, documentUpdateRequest); |
| 2630 | + } |
| 2631 | + |
| 2632 | + /** |
| 2633 | + * Update Document only in the draft status |
| 2634 | + * |
| 2635 | + * @param id Document ID (required) |
| 2636 | + * @param documentUpdateRequest (required) |
| 2637 | + * @return ApiResponse<Void> |
| 2638 | + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body |
| 2639 | + * @http.response.details |
| 2640 | + <table summary="Response Details" border="1"> |
| 2641 | + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 2642 | + <tr><td> 204 </td><td> No content </td><td> - </td></tr> |
| 2643 | + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> |
| 2644 | + <tr><td> 401 </td><td> Authentication error </td><td> - </td></tr> |
| 2645 | + <tr><td> 403 </td><td> Permission error </td><td> - </td></tr> |
| 2646 | + <tr><td> 404 </td><td> Not found </td><td> - </td></tr> |
| 2647 | + <tr><td> 429 </td><td> Too Many Requests </td><td> - </td></tr> |
| 2648 | + </table> |
| 2649 | + */ |
| 2650 | + public ApiResponse<Void> updateDocumentWithHttpInfo(String id, DocumentUpdateRequest documentUpdateRequest) throws ApiException { |
| 2651 | + okhttp3.Call localVarCall = updateDocumentValidateBeforeCall(id, documentUpdateRequest, null); |
| 2652 | + return localVarApiClient.execute(localVarCall); |
| 2653 | + } |
| 2654 | + |
| 2655 | + /** |
| 2656 | + * Update Document only in the draft status (asynchronously) |
| 2657 | + * |
| 2658 | + * @param id Document ID (required) |
| 2659 | + * @param documentUpdateRequest (required) |
| 2660 | + * @param _callback The callback to be executed when the API call finishes |
| 2661 | + * @return The request call |
| 2662 | + * @throws ApiException If fail to process the API call, e.g. serializing the request body object |
| 2663 | + * @http.response.details |
| 2664 | + <table summary="Response Details" border="1"> |
| 2665 | + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> |
| 2666 | + <tr><td> 204 </td><td> No content </td><td> - </td></tr> |
| 2667 | + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> |
| 2668 | + <tr><td> 401 </td><td> Authentication error </td><td> - </td></tr> |
| 2669 | + <tr><td> 403 </td><td> Permission error </td><td> - </td></tr> |
| 2670 | + <tr><td> 404 </td><td> Not found </td><td> - </td></tr> |
| 2671 | + <tr><td> 429 </td><td> Too Many Requests </td><td> - </td></tr> |
| 2672 | + </table> |
| 2673 | + */ |
| 2674 | + public okhttp3.Call updateDocumentAsync(String id, DocumentUpdateRequest documentUpdateRequest, final ApiCallback<Void> _callback) throws ApiException { |
| 2675 | + |
| 2676 | + okhttp3.Call localVarCall = updateDocumentValidateBeforeCall(id, documentUpdateRequest, _callback); |
| 2677 | + localVarApiClient.executeAsync(localVarCall, _callback); |
| 2678 | + return localVarCall; |
| 2679 | + } |
2526 | 2680 | } |
0 commit comments