Skip to content

Commit ef7eb66

Browse files
authored
v5.3.0 (#14)
- "Sender" parameter is added to the document send endpoint - Add a new endpoint "document update"
1 parent f9d04f9 commit ef7eb66

14 files changed

+757
-10
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Add this dependency to your project's POM:
3535
<dependency>
3636
<groupId>com.pandadoc</groupId>
3737
<artifactId>pandadoc-java-client</artifactId>
38-
<version>5.2.0</version>
38+
<version>5.3.0</version>
3939
<scope>compile</scope>
4040
</dependency>
4141
```
@@ -45,7 +45,7 @@ Add this dependency to your project's POM:
4545
Add this dependency to your project's build file:
4646

4747
```groovy
48-
compile "com.pandadoc:pandadoc-java-client:5.2.0"
48+
compile "com.pandadoc:pandadoc-java-client:5.3.0"
4949
```
5050

5151
### Others
@@ -58,7 +58,7 @@ mvn clean package
5858

5959
Then manually install the following JARs:
6060

61-
- `target/pandadoc-java-client-5.2.0.jar`
61+
- `target/pandadoc-java-client-5.3.0.jar`
6262
- `target/lib/*.jar`
6363

6464
## Getting Started
@@ -145,6 +145,7 @@ Class | Method | HTTP request | Description
145145
*DocumentsApi* | [**statusDocument**](docs/DocumentsApi.md#statusDocument) | **GET** /public/v1/documents/{id} | Document status
146146
*DocumentsApi* | [**transferAllDocumentsOwnership**](docs/DocumentsApi.md#transferAllDocumentsOwnership) | **PATCH** /public/v1/documents/ownership | Transfer all documents ownership
147147
*DocumentsApi* | [**transferDocumentOwnership**](docs/DocumentsApi.md#transferDocumentOwnership) | **PATCH** /public/v1/documents/{id}/ownership | Update document ownership
148+
*DocumentsApi* | [**updateDocument**](docs/DocumentsApi.md#updateDocument) | **PATCH** /public/v1/documents/{id} | Update Document only in the draft status
148149
*FoldersApiApi* | [**createDocumentFolder**](docs/FoldersApiApi.md#createDocumentFolder) | **POST** /public/v1/documents/folders | Create Documents Folder
149150
*FoldersApiApi* | [**createTemplateFolder**](docs/FoldersApiApi.md#createTemplateFolder) | **POST** /public/v1/templates/folders | Create Templates Folder
150151
*FoldersApiApi* | [**listDocumentFolders**](docs/FoldersApiApi.md#listDocumentFolders) | **GET** /public/v1/documents/folders | List Documents Folders

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apply plugin: 'java'
44
apply plugin: 'com.diffplug.spotless'
55

66
group = 'com.pandadoc'
7-
version = '5.2.0'
7+
version = '5.3.0'
88

99
buildscript {
1010
repositories {

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
22
settings(
33
organization := "com.pandadoc",
44
name := "pandadoc-java-client",
5-
version := "5.2.0",
5+
version := "5.3.0",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),

docs/DocumentSendRequest.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
1010
**message** | **String** | A message that will be sent by email with a link to a document to sign. | [optional]
1111
**subject** | **String** | Value that will be used as the email subject. | [optional]
1212
**silent** | **Boolean** | Disables sent, viewed, comment, and completed email notifications for document recipients and the document sender. By default, notifications emails are sent for specific actions. If set as true, it won&#39;t affect the \&quot;Approve document\&quot; email notification sent to the Approver. | [optional]
13+
**sender** | **Map&lt;String, String&gt;** | You can set a sender of a document as an &#x60;email&#x60; or &#x60;membership_id&#x60; | [optional]
1314

1415

1516

docs/DocumentUpdateRequest.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
3+
# DocumentUpdateRequest
4+
5+
6+
## Properties
7+
8+
Name | Type | Description | Notes
9+
------------ | ------------- | ------------- | -------------
10+
**recipients** | [**List&lt;DocumentUpdateRequestRecipients&gt;**](DocumentUpdateRequestRecipients.md) | The list of recipients you&#39;re sending the document to. The ID or email are required. If the ID is passed, an existing recipient will be updated. If the email is passed, a new recipient will be added to CC. | [optional]
11+
**fields** | **Object** | You may pass a list of fields/values which exist in a document. Please use &#x60;Merge Field&#x60; property of the fields like the key. | [optional]
12+
**tokens** | [**List&lt;DocumentCreateByTemplateRequestTokens&gt;**](DocumentCreateByTemplateRequestTokens.md) | You can pass a list of tokens/values. If a token name exists in a document then the value will be updated. Otherwise, a new token will be added to the document. | [optional]
13+
**metadata** | **Object** | You can pass arbitrary data in the key-value format to associate custom information with a document. This information is returned in any API requests for the document details by id. If metadata exists in a document then the value will be updated. Otherwise, metadata will be added to the document. | [optional]
14+
**pricingTables** | [**List&lt;PricingTableRequest&gt;**](PricingTableRequest.md) | | [optional]
15+
16+
17+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
3+
# DocumentUpdateRequestRecipients
4+
5+
6+
## Properties
7+
8+
Name | Type | Description | Notes
9+
------------ | ------------- | ------------- | -------------
10+
**id** | **String** | | [optional]
11+
**email** | **String** | | [optional]
12+
**firstName** | **String** | | [optional]
13+
**lastName** | **String** | | [optional]
14+
15+
16+

docs/DocumentsApi.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Method | HTTP request | Description
1919
[**statusDocument**](DocumentsApi.md#statusDocument) | **GET** /public/v1/documents/{id} | Document status
2020
[**transferAllDocumentsOwnership**](DocumentsApi.md#transferAllDocumentsOwnership) | **PATCH** /public/v1/documents/ownership | Transfer all documents ownership
2121
[**transferDocumentOwnership**](DocumentsApi.md#transferDocumentOwnership) | **PATCH** /public/v1/documents/{id}/ownership | Update document ownership
22+
[**updateDocument**](DocumentsApi.md#updateDocument) | **PATCH** /public/v1/documents/{id} | Update Document only in the draft status
2223

2324

2425

@@ -1384,3 +1385,90 @@ null (empty response body)
13841385
| **409** | Conflict | - |
13851386
| **429** | Too Many Requests | - |
13861387

1388+
1389+
## updateDocument
1390+
1391+
> updateDocument(id, documentUpdateRequest)
1392+
1393+
Update Document only in the draft status
1394+
1395+
### Example
1396+
1397+
```java
1398+
// Import classes:
1399+
import com.pandadoc.client.ApiClient;
1400+
import com.pandadoc.client.ApiException;
1401+
import com.pandadoc.client.Configuration;
1402+
import com.pandadoc.client.auth.*;
1403+
import com.pandadoc.client.models.*;
1404+
import com.pandadoc.client.api.DocumentsApi;
1405+
1406+
import java.util.Arrays;
1407+
import java.io.File;
1408+
import java.util.List;
1409+
1410+
public class Example {
1411+
public static void main(String[] args) {
1412+
ApiClient defaultClient = Configuration.getDefaultApiClient();
1413+
defaultClient.setBasePath("https://api.pandadoc.com");
1414+
1415+
// Configure API key authorization: apiKey
1416+
ApiKeyAuth apiKey = (ApiKeyAuth) defaultClient.getAuthentication("apiKey");
1417+
apiKey.setApiKey("YOUR API KEY");
1418+
// Uncomment the following line to set a prefix for the API key, e.g. "API-Key" (defaults to null)
1419+
//apiKey.setApiKeyPrefix("API-Key");
1420+
1421+
// Configure OAuth2 access token for authorization: oauth2
1422+
// OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
1423+
// oauth2.setAccessToken("YOUR ACCESS TOKEN");
1424+
1425+
DocumentsApi apiInstance = new DocumentsApi(defaultClient);
1426+
// String | Document ID
1427+
String id = "BhVzRcxH9Z2LgfPPGXFUBa";
1428+
// DocumentUpdateRequest |
1429+
DocumentUpdateRequest documentUpdateRequest = new DocumentUpdateRequest();
1430+
try {
1431+
apiInstance.updateDocument(id, documentUpdateRequest);
1432+
} catch (ApiException e) {
1433+
System.err.println("Exception when calling DocumentsApi#updateDocument");
1434+
System.err.println("Status code: " + e.getCode());
1435+
System.err.println("Reason: " + e.getResponseBody());
1436+
System.err.println("Response headers: " + e.getResponseHeaders());
1437+
e.printStackTrace();
1438+
}
1439+
}
1440+
}
1441+
```
1442+
1443+
### Parameters
1444+
1445+
1446+
Name | Type | Description | Notes
1447+
------------- | ------------- | ------------- | -------------
1448+
**id** | **String**| Document ID |
1449+
**documentUpdateRequest** | [**DocumentUpdateRequest**](DocumentUpdateRequest.md)| |
1450+
1451+
### Return type
1452+
1453+
null (empty response body)
1454+
1455+
### Authorization
1456+
1457+
[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2)
1458+
1459+
### HTTP request headers
1460+
1461+
- **Content-Type**: application/json
1462+
- **Accept**: application/json
1463+
1464+
1465+
### HTTP response details
1466+
| Status code | Description | Response headers |
1467+
|-------------|-------------|------------------|
1468+
| **204** | No content | - |
1469+
| **400** | Bad Request | - |
1470+
| **401** | Authentication error | - |
1471+
| **403** | Permission error | - |
1472+
| **404** | Not found | - |
1473+
| **429** | Too Many Requests | - |
1474+

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>pandadoc-java-client</artifactId>
66
<packaging>jar</packaging>
77
<name>pandadoc-java-client</name>
8-
<version>5.2.0</version>
8+
<version>5.3.0</version>
99
<url>https://github.com/PandaDoc/pandadoc-api-java-client</url>
1010
<description>PandaDoc SDK spans a broad range of functionality to help you build incredible documents automation experiences inside your product.</description>
1111
<scm>

src/main/java/com/pandadoc/client/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ private void init() {
204204
json = new JSON();
205205

206206
// Set default User-Agent.
207-
setUserAgent("pandadoc_java_client/5.2.0");
207+
setUserAgent("pandadoc_java_client/5.3.0");
208208

209209
authentications = new HashMap<String, Authentication>();
210210
}

src/main/java/com/pandadoc/client/api/DocumentsApi.java

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import com.pandadoc.client.models.DocumentStatusResponse;
4141
import com.pandadoc.client.models.DocumentTransferAllOwnershipRequest;
4242
import com.pandadoc.client.models.DocumentTransferOwnershipRequest;
43+
import com.pandadoc.client.models.DocumentUpdateRequest;
4344
import java.io.File;
4445
import com.pandadoc.client.models.LinkedObjectCreateRequest;
4546
import com.pandadoc.client.models.LinkedObjectCreateResponse;
@@ -2523,4 +2524,157 @@ public okhttp3.Call transferDocumentOwnershipAsync(String id, DocumentTransferOw
25232524
localVarApiClient.executeAsync(localVarCall, _callback);
25242525
return localVarCall;
25252526
}
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&lt;Void&gt;
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+
}
25262680
}

0 commit comments

Comments
 (0)