From d271973445d4b8e757831b5a5050bf824dab090e Mon Sep 17 00:00:00 2001 From: Harsha Rahul Boggaram Date: Thu, 15 Jul 2021 22:50:01 -0700 Subject: [PATCH] Version 2.11.0rc1-v2-21.2.00.00 release (#117) Co-authored-by: DevCenter-DocuSign --- CHANGELOG.md | 5 + docusign_esign/__init__.py | 2 +- docusign_esign/client/api_exception.py | 9 +- docusign_esign/client/configuration.py | 4 +- docusign_esign/models/__init__.py | 2 +- docusign_esign/models/account_billing_plan.py | 58 ++++- docusign_esign/models/envelope_form_data.py | 6 +- docusign_esign/models/prefill_form_data.py | 201 ++++++++++++++++++ setup.py | 2 +- test/unit_tests.py | 35 +++ 10 files changed, 313 insertions(+), 11 deletions(-) create mode 100644 docusign_esign/models/prefill_form_data.py diff --git a/CHANGELOG.md b/CHANGELOG.md index f46a25ee..8427e287 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ 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. +## [2.11.0rc1] - eSignature API v2-2.11.0rc1 - 2021-07-13 +### Changed +- Added support for version v2-2.11.0rc1 of the DocuSign eSignature API. +- Updated the SDK release version. + ## [2.10.0] - eSignature API v2-21.1.02.00 - 2021-06-08 ### Breaking - Removed methods `get_account_settings_export`,`get_seal_providers` from Accounts. diff --git a/docusign_esign/__init__.py b/docusign_esign/__init__.py index cce54077..86085b61 100644 --- a/docusign_esign/__init__.py +++ b/docusign_esign/__init__.py @@ -183,7 +183,6 @@ from docusign_esign.models.envelope_documents_result import EnvelopeDocumentsResult from docusign_esign.models.envelope_event import EnvelopeEvent from docusign_esign.models.envelope_form_data import EnvelopeFormData -from docusign_esign.models.envelope_form_data_prefill_form_data import EnvelopeFormDataPrefillFormData from docusign_esign.models.envelope_id import EnvelopeId from docusign_esign.models.envelope_ids_request import EnvelopeIdsRequest from docusign_esign.models.envelope_notification_request import EnvelopeNotificationRequest @@ -280,6 +279,7 @@ from docusign_esign.models.power_forms_form_data_response import PowerFormsFormDataResponse from docusign_esign.models.power_forms_request import PowerFormsRequest from docusign_esign.models.power_forms_response import PowerFormsResponse +from docusign_esign.models.prefill_form_data import PrefillFormData from docusign_esign.models.property_metadata import PropertyMetadata from docusign_esign.models.province import Province from docusign_esign.models.provisioning_information import ProvisioningInformation diff --git a/docusign_esign/client/api_exception.py b/docusign_esign/client/api_exception.py index 4a790a6b..55c2d19f 100644 --- a/docusign_esign/client/api_exception.py +++ b/docusign_esign/client/api_exception.py @@ -21,6 +21,9 @@ def __init__(self, status=None, reason=None, http_resp=None): self.reason = http_resp.reason self.body = http_resp.data self.headers = http_resp.getheaders() + self.trace_token = http_resp.getheader('X-DocuSign-TraceToken') + self.timestamp = http_resp.getheader('date') + self.response = http_resp else: self.status = status self.reason = reason @@ -31,8 +34,10 @@ def __str__(self): """ Custom error messages for exception """ - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) + error_message = "({0})\n" \ + "Reason: {1}\n" \ + "Trace-Token: {2}\n" \ + "Timestamp: {3}\n".format(self.status, self.reason, self.trace_token, self.timestamp) if self.headers: error_message += "HTTP response headers: {0}\n".format(self.headers) diff --git a/docusign_esign/client/configuration.py b/docusign_esign/client/configuration.py index c40c81a0..27f7baa7 100644 --- a/docusign_esign/client/configuration.py +++ b/docusign_esign/client/configuration.py @@ -90,9 +90,9 @@ def __init__(self): self.key_file = None if PY3: - self.user_agent = 'Swagger-Codegen/v2/2.10.0/python3' + self.user_agent = 'Swagger-Codegen/v2/2.11.0rc1/python3' else: - self.user_agent = 'Swagger-Codegen/v2/2.10.0/python2' + self.user_agent = 'Swagger-Codegen/v2/2.11.0rc1/python2' @property def logger_file(self): diff --git a/docusign_esign/models/__init__.py b/docusign_esign/models/__init__.py index 092202ca..bb63fa40 100644 --- a/docusign_esign/models/__init__.py +++ b/docusign_esign/models/__init__.py @@ -162,7 +162,6 @@ from docusign_esign.models.envelope_documents_result import EnvelopeDocumentsResult from docusign_esign.models.envelope_event import EnvelopeEvent from docusign_esign.models.envelope_form_data import EnvelopeFormData -from docusign_esign.models.envelope_form_data_prefill_form_data import EnvelopeFormDataPrefillFormData from docusign_esign.models.envelope_id import EnvelopeId from docusign_esign.models.envelope_ids_request import EnvelopeIdsRequest from docusign_esign.models.envelope_notification_request import EnvelopeNotificationRequest @@ -259,6 +258,7 @@ from docusign_esign.models.power_forms_form_data_response import PowerFormsFormDataResponse from docusign_esign.models.power_forms_request import PowerFormsRequest from docusign_esign.models.power_forms_response import PowerFormsResponse +from docusign_esign.models.prefill_form_data import PrefillFormData from docusign_esign.models.property_metadata import PropertyMetadata from docusign_esign.models.province import Province from docusign_esign.models.provisioning_information import ProvisioningInformation diff --git a/docusign_esign/models/account_billing_plan.py b/docusign_esign/models/account_billing_plan.py index 914429e1..24242fe9 100644 --- a/docusign_esign/models/account_billing_plan.py +++ b/docusign_esign/models/account_billing_plan.py @@ -50,6 +50,8 @@ class AccountBillingPlan(object): 'plan_feature_sets': 'list[FeatureSet]', 'plan_id': 'str', 'plan_name': 'str', + 'plan_start_date': 'str', + 'renewal_date': 'str', 'renewal_status': 'str', 'seat_discounts': 'list[SeatDiscount]', 'support_incident_fee': 'str', @@ -76,13 +78,15 @@ class AccountBillingPlan(object): 'plan_feature_sets': 'planFeatureSets', 'plan_id': 'planId', 'plan_name': 'planName', + 'plan_start_date': 'planStartDate', + 'renewal_date': 'renewalDate', 'renewal_status': 'renewalStatus', 'seat_discounts': 'seatDiscounts', 'support_incident_fee': 'supportIncidentFee', 'support_plan_fee': 'supportPlanFee' } - def __init__(self, add_ons=None, app_store_receipt_expiration_date=None, app_store_receipt_purchase_date=None, can_cancel_renewal=None, can_upgrade=None, currency_code=None, enable_support=None, included_seats=None, incremental_seats=None, is_downgrade=None, notification_type=None, other_discount_percent=None, payment_cycle=None, payment_method=None, per_seat_price=None, plan_classification=None, plan_feature_sets=None, plan_id=None, plan_name=None, renewal_status=None, seat_discounts=None, support_incident_fee=None, support_plan_fee=None): # noqa: E501 + def __init__(self, add_ons=None, app_store_receipt_expiration_date=None, app_store_receipt_purchase_date=None, can_cancel_renewal=None, can_upgrade=None, currency_code=None, enable_support=None, included_seats=None, incremental_seats=None, is_downgrade=None, notification_type=None, other_discount_percent=None, payment_cycle=None, payment_method=None, per_seat_price=None, plan_classification=None, plan_feature_sets=None, plan_id=None, plan_name=None, plan_start_date=None, renewal_date=None, renewal_status=None, seat_discounts=None, support_incident_fee=None, support_plan_fee=None): # noqa: E501 """AccountBillingPlan - a model defined in Swagger""" # noqa: E501 self._add_ons = None @@ -104,6 +108,8 @@ def __init__(self, add_ons=None, app_store_receipt_expiration_date=None, app_sto self._plan_feature_sets = None self._plan_id = None self._plan_name = None + self._plan_start_date = None + self._renewal_date = None self._renewal_status = None self._seat_discounts = None self._support_incident_fee = None @@ -148,6 +154,10 @@ def __init__(self, add_ons=None, app_store_receipt_expiration_date=None, app_sto self.plan_id = plan_id if plan_name is not None: self.plan_name = plan_name + if plan_start_date is not None: + self.plan_start_date = plan_start_date + if renewal_date is not None: + self.renewal_date = renewal_date if renewal_status is not None: self.renewal_status = renewal_status if seat_discounts is not None: @@ -594,6 +604,52 @@ def plan_name(self, plan_name): self._plan_name = plan_name + @property + def plan_start_date(self): + """Gets the plan_start_date of this AccountBillingPlan. # noqa: E501 + + # noqa: E501 + + :return: The plan_start_date of this AccountBillingPlan. # noqa: E501 + :rtype: str + """ + return self._plan_start_date + + @plan_start_date.setter + def plan_start_date(self, plan_start_date): + """Sets the plan_start_date of this AccountBillingPlan. + + # noqa: E501 + + :param plan_start_date: The plan_start_date of this AccountBillingPlan. # noqa: E501 + :type: str + """ + + self._plan_start_date = plan_start_date + + @property + def renewal_date(self): + """Gets the renewal_date of this AccountBillingPlan. # noqa: E501 + + # noqa: E501 + + :return: The renewal_date of this AccountBillingPlan. # noqa: E501 + :rtype: str + """ + return self._renewal_date + + @renewal_date.setter + def renewal_date(self, renewal_date): + """Sets the renewal_date of this AccountBillingPlan. + + # noqa: E501 + + :param renewal_date: The renewal_date of this AccountBillingPlan. # noqa: E501 + :type: str + """ + + self._renewal_date = renewal_date + @property def renewal_status(self): """Gets the renewal_status of this AccountBillingPlan. # noqa: E501 diff --git a/docusign_esign/models/envelope_form_data.py b/docusign_esign/models/envelope_form_data.py index 88d16aa9..684a4754 100644 --- a/docusign_esign/models/envelope_form_data.py +++ b/docusign_esign/models/envelope_form_data.py @@ -34,7 +34,7 @@ class EnvelopeFormData(object): 'email_subject': 'str', 'envelope_id': 'str', 'form_data': 'list[NameValue]', - 'prefill_form_data': 'EnvelopeFormDataPrefillFormData', + 'prefill_form_data': 'PrefillFormData', 'recipient_form_data': 'list[RecipientFormData]', 'sent_date_time': 'str', 'status': 'str' @@ -152,7 +152,7 @@ def prefill_form_data(self): :return: The prefill_form_data of this EnvelopeFormData. # noqa: E501 - :rtype: EnvelopeFormDataPrefillFormData + :rtype: PrefillFormData """ return self._prefill_form_data @@ -162,7 +162,7 @@ def prefill_form_data(self, prefill_form_data): :param prefill_form_data: The prefill_form_data of this EnvelopeFormData. # noqa: E501 - :type: EnvelopeFormDataPrefillFormData + :type: PrefillFormData """ self._prefill_form_data = prefill_form_data diff --git a/docusign_esign/models/prefill_form_data.py b/docusign_esign/models/prefill_form_data.py new file mode 100644 index 00000000..b6ac885f --- /dev/null +++ b/docusign_esign/models/prefill_form_data.py @@ -0,0 +1,201 @@ +# coding: utf-8 + +""" + DocuSign REST API + + The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501 + + OpenAPI spec version: v2 + Contact: devcenter@docusign.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + + +class PrefillFormData(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'form_data': 'list[NameValue]', + 'sender_email': 'str', + 'sender_name': 'str', + 'sender_user_id': 'str' + } + + attribute_map = { + 'form_data': 'formData', + 'sender_email': 'senderEmail', + 'sender_name': 'senderName', + 'sender_user_id': 'senderUserId' + } + + def __init__(self, form_data=None, sender_email=None, sender_name=None, sender_user_id=None): # noqa: E501 + """PrefillFormData - a model defined in Swagger""" # noqa: E501 + + self._form_data = None + self._sender_email = None + self._sender_name = None + self._sender_user_id = None + self.discriminator = None + + if form_data is not None: + self.form_data = form_data + if sender_email is not None: + self.sender_email = sender_email + if sender_name is not None: + self.sender_name = sender_name + if sender_user_id is not None: + self.sender_user_id = sender_user_id + + @property + def form_data(self): + """Gets the form_data of this PrefillFormData. # noqa: E501 + + # noqa: E501 + + :return: The form_data of this PrefillFormData. # noqa: E501 + :rtype: list[NameValue] + """ + return self._form_data + + @form_data.setter + def form_data(self, form_data): + """Sets the form_data of this PrefillFormData. + + # noqa: E501 + + :param form_data: The form_data of this PrefillFormData. # noqa: E501 + :type: list[NameValue] + """ + + self._form_data = form_data + + @property + def sender_email(self): + """Gets the sender_email of this PrefillFormData. # noqa: E501 + + # noqa: E501 + + :return: The sender_email of this PrefillFormData. # noqa: E501 + :rtype: str + """ + return self._sender_email + + @sender_email.setter + def sender_email(self, sender_email): + """Sets the sender_email of this PrefillFormData. + + # noqa: E501 + + :param sender_email: The sender_email of this PrefillFormData. # noqa: E501 + :type: str + """ + + self._sender_email = sender_email + + @property + def sender_name(self): + """Gets the sender_name of this PrefillFormData. # noqa: E501 + + # noqa: E501 + + :return: The sender_name of this PrefillFormData. # noqa: E501 + :rtype: str + """ + return self._sender_name + + @sender_name.setter + def sender_name(self, sender_name): + """Sets the sender_name of this PrefillFormData. + + # noqa: E501 + + :param sender_name: The sender_name of this PrefillFormData. # noqa: E501 + :type: str + """ + + self._sender_name = sender_name + + @property + def sender_user_id(self): + """Gets the sender_user_id of this PrefillFormData. # noqa: E501 + + # noqa: E501 + + :return: The sender_user_id of this PrefillFormData. # noqa: E501 + :rtype: str + """ + return self._sender_user_id + + @sender_user_id.setter + def sender_user_id(self, sender_user_id): + """Sets the sender_user_id of this PrefillFormData. + + # noqa: E501 + + :param sender_user_id: The sender_user_id of this PrefillFormData. # noqa: E501 + :type: str + """ + + self._sender_user_id = sender_user_id + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PrefillFormData, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PrefillFormData): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/setup.py b/setup.py index d4858331..561e8824 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ from setuptools import setup, find_packages, Command, os # noqa: H301 NAME = "docusign-esign" -VERSION = "2.10.0" +VERSION = "2.11.0rc1" # To install the library, run the following # # python setup.py install diff --git a/test/unit_tests.py b/test/unit_tests.py index 54ead8b1..7e969b4b 100644 --- a/test/unit_tests.py +++ b/test/unit_tests.py @@ -67,6 +67,8 @@ def setUp(self): except ApiException as e: print("\nException when calling DocuSign API: %s" % e) + except Exception as e: + print("\nException when calling DocuSign API: %s" % e) self.api_client.rest_client.pool_manager.clear() def tearDown(self): @@ -92,6 +94,9 @@ def testLogin(self): except ApiException as e: print("\nException when calling DocuSign API: %s" % e) assert e is None # make the test case fail in case of an API exception + except Exception as e: + print("\nException when calling DocuSign API: %s" % e) + assert e is None # make the test case fail in case of an API exception def testRequestASignature(self): with open(SignTest1File, 'rb') as sign_file: @@ -157,6 +162,9 @@ def testRequestASignature(self): except ApiException as e: print("\nException when calling DocuSign API: %s" % e) assert e is None # make the test case fail in case of an API exception + except Exception as e: + print("\nException when calling DocuSign API: %s" % e) + assert e is None # make the test case fail in case of an API exception def testRequestSignatureFromTemplate(self): template_role_name = 'Needs to sign' @@ -202,6 +210,9 @@ def testRequestSignatureFromTemplate(self): except ApiException as e: print("\nException when calling DocuSign API: %s" % e) assert e is None # make the test case fail in case of an API exception + except Exception as e: + print("\nException when calling DocuSign API: %s" % e) + assert e is None # make the test case fail in case of an API exception def testEmbeddedSigning(self): with open(SignTest1File, 'rb') as sign_file: @@ -290,6 +301,9 @@ def testEmbeddedSigning(self): except ApiException as e: print("\nException when calling DocuSign API: %s" % e) assert e is None # make the test case fail in case of an API exception + except Exception as e: + print("\nException when calling DocuSign API: %s" % e) + assert e is None # make the test case fail in case of an API exception def testCreateTemplate(self): with open(SignTest1File, 'rb') as sign_file: @@ -358,6 +372,9 @@ def testCreateTemplate(self): except ApiException as e: print("\nException when calling DocuSign API: %s" % e) assert e is None # make the test case fail in case of an API exception + except Exception as e: + print("\nException when calling DocuSign API: %s" % e) + assert e is None # make the test case fail in case of an API exception def testDownLoadEnvelopeDocuments(self): with open(SignTest1File, 'rb') as sign_file: @@ -429,6 +446,9 @@ def testDownLoadEnvelopeDocuments(self): except ApiException as e: print("\nException when calling DocuSign API: %s" % e) assert e is None # make the test case fail in case of an API exception + except Exception as e: + print("\nException when calling DocuSign API: %s" % e) + assert e is None # make the test case fail in case of an API exception def testListDocuments(self): auth_api = AuthenticationApi() @@ -452,6 +472,9 @@ def testListDocuments(self): except ApiException as e: print("\nException when calling DocuSign API: %s" % e) assert e is None # make the test case fail in case of an API exception + except Exception as e: + print("\nException when calling DocuSign API: %s" % e) + assert e is None # make the test case fail in case of an API exception def testResendEnvelope(self): with open(SignTest1File, 'rb') as sign_file: @@ -528,6 +551,9 @@ def testResendEnvelope(self): except ApiException as e: print("\nException when calling DocuSign API: %s" % e) assert e is None # make the test case fail in case of an API exception + except Exception as e: + print("\nException when calling DocuSign API: %s" % e) + assert e is None # make the test case fail in case of an API exception def testGetDiagnosticLogs(self): with open(SignTest1File, 'rb') as sign_file: @@ -616,6 +642,9 @@ def testGetDiagnosticLogs(self): except ApiException as e: print("\nException when calling DocuSign API: %s" % e) assert e is None # make the test case fail in case of an API exception + except Exception as e: + print("\nException when calling DocuSign API: %s" % e) + assert e is None # make the test case fail in case of an API exception def testGetFormData(self): try: @@ -687,6 +716,9 @@ def testListTabs(self): except ApiException as e: print("\nException when calling DocuSign API: %s" % e) assert e is None # make the test case fail in case of an API exception + except Exception as e: + print("\nException when calling DocuSign API: %s" % e) + assert e is None # make the test case fail in case of an API exception def testMoveEnvelopes(self): with open(SignTest1File, 'rb') as sign_file: @@ -777,6 +809,9 @@ def testMoveEnvelopes(self): except ApiException as e: print("\nException when calling DocuSign API: %s" % e) assert e is None # make the test case fail in case of an API exception + except Exception as e: + print("\nException when calling DocuSign API: %s" % e) + assert e is None # make the test case fail in case of an API exception if __name__ == '__main__':