Skip to content

Commit 56816a9

Browse files
authored
- Added 'separete_files' GET parameter for document download endpoint (#12)
- Added 'id' field to linked_objects
1 parent a3d2355 commit 56816a9

9 files changed

Lines changed: 83 additions & 31 deletions

File tree

README.md

Lines changed: 3 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.0.2</version>
38+
<version>5.1.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.0.2"
48+
compile "com.pandadoc:pandadoc-java-client:5.1.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.0.2.jar`
61+
- `target/pandadoc-java-client-5.1.0.jar`
6262
- `target/lib/*.jar`
6363

6464
## Getting Started

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.0.2'
7+
version = '5.1.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.0.2",
5+
version := "5.1.0",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),

docs/DocumentDetailsResponseLinkedObjects.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
1010
**provider** | **String** | | [optional]
1111
**entityType** | **String** | | [optional]
1212
**entityId** | **String** | | [optional]
13+
**id** | **String** | | [optional]
1314

1415

1516

docs/DocumentsApi.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ Name | Type | Description | Notes
625625

626626
## downloadDocument
627627

628-
> File downloadDocument(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText)
628+
> File downloadDocument(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText, separateFiles)
629629
630630
Document download
631631

@@ -670,8 +670,10 @@ public class Example {
670670
Float watermarkOpacity = 0.5F;
671671
// String | Specify watermark text.
672672
String watermarkText = "John Doe inc.";
673+
// Boolean | Set as `true` if you want to receive a zip file with all documents in separate when document transaction contains more than 1.
674+
Boolean separateFiles = true;
673675
try {
674-
File result = apiInstance.downloadDocument(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText);
676+
File result = apiInstance.downloadDocument(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText, separateFiles);
675677
System.out.println(result);
676678
} catch (ApiException e) {
677679
System.err.println("Exception when calling DocumentsApi#downloadDocument");
@@ -694,6 +696,7 @@ Name | Type | Description | Notes
694696
**watermarkFontSize** | **Integer**| Font size of the watermark. | [optional]
695697
**watermarkOpacity** | **Float**| In range 0.0-1.0 | [optional]
696698
**watermarkText** | **String**| Specify watermark text. | [optional]
699+
**separateFiles** | **Boolean**| Set as &#x60;true&#x60; if you want to receive a zip file with all documents in separate when document transaction contains more than 1. | [optional]
697700

698701
### Return type
699702

@@ -723,7 +726,7 @@ Name | Type | Description | Notes
723726

724727
## downloadProtectedDocument
725728

726-
> File downloadProtectedDocument(id)
729+
> File downloadProtectedDocument(id, separateFiles)
727730
728731
Download document protected
729732

@@ -762,8 +765,10 @@ public class Example {
762765
DocumentsApi apiInstance = new DocumentsApi(defaultClient);
763766
// String | Specify document ID.
764767
String id = "Mebvyy3NGsGBnY2rPLkH84";
768+
// Boolean | Set as `true` if you want to receive a zip file with all documents in separate when document transaction contains more than 1.
769+
Boolean separateFiles = true;
765770
try {
766-
File result = apiInstance.downloadProtectedDocument(id);
771+
File result = apiInstance.downloadProtectedDocument(id, separateFiles);
767772
System.out.println(result);
768773
} catch (ApiException e) {
769774
System.err.println("Exception when calling DocumentsApi#downloadProtectedDocument");
@@ -782,6 +787,7 @@ public class Example {
782787
Name | Type | Description | Notes
783788
------------- | ------------- | ------------- | -------------
784789
**id** | **String**| Specify document ID. |
790+
**separateFiles** | **Boolean**| Set as &#x60;true&#x60; if you want to receive a zip file with all documents in separate when document transaction contains more than 1. | [optional]
785791

786792
### Return type
787793

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.0.2</version>
8+
<version>5.1.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.0.2");
207+
setUserAgent("pandadoc_java_client/5.1.0");
208208

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

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

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,7 @@ public okhttp3.Call detailsDocumentAsync(String id, final ApiCallback<DocumentDe
11391139
* @param watermarkFontSize Font size of the watermark. (optional)
11401140
* @param watermarkOpacity In range 0.0-1.0 (optional)
11411141
* @param watermarkText Specify watermark text. (optional)
1142+
* @param separateFiles Set as &#x60;true&#x60; if you want to receive a zip file with all documents in separate when document transaction contains more than 1. (optional)
11421143
* @param _callback Callback for upload/download progress
11431144
* @return Call to execute
11441145
* @throws ApiException If fail to serialize the request body object
@@ -1154,7 +1155,7 @@ public okhttp3.Call detailsDocumentAsync(String id, final ApiCallback<DocumentDe
11541155
<tr><td> 429 </td><td> Too Many Requests </td><td> - </td></tr>
11551156
</table>
11561157
*/
1157-
public okhttp3.Call downloadDocumentCall(String id, String watermarkColor, Integer watermarkFontSize, Float watermarkOpacity, String watermarkText, final ApiCallback _callback) throws ApiException {
1158+
public okhttp3.Call downloadDocumentCall(String id, String watermarkColor, Integer watermarkFontSize, Float watermarkOpacity, String watermarkText, Boolean separateFiles, final ApiCallback _callback) throws ApiException {
11581159
String basePath = null;
11591160

11601161
// Operation Servers
@@ -1197,6 +1198,10 @@ public okhttp3.Call downloadDocumentCall(String id, String watermarkColor, Integ
11971198
localVarQueryParams.addAll(localVarApiClient.parameterToPair("watermark_text", watermarkText));
11981199
}
11991200

1201+
if (separateFiles != null) {
1202+
localVarQueryParams.addAll(localVarApiClient.parameterToPair("separate_files", separateFiles));
1203+
}
1204+
12001205
final String[] localVarAccepts = {
12011206
"application/pdf", "application/json"
12021207
};
@@ -1218,15 +1223,15 @@ public okhttp3.Call downloadDocumentCall(String id, String watermarkColor, Integ
12181223
}
12191224

12201225
@SuppressWarnings("rawtypes")
1221-
private okhttp3.Call downloadDocumentValidateBeforeCall(String id, String watermarkColor, Integer watermarkFontSize, Float watermarkOpacity, String watermarkText, final ApiCallback _callback) throws ApiException {
1226+
private okhttp3.Call downloadDocumentValidateBeforeCall(String id, String watermarkColor, Integer watermarkFontSize, Float watermarkOpacity, String watermarkText, Boolean separateFiles, final ApiCallback _callback) throws ApiException {
12221227

12231228
// verify the required parameter 'id' is set
12241229
if (id == null) {
12251230
throw new ApiException("Missing the required parameter 'id' when calling downloadDocument(Async)");
12261231
}
12271232

12281233

1229-
okhttp3.Call localVarCall = downloadDocumentCall(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText, _callback);
1234+
okhttp3.Call localVarCall = downloadDocumentCall(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText, separateFiles, _callback);
12301235
return localVarCall;
12311236

12321237
}
@@ -1239,6 +1244,7 @@ private okhttp3.Call downloadDocumentValidateBeforeCall(String id, String waterm
12391244
* @param watermarkFontSize Font size of the watermark. (optional)
12401245
* @param watermarkOpacity In range 0.0-1.0 (optional)
12411246
* @param watermarkText Specify watermark text. (optional)
1247+
* @param separateFiles Set as &#x60;true&#x60; if you want to receive a zip file with all documents in separate when document transaction contains more than 1. (optional)
12421248
* @return File
12431249
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
12441250
* @http.response.details
@@ -1253,8 +1259,8 @@ private okhttp3.Call downloadDocumentValidateBeforeCall(String id, String waterm
12531259
<tr><td> 429 </td><td> Too Many Requests </td><td> - </td></tr>
12541260
</table>
12551261
*/
1256-
public File downloadDocument(String id, String watermarkColor, Integer watermarkFontSize, Float watermarkOpacity, String watermarkText) throws ApiException {
1257-
ApiResponse<File> localVarResp = downloadDocumentWithHttpInfo(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText);
1262+
public File downloadDocument(String id, String watermarkColor, Integer watermarkFontSize, Float watermarkOpacity, String watermarkText, Boolean separateFiles) throws ApiException {
1263+
ApiResponse<File> localVarResp = downloadDocumentWithHttpInfo(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText, separateFiles);
12581264
return localVarResp.getData();
12591265
}
12601266

@@ -1266,6 +1272,7 @@ public File downloadDocument(String id, String watermarkColor, Integer watermark
12661272
* @param watermarkFontSize Font size of the watermark. (optional)
12671273
* @param watermarkOpacity In range 0.0-1.0 (optional)
12681274
* @param watermarkText Specify watermark text. (optional)
1275+
* @param separateFiles Set as &#x60;true&#x60; if you want to receive a zip file with all documents in separate when document transaction contains more than 1. (optional)
12691276
* @return ApiResponse&lt;File&gt;
12701277
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
12711278
* @http.response.details
@@ -1280,8 +1287,8 @@ public File downloadDocument(String id, String watermarkColor, Integer watermark
12801287
<tr><td> 429 </td><td> Too Many Requests </td><td> - </td></tr>
12811288
</table>
12821289
*/
1283-
public ApiResponse<File> downloadDocumentWithHttpInfo(String id, String watermarkColor, Integer watermarkFontSize, Float watermarkOpacity, String watermarkText) throws ApiException {
1284-
okhttp3.Call localVarCall = downloadDocumentValidateBeforeCall(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText, null);
1290+
public ApiResponse<File> downloadDocumentWithHttpInfo(String id, String watermarkColor, Integer watermarkFontSize, Float watermarkOpacity, String watermarkText, Boolean separateFiles) throws ApiException {
1291+
okhttp3.Call localVarCall = downloadDocumentValidateBeforeCall(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText, separateFiles, null);
12851292
Type localVarReturnType = new TypeToken<File>(){}.getType();
12861293
return localVarApiClient.execute(localVarCall, localVarReturnType);
12871294
}
@@ -1294,6 +1301,7 @@ public ApiResponse<File> downloadDocumentWithHttpInfo(String id, String watermar
12941301
* @param watermarkFontSize Font size of the watermark. (optional)
12951302
* @param watermarkOpacity In range 0.0-1.0 (optional)
12961303
* @param watermarkText Specify watermark text. (optional)
1304+
* @param separateFiles Set as &#x60;true&#x60; if you want to receive a zip file with all documents in separate when document transaction contains more than 1. (optional)
12971305
* @param _callback The callback to be executed when the API call finishes
12981306
* @return The request call
12991307
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
@@ -1309,16 +1317,17 @@ public ApiResponse<File> downloadDocumentWithHttpInfo(String id, String watermar
13091317
<tr><td> 429 </td><td> Too Many Requests </td><td> - </td></tr>
13101318
</table>
13111319
*/
1312-
public okhttp3.Call downloadDocumentAsync(String id, String watermarkColor, Integer watermarkFontSize, Float watermarkOpacity, String watermarkText, final ApiCallback<File> _callback) throws ApiException {
1320+
public okhttp3.Call downloadDocumentAsync(String id, String watermarkColor, Integer watermarkFontSize, Float watermarkOpacity, String watermarkText, Boolean separateFiles, final ApiCallback<File> _callback) throws ApiException {
13131321

1314-
okhttp3.Call localVarCall = downloadDocumentValidateBeforeCall(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText, _callback);
1322+
okhttp3.Call localVarCall = downloadDocumentValidateBeforeCall(id, watermarkColor, watermarkFontSize, watermarkOpacity, watermarkText, separateFiles, _callback);
13151323
Type localVarReturnType = new TypeToken<File>(){}.getType();
13161324
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
13171325
return localVarCall;
13181326
}
13191327
/**
13201328
* Build call for downloadProtectedDocument
13211329
* @param id Specify document ID. (required)
1330+
* @param separateFiles Set as &#x60;true&#x60; if you want to receive a zip file with all documents in separate when document transaction contains more than 1. (optional)
13221331
* @param _callback Callback for upload/download progress
13231332
* @return Call to execute
13241333
* @throws ApiException If fail to serialize the request body object
@@ -1333,7 +1342,7 @@ public okhttp3.Call downloadDocumentAsync(String id, String watermarkColor, Inte
13331342
<tr><td> 429 </td><td> Too Many Requests </td><td> - </td></tr>
13341343
</table>
13351344
*/
1336-
public okhttp3.Call downloadProtectedDocumentCall(String id, final ApiCallback _callback) throws ApiException {
1345+
public okhttp3.Call downloadProtectedDocumentCall(String id, Boolean separateFiles, final ApiCallback _callback) throws ApiException {
13371346
String basePath = null;
13381347

13391348
// Operation Servers
@@ -1360,6 +1369,10 @@ public okhttp3.Call downloadProtectedDocumentCall(String id, final ApiCallback _
13601369
Map<String, String> localVarCookieParams = new HashMap<String, String>();
13611370
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
13621371

1372+
if (separateFiles != null) {
1373+
localVarQueryParams.addAll(localVarApiClient.parameterToPair("separate_files", separateFiles));
1374+
}
1375+
13631376
final String[] localVarAccepts = {
13641377
"application/pdf", "application/json"
13651378
};
@@ -1381,15 +1394,15 @@ public okhttp3.Call downloadProtectedDocumentCall(String id, final ApiCallback _
13811394
}
13821395

13831396
@SuppressWarnings("rawtypes")
1384-
private okhttp3.Call downloadProtectedDocumentValidateBeforeCall(String id, final ApiCallback _callback) throws ApiException {
1397+
private okhttp3.Call downloadProtectedDocumentValidateBeforeCall(String id, Boolean separateFiles, final ApiCallback _callback) throws ApiException {
13851398

13861399
// verify the required parameter 'id' is set
13871400
if (id == null) {
13881401
throw new ApiException("Missing the required parameter 'id' when calling downloadProtectedDocument(Async)");
13891402
}
13901403

13911404

1392-
okhttp3.Call localVarCall = downloadProtectedDocumentCall(id, _callback);
1405+
okhttp3.Call localVarCall = downloadProtectedDocumentCall(id, separateFiles, _callback);
13931406
return localVarCall;
13941407

13951408
}
@@ -1398,6 +1411,7 @@ private okhttp3.Call downloadProtectedDocumentValidateBeforeCall(String id, fina
13981411
* Download document protected
13991412
* Download a signed PDF of a completed document
14001413
* @param id Specify document ID. (required)
1414+
* @param separateFiles Set as &#x60;true&#x60; if you want to receive a zip file with all documents in separate when document transaction contains more than 1. (optional)
14011415
* @return File
14021416
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
14031417
* @http.response.details
@@ -1411,15 +1425,16 @@ private okhttp3.Call downloadProtectedDocumentValidateBeforeCall(String id, fina
14111425
<tr><td> 429 </td><td> Too Many Requests </td><td> - </td></tr>
14121426
</table>
14131427
*/
1414-
public File downloadProtectedDocument(String id) throws ApiException {
1415-
ApiResponse<File> localVarResp = downloadProtectedDocumentWithHttpInfo(id);
1428+
public File downloadProtectedDocument(String id, Boolean separateFiles) throws ApiException {
1429+
ApiResponse<File> localVarResp = downloadProtectedDocumentWithHttpInfo(id, separateFiles);
14161430
return localVarResp.getData();
14171431
}
14181432

14191433
/**
14201434
* Download document protected
14211435
* Download a signed PDF of a completed document
14221436
* @param id Specify document ID. (required)
1437+
* @param separateFiles Set as &#x60;true&#x60; if you want to receive a zip file with all documents in separate when document transaction contains more than 1. (optional)
14231438
* @return ApiResponse&lt;File&gt;
14241439
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
14251440
* @http.response.details
@@ -1433,8 +1448,8 @@ public File downloadProtectedDocument(String id) throws ApiException {
14331448
<tr><td> 429 </td><td> Too Many Requests </td><td> - </td></tr>
14341449
</table>
14351450
*/
1436-
public ApiResponse<File> downloadProtectedDocumentWithHttpInfo(String id) throws ApiException {
1437-
okhttp3.Call localVarCall = downloadProtectedDocumentValidateBeforeCall(id, null);
1451+
public ApiResponse<File> downloadProtectedDocumentWithHttpInfo(String id, Boolean separateFiles) throws ApiException {
1452+
okhttp3.Call localVarCall = downloadProtectedDocumentValidateBeforeCall(id, separateFiles, null);
14381453
Type localVarReturnType = new TypeToken<File>(){}.getType();
14391454
return localVarApiClient.execute(localVarCall, localVarReturnType);
14401455
}
@@ -1443,6 +1458,7 @@ public ApiResponse<File> downloadProtectedDocumentWithHttpInfo(String id) throws
14431458
* Download document protected (asynchronously)
14441459
* Download a signed PDF of a completed document
14451460
* @param id Specify document ID. (required)
1461+
* @param separateFiles Set as &#x60;true&#x60; if you want to receive a zip file with all documents in separate when document transaction contains more than 1. (optional)
14461462
* @param _callback The callback to be executed when the API call finishes
14471463
* @return The request call
14481464
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
@@ -1457,9 +1473,9 @@ public ApiResponse<File> downloadProtectedDocumentWithHttpInfo(String id) throws
14571473
<tr><td> 429 </td><td> Too Many Requests </td><td> - </td></tr>
14581474
</table>
14591475
*/
1460-
public okhttp3.Call downloadProtectedDocumentAsync(String id, final ApiCallback<File> _callback) throws ApiException {
1476+
public okhttp3.Call downloadProtectedDocumentAsync(String id, Boolean separateFiles, final ApiCallback<File> _callback) throws ApiException {
14611477

1462-
okhttp3.Call localVarCall = downloadProtectedDocumentValidateBeforeCall(id, _callback);
1478+
okhttp3.Call localVarCall = downloadProtectedDocumentValidateBeforeCall(id, separateFiles, _callback);
14631479
Type localVarReturnType = new TypeToken<File>(){}.getType();
14641480
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
14651481
return localVarCall;

0 commit comments

Comments
 (0)