Skip to content

Commit 578e8ee

Browse files
Version 3.10.1 release (#172)
* Version 3.10.1-v2.1-20.3.01 release * Update pom.xml Co-authored-by: DevCenter-DocuSign <dcdev@docusign.com>
1 parent 7311091 commit 578e8ee

8 files changed

Lines changed: 3045 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
# DocuSign Java Client Changelog
22
See [DocuSign Support Center](https://support.docusign.com/en/releasenotes/) for Product Release Notes.
33

4-
## [v3.10.0-RC1] - eSignature API v2.1-20.3.01 - 2020-10-15
4+
## [v3.10.1] - eSignature API v2.1-20.3.01 - 2020-10-29
55
### Changed
66
- Added support for version v2.1-20.3.01 of the DocuSign eSignature API.
77
- Updated the SDK release version.
88
- Updated ApiClient to use an empty JSON object if the body is null. (DCM-4359)
9+
### Fixed
10+
- AccountBrands::updateBrandResourcesByContentType is missing brand file option. (DCM-3868)
11+
12+
## [v3.10.0-RC1] - eSignature API v2.1-20.3.01 - 2020-10-15
13+
### Changed
14+
- Added support for version v2.1-20.3.01 of the DocuSign eSignature API.
15+
- Updated the SDK release version.
916

1017
## [v3.9.0] - eSignature API v2.1-20.3.00 - 2020-09-24
1118
### Changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Note: DocuSign uses **Eclipse** with **Maven** for testing purposes.
3434
<dependency>
3535
<groupId>com.docusign</groupId>
3636
<artifactId>docusign-esign-java</artifactId>
37-
<version>3.10.0-RC1</version>
37+
<version>3.10.1</version>
3838
</dependency>
3939
```
4040

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apply plugin: 'idea'
22
apply plugin: 'eclipse'
33

44
group = 'com.docusign'
5-
version = '3.10.0-RC1'
5+
version = '3.10.1'
66

77
buildscript {
88
repositories {

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<artifactId>docusign-esign-java</artifactId>
55
<packaging>jar</packaging>
66
<name>docusign-esign-java</name>
7-
<version>3.10.0-RC1</version>
7+
<version>3.10.1</version>
88
<description>The official DocuSign eSignature JAVA client is based on version 2 of the DocuSign REST API and provides libraries for JAVA application integration. It is recommended that you use this version of the library for new development.</description>
99
<url>https://developers.docusign.com</url>
1010

src/main/java/com/docusign/esign/api/AccountsApi.java

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public AccountSignaturesInformation createAccountSignatures(String accountId, Ac
184184
/**
185185
* Creates one or more brand profile files for the account.
186186
* Creates one or more brand profile files for the account. The Account Branding feature (accountSettings properties &#x60;canSelfBrandSend&#x60; and &#x60;canSelfBrandSig&#x60;) must be set to **true** for the account to use this call. An error is returned if &#x60;brandId&#x60; property for a brand profile is already set for the account. To upload a new version of an existing brand profile, you must delete the profile and then upload the newer version. When brand profile files are being uploaded, they must be combined into one zip file and the &#x60;Content-Type&#x60; must be &#x60;application/zip&#x60;.
187-
* @param accountId The external account number (int) or account ID Guid. (required)
187+
* @param accountId The external account number (int) or account ID GUID. (required)
188188
* @param brand (optional)
189189
* @return BrandsResponse
190190
* @throws ApiException if fails to make API call
@@ -3817,13 +3817,14 @@ public void updateBrandLogoByType(String accountId, String brandId, String logoT
38173817
/**
38183818
* Uploads a branding resource file.
38193819
*
3820-
* @param accountId The external account number (int) or account ID Guid. (required)
3821-
* @param brandId The unique identifier of a brand. (required)
3822-
* @param resourceContentType (required)
3820+
* @param accountId The external account number (int) or account ID GUID. (required)
3821+
* @param brandId The id of the brand. (required)
3822+
* @param resourceContentType The type of brand resource file that you are updating. Valid values are: - &#x60;sending&#x60; - &#x60;signing&#x60; - &#x60;email&#x60; - &#x60;signing_captive&#x60; (required)
3823+
* @param fileXml Brand resource XML file. (required)
38233824
* @return BrandResources
38243825
* @throws ApiException if fails to make API call
38253826
*/
3826-
public BrandResources updateBrandResourcesByContentType(String accountId, String brandId, String resourceContentType) throws ApiException {
3827+
public BrandResources updateBrandResourcesByContentType(String accountId, String brandId, String resourceContentType, byte[] fileXml) throws ApiException {
38273828
Object localVarPostBody = "{}";
38283829

38293830
// verify the required parameter 'accountId' is set
@@ -3841,6 +3842,11 @@ public BrandResources updateBrandResourcesByContentType(String accountId, String
38413842
throw new ApiException(400, "Missing the required parameter 'resourceContentType' when calling updateBrandResourcesByContentType");
38423843
}
38433844

3845+
// verify the required parameter 'fileXml' is set
3846+
if (fileXml == null) {
3847+
throw new ApiException(400, "Missing the required parameter 'fileXml' when calling updateBrandResourcesByContentType");
3848+
}
3849+
38443850
// create path and map variables
38453851
String localVarPath = "/v2.1/accounts/{accountId}/brands/{brandId}/resources/{resourceContentType}"
38463852
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
@@ -3857,15 +3863,17 @@ public BrandResources updateBrandResourcesByContentType(String accountId, String
38573863

38583864

38593865

3860-
3866+
if (fileXml != null) {
3867+
localVarFormParams.put("file.xml", fileXml);
3868+
}
38613869

38623870
final String[] localVarAccepts = {
38633871
"application/json"
38643872
};
38653873
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
38663874

38673875
final String[] localVarContentTypes = {
3868-
3876+
"multipart/form-data"
38693877
};
38703878
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
38713879

src/main/java/com/docusign/esign/client/ApiClient.java

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@
2020
import org.glassfish.jersey.client.spi.ConnectorProvider;
2121
import org.glassfish.jersey.jackson.JacksonFeature;
2222
import org.glassfish.jersey.logging.LoggingFeature;
23-
import org.glassfish.jersey.media.multipart.FormDataBodyPart;
24-
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
25-
import org.glassfish.jersey.media.multipart.MultiPart;
26-
import org.glassfish.jersey.media.multipart.MultiPartFeature;
23+
import org.glassfish.jersey.media.multipart.*;
2724

2825
import javax.net.ssl.*;
2926
import javax.ws.rs.client.*;
@@ -87,7 +84,7 @@ public ApiClient() {
8784
this.dateFormat = new RFC3339DateFormat();
8885

8986
// Set default User-Agent.
90-
setUserAgent("Swagger-Codegen/3.10.0-RC1/java");
87+
setUserAgent("Swagger-Codegen/3.10.1/java");
9188

9289
// Setup authentications (key: authentication name, value: authentication).
9390
authentications = new HashMap<String, Authentication>();
@@ -1176,7 +1173,13 @@ public Entity<?> serialize(Object obj, Map<String, Object> formParams, String co
11761173
if (contentType.startsWith("multipart/form-data")) {
11771174
MultiPart multiPart = new MultiPart();
11781175
for (Entry<String, Object> param: formParams.entrySet()) {
1179-
if (param.getValue() instanceof File) {
1176+
if (param.getValue() instanceof byte[]) {
1177+
byte[] bytes = (byte[]) param.getValue();
1178+
FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey())
1179+
.fileName(param.getKey()).size(bytes.length).build();
1180+
1181+
multiPart.bodyPart(new FormDataBodyPart(contentDisp, bytes, MediaType.APPLICATION_OCTET_STREAM_TYPE));
1182+
} else if (param.getValue() instanceof File) {
11801183
File file = (File) param.getValue();
11811184
FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey())
11821185
.fileName(file.getName()).size(file.length()).build();
@@ -1345,7 +1348,25 @@ public <T> T invokeAPI(String path, String method, List<Pair> queryParams, List<
13451348
}
13461349
}
13471350

1348-
Entity<?> entity = (body == null) ? Entity.json("{}") : serialize(body, formParams, contentType);
1351+
Entity<?> entity = (body == null && formParams.isEmpty()) ? Entity.json("{}") : serialize(body, formParams, contentType);
1352+
1353+
// Generate and add Content-Disposition header as per RFC 6266
1354+
if (contentType.startsWith("multipart/form-data")) {
1355+
for (Entry<String, Object> param : formParams.entrySet()) {
1356+
if (param.getValue() instanceof byte[]) {
1357+
MultiPart mp = ((MultiPart) entity.getEntity());
1358+
List<BodyPart> bodyParts = mp.getBodyParts();
1359+
if (!bodyParts.isEmpty()) {
1360+
BodyPart bodyPart = bodyParts.get(0);
1361+
if (bodyPart.getContentDisposition() != null) {
1362+
String contentDispositionValue = bodyPart.getContentDisposition().toString();
1363+
invocationBuilder = invocationBuilder.header("Content-Disposition", contentDispositionValue);
1364+
entity = Entity.entity(param.getValue(), "application/octet-stream");
1365+
}
1366+
}
1367+
}
1368+
}
1369+
}
13491370

13501371
Response response = null;
13511372
String message = "error";

0 commit comments

Comments
 (0)