diff --git a/README.md b/README.md index fe3fd13..9d276ae 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ Python 3.8+ Install using `pip`: ```shell -python3 -m pip install dropbox-sign==1.9.0 +python3 -m pip install dropbox-sign==1.10.0 ``` Alternatively: @@ -400,6 +400,6 @@ apisupport@hellosign.com This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 3.0.0 -- Package version: 1.9.0 +- Package version: 1.10.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen diff --git a/VERSION b/VERSION index f8e233b..81c871d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.9.0 +1.10.0 diff --git a/bin/check-clean-git-status b/bin/check-clean-git-status index debcd48..a2131c2 100755 --- a/bin/check-clean-git-status +++ b/bin/check-clean-git-status @@ -7,7 +7,6 @@ if [[ $(git status --porcelain) != '' ]]; then printf "\t./run-build\n" git status - git diff exit 1 else diff --git a/docs/TemplateResponseDocumentFormFieldText.md b/docs/TemplateResponseDocumentFormFieldText.md index 8d52035..c0ed796 100644 --- a/docs/TemplateResponseDocumentFormFieldText.md +++ b/docs/TemplateResponseDocumentFormFieldText.md @@ -11,6 +11,8 @@ Name | Type | Description | Notes | `original_font_size` | ```int``` | Original font size used in this form field's text. | | | `font_family` | ```str``` | Font family used in this form field's text. | | | `validation_type` | ```str``` | Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values. | | +| `validation_custom_regex` | ```str``` | When `validation_type` is set to `custom_regex`, this specifies the custom regular expression pattern that will be used to validate the text field. | | +| `validation_custom_regex_format_label` | ```str``` | When `validation_type` is set to `custom_regex`, this specifies the error message displayed to the signer when the text does not match the provided regex pattern. | | | `group` | ```str``` | The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields. | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/dropbox_sign/__init__.py b/dropbox_sign/__init__.py index a000968..1486b6f 100644 --- a/dropbox_sign/__init__.py +++ b/dropbox_sign/__init__.py @@ -15,7 +15,7 @@ """ # noqa: E501 -__version__ = "1.9.0" +__version__ = "1.10.0" # import apis into sdk package from dropbox_sign.apis import * diff --git a/dropbox_sign/api_client.py b/dropbox_sign/api_client.py index b8ac14b..cd98147 100644 --- a/dropbox_sign/api_client.py +++ b/dropbox_sign/api_client.py @@ -89,7 +89,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = "OpenAPI-Generator/1.9.0/python" + self.user_agent = "OpenAPI-Generator/1.10.0/python" self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/dropbox_sign/configuration.py b/dropbox_sign/configuration.py index 180560a..1e0e120 100644 --- a/dropbox_sign/configuration.py +++ b/dropbox_sign/configuration.py @@ -546,7 +546,9 @@ def to_debug_report(self) -> str: "OS: {env}\n" "Python Version: {pyversion}\n" "Version of the API: 3.0.0\n" - "SDK Package Version: 1.9.0".format(env=sys.platform, pyversion=sys.version) + "SDK Package Version: 1.10.0".format( + env=sys.platform, pyversion=sys.version + ) ) def get_host_settings(self) -> List[HostSetting]: diff --git a/dropbox_sign/models/api_app_create_request.py b/dropbox_sign/models/api_app_create_request.py index 2e8e6a7..788c74a 100644 --- a/dropbox_sign/models/api_app_create_request.py +++ b/dropbox_sign/models/api_app_create_request.py @@ -36,7 +36,7 @@ class ApiAppCreateRequest(BaseModel): ApiAppCreateRequest """ # noqa: E501 - domains: Annotated[List[StrictStr], Field(min_length=1, max_length=2)] = Field( + domains: Annotated[List[StrictStr], Field(min_length=1, max_length=10)] = Field( description="The domain names the ApiApp will be associated with." ) name: StrictStr = Field(description="The name you want to assign to the ApiApp.") diff --git a/dropbox_sign/models/api_app_update_request.py b/dropbox_sign/models/api_app_update_request.py index 7e1f872..7370a7e 100644 --- a/dropbox_sign/models/api_app_update_request.py +++ b/dropbox_sign/models/api_app_update_request.py @@ -46,7 +46,7 @@ class ApiAppUpdateRequest(BaseModel): default=None, description="An image file to use as a custom logo in embedded contexts. (Only applies to some API plans)", ) - domains: Optional[Annotated[List[StrictStr], Field(max_length=2)]] = Field( + domains: Optional[Annotated[List[StrictStr], Field(max_length=10)]] = Field( default=None, description="The domain names the ApiApp will be associated with." ) name: Optional[StrictStr] = Field( diff --git a/dropbox_sign/models/report_create_request.py b/dropbox_sign/models/report_create_request.py index bdee210..9c4e3e1 100644 --- a/dropbox_sign/models/report_create_request.py +++ b/dropbox_sign/models/report_create_request.py @@ -48,9 +48,9 @@ class ReportCreateRequest(BaseModel): def report_type_validate_enum(cls, value): """Validates the enum""" for i in value: - if i not in set(["user_activity", "document_status"]): + if i not in set(["user_activity", "document_status", "sms_activity"]): raise ValueError( - "each list item must be one of ('user_activity', 'document_status')" + "each list item must be one of ('user_activity', 'document_status', 'sms_activity')" ) return value diff --git a/dropbox_sign/models/report_response.py b/dropbox_sign/models/report_response.py index f1fbe51..176195d 100644 --- a/dropbox_sign/models/report_response.py +++ b/dropbox_sign/models/report_response.py @@ -62,9 +62,9 @@ def report_type_validate_enum(cls, value): return value for i in value: - if i not in set(["user_activity", "document_status"]): + if i not in set(["user_activity", "document_status", "sms_activity"]): raise ValueError( - "each list item must be one of ('user_activity', 'document_status')" + "each list item must be one of ('user_activity', 'document_status', 'sms_activity')" ) return value diff --git a/dropbox_sign/models/template_response_document_form_field_text.py b/dropbox_sign/models/template_response_document_form_field_text.py index e6800d2..6280970 100644 --- a/dropbox_sign/models/template_response_document_form_field_text.py +++ b/dropbox_sign/models/template_response_document_form_field_text.py @@ -68,6 +68,14 @@ class TemplateResponseDocumentFormFieldText(TemplateResponseDocumentFormFieldBas default=None, description="Each text field may contain a `validation_type` parameter. Check out the list of [validation types](https://faq.hellosign.com/hc/en-us/articles/217115577) to learn more about the possible values.", ) + validation_custom_regex: Optional[StrictStr] = Field( + default=None, + description="When `validation_type` is set to `custom_regex`, this specifies the custom regular expression pattern that will be used to validate the text field.", + ) + validation_custom_regex_format_label: Optional[StrictStr] = Field( + default=None, + description="When `validation_type` is set to `custom_regex`, this specifies the error message displayed to the signer when the text does not match the provided regex pattern.", + ) group: Optional[StrictStr] = Field( default=None, description="The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.", @@ -87,6 +95,8 @@ class TemplateResponseDocumentFormFieldText(TemplateResponseDocumentFormFieldBas "originalFontSize", "fontFamily", "validation_type", + "validation_custom_regex", + "validation_custom_regex_format_label", "group", ] @@ -199,6 +209,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "originalFontSize": obj.get("originalFontSize"), "fontFamily": obj.get("fontFamily"), "validation_type": obj.get("validation_type"), + "validation_custom_regex": obj.get("validation_custom_regex"), + "validation_custom_regex_format_label": obj.get( + "validation_custom_regex_format_label" + ), "group": obj.get("group"), } ) @@ -223,6 +237,8 @@ def openapi_types(cls) -> Dict[str, str]: "original_font_size": "(int,)", "font_family": "(str,)", "validation_type": "(str,)", + "validation_custom_regex": "(str,)", + "validation_custom_regex_format_label": "(str,)", "group": "(str,)", "api_id": "(str,)", "name": "(str,)", diff --git a/openapi-config.yaml b/openapi-config.yaml index 0e7bd04..d3677b8 100644 --- a/openapi-config.yaml +++ b/openapi-config.yaml @@ -5,7 +5,7 @@ additionalProperties: generatorLanguageVersion: ">=3.8" packageName: dropbox_sign projectName: dropbox-sign - packageVersion: 1.9.0 + packageVersion: 1.10.0 sortModelPropertiesByRequiredFlag: true legacyDiscriminatorBehavior: true packageAuthor: Dropbox Sign API Team diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index c832450..f984d4d 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -7797,7 +7797,7 @@ components: type: array items: type: string - maxItems: 2 + maxItems: 10 minItems: 1 name: description: 'The name you want to assign to the ApiApp.' @@ -7823,7 +7823,7 @@ components: type: array items: type: string - maxItems: 2 + maxItems: 10 name: description: 'The name you want to assign to the ApiApp.' type: string @@ -8135,6 +8135,7 @@ components: enum: - user_activity - document_status + - sms_activity maxItems: 2 minItems: 1 start_date: @@ -11964,6 +11965,7 @@ components: enum: - user_activity - document_status + - sms_activity type: object x-internal-class: true SignatureRequestResponse: @@ -13130,6 +13132,14 @@ components: - employer_identification_number - custom_regex nullable: true + validation_custom_regex: + description: 'When `validation_type` is set to `custom_regex`, this specifies the custom regular expression pattern that will be used to validate the text field.' + type: string + nullable: true + validation_custom_regex_format_label: + description: 'When `validation_type` is set to `custom_regex`, this specifies the error message displayed to the signer when the text does not match the provided regex pattern.' + type: string + nullable: true group: description: 'The name of the group this field is in. If this field is not a group, this defaults to `null` except for Radio fields.' type: string diff --git a/pyproject.toml b/pyproject.toml index 9c6179c..2464415 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "dropbox_sign" -version = "1.9.0" +version = "1.10.0" description = "Dropbox Sign API" authors = ["Official Python SDK for the Dropbox Sign API "] license = "MIT" diff --git a/setup.py b/setup.py index a33217a..03d5fb2 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "dropbox-sign" -VERSION = "1.9.0" +VERSION = "1.10.0" PYTHON_REQUIRES = ">= 3.8" REQUIRES = [ "urllib3 >= 1.25.3, < 3.0.0", diff --git a/test_fixtures/FaxGetResponse.json b/test_fixtures/FaxGetResponse.json index 2eda936..0d668e0 100644 --- a/test_fixtures/FaxGetResponse.json +++ b/test_fixtures/FaxGetResponse.json @@ -20,12 +20,11 @@ "transmissions": [ { "recipient": "recipient@dropboxsign.com", - "sender": "me@dropboxsign.com", "sent_at": 1723231831, "status_code": "success" } ], - "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2", + "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2" } } } diff --git a/test_fixtures/FaxLineCreateRequest.json b/test_fixtures/FaxLineCreateRequest.json new file mode 100644 index 0000000..91d11c8 --- /dev/null +++ b/test_fixtures/FaxLineCreateRequest.json @@ -0,0 +1,6 @@ +{ + "default": { + "country": "US", + "area_code": 949 + } +} diff --git a/test_fixtures/FaxLineListResponse.json b/test_fixtures/FaxLineListResponse.json new file mode 100644 index 0000000..c241c1b --- /dev/null +++ b/test_fixtures/FaxLineListResponse.json @@ -0,0 +1,26 @@ +{ + "default": { + "list_info": { + "num_pages": 1, + "num_results": 1, + "page": 1, + "page_size": 1 + }, + "fax_lines": [ + { + "number": "14155557897", + "created_at": 1750196223, + "updated_at": 1750196223, + "accounts": [ + { + "account_id": "a3367a4130f3624687ea7de6f09df951a44923dd", + "email_address": "me@dropboxsign.com", + "is_locked": false, + "is_paid_hs": false, + "is_paid_hf": true + } + ] + } + ] + } +} diff --git a/test_fixtures/FaxLineResponse.json b/test_fixtures/FaxLineResponse.json new file mode 100644 index 0000000..3855a8a --- /dev/null +++ b/test_fixtures/FaxLineResponse.json @@ -0,0 +1,18 @@ +{ + "default": { + "fax_line": { + "number": "14155557897", + "created_at": 1750196223, + "updated_at": 1750196223, + "accounts": [ + { + "account_id": "a3367a4130f3624687ea7de6f09df951a44923dd", + "email_address": "me@dropboxsign.com", + "is_locked": false, + "is_paid_hs": false, + "is_paid_hf": true + } + ] + } + } +} diff --git a/test_fixtures/FaxListResponse.json b/test_fixtures/FaxListResponse.json index a9ebf63..d0ce7fe 100644 --- a/test_fixtures/FaxListResponse.json +++ b/test_fixtures/FaxListResponse.json @@ -27,12 +27,11 @@ "transmissions": [ { "recipient": "recipient@dropboxsign.com", - "sender": "me@dropboxsign.com", "sent_at": 1723231831, "status_code": "success" } ], - "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2", + "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2" } ] } diff --git a/test_fixtures/FaxResponse.json b/test_fixtures/FaxResponse.json new file mode 100644 index 0000000..32a44d5 --- /dev/null +++ b/test_fixtures/FaxResponse.json @@ -0,0 +1,24 @@ +{ + "default": { + "fax": { + "fax_id": "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d", + "title": "example title", + "original_title": "example original title", + "metadata": {}, + "created_at": 1750105080, + "sender": "14155557068", + "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2", + "final_copy_uri": "/v3/transmission/final_copy/c2e9691c85d9d6fa6ae773842e3680b2b8650f1d", + "transmissions": [ + { + "recipient": "18005550199", + "status_code": "transmitting" + } + ], + "transmission_id": "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d", + "from": "14155557068", + "test_mode": false + } + } +} + diff --git a/test_fixtures/FaxSendResponse.json b/test_fixtures/FaxSendResponse.json deleted file mode 100644 index b651c78..0000000 --- a/test_fixtures/FaxSendResponse.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "default": { - "fax": { - "fax_id": "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d", - "title": "example title", - "original_title": "example original title", - "subject": "example subject", - "message": "example message", - "metadata": [ ], - "created_at": 1726774555, - "sender": "me@dropboxsign.com", - "transmissions": [], - "files_url": "https://api.hellosign.com/v3/fax/files/2b388914e3ae3b738bd4e2ee2850c677e6dc53d2" - } - } -} diff --git a/tests/test_fax_api.py b/tests/test_fax_api.py new file mode 100644 index 0000000..b97509b --- /dev/null +++ b/tests/test_fax_api.py @@ -0,0 +1,71 @@ +import unittest + +from dropbox_sign import ApiClient, Configuration, apis, models as m +from test_utils import get_fixture_data, MockPoolManager, get_base_path + + +class TestFaxApi(unittest.TestCase): + def setUp(self): + self.configuration = Configuration() + self.api_client = ApiClient(self.configuration) + self.mock_pool = MockPoolManager(self) + self.api_client.rest_client.pool_manager = self.mock_pool + + self.api = apis.FaxApi(self.api_client) + + def test_fax_send(self): + request_class = "FaxSendRequest" + request_data = get_fixture_data(request_class)["default"] + + response_class = "FaxGetResponse" + response_data = get_fixture_data(response_class)["default"] + + self.mock_pool.expect_request( + content_type="multipart/form-data", + data=request_data, + response=response_data, + ) + expected = m.FaxGetResponse.init(response_data) + obj = m.FaxSendRequest.init(request_data) + obj.files = [open(f"{get_base_path()}/pdf-sample.pdf", "rb")] + + result = self.api.fax_send(obj) + + self.assertEqual(result.__class__.__name__, response_class) + self.assertEqual(result, expected) + + obj.files[0].close() + + def test_fax_get(self): + fax_id = "c2e9691c85d9d6fa6ae773842e3680b2b8650f1d" + + response_class = "FaxGetResponse" + response_data = get_fixture_data(response_class)["default"] + + self.mock_pool.expect_request( + content_type="application/json", response=response_data + ) + expected = m.FaxGetResponse.init(response_data) + + result = self.api.fax_get(fax_id) + + self.assertEqual(result.__class__.__name__, response_class) + self.assertEqual(result, expected) + + def test_fax_list(self): + response_class = "FaxListResponse" + response_data = get_fixture_data(response_class)["default"] + + self.mock_pool.expect_request( + content_type="application/json", response=response_data + ) + expected = m.FaxListResponse.init(response_data) + + result = self.api.fax_list() + + self.assertEqual(result.__class__.__name__, response_class) + self.assertEqual(result, expected) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/test_fax_line_api.py b/tests/test_fax_line_api.py new file mode 100644 index 0000000..569a08b --- /dev/null +++ b/tests/test_fax_line_api.py @@ -0,0 +1,68 @@ +import unittest + +from dropbox_sign import ApiClient, Configuration, apis, models as m +from test_utils import get_fixture_data, MockPoolManager, get_base_path + + +class TestFaxLineApi(unittest.TestCase): + def setUp(self): + self.configuration = Configuration() + self.api_client = ApiClient(self.configuration) + self.mock_pool = MockPoolManager(self) + self.api_client.rest_client.pool_manager = self.mock_pool + + self.api = apis.FaxLineApi(self.api_client) + + def test_fax_line_create(self): + request_class = "FaxLineCreateRequest" + request_data = get_fixture_data(request_class)["default"] + + response_class = "FaxLineResponse" + response_data = get_fixture_data(response_class)["default"] + + self.mock_pool.expect_request( + content_type="application/json", response=response_data + ) + + expected = m.FaxLineResponse.init(response_data) + + result = self.api.fax_line_create(obj) + + self.assertEqual(result.__class__.__name__, response_class) + self.assertEqual(result, expected) + + obj.files[0].close() + + def test_fax_line_get(self): + fax_line_number = "14155557897" + + response_class = "FaxLineResponse" + response_data = get_fixture_data(response_class)["default"] + + self.mock_pool.expect_request( + content_type="application/json", response=response_data + ) + expected = m.FaxLineResponse.init(response_data) + + result = self.api.fax_line_get(fax_line_number) + + self.assertEqual(result.__class__.__name__, response_class) + self.assertEqual(result, expected) + + def test_fax_line_list(self): + response_class = "FaxLineListResponse" + response_data = get_fixture_data(response_class)["default"] + + self.mock_pool.expect_request( + content_type="application/json", response=response_data + ) + expected = m.FaxLineListResponse.init(response_data) + + result = self.api.fax_line_list() + + self.assertEqual(result.__class__.__name__, response_class) + self.assertEqual(result, expected) + + +if __name__ == "__main__": + unittest.main()