Skip to content

Commit 573d489

Browse files
garg-muditroot
andauthored
Version 3.25.1 release (#180)
* Version 3.25.1-v2.1-23.3.01.02 release * Update CHANGELOG.md Signed-off-by: Mudit Garg <[email protected]> --------- Signed-off-by: Mudit Garg <[email protected]> Co-authored-by: root <[email protected]>
1 parent 27741d3 commit 573d489

File tree

8 files changed

+1628
-1206
lines changed

8 files changed

+1628
-1206
lines changed

.swagger-codegen/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.21-SNAPSHOT
1+
2.4.21

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ 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+
## [v3.25.1] - eSignature API v2.1-23.3.01.02 - 2023-12-14
7+
### Changed
8+
- Added support for version v2.1-23.3.01.02 of the DocuSign ESignature API.
9+
- Updated the SDK release version.
10+
- Updated Date model.
11+
- Updated response.py to fix issue with Envelopes::listStatus endpoint requiring a body.
12+
613
## [v3.25.0] - eSignature API v2.1-23.3.01.02 - 2023-10-25
714
### Changed
815
- Added support for version v2.1-23.3.01.02 of the DocuSign ESignature API.

docusign_esign/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@
216216
from docusign_esign.models.custom_fields import CustomFields
217217
from docusign_esign.models.custom_fields_envelope import CustomFieldsEnvelope
218218
from docusign_esign.models.custom_settings_information import CustomSettingsInformation
219+
from docusign_esign.models.date import Date
219220
from docusign_esign.models.date_signed import DateSigned
220221
from docusign_esign.models.date_stamp_properties import DateStampProperties
221222
from docusign_esign.models.decline import Decline
@@ -344,7 +345,6 @@
344345
from docusign_esign.models.merge_field import MergeField
345346
from docusign_esign.models.mobile_notifier_configuration import MobileNotifierConfiguration
346347
from docusign_esign.models.mobile_notifier_configuration_information import MobileNotifierConfigurationInformation
347-
from docusign_esign.models.model_date import ModelDate
348348
from docusign_esign.models.money import Money
349349
from docusign_esign.models.name_value import NameValue
350350
from docusign_esign.models.new_account_definition import NewAccountDefinition
@@ -540,6 +540,6 @@
540540
from docusign_esign.models.workspace_user import WorkspaceUser
541541
from docusign_esign.models.workspace_user_authorization import WorkspaceUserAuthorization
542542
from docusign_esign.models.zip import Zip
543-
from docusign_esign.models.date import Date
544543

545-
configuration = Configuration()
544+
545+
configuration = Configuration()

docusign_esign/client/api_response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ def request(self, method, url, query_params=None, headers=None,
133133
if query_params:
134134
url += '?' + urlencode(query_params)
135135
if re.search('json', headers['Content-Type'], re.IGNORECASE):
136-
request_body = None
137-
if body:
136+
request_body = '{}'
137+
if body is not None:
138138
request_body = json.dumps(body)
139139
r = self.pool_manager.request(method, url,
140140
body=request_body,

docusign_esign/models/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@
180180
from docusign_esign.models.custom_fields import CustomFields
181181
from docusign_esign.models.custom_fields_envelope import CustomFieldsEnvelope
182182
from docusign_esign.models.custom_settings_information import CustomSettingsInformation
183+
from docusign_esign.models.date import Date
183184
from docusign_esign.models.date_signed import DateSigned
184185
from docusign_esign.models.date_stamp_properties import DateStampProperties
185186
from docusign_esign.models.decline import Decline
@@ -308,7 +309,6 @@
308309
from docusign_esign.models.merge_field import MergeField
309310
from docusign_esign.models.mobile_notifier_configuration import MobileNotifierConfiguration
310311
from docusign_esign.models.mobile_notifier_configuration_information import MobileNotifierConfigurationInformation
311-
from docusign_esign.models.model_date import ModelDate
312312
from docusign_esign.models.money import Money
313313
from docusign_esign.models.name_value import NameValue
314314
from docusign_esign.models.new_account_definition import NewAccountDefinition
@@ -504,4 +504,3 @@
504504
from docusign_esign.models.workspace_user import WorkspaceUser
505505
from docusign_esign.models.workspace_user_authorization import WorkspaceUserAuthorization
506506
from docusign_esign.models.zip import Zip
507-
from docusign_esign.models.date import Date

docusign_esign/models/date.py

Lines changed: 1515 additions & 1146 deletions
Large diffs are not rendered by default.

setup.py

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# coding: utf-8
2-
1+
# coding: utf-8
2+
33
"""
44
DocuSign REST API
55
@@ -9,49 +9,49 @@
99
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
12-
13-
14-
from setuptools import setup, find_packages, Command, os # noqa: H301
15-
16-
NAME = "docusign-esign"
17-
VERSION = "3.25.0"
18-
# To install the library, run the following
19-
#
20-
# python setup.py install
21-
#
22-
# prerequisite: setuptools
23-
# http://pypi.python.org/pypi/setuptools
24-
25-
REQUIRES = ["urllib3 >= 1.15", "six >= 1.8.0", "certifi >= 14.05.14", "python-dateutil >= 2.5.3", "setuptools >= 21.0.0", "PyJWT>=1.7.1", "cryptography>=2.5", "nose>=1.3.7"]
26-
27-
class CleanCommand(Command):
28-
"""Custom clean command to tidy up the project root."""
29-
user_options = []
30-
def initialize_options(self):
31-
pass
32-
def finalize_options(self):
33-
pass
34-
def run(self):
35-
os.system('rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info')
36-
37-
this_directory = os.path.abspath(os.path.dirname(__file__))
38-
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
39-
long_description = f.read()
40-
41-
42-
setup(
43-
name=NAME,
44-
version=VERSION,
45-
description="DocuSign REST API",
46-
author_email="[email protected]",
47-
url="",
48-
keywords=["Swagger", "DocuSign REST API"],
49-
install_requires=REQUIRES,
50-
packages=find_packages(),
51-
include_package_data=True,
52-
cmdclass={
53-
'clean': CleanCommand,
54-
},
55-
long_description=long_description,
56-
long_description_content_type='text/markdown'
57-
)
12+
13+
14+
from setuptools import setup, find_packages, Command, os # noqa: H301
15+
16+
NAME = "docusign-esign"
17+
VERSION = "3.25.1"
18+
# To install the library, run the following
19+
#
20+
# python setup.py install
21+
#
22+
# prerequisite: setuptools
23+
# http://pypi.python.org/pypi/setuptools
24+
25+
REQUIRES = ["urllib3 >= 1.15", "six >= 1.8.0", "certifi >= 14.05.14", "python-dateutil >= 2.5.3", "setuptools >= 21.0.0", "PyJWT>=1.7.1", "cryptography>=2.5", "nose>=1.3.7"]
26+
27+
class CleanCommand(Command):
28+
"""Custom clean command to tidy up the project root."""
29+
user_options = []
30+
def initialize_options(self):
31+
pass
32+
def finalize_options(self):
33+
pass
34+
def run(self):
35+
os.system('rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info')
36+
37+
this_directory = os.path.abspath(os.path.dirname(__file__))
38+
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
39+
long_description = f.read()
40+
41+
42+
setup(
43+
name=NAME,
44+
version=VERSION,
45+
description="DocuSign REST API",
46+
author_email="[email protected]",
47+
url="",
48+
keywords=["Swagger", "DocuSign REST API"],
49+
install_requires=REQUIRES,
50+
packages=find_packages(),
51+
include_package_data=True,
52+
cmdclass={
53+
'clean': CleanCommand,
54+
},
55+
long_description=long_description,
56+
long_description_content_type='text/markdown'
57+
)

test/unit_tests.py

Lines changed: 51 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
import os
77
import subprocess
88
import unittest
9-
from pprint import pprint
9+
1010
from time import sleep
11+
from datetime import datetime
1112

1213
import docusign_esign as docusign
13-
from docusign_esign import AuthenticationApi, EnvelopesApi, TemplatesApi, DiagnosticsApi, FoldersApi, ApiException
14+
from docusign_esign import AuthenticationApi, EnvelopesApi, TemplatesApi, DiagnosticsApi, FoldersApi, ApiException, TemplateSummary
1415

1516
Username = os.environ.get("USER_NAME")
1617
IntegratorKey = os.environ.get("INTEGRATOR_KEY_JWT")
@@ -340,7 +341,7 @@ def testEmbeddedSigning(self):
340341
print("\nException when calling DocuSign API: %s" % e)
341342
assert e is None # make the test case fail in case of an API exception
342343

343-
def testCreateTemplate(self):
344+
def testCreateTemplate(self) -> TemplateSummary:
344345
with open(SignTest1File, 'rb') as sign_file:
345346
file_contents = sign_file.read()
346347

@@ -377,7 +378,23 @@ def testCreateTemplate(self):
377378
scale_value=sign_scale_value)
378379

379380
sign_here_tabs = [sign_here]
380-
tabs = docusign.Tabs(sign_here_tabs=sign_here_tabs)
381+
382+
# Create a date tab somewhere on the document for the signer to know about current date
383+
date_document_id = '1'
384+
date_page_number = '1'
385+
date_x_position = '50'
386+
date_y_position = '50'
387+
388+
current_date_tab = docusign.Date(document_id=date_document_id,
389+
page_number=date_page_number,
390+
recipient_id=recipient_id,
391+
x_position=date_x_position,
392+
y_position=date_y_position,
393+
value=datetime.utcnow().date())
394+
date_tabs = [current_date_tab]
395+
396+
tabs = docusign.Tabs(sign_here_tabs=sign_here_tabs, date_tabs=date_tabs)
397+
381398
signer = docusign.Signer(email=email,
382399
name=name,
383400
recipient_id=recipient_id,
@@ -403,6 +420,7 @@ def testCreateTemplate(self):
403420
assert template_summary is not None
404421
assert template_summary.template_id is not None
405422

423+
return template_summary
406424
except ApiException as e:
407425
print("\nException when calling DocuSign API: %s" % e)
408426
assert e is None # make the test case fail in case of an API exception
@@ -853,6 +871,35 @@ def testMoveEnvelopes(self):
853871
print("\nException when calling DocuSign API: %s" % e)
854872
assert e is None # make the test case fail in case of an API exception
855873

874+
def testTemplateDocumentTabsRetrieval(self):
875+
876+
# Create Envelope template
877+
template_summary = self.testCreateTemplate()
878+
template_id = template_summary.template_id
879+
880+
templates_api = TemplatesApi()
881+
882+
# List all documents from the created template to find the documentId
883+
template_documents_list_result = templates_api.list_documents(self.user_info.accounts[0].account_id, template_id)
884+
885+
# Check if there are no documents within the template
886+
has_template_documents = template_documents_list_result is None or template_documents_list_result.template_documents is None or len(template_documents_list_result.template_documents) == 0
887+
assert has_template_documents, 'No document found within created template'
888+
889+
document_id = template_documents_list_result.template_documents[0].document_id
890+
891+
try:
892+
# Get list of various document tabs
893+
document_tabs = templates_api.get_document_tabs(self.user_info.accounts[0].account_id, document_id, template_id)
894+
895+
assert document_tabs is not None
896+
897+
except ApiException as e:
898+
print("\nException when calling DocuSign API: %s" % e)
899+
assert e is None # make the test case fail in case of an API exception
900+
except Exception as e:
901+
print("\nException when calling DocuSign API: %s" % e)
902+
assert e is None # make the test case fail in case of an API exception
856903

857904
if __name__ == '__main__':
858905
unittest.main()

0 commit comments

Comments
 (0)