Skip to content

Commit

Permalink
Version 3.7.0 release (#93)
Browse files Browse the repository at this point in the history
* Version v3.7.0-v2.1-20.3.01 release

* Update .travis.yml

* Update README.md

Co-authored-by: DevCenter-DocuSign <[email protected]>
  • Loading branch information
harsharahul and DevCenter-DocuSign authored Oct 30, 2020
1 parent f32e050 commit 7c0804b
Show file tree
Hide file tree
Showing 6 changed files with 3,027 additions and 24 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file.

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

## [3.7.1] - eSignature API v2.1-20.3.01 - 2020-10-30
### Changed
- Added support for version v2.1-20.3.01 of the DocuSign eSignature API.
- Updated the SDK release version.
### Fixed
- DCM-3866, Added support for updateBrandResourcesByContentType function to take in file to upload.
- DCM-3468, Template get working, added test case for catching regression in future.

## [3.6.0] - eSignature API v2.1-20.3.00 - 2020-09-24
### Changed
- Added support for version v2.1-20.3.00 of the DocuSign eSignature API.
Expand Down
45 changes: 28 additions & 17 deletions docusign_esign/apis/accounts_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ def create_brand(self, account_id, **kwargs):
:param callback function: The callback function
for asynchronous request. (optional)
:param str account_id: The external account number (int) or account ID Guid. (required)
:param Brand brand:
:param str account_id: The external account number (int) or account ID GUID. (required)
:param Brand brand:
:return: BrandsResponse
If the method is called asynchronously,
returns the request thread.
Expand All @@ -294,8 +294,8 @@ def create_brand_with_http_info(self, account_id, **kwargs):
:param callback function: The callback function
for asynchronous request. (optional)
:param str account_id: The external account number (int) or account ID Guid. (required)
:param Brand brand:
:param str account_id: The external account number (int) or account ID GUID. (required)
:param Brand brand:
:return: BrandsResponse
If the method is called asynchronously,
returns the request thread.
Expand Down Expand Up @@ -6513,7 +6513,7 @@ def update_brand_logo_by_type_with_http_info(self, account_id, brand_id, logo_ty
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)

def update_brand_resources_by_content_type(self, account_id, brand_id, resource_content_type, **kwargs):
def update_brand_resources_by_content_type(self, account_id, brand_id, resource_content_type, file_xml, **kwargs):
"""
Uploads a branding resource file.
This method makes a synchronous HTTP request by default. To make an
Expand All @@ -6522,25 +6522,26 @@ def update_brand_resources_by_content_type(self, account_id, brand_id, resource_
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.update_brand_resources_by_content_type(account_id, brand_id, resource_content_type, callback=callback_function)
>>> thread = api.update_brand_resources_by_content_type(account_id, brand_id, resource_content_type, file_xml, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str account_id: The external account number (int) or account ID Guid. (required)
:param str brand_id: The unique identifier of a brand. (required)
:param str resource_content_type: (required)
:param str account_id: The external account number (int) or account ID GUID. (required)
:param str brand_id: The id of the brand. (required)
:param str resource_content_type: The type of brand resource file that you are updating. Valid values are: - `sending` - `signing` - `email` - `signing_captive` (required)
:param file file_xml: Brand resource XML file. (required)
:return: BrandResources
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('callback'):
return self.update_brand_resources_by_content_type_with_http_info(account_id, brand_id, resource_content_type, **kwargs)
return self.update_brand_resources_by_content_type_with_http_info(account_id, brand_id, resource_content_type, file_xml, **kwargs)
else:
(data) = self.update_brand_resources_by_content_type_with_http_info(account_id, brand_id, resource_content_type, **kwargs)
(data) = self.update_brand_resources_by_content_type_with_http_info(account_id, brand_id, resource_content_type, file_xml, **kwargs)
return data

def update_brand_resources_by_content_type_with_http_info(self, account_id, brand_id, resource_content_type, **kwargs):
def update_brand_resources_by_content_type_with_http_info(self, account_id, brand_id, resource_content_type, file_xml, **kwargs):
"""
Uploads a branding resource file.
This method makes a synchronous HTTP request by default. To make an
Expand All @@ -6549,19 +6550,20 @@ def update_brand_resources_by_content_type_with_http_info(self, account_id, bran
>>> def callback_function(response):
>>> pprint(response)
>>>
>>> thread = api.update_brand_resources_by_content_type_with_http_info(account_id, brand_id, resource_content_type, callback=callback_function)
>>> thread = api.update_brand_resources_by_content_type_with_http_info(account_id, brand_id, resource_content_type, file_xml, callback=callback_function)
:param callback function: The callback function
for asynchronous request. (optional)
:param str account_id: The external account number (int) or account ID Guid. (required)
:param str brand_id: The unique identifier of a brand. (required)
:param str resource_content_type: (required)
:param str account_id: The external account number (int) or account ID GUID. (required)
:param str brand_id: The id of the brand. (required)
:param str resource_content_type: The type of brand resource file that you are updating. Valid values are: - `sending` - `signing` - `email` - `signing_captive` (required)
:param file file_xml: Brand resource XML file. (required)
:return: BrandResources
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['account_id', 'brand_id', 'resource_content_type']
all_params = ['account_id', 'brand_id', 'resource_content_type', 'file_xml']
all_params.append('callback')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
Expand All @@ -6585,6 +6587,9 @@ def update_brand_resources_by_content_type_with_http_info(self, account_id, bran
# verify the required parameter 'resource_content_type' is set
if ('resource_content_type' not in params) or (params['resource_content_type'] is None):
raise ValueError("Missing the required parameter `resource_content_type` when calling `update_brand_resources_by_content_type`")
# verify the required parameter 'file_xml' is set
if ('file_xml' not in params) or (params['file_xml'] is None):
raise ValueError("Missing the required parameter `file_xml` when calling `update_brand_resources_by_content_type`")


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

form_params = []
local_var_files = {}
if 'file_xml' in params:
local_var_files['file.xml'] = params['file_xml']

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

# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
select_header_content_type(['multipart/form-data'])

# Authentication setting
auth_settings = []

Expand Down
29 changes: 23 additions & 6 deletions docusign_esign/client/api_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,29 @@ def request(self, method, url, query_params=None, headers=None,
# must del headers['Content-Type'], or the correct Content-Type
# which generated by urllib3 will be overwritten.
del headers['Content-Type']
r = self.pool_manager.request(method, url,
fields=post_params,
encode_multipart=True,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
is_content_disposition_type = False

if len(post_params):
[k, v] = post_params[0]
[file_name, file_data, mime_type] = v
if isinstance(file_data, bytes):
headers['Content-Type'] = mime_type
headers['Content-Disposition'] = 'form-data; name="' + k + '"; filename="' + file_name + '"'
is_content_disposition_type = True

if is_content_disposition_type:
r = self.pool_manager.request(method, url,
body=file_data,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
else:
r = self.pool_manager.request(method, url,
fields=post_params,
encode_multipart=True,
preload_content=_preload_content,
timeout=timeout,
headers=headers)
# Pass a `string` parameter directly in the body to support
# other content types than Json when `body` argument is provided
# in serialized form
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from setuptools import setup, find_packages, Command, os # noqa: H301

NAME = "docusign-esign"
VERSION = "3.7.0rc1"
VERSION = "3.7.1"
# To install the library, run the following
#
# python setup.py install
Expand Down
Loading

0 comments on commit 7c0804b

Please sign in to comment.