Skip to content

Commit 7c0804b

Browse files
Version 3.7.0 release (#93)
* Version v3.7.0-v2.1-20.3.01 release * Update .travis.yml * Update README.md Co-authored-by: DevCenter-DocuSign <dcdev@docusign.com>
1 parent f32e050 commit 7c0804b

File tree

6 files changed

+3027
-24
lines changed

6 files changed

+3027
-24
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file.
33

44
See [DocuSign Support Center](https://support.docusign.com/en/releasenotes/) for Product Release Notes.
55

6+
## [3.7.1] - eSignature API v2.1-20.3.01 - 2020-10-30
7+
### Changed
8+
- Added support for version v2.1-20.3.01 of the DocuSign eSignature API.
9+
- Updated the SDK release version.
10+
### Fixed
11+
- DCM-3866, Added support for updateBrandResourcesByContentType function to take in file to upload.
12+
- DCM-3468, Template get working, added test case for catching regression in future.
13+
614
## [3.6.0] - eSignature API v2.1-20.3.00 - 2020-09-24
715
### Changed
816
- Added support for version v2.1-20.3.00 of the DocuSign eSignature API.

docusign_esign/apis/accounts_api.py

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ def create_brand(self, account_id, **kwargs):
267267
268268
:param callback function: The callback function
269269
for asynchronous request. (optional)
270-
:param str account_id: The external account number (int) or account ID Guid. (required)
271-
:param Brand brand:
270+
:param str account_id: The external account number (int) or account ID GUID. (required)
271+
:param Brand brand:
272272
:return: BrandsResponse
273273
If the method is called asynchronously,
274274
returns the request thread.
@@ -294,8 +294,8 @@ def create_brand_with_http_info(self, account_id, **kwargs):
294294
295295
:param callback function: The callback function
296296
for asynchronous request. (optional)
297-
:param str account_id: The external account number (int) or account ID Guid. (required)
298-
:param Brand brand:
297+
:param str account_id: The external account number (int) or account ID GUID. (required)
298+
:param Brand brand:
299299
:return: BrandsResponse
300300
If the method is called asynchronously,
301301
returns the request thread.
@@ -6513,7 +6513,7 @@ def update_brand_logo_by_type_with_http_info(self, account_id, brand_id, logo_ty
65136513
_request_timeout=params.get('_request_timeout'),
65146514
collection_formats=collection_formats)
65156515

6516-
def update_brand_resources_by_content_type(self, account_id, brand_id, resource_content_type, **kwargs):
6516+
def update_brand_resources_by_content_type(self, account_id, brand_id, resource_content_type, file_xml, **kwargs):
65176517
"""
65186518
Uploads a branding resource file.
65196519
This method makes a synchronous HTTP request by default. To make an
@@ -6522,25 +6522,26 @@ def update_brand_resources_by_content_type(self, account_id, brand_id, resource_
65226522
>>> def callback_function(response):
65236523
>>> pprint(response)
65246524
>>>
6525-
>>> thread = api.update_brand_resources_by_content_type(account_id, brand_id, resource_content_type, callback=callback_function)
6525+
>>> thread = api.update_brand_resources_by_content_type(account_id, brand_id, resource_content_type, file_xml, callback=callback_function)
65266526
65276527
:param callback function: The callback function
65286528
for asynchronous request. (optional)
6529-
:param str account_id: The external account number (int) or account ID Guid. (required)
6530-
:param str brand_id: The unique identifier of a brand. (required)
6531-
:param str resource_content_type: (required)
6529+
:param str account_id: The external account number (int) or account ID GUID. (required)
6530+
:param str brand_id: The id of the brand. (required)
6531+
:param str resource_content_type: The type of brand resource file that you are updating. Valid values are: - `sending` - `signing` - `email` - `signing_captive` (required)
6532+
:param file file_xml: Brand resource XML file. (required)
65326533
:return: BrandResources
65336534
If the method is called asynchronously,
65346535
returns the request thread.
65356536
"""
65366537
kwargs['_return_http_data_only'] = True
65376538
if kwargs.get('callback'):
6538-
return self.update_brand_resources_by_content_type_with_http_info(account_id, brand_id, resource_content_type, **kwargs)
6539+
return self.update_brand_resources_by_content_type_with_http_info(account_id, brand_id, resource_content_type, file_xml, **kwargs)
65396540
else:
6540-
(data) = self.update_brand_resources_by_content_type_with_http_info(account_id, brand_id, resource_content_type, **kwargs)
6541+
(data) = self.update_brand_resources_by_content_type_with_http_info(account_id, brand_id, resource_content_type, file_xml, **kwargs)
65416542
return data
65426543

6543-
def update_brand_resources_by_content_type_with_http_info(self, account_id, brand_id, resource_content_type, **kwargs):
6544+
def update_brand_resources_by_content_type_with_http_info(self, account_id, brand_id, resource_content_type, file_xml, **kwargs):
65446545
"""
65456546
Uploads a branding resource file.
65466547
This method makes a synchronous HTTP request by default. To make an
@@ -6549,19 +6550,20 @@ def update_brand_resources_by_content_type_with_http_info(self, account_id, bran
65496550
>>> def callback_function(response):
65506551
>>> pprint(response)
65516552
>>>
6552-
>>> thread = api.update_brand_resources_by_content_type_with_http_info(account_id, brand_id, resource_content_type, callback=callback_function)
6553+
>>> thread = api.update_brand_resources_by_content_type_with_http_info(account_id, brand_id, resource_content_type, file_xml, callback=callback_function)
65536554
65546555
:param callback function: The callback function
65556556
for asynchronous request. (optional)
6556-
:param str account_id: The external account number (int) or account ID Guid. (required)
6557-
:param str brand_id: The unique identifier of a brand. (required)
6558-
:param str resource_content_type: (required)
6557+
:param str account_id: The external account number (int) or account ID GUID. (required)
6558+
:param str brand_id: The id of the brand. (required)
6559+
:param str resource_content_type: The type of brand resource file that you are updating. Valid values are: - `sending` - `signing` - `email` - `signing_captive` (required)
6560+
:param file file_xml: Brand resource XML file. (required)
65596561
:return: BrandResources
65606562
If the method is called asynchronously,
65616563
returns the request thread.
65626564
"""
65636565

6564-
all_params = ['account_id', 'brand_id', 'resource_content_type']
6566+
all_params = ['account_id', 'brand_id', 'resource_content_type', 'file_xml']
65656567
all_params.append('callback')
65666568
all_params.append('_return_http_data_only')
65676569
all_params.append('_preload_content')
@@ -6585,6 +6587,9 @@ def update_brand_resources_by_content_type_with_http_info(self, account_id, bran
65856587
# verify the required parameter 'resource_content_type' is set
65866588
if ('resource_content_type' not in params) or (params['resource_content_type'] is None):
65876589
raise ValueError("Missing the required parameter `resource_content_type` when calling `update_brand_resources_by_content_type`")
6590+
# verify the required parameter 'file_xml' is set
6591+
if ('file_xml' not in params) or (params['file_xml'] is None):
6592+
raise ValueError("Missing the required parameter `file_xml` when calling `update_brand_resources_by_content_type`")
65886593

65896594

65906595
collection_formats = {}
@@ -6604,12 +6609,18 @@ def update_brand_resources_by_content_type_with_http_info(self, account_id, bran
66046609

66056610
form_params = []
66066611
local_var_files = {}
6612+
if 'file_xml' in params:
6613+
local_var_files['file.xml'] = params['file_xml']
66076614

66086615
body_params = None
66096616
# HTTP header `Accept`
66106617
header_params['Accept'] = self.api_client.\
66116618
select_header_accept(['application/json'])
66126619

6620+
# HTTP header `Content-Type`
6621+
header_params['Content-Type'] = self.api_client.\
6622+
select_header_content_type(['multipart/form-data'])
6623+
66136624
# Authentication setting
66146625
auth_settings = []
66156626

docusign_esign/client/api_response.py

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,29 @@ def request(self, method, url, query_params=None, headers=None,
152152
# must del headers['Content-Type'], or the correct Content-Type
153153
# which generated by urllib3 will be overwritten.
154154
del headers['Content-Type']
155-
r = self.pool_manager.request(method, url,
156-
fields=post_params,
157-
encode_multipart=True,
158-
preload_content=_preload_content,
159-
timeout=timeout,
160-
headers=headers)
155+
is_content_disposition_type = False
156+
157+
if len(post_params):
158+
[k, v] = post_params[0]
159+
[file_name, file_data, mime_type] = v
160+
if isinstance(file_data, bytes):
161+
headers['Content-Type'] = mime_type
162+
headers['Content-Disposition'] = 'form-data; name="' + k + '"; filename="' + file_name + '"'
163+
is_content_disposition_type = True
164+
165+
if is_content_disposition_type:
166+
r = self.pool_manager.request(method, url,
167+
body=file_data,
168+
preload_content=_preload_content,
169+
timeout=timeout,
170+
headers=headers)
171+
else:
172+
r = self.pool_manager.request(method, url,
173+
fields=post_params,
174+
encode_multipart=True,
175+
preload_content=_preload_content,
176+
timeout=timeout,
177+
headers=headers)
161178
# Pass a `string` parameter directly in the body to support
162179
# other content types than Json when `body` argument is provided
163180
# in serialized form

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from setuptools import setup, find_packages, Command, os # noqa: H301
1414

1515
NAME = "docusign-esign"
16-
VERSION = "3.7.0rc1"
16+
VERSION = "3.7.1"
1717
# To install the library, run the following
1818
#
1919
# python setup.py install

0 commit comments

Comments
 (0)