diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml new file mode 100644 index 0000000..f3b2715 --- /dev/null +++ b/.github/workflows/python.yml @@ -0,0 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: docspring Python package + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r test-requirements.txt + - name: Test with pytest + run: | + pytest --cov={{packageName}} diff --git a/.gitignore b/.gitignore index b430c99..43995bd 100644 --- a/.gitignore +++ b/.gitignore @@ -45,7 +45,9 @@ coverage.xml *,cover .hypothesis/ venv/ +.venv/ .python-version +.pytest_cache # Translations *.mo @@ -62,8 +64,3 @@ target/ #Ipython Notebook .ipynb_checkpoints - -# Custom -test/venv-2/ -test/venv-3/ -.pytest_cache diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..5b8405c --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,31 @@ +# NOTE: This file is auto generated by OpenAPI Generator. +# URL: https://openapi-generator.tech +# +# ref: https://docs.gitlab.com/ee/ci/README.html +# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml + +stages: + - test + +.pytest: + stage: test + script: + - pip install -r requirements.txt + - pip install -r test-requirements.txt + - pytest --cov=docspring + +pytest-3.8: + extends: .pytest + image: python:3.8-alpine +pytest-3.9: + extends: .pytest + image: python:3.9-alpine +pytest-3.10: + extends: .pytest + image: python:3.10-alpine +pytest-3.11: + extends: .pytest + image: python:3.11-alpine +pytest-3.12: + extends: .pytest + image: python:3.12-alpine diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 0000000..75fe706 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,169 @@ +.github/workflows/python.yml +.gitignore +.gitlab-ci.yml +.travis.yml +README.md +docs/AddFieldsData.md +docs/BatchGeneratePdfs201Response.md +docs/CombinePdfsData.md +docs/CombinedSubmission.md +docs/CombinedSubmissionAction.md +docs/CombinedSubmissionData.md +docs/CopyTemplateOptions.md +docs/CreateCombinedSubmissionResponse.md +docs/CreateCustomFileData.md +docs/CreateCustomFileResponse.md +docs/CreateFolderData.md +docs/CreateHtmlSubmissionData.md +docs/CreateHtmlTemplate.md +docs/CreatePdfSubmissionData.md +docs/CreatePdfTemplate.md +docs/CreateSubmissionDataRequestData.md +docs/CreateSubmissionDataRequestEventRequest.md +docs/CreateSubmissionDataRequestEventResponse.md +docs/CreateSubmissionDataRequestResponse.md +docs/CreateSubmissionDataRequestTokenResponse.md +docs/CreateSubmissionResponse.md +docs/CustomFile.md +docs/ErrorResponse.md +docs/Folder.md +docs/JsonSchema.md +docs/ListSubmissionsResponse.md +docs/MoveFolderData.md +docs/MoveTemplateData.md +docs/MultipleErrorsResponse.md +docs/PDFApi.md +docs/RenameFolderData.md +docs/Submission.md +docs/SubmissionAction.md +docs/SubmissionBatch.md +docs/SubmissionBatchData.md +docs/SubmissionBatchWithSubmissions.md +docs/SubmissionDataRequest.md +docs/SubmissionDataRequestEvent.md +docs/SubmissionDataRequestShow.md +docs/SubmissionDataRequestToken.md +docs/SubmissionPreview.md +docs/SuccessErrorResponse.md +docs/SuccessMultipleErrorsResponse.md +docs/Template.md +docs/TemplateAddFieldsResponse.md +docs/TemplatePreview.md +docs/UpdateHtmlTemplate.md +docs/UpdateSubmissionDataRequestData.md +docs/UploadPresignResponse.md +docspring/__init__.py +docspring/api/__init__.py +docspring/api/pdf_api.py +docspring/api_client.py +docspring/api_response.py +docspring/configuration.py +docspring/exceptions.py +docspring/models/__init__.py +docspring/models/add_fields_data.py +docspring/models/batch_generate_pdfs201_response.py +docspring/models/combine_pdfs_data.py +docspring/models/combined_submission.py +docspring/models/combined_submission_action.py +docspring/models/combined_submission_data.py +docspring/models/copy_template_options.py +docspring/models/create_combined_submission_response.py +docspring/models/create_custom_file_data.py +docspring/models/create_custom_file_response.py +docspring/models/create_folder_data.py +docspring/models/create_html_submission_data.py +docspring/models/create_html_template.py +docspring/models/create_pdf_submission_data.py +docspring/models/create_pdf_template.py +docspring/models/create_submission_data_request_data.py +docspring/models/create_submission_data_request_event_request.py +docspring/models/create_submission_data_request_event_response.py +docspring/models/create_submission_data_request_response.py +docspring/models/create_submission_data_request_token_response.py +docspring/models/create_submission_response.py +docspring/models/custom_file.py +docspring/models/error_response.py +docspring/models/folder.py +docspring/models/json_schema.py +docspring/models/list_submissions_response.py +docspring/models/move_folder_data.py +docspring/models/move_template_data.py +docspring/models/multiple_errors_response.py +docspring/models/rename_folder_data.py +docspring/models/submission.py +docspring/models/submission_action.py +docspring/models/submission_batch.py +docspring/models/submission_batch_data.py +docspring/models/submission_batch_with_submissions.py +docspring/models/submission_data_request.py +docspring/models/submission_data_request_event.py +docspring/models/submission_data_request_show.py +docspring/models/submission_data_request_token.py +docspring/models/submission_preview.py +docspring/models/success_error_response.py +docspring/models/success_multiple_errors_response.py +docspring/models/template.py +docspring/models/template_add_fields_response.py +docspring/models/template_preview.py +docspring/models/update_html_template.py +docspring/models/update_submission_data_request_data.py +docspring/models/upload_presign_response.py +docspring/py.typed +docspring/rest.py +git_push.sh +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt +test/__init__.py +test/test_add_fields_data.py +test/test_batch_generate_pdfs201_response.py +test/test_combine_pdfs_data.py +test/test_combined_submission.py +test/test_combined_submission_action.py +test/test_combined_submission_data.py +test/test_copy_template_options.py +test/test_create_combined_submission_response.py +test/test_create_custom_file_data.py +test/test_create_custom_file_response.py +test/test_create_folder_data.py +test/test_create_html_submission_data.py +test/test_create_html_template.py +test/test_create_pdf_submission_data.py +test/test_create_pdf_template.py +test/test_create_submission_data_request_data.py +test/test_create_submission_data_request_event_request.py +test/test_create_submission_data_request_event_response.py +test/test_create_submission_data_request_response.py +test/test_create_submission_data_request_token_response.py +test/test_create_submission_response.py +test/test_custom_file.py +test/test_error_response.py +test/test_folder.py +test/test_json_schema.py +test/test_list_submissions_response.py +test/test_move_folder_data.py +test/test_move_template_data.py +test/test_multiple_errors_response.py +test/test_pdf_api.py +test/test_rename_folder_data.py +test/test_submission.py +test/test_submission_action.py +test/test_submission_batch.py +test/test_submission_batch_data.py +test/test_submission_batch_with_submissions.py +test/test_submission_data_request.py +test/test_submission_data_request_event.py +test/test_submission_data_request_show.py +test/test_submission_data_request_token.py +test/test_submission_preview.py +test/test_success_error_response.py +test/test_success_multiple_errors_response.py +test/test_template.py +test/test_template_add_fields_response.py +test/test_template_preview.py +test/test_update_html_template.py +test/test_update_submission_data_request_data.py +test/test_upload_presign_response.py +tox.ini diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 0fa4ae4..b23eb27 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -3.3.0 \ No newline at end of file +7.11.0 diff --git a/.travis.yml b/.travis.yml index 86211e2..b352520 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,14 +1,17 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "2.7" - - "3.2" - - "3.3" - - "3.4" - - "3.5" - #- "3.5-dev" # 3.5 development branch - #- "nightly" # points to the latest development branch e.g. 3.6-dev + - "3.8" + - "3.9" + - "3.10" + - "3.11" + - "3.12" + # uncomment the following if needed + #- "3.12-dev" # 3.12 development branch + #- "nightly" # nightly build # command to install dependencies -install: "pip install -r requirements.txt" +install: + - "pip install -r requirements.txt" + - "pip install -r test-requirements.txt" # command to run tests -script: nosetests +script: pytest --cov=docspring diff --git a/CHANGELOG.md b/CHANGELOG.md index 64847bd..5e1b109 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### 2.0.0 [February 23, 2025] + +- **BREAKING CHANGE**: Updated default host to our new synchronous API subdomain: sync.api.docspring.com. (EU customers should use sync.api-eu.docspring.com). Removed all custom polling code from library since this logic is now handled by the API service running on our sync subdomain +- Fixed User-Agent header: docspring-python-x.x.x + ### 1.3.2 [November 28, 2021] - Added 'password' parameter to Generate PDF and Combine PDF API endpoints. You can now encrypt each generated PDF with a unique password. diff --git a/README.md b/README.md index 11b1cf5..ea8ed8d 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,21 @@ # docspring -DocSpring is a service that helps you fill out and sign PDF templates. +DocSpring provides an API that helps you fill out and sign PDF templates. This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: v1 -- Package version: 1.3.2 -- Build package: com.docspring.codegen.DocSpringPythonClientCodegen +- Package version: 2.0.0 +- Generator version: 7.11.0 +- Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. -Python 2.7 and 3.4+ +Python 3.8+ ## Installation & Usage ### pip install -If the python package is hosted on Github, you can install directly from Github +If the python package is hosted on a repository, you can install directly using: ```sh pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git @@ -23,7 +24,7 @@ pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git Then import the package: ```python -import docspring +import docspring ``` ### Setuptools @@ -40,58 +41,80 @@ Then import the package: import docspring ``` +### Tests + +Execute `pytest` to run the tests. + ## Getting Started Please follow the [installation procedure](#installation--usage) and then run the following: ```python -from __future__ import print_function -import time + import docspring from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -template_id = 'tpl_000000000000000002' # str | -add_fields_data = docspring.AddFieldsData() # AddFieldsData | - -try: - # Add new fields to a Template - api_response = api_instance.add_fields_to_template(template_id, add_fields_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->add_fields_to_template: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + template_id = 'tpl_1234567890abcdef02' # str | + data = docspring.AddFieldsData() # AddFieldsData | + + try: + # Add new fields to a Template + api_response = api_instance.add_fields_to_template(template_id, data) + print("The response of PDFApi->add_fields_to_template:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling PDFApi->add_fields_to_template: %s\n" % e) ``` ## Documentation for API Endpoints -All URIs are relative to *https://api.docspring.com/api/v1* +All URIs are relative to *https://sync.api.docspring.com/api/v1* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *PDFApi* | [**add_fields_to_template**](docs/PDFApi.md#add_fields_to_template) | **PUT** /templates/{template_id}/add_fields | Add new fields to a Template -*PDFApi* | [**batch_generate_pdf_v1**](docs/PDFApi.md#batch_generate_pdf_v1) | **POST** /templates/{template_id}/submissions/batch | Generates multiple PDFs *PDFApi* | [**batch_generate_pdfs**](docs/PDFApi.md#batch_generate_pdfs) | **POST** /submissions/batches | Generates multiple PDFs *PDFApi* | [**combine_pdfs**](docs/PDFApi.md#combine_pdfs) | **POST** /combined_submissions?v=2 | Merge submission PDFs, template PDFs, or custom files *PDFApi* | [**combine_submissions**](docs/PDFApi.md#combine_submissions) | **POST** /combined_submissions | Merge generated PDFs together *PDFApi* | [**copy_template**](docs/PDFApi.md#copy_template) | **POST** /templates/{template_id}/copy | Copy a Template *PDFApi* | [**create_custom_file_from_upload**](docs/PDFApi.md#create_custom_file_from_upload) | **POST** /custom_files | Create a new custom file from a cached presign upload +*PDFApi* | [**create_data_request_event**](docs/PDFApi.md#create_data_request_event) | **POST** /data_requests/{data_request_id}/events | Creates a new event for emailing a signee a request for signature *PDFApi* | [**create_data_request_token**](docs/PDFApi.md#create_data_request_token) | **POST** /data_requests/{data_request_id}/tokens | Creates a new data request token for form authentication *PDFApi* | [**create_folder**](docs/PDFApi.md#create_folder) | **POST** /folders/ | Create a folder -*PDFApi* | [**create_html_template**](docs/PDFApi.md#create_html_template) | **POST** /templates?desc=html | Create a new HTML template +*PDFApi* | [**create_html_template**](docs/PDFApi.md#create_html_template) | **POST** /templates?endpoint_description=html | Create a new HTML template *PDFApi* | [**create_pdf_template**](docs/PDFApi.md#create_pdf_template) | **POST** /templates | Create a new PDF template with a form POST file upload -*PDFApi* | [**create_pdf_template_from_upload**](docs/PDFApi.md#create_pdf_template_from_upload) | **POST** /templates?desc=cached_upload | Create a new PDF template from a cached presign upload +*PDFApi* | [**create_pdf_template_from_upload**](docs/PDFApi.md#create_pdf_template_from_upload) | **POST** /templates?endpoint_description=cached_upload | Create a new PDF template from a cached presign upload *PDFApi* | [**delete_folder**](docs/PDFApi.md#delete_folder) | **DELETE** /folders/{folder_id} | Delete a folder +*PDFApi* | [**delete_template**](docs/PDFApi.md#delete_template) | **DELETE** /templates/{template_id} | Delete a template *PDFApi* | [**expire_combined_submission**](docs/PDFApi.md#expire_combined_submission) | **DELETE** /combined_submissions/{combined_submission_id} | Expire a combined submission *PDFApi* | [**expire_submission**](docs/PDFApi.md#expire_submission) | **DELETE** /submissions/{submission_id} | Expire a PDF submission *PDFApi* | [**generate_pdf**](docs/PDFApi.md#generate_pdf) | **POST** /templates/{template_id}/submissions | Generates a new PDF +*PDFApi* | [**generate_pdf_for_html_template**](docs/PDFApi.md#generate_pdf_for_html_template) | **POST** /templates/{template_id}/submissions?endpoint_description=html_templates | Generates a new PDF for an HTML template +*PDFApi* | [**generate_preview**](docs/PDFApi.md#generate_preview) | **POST** /submissions/{submission_id}/generate_preview | Generated a preview PDF for partially completed data requests *PDFApi* | [**get_combined_submission**](docs/PDFApi.md#get_combined_submission) | **GET** /combined_submissions/{combined_submission_id} | Check the status of a combined submission (merged PDFs) *PDFApi* | [**get_data_request**](docs/PDFApi.md#get_data_request) | **GET** /data_requests/{data_request_id} | Look up a submission data request *PDFApi* | [**get_full_template**](docs/PDFApi.md#get_full_template) | **GET** /templates/{template_id}?full=true | Fetch the full template attributes @@ -100,9 +123,10 @@ Class | Method | HTTP request | Description *PDFApi* | [**get_submission_batch**](docs/PDFApi.md#get_submission_batch) | **GET** /submissions/batches/{submission_batch_id} | Check the status of a submission batch job *PDFApi* | [**get_template**](docs/PDFApi.md#get_template) | **GET** /templates/{template_id} | Check the status of an uploaded template *PDFApi* | [**get_template_schema**](docs/PDFApi.md#get_template_schema) | **GET** /templates/{template_id}/schema | Fetch the JSON schema for a template +*PDFApi* | [**list_combined_submissions**](docs/PDFApi.md#list_combined_submissions) | **GET** /combined_submissions | Get a list of all combined submissions *PDFApi* | [**list_folders**](docs/PDFApi.md#list_folders) | **GET** /folders/ | Get a list of all folders *PDFApi* | [**list_submissions**](docs/PDFApi.md#list_submissions) | **GET** /submissions | List all submissions -*PDFApi* | [**list_submissions_0**](docs/PDFApi.md#list_submissions_0) | **GET** /templates/{template_id}/submissions | List all submissions for a given template +*PDFApi* | [**list_template_submissions**](docs/PDFApi.md#list_template_submissions) | **GET** /templates/{template_id}/submissions | List all submissions for a given template *PDFApi* | [**list_templates**](docs/PDFApi.md#list_templates) | **GET** /templates | Get a list of all templates *PDFApi* | [**move_folder_to_folder**](docs/PDFApi.md#move_folder_to_folder) | **POST** /folders/{folder_id}/move | Move a folder *PDFApi* | [**move_template_to_folder**](docs/PDFApi.md#move_template_to_folder) | **POST** /templates/{template_id}/move | Move Template to folder @@ -115,62 +139,62 @@ Class | Method | HTTP request | Description ## Documentation For Models - [AddFieldsData](docs/AddFieldsData.md) - - [AddFieldsTemplateResponse](docs/AddFieldsTemplateResponse.md) - - [AuthenticationError](docs/AuthenticationError.md) - - [AuthenticationSuccessResponse](docs/AuthenticationSuccessResponse.md) + - [BatchGeneratePdfs201Response](docs/BatchGeneratePdfs201Response.md) - [CombinePdfsData](docs/CombinePdfsData.md) - [CombinedSubmission](docs/CombinedSubmission.md) - [CombinedSubmissionAction](docs/CombinedSubmissionAction.md) - [CombinedSubmissionData](docs/CombinedSubmissionData.md) - - [CopyTemplateData](docs/CopyTemplateData.md) + - [CopyTemplateOptions](docs/CopyTemplateOptions.md) - [CreateCombinedSubmissionResponse](docs/CreateCombinedSubmissionResponse.md) - [CreateCustomFileData](docs/CreateCustomFileData.md) - [CreateCustomFileResponse](docs/CreateCustomFileResponse.md) - [CreateFolderData](docs/CreateFolderData.md) - - [CreateHtmlTemplateData](docs/CreateHtmlTemplateData.md) - - [CreateSubmissionBatchResponse](docs/CreateSubmissionBatchResponse.md) - - [CreateSubmissionBatchSubmissionsResponse](docs/CreateSubmissionBatchSubmissionsResponse.md) + - [CreateHtmlSubmissionData](docs/CreateHtmlSubmissionData.md) + - [CreateHtmlTemplate](docs/CreateHtmlTemplate.md) + - [CreatePdfSubmissionData](docs/CreatePdfSubmissionData.md) + - [CreatePdfTemplate](docs/CreatePdfTemplate.md) - [CreateSubmissionDataRequestData](docs/CreateSubmissionDataRequestData.md) + - [CreateSubmissionDataRequestEventRequest](docs/CreateSubmissionDataRequestEventRequest.md) + - [CreateSubmissionDataRequestEventResponse](docs/CreateSubmissionDataRequestEventResponse.md) + - [CreateSubmissionDataRequestResponse](docs/CreateSubmissionDataRequestResponse.md) - [CreateSubmissionDataRequestTokenResponse](docs/CreateSubmissionDataRequestTokenResponse.md) - - [CreateSubmissionDataRequestTokenResponseToken](docs/CreateSubmissionDataRequestTokenResponseToken.md) - [CreateSubmissionResponse](docs/CreateSubmissionResponse.md) - - [CreateTemplateFromUploadData](docs/CreateTemplateFromUploadData.md) - [CustomFile](docs/CustomFile.md) - - [Error](docs/Error.md) + - [ErrorResponse](docs/ErrorResponse.md) - [Folder](docs/Folder.md) - - [FoldersFolder](docs/FoldersFolder.md) - - [HtmlTemplateData](docs/HtmlTemplateData.md) - - [InvalidRequest](docs/InvalidRequest.md) + - [JsonSchema](docs/JsonSchema.md) - [ListSubmissionsResponse](docs/ListSubmissionsResponse.md) - [MoveFolderData](docs/MoveFolderData.md) - [MoveTemplateData](docs/MoveTemplateData.md) - - [PendingTemplate](docs/PendingTemplate.md) + - [MultipleErrorsResponse](docs/MultipleErrorsResponse.md) - [RenameFolderData](docs/RenameFolderData.md) - [Submission](docs/Submission.md) - [SubmissionAction](docs/SubmissionAction.md) - [SubmissionBatch](docs/SubmissionBatch.md) - [SubmissionBatchData](docs/SubmissionBatchData.md) - - [SubmissionData](docs/SubmissionData.md) - - [SubmissionDataBatchRequest](docs/SubmissionDataBatchRequest.md) + - [SubmissionBatchWithSubmissions](docs/SubmissionBatchWithSubmissions.md) - [SubmissionDataRequest](docs/SubmissionDataRequest.md) + - [SubmissionDataRequestEvent](docs/SubmissionDataRequestEvent.md) + - [SubmissionDataRequestShow](docs/SubmissionDataRequestShow.md) + - [SubmissionDataRequestToken](docs/SubmissionDataRequestToken.md) + - [SubmissionPreview](docs/SubmissionPreview.md) + - [SuccessErrorResponse](docs/SuccessErrorResponse.md) + - [SuccessMultipleErrorsResponse](docs/SuccessMultipleErrorsResponse.md) - [Template](docs/Template.md) - - [Template1](docs/Template1.md) - - [Template1Defaults](docs/Template1Defaults.md) - - [TemplateData](docs/TemplateData.md) - - [TemplatestemplateIdaddFieldsFields](docs/TemplatestemplateIdaddFieldsFields.md) - - [UpdateDataRequestResponse](docs/UpdateDataRequestResponse.md) + - [TemplateAddFieldsResponse](docs/TemplateAddFieldsResponse.md) + - [TemplatePreview](docs/TemplatePreview.md) + - [UpdateHtmlTemplate](docs/UpdateHtmlTemplate.md) - [UpdateSubmissionDataRequestData](docs/UpdateSubmissionDataRequestData.md) - - [UpdateTemplateData](docs/UpdateTemplateData.md) - - [UpdateTemplateResponse](docs/UpdateTemplateResponse.md) - - [UploadTemplateData](docs/UploadTemplateData.md) - - [UploadTemplateDataDocument](docs/UploadTemplateDataDocument.md) - - [UploadTemplateDataDocumentMetadata](docs/UploadTemplateDataDocumentMetadata.md) + - [UploadPresignResponse](docs/UploadPresignResponse.md) + ## Documentation For Authorization -## api_token_basic +Authentication schemes defined for the API: + +### api_token_basic - **Type**: HTTP basic authentication diff --git a/docs/AddFieldsData.md b/docs/AddFieldsData.md index 8c059f7..b6f97c5 100644 --- a/docs/AddFieldsData.md +++ b/docs/AddFieldsData.md @@ -1,10 +1,29 @@ # AddFieldsData + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**fields** | [**list[TemplatestemplateIdaddFieldsFields]**](TemplatestemplateIdaddFieldsFields.md) | | +**fields** | **List[object]** | | + +## Example + +```python +from docspring.models.add_fields_data import AddFieldsData + +# TODO update the JSON string below +json = "{}" +# create an instance of AddFieldsData from a JSON string +add_fields_data_instance = AddFieldsData.from_json(json) +# print the JSON string representation of the object +print(AddFieldsData.to_json()) +# convert the object into a dict +add_fields_data_dict = add_fields_data_instance.to_dict() +# create an instance of AddFieldsData from a dict +add_fields_data_from_dict = AddFieldsData.from_dict(add_fields_data_dict) +``` [[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/docs/AddFieldsTemplateResponse.md b/docs/AddFieldsTemplateResponse.md deleted file mode 100644 index 2858f5c..0000000 --- a/docs/AddFieldsTemplateResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# AddFieldsTemplateResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**new_field_ids** | **list[int]** | | [optional] -**errors** | **list[str]** | | [optional] -**status** | **str** | | [optional] - -[[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/docs/AuthenticationError.md b/docs/AuthenticationError.md deleted file mode 100644 index 6a90772..0000000 --- a/docs/AuthenticationError.md +++ /dev/null @@ -1,11 +0,0 @@ -# AuthenticationError - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **str** | | [optional] -**error** | **str** | | - -[[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/docs/AuthenticationSuccessResponse.md b/docs/AuthenticationSuccessResponse.md deleted file mode 100644 index dcad9ca..0000000 --- a/docs/AuthenticationSuccessResponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# AuthenticationSuccessResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **str** | | [optional] - -[[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/docs/BatchGeneratePdfs201Response.md b/docs/BatchGeneratePdfs201Response.md new file mode 100644 index 0000000..9260de1 --- /dev/null +++ b/docs/BatchGeneratePdfs201Response.md @@ -0,0 +1,33 @@ +# BatchGeneratePdfs201Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | | +**error** | **str** | | [optional] +**errors** | **List[str]** | | [optional] +**submission_batch** | [**SubmissionBatch**](SubmissionBatch.md) | | +**submissions** | **List[object]** | | + +## Example + +```python +from docspring.models.batch_generate_pdfs201_response import BatchGeneratePdfs201Response + +# TODO update the JSON string below +json = "{}" +# create an instance of BatchGeneratePdfs201Response from a JSON string +batch_generate_pdfs201_response_instance = BatchGeneratePdfs201Response.from_json(json) +# print the JSON string representation of the object +print(BatchGeneratePdfs201Response.to_json()) + +# convert the object into a dict +batch_generate_pdfs201_response_dict = batch_generate_pdfs201_response_instance.to_dict() +# create an instance of BatchGeneratePdfs201Response from a dict +batch_generate_pdfs201_response_from_dict = BatchGeneratePdfs201Response.from_dict(batch_generate_pdfs201_response_dict) +``` +[[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/docs/CombinePdfsData.md b/docs/CombinePdfsData.md index 793cf75..ab2009a 100644 --- a/docs/CombinePdfsData.md +++ b/docs/CombinePdfsData.md @@ -1,15 +1,34 @@ # CombinePdfsData + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **delete_custom_files** | **bool** | | [optional] **expires_in** | **int** | | [optional] **metadata** | **object** | | [optional] **password** | **str** | | [optional] -**source_pdfs** | **list[object]** | | +**source_pdfs** | **List[object]** | | **test** | **bool** | | [optional] +## Example + +```python +from docspring.models.combine_pdfs_data import CombinePdfsData + +# TODO update the JSON string below +json = "{}" +# create an instance of CombinePdfsData from a JSON string +combine_pdfs_data_instance = CombinePdfsData.from_json(json) +# print the JSON string representation of the object +print(CombinePdfsData.to_json()) + +# convert the object into a dict +combine_pdfs_data_dict = combine_pdfs_data_instance.to_dict() +# create an instance of CombinePdfsData from a dict +combine_pdfs_data_from_dict = CombinePdfsData.from_dict(combine_pdfs_data_dict) +``` [[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/docs/CombinedSubmission.md b/docs/CombinedSubmission.md index e0c4248..77d4f33 100644 --- a/docs/CombinedSubmission.md +++ b/docs/CombinedSubmission.md @@ -1,20 +1,42 @@ # CombinedSubmission + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**metadata** | **object** | | [optional] -**password** | **str** | | [optional] -**expired** | **bool** | | [optional] -**expires_at** | **str** | | [optional] -**source_pdfs** | **list[object]** | | [optional] -**pdf_hash** | **str** | | [optional] -**download_url** | **str** | | [optional] -**submission_ids** | **list[str]** | | [optional] -**id** | **str** | | [optional] -**state** | **str** | | [optional] -**actions** | [**list[CombinedSubmissionAction]**](CombinedSubmissionAction.md) | | [optional] +**id** | **str** | | +**state** | **str** | | +**expired** | **bool** | | +**expires_in** | **int** | | +**expires_at** | **str** | | +**processed_at** | **str** | | +**error_message** | **str** | | +**submission_ids** | **List[str]** | | +**source_pdfs** | **List[object]** | | +**metadata** | **object** | | +**password** | **str** | | +**pdf_hash** | **str** | | +**download_url** | **str** | | +**actions** | [**List[CombinedSubmissionAction]**](CombinedSubmissionAction.md) | | + +## Example + +```python +from docspring.models.combined_submission import CombinedSubmission + +# TODO update the JSON string below +json = "{}" +# create an instance of CombinedSubmission from a JSON string +combined_submission_instance = CombinedSubmission.from_json(json) +# print the JSON string representation of the object +print(CombinedSubmission.to_json()) +# convert the object into a dict +combined_submission_dict = combined_submission_instance.to_dict() +# create an instance of CombinedSubmission from a dict +combined_submission_from_dict = CombinedSubmission.from_dict(combined_submission_dict) +``` [[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/docs/CombinedSubmissionAction.md b/docs/CombinedSubmissionAction.md index 101e085..9baad5c 100644 --- a/docs/CombinedSubmissionAction.md +++ b/docs/CombinedSubmissionAction.md @@ -1,15 +1,34 @@ # CombinedSubmissionAction + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | **integration_id** | **str** | | **state** | **str** | | -**action_category** | **str** | | **action_type** | **str** | | +**action_category** | **str** | | **result_data** | **object** | | +## Example + +```python +from docspring.models.combined_submission_action import CombinedSubmissionAction + +# TODO update the JSON string below +json = "{}" +# create an instance of CombinedSubmissionAction from a JSON string +combined_submission_action_instance = CombinedSubmissionAction.from_json(json) +# print the JSON string representation of the object +print(CombinedSubmissionAction.to_json()) + +# convert the object into a dict +combined_submission_action_dict = combined_submission_action_instance.to_dict() +# create an instance of CombinedSubmissionAction from a dict +combined_submission_action_from_dict = CombinedSubmissionAction.from_dict(combined_submission_action_dict) +``` [[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/docs/CombinedSubmissionData.md b/docs/CombinedSubmissionData.md index 8c77e02..dbeee75 100644 --- a/docs/CombinedSubmissionData.md +++ b/docs/CombinedSubmissionData.md @@ -1,14 +1,33 @@ # CombinedSubmissionData + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **expires_in** | **int** | | [optional] **metadata** | **object** | | [optional] **password** | **str** | | [optional] -**submission_ids** | **list[str]** | | +**submission_ids** | **List[str]** | | **test** | **bool** | | [optional] +## Example + +```python +from docspring.models.combined_submission_data import CombinedSubmissionData + +# TODO update the JSON string below +json = "{}" +# create an instance of CombinedSubmissionData from a JSON string +combined_submission_data_instance = CombinedSubmissionData.from_json(json) +# print the JSON string representation of the object +print(CombinedSubmissionData.to_json()) + +# convert the object into a dict +combined_submission_data_dict = combined_submission_data_instance.to_dict() +# create an instance of CombinedSubmissionData from a dict +combined_submission_data_from_dict = CombinedSubmissionData.from_dict(combined_submission_data_dict) +``` [[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/docs/CopyTemplateData.md b/docs/CopyTemplateData.md deleted file mode 100644 index 20539f3..0000000 --- a/docs/CopyTemplateData.md +++ /dev/null @@ -1,11 +0,0 @@ -# CopyTemplateData - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**parent_folder_id** | **str** | | - -[[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/docs/CopyTemplateOptions.md b/docs/CopyTemplateOptions.md new file mode 100644 index 0000000..cada787 --- /dev/null +++ b/docs/CopyTemplateOptions.md @@ -0,0 +1,30 @@ +# CopyTemplateOptions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | | [optional] +**parent_folder_id** | **str** | | + +## Example + +```python +from docspring.models.copy_template_options import CopyTemplateOptions + +# TODO update the JSON string below +json = "{}" +# create an instance of CopyTemplateOptions from a JSON string +copy_template_options_instance = CopyTemplateOptions.from_json(json) +# print the JSON string representation of the object +print(CopyTemplateOptions.to_json()) + +# convert the object into a dict +copy_template_options_dict = copy_template_options_instance.to_dict() +# create an instance of CopyTemplateOptions from a dict +copy_template_options_from_dict = CopyTemplateOptions.from_dict(copy_template_options_dict) +``` +[[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/docs/CreateCombinedSubmissionResponse.md b/docs/CreateCombinedSubmissionResponse.md index 3c470bc..6bce979 100644 --- a/docs/CreateCombinedSubmissionResponse.md +++ b/docs/CreateCombinedSubmissionResponse.md @@ -1,12 +1,31 @@ # CreateCombinedSubmissionResponse + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**combined_submission** | [**CombinedSubmission**](CombinedSubmission.md) | | [optional] -**errors** | **list[str]** | | [optional] -**status** | **str** | | [optional] +**status** | **str** | | +**combined_submission** | [**CombinedSubmission**](CombinedSubmission.md) | | +**errors** | **List[str]** | | [optional] + +## Example + +```python +from docspring.models.create_combined_submission_response import CreateCombinedSubmissionResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateCombinedSubmissionResponse from a JSON string +create_combined_submission_response_instance = CreateCombinedSubmissionResponse.from_json(json) +# print the JSON string representation of the object +print(CreateCombinedSubmissionResponse.to_json()) +# convert the object into a dict +create_combined_submission_response_dict = create_combined_submission_response_instance.to_dict() +# create an instance of CreateCombinedSubmissionResponse from a dict +create_combined_submission_response_from_dict = CreateCombinedSubmissionResponse.from_dict(create_combined_submission_response_dict) +``` [[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/docs/CreateCustomFileData.md b/docs/CreateCustomFileData.md index 492a041..212a552 100644 --- a/docs/CreateCustomFileData.md +++ b/docs/CreateCustomFileData.md @@ -1,10 +1,29 @@ # CreateCustomFileData + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **cache_id** | **str** | | +## Example + +```python +from docspring.models.create_custom_file_data import CreateCustomFileData + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateCustomFileData from a JSON string +create_custom_file_data_instance = CreateCustomFileData.from_json(json) +# print the JSON string representation of the object +print(CreateCustomFileData.to_json()) + +# convert the object into a dict +create_custom_file_data_dict = create_custom_file_data_instance.to_dict() +# create an instance of CreateCustomFileData from a dict +create_custom_file_data_from_dict = CreateCustomFileData.from_dict(create_custom_file_data_dict) +``` [[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/docs/CreateCustomFileResponse.md b/docs/CreateCustomFileResponse.md index 68f4565..1eebefe 100644 --- a/docs/CreateCustomFileResponse.md +++ b/docs/CreateCustomFileResponse.md @@ -1,12 +1,31 @@ # CreateCustomFileResponse + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**custom_file** | [**CustomFile**](CustomFile.md) | | [optional] -**errors** | **list[str]** | | [optional] -**status** | **str** | | [optional] +**status** | **str** | | +**custom_file** | [**CustomFile**](CustomFile.md) | | +**errors** | **List[str]** | | [optional] + +## Example + +```python +from docspring.models.create_custom_file_response import CreateCustomFileResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateCustomFileResponse from a JSON string +create_custom_file_response_instance = CreateCustomFileResponse.from_json(json) +# print the JSON string representation of the object +print(CreateCustomFileResponse.to_json()) +# convert the object into a dict +create_custom_file_response_dict = create_custom_file_response_instance.to_dict() +# create an instance of CreateCustomFileResponse from a dict +create_custom_file_response_from_dict = CreateCustomFileResponse.from_dict(create_custom_file_response_dict) +``` [[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/docs/CreateFolderData.md b/docs/CreateFolderData.md index a95a8e0..1e8fbef 100644 --- a/docs/CreateFolderData.md +++ b/docs/CreateFolderData.md @@ -1,10 +1,29 @@ # CreateFolderData + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**folder** | [**FoldersFolder**](FoldersFolder.md) | | +**folder** | **object** | | + +## Example + +```python +from docspring.models.create_folder_data import CreateFolderData + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateFolderData from a JSON string +create_folder_data_instance = CreateFolderData.from_json(json) +# print the JSON string representation of the object +print(CreateFolderData.to_json()) +# convert the object into a dict +create_folder_data_dict = create_folder_data_instance.to_dict() +# create an instance of CreateFolderData from a dict +create_folder_data_from_dict = CreateFolderData.from_dict(create_folder_data_dict) +``` [[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/docs/CreateHtmlSubmissionData.md b/docs/CreateHtmlSubmissionData.md new file mode 100644 index 0000000..c4b25d8 --- /dev/null +++ b/docs/CreateHtmlSubmissionData.md @@ -0,0 +1,37 @@ +# CreateHtmlSubmissionData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**css** | **str** | | [optional] +**data** | **object** | | [optional] +**editable** | **bool** | | [optional] +**expires_in** | **int** | | [optional] +**field_overrides** | **object** | | [optional] +**html** | **str** | | [optional] +**metadata** | **object** | | [optional] +**password** | **str** | | [optional] +**test** | **bool** | | [optional] + +## Example + +```python +from docspring.models.create_html_submission_data import CreateHtmlSubmissionData + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateHtmlSubmissionData from a JSON string +create_html_submission_data_instance = CreateHtmlSubmissionData.from_json(json) +# print the JSON string representation of the object +print(CreateHtmlSubmissionData.to_json()) + +# convert the object into a dict +create_html_submission_data_dict = create_html_submission_data_instance.to_dict() +# create an instance of CreateHtmlSubmissionData from a dict +create_html_submission_data_from_dict = CreateHtmlSubmissionData.from_dict(create_html_submission_data_dict) +``` +[[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/docs/CreateHtmlTemplate.md b/docs/CreateHtmlTemplate.md new file mode 100644 index 0000000..43f50ac --- /dev/null +++ b/docs/CreateHtmlTemplate.md @@ -0,0 +1,29 @@ +# CreateHtmlTemplate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**template** | **object** | | + +## Example + +```python +from docspring.models.create_html_template import CreateHtmlTemplate + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateHtmlTemplate from a JSON string +create_html_template_instance = CreateHtmlTemplate.from_json(json) +# print the JSON string representation of the object +print(CreateHtmlTemplate.to_json()) + +# convert the object into a dict +create_html_template_dict = create_html_template_instance.to_dict() +# create an instance of CreateHtmlTemplate from a dict +create_html_template_from_dict = CreateHtmlTemplate.from_dict(create_html_template_dict) +``` +[[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/docs/CreateHtmlTemplateData.md b/docs/CreateHtmlTemplateData.md deleted file mode 100644 index e58ca6a..0000000 --- a/docs/CreateHtmlTemplateData.md +++ /dev/null @@ -1,10 +0,0 @@ -# CreateHtmlTemplateData - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**template** | [**HtmlTemplateData**](HtmlTemplateData.md) | | - -[[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/docs/CreatePdfSubmissionData.md b/docs/CreatePdfSubmissionData.md new file mode 100644 index 0000000..b315a98 --- /dev/null +++ b/docs/CreatePdfSubmissionData.md @@ -0,0 +1,36 @@ +# CreatePdfSubmissionData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | **object** | | +**data_requests** | [**List[CreateSubmissionDataRequestData]**](CreateSubmissionDataRequestData.md) | | [optional] +**editable** | **bool** | | [optional] +**expires_in** | **int** | | [optional] +**field_overrides** | **object** | | [optional] +**metadata** | **object** | | [optional] +**password** | **str** | | [optional] +**test** | **bool** | | [optional] + +## Example + +```python +from docspring.models.create_pdf_submission_data import CreatePdfSubmissionData + +# TODO update the JSON string below +json = "{}" +# create an instance of CreatePdfSubmissionData from a JSON string +create_pdf_submission_data_instance = CreatePdfSubmissionData.from_json(json) +# print the JSON string representation of the object +print(CreatePdfSubmissionData.to_json()) + +# convert the object into a dict +create_pdf_submission_data_dict = create_pdf_submission_data_instance.to_dict() +# create an instance of CreatePdfSubmissionData from a dict +create_pdf_submission_data_from_dict = CreatePdfSubmissionData.from_dict(create_pdf_submission_data_dict) +``` +[[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/docs/CreatePdfTemplate.md b/docs/CreatePdfTemplate.md new file mode 100644 index 0000000..4594d43 --- /dev/null +++ b/docs/CreatePdfTemplate.md @@ -0,0 +1,29 @@ +# CreatePdfTemplate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**template** | **object** | | + +## Example + +```python +from docspring.models.create_pdf_template import CreatePdfTemplate + +# TODO update the JSON string below +json = "{}" +# create an instance of CreatePdfTemplate from a JSON string +create_pdf_template_instance = CreatePdfTemplate.from_json(json) +# print the JSON string representation of the object +print(CreatePdfTemplate.to_json()) + +# convert the object into a dict +create_pdf_template_dict = create_pdf_template_instance.to_dict() +# create an instance of CreatePdfTemplate from a dict +create_pdf_template_from_dict = CreatePdfTemplate.from_dict(create_pdf_template_dict) +``` +[[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/docs/CreateSubmissionBatchResponse.md b/docs/CreateSubmissionBatchResponse.md deleted file mode 100644 index 6ec3442..0000000 --- a/docs/CreateSubmissionBatchResponse.md +++ /dev/null @@ -1,14 +0,0 @@ -# CreateSubmissionBatchResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**submission_batch** | [**SubmissionBatch**](SubmissionBatch.md) | | [optional] -**submissions** | [**list[CreateSubmissionBatchSubmissionsResponse]**](CreateSubmissionBatchSubmissionsResponse.md) | | [optional] -**error** | **str** | | [optional] -**errors** | **list[str]** | | [optional] -**status** | **str** | | [optional] - -[[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/docs/CreateSubmissionBatchSubmissionsResponse.md b/docs/CreateSubmissionBatchSubmissionsResponse.md deleted file mode 100644 index eee98ce..0000000 --- a/docs/CreateSubmissionBatchSubmissionsResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# CreateSubmissionBatchSubmissionsResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**submission** | [**Submission**](Submission.md) | | [optional] -**errors** | **list[str]** | | [optional] -**status** | **str** | | [optional] - -[[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/docs/CreateSubmissionDataRequestData.md b/docs/CreateSubmissionDataRequestData.md index 79bc21a..e020029 100644 --- a/docs/CreateSubmissionDataRequestData.md +++ b/docs/CreateSubmissionDataRequestData.md @@ -1,22 +1,33 @@ # CreateSubmissionDataRequestData + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**auth_second_factor_type** | **str** | | [optional] **auth_type** | **str** | | [optional] +**fields** | **List[str]** | | [optional] **metadata** | **object** | | [optional] -**auth_second_factor_type** | **str** | | [optional] -**auth_phone_number_hash** | **str** | | [optional] -**auth_session_started_at** | **str** | | [optional] -**auth_user_id_hash** | **str** | | [optional] -**auth_session_id_hash** | **str** | | [optional] -**auth_username_hash** | **str** | | [optional] -**name** | **str** | | [optional] -**fields** | **list[str]** | | [optional] -**auth_provider** | **str** | | [optional] -**email** | **str** | | [optional] **order** | **int** | | [optional] +## Example + +```python +from docspring.models.create_submission_data_request_data import CreateSubmissionDataRequestData + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateSubmissionDataRequestData from a JSON string +create_submission_data_request_data_instance = CreateSubmissionDataRequestData.from_json(json) +# print the JSON string representation of the object +print(CreateSubmissionDataRequestData.to_json()) + +# convert the object into a dict +create_submission_data_request_data_dict = create_submission_data_request_data_instance.to_dict() +# create an instance of CreateSubmissionDataRequestData from a dict +create_submission_data_request_data_from_dict = CreateSubmissionDataRequestData.from_dict(create_submission_data_request_data_dict) +``` [[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/docs/CreateSubmissionDataRequestEventRequest.md b/docs/CreateSubmissionDataRequestEventRequest.md new file mode 100644 index 0000000..b10dcc6 --- /dev/null +++ b/docs/CreateSubmissionDataRequestEventRequest.md @@ -0,0 +1,30 @@ +# CreateSubmissionDataRequestEventRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**event_type** | **str** | | +**message_type** | **str** | | [optional] + +## Example + +```python +from docspring.models.create_submission_data_request_event_request import CreateSubmissionDataRequestEventRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateSubmissionDataRequestEventRequest from a JSON string +create_submission_data_request_event_request_instance = CreateSubmissionDataRequestEventRequest.from_json(json) +# print the JSON string representation of the object +print(CreateSubmissionDataRequestEventRequest.to_json()) + +# convert the object into a dict +create_submission_data_request_event_request_dict = create_submission_data_request_event_request_instance.to_dict() +# create an instance of CreateSubmissionDataRequestEventRequest from a dict +create_submission_data_request_event_request_from_dict = CreateSubmissionDataRequestEventRequest.from_dict(create_submission_data_request_event_request_dict) +``` +[[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/docs/CreateSubmissionDataRequestEventResponse.md b/docs/CreateSubmissionDataRequestEventResponse.md new file mode 100644 index 0000000..4156d95 --- /dev/null +++ b/docs/CreateSubmissionDataRequestEventResponse.md @@ -0,0 +1,31 @@ +# CreateSubmissionDataRequestEventResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | | +**event** | [**SubmissionDataRequestEvent**](SubmissionDataRequestEvent.md) | | +**errors** | **List[str]** | | [optional] + +## Example + +```python +from docspring.models.create_submission_data_request_event_response import CreateSubmissionDataRequestEventResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateSubmissionDataRequestEventResponse from a JSON string +create_submission_data_request_event_response_instance = CreateSubmissionDataRequestEventResponse.from_json(json) +# print the JSON string representation of the object +print(CreateSubmissionDataRequestEventResponse.to_json()) + +# convert the object into a dict +create_submission_data_request_event_response_dict = create_submission_data_request_event_response_instance.to_dict() +# create an instance of CreateSubmissionDataRequestEventResponse from a dict +create_submission_data_request_event_response_from_dict = CreateSubmissionDataRequestEventResponse.from_dict(create_submission_data_request_event_response_dict) +``` +[[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/docs/CreateSubmissionDataRequestResponse.md b/docs/CreateSubmissionDataRequestResponse.md new file mode 100644 index 0000000..7bd9829 --- /dev/null +++ b/docs/CreateSubmissionDataRequestResponse.md @@ -0,0 +1,31 @@ +# CreateSubmissionDataRequestResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | | +**data_request** | [**SubmissionDataRequestShow**](SubmissionDataRequestShow.md) | | +**errors** | **List[str]** | | [optional] + +## Example + +```python +from docspring.models.create_submission_data_request_response import CreateSubmissionDataRequestResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateSubmissionDataRequestResponse from a JSON string +create_submission_data_request_response_instance = CreateSubmissionDataRequestResponse.from_json(json) +# print the JSON string representation of the object +print(CreateSubmissionDataRequestResponse.to_json()) + +# convert the object into a dict +create_submission_data_request_response_dict = create_submission_data_request_response_instance.to_dict() +# create an instance of CreateSubmissionDataRequestResponse from a dict +create_submission_data_request_response_from_dict = CreateSubmissionDataRequestResponse.from_dict(create_submission_data_request_response_dict) +``` +[[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/docs/CreateSubmissionDataRequestTokenResponse.md b/docs/CreateSubmissionDataRequestTokenResponse.md index 49ed679..43c75c0 100644 --- a/docs/CreateSubmissionDataRequestTokenResponse.md +++ b/docs/CreateSubmissionDataRequestTokenResponse.md @@ -1,12 +1,31 @@ # CreateSubmissionDataRequestTokenResponse + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**errors** | **list[str]** | | [optional] -**status** | **str** | | [optional] -**token** | [**CreateSubmissionDataRequestTokenResponseToken**](CreateSubmissionDataRequestTokenResponseToken.md) | | [optional] +**status** | **str** | | +**token** | [**SubmissionDataRequestToken**](SubmissionDataRequestToken.md) | | +**errors** | **List[str]** | | [optional] + +## Example + +```python +from docspring.models.create_submission_data_request_token_response import CreateSubmissionDataRequestTokenResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateSubmissionDataRequestTokenResponse from a JSON string +create_submission_data_request_token_response_instance = CreateSubmissionDataRequestTokenResponse.from_json(json) +# print the JSON string representation of the object +print(CreateSubmissionDataRequestTokenResponse.to_json()) +# convert the object into a dict +create_submission_data_request_token_response_dict = create_submission_data_request_token_response_instance.to_dict() +# create an instance of CreateSubmissionDataRequestTokenResponse from a dict +create_submission_data_request_token_response_from_dict = CreateSubmissionDataRequestTokenResponse.from_dict(create_submission_data_request_token_response_dict) +``` [[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/docs/CreateSubmissionDataRequestTokenResponseToken.md b/docs/CreateSubmissionDataRequestTokenResponseToken.md deleted file mode 100644 index 69a3ca8..0000000 --- a/docs/CreateSubmissionDataRequestTokenResponseToken.md +++ /dev/null @@ -1,13 +0,0 @@ -# CreateSubmissionDataRequestTokenResponseToken - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**expires_at** | **str** | | [optional] -**id** | **str** | | [optional] -**secret** | **str** | | [optional] -**data_request_url** | **str** | | [optional] - -[[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/docs/CreateSubmissionResponse.md b/docs/CreateSubmissionResponse.md index ef35322..6be918b 100644 --- a/docs/CreateSubmissionResponse.md +++ b/docs/CreateSubmissionResponse.md @@ -1,12 +1,31 @@ # CreateSubmissionResponse + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**submission** | [**Submission**](Submission.md) | | [optional] -**errors** | **list[str]** | | [optional] -**status** | **str** | | [optional] +**status** | **str** | | +**submission** | [**SubmissionPreview**](SubmissionPreview.md) | | +**errors** | **List[str]** | | [optional] + +## Example + +```python +from docspring.models.create_submission_response import CreateSubmissionResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateSubmissionResponse from a JSON string +create_submission_response_instance = CreateSubmissionResponse.from_json(json) +# print the JSON string representation of the object +print(CreateSubmissionResponse.to_json()) +# convert the object into a dict +create_submission_response_dict = create_submission_response_instance.to_dict() +# create an instance of CreateSubmissionResponse from a dict +create_submission_response_from_dict = CreateSubmissionResponse.from_dict(create_submission_response_dict) +``` [[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/docs/CreateTemplateFromUploadData.md b/docs/CreateTemplateFromUploadData.md deleted file mode 100644 index d245d4b..0000000 --- a/docs/CreateTemplateFromUploadData.md +++ /dev/null @@ -1,10 +0,0 @@ -# CreateTemplateFromUploadData - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**template** | [**UploadTemplateData**](UploadTemplateData.md) | | - -[[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/docs/CustomFile.md b/docs/CustomFile.md index 891502a..4c557a9 100644 --- a/docs/CustomFile.md +++ b/docs/CustomFile.md @@ -1,11 +1,30 @@ # CustomFile + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | [optional] -**url** | **str** | | [optional] +**id** | **str** | | +**url** | **str** | | + +## Example + +```python +from docspring.models.custom_file import CustomFile + +# TODO update the JSON string below +json = "{}" +# create an instance of CustomFile from a JSON string +custom_file_instance = CustomFile.from_json(json) +# print the JSON string representation of the object +print(CustomFile.to_json()) +# convert the object into a dict +custom_file_dict = custom_file_instance.to_dict() +# create an instance of CustomFile from a dict +custom_file_from_dict = CustomFile.from_dict(custom_file_dict) +``` [[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/docs/Error.md b/docs/Error.md deleted file mode 100644 index b403d6d..0000000 --- a/docs/Error.md +++ /dev/null @@ -1,11 +0,0 @@ -# Error - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **str** | | -**error** | **str** | | - -[[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/docs/ErrorResponse.md b/docs/ErrorResponse.md new file mode 100644 index 0000000..7449b28 --- /dev/null +++ b/docs/ErrorResponse.md @@ -0,0 +1,30 @@ +# ErrorResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | | +**error** | **str** | | + +## Example + +```python +from docspring.models.error_response import ErrorResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ErrorResponse from a JSON string +error_response_instance = ErrorResponse.from_json(json) +# print the JSON string representation of the object +print(ErrorResponse.to_json()) + +# convert the object into a dict +error_response_dict = error_response_instance.to_dict() +# create an instance of ErrorResponse from a dict +error_response_from_dict = ErrorResponse.from_dict(error_response_dict) +``` +[[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/docs/Folder.md b/docs/Folder.md index 95e4f9e..42990ac 100644 --- a/docs/Folder.md +++ b/docs/Folder.md @@ -1,13 +1,32 @@ # Folder + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**path** | **str** | | [optional] -**parent_folder_id** | **str** | | [optional] -**name** | **str** | | [optional] -**id** | **str** | | [optional] +**id** | **str** | | +**name** | **str** | | +**path** | **str** | | +**parent_folder_id** | **str** | | + +## Example + +```python +from docspring.models.folder import Folder + +# TODO update the JSON string below +json = "{}" +# create an instance of Folder from a JSON string +folder_instance = Folder.from_json(json) +# print the JSON string representation of the object +print(Folder.to_json()) +# convert the object into a dict +folder_dict = folder_instance.to_dict() +# create an instance of Folder from a dict +folder_from_dict = Folder.from_dict(folder_dict) +``` [[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/docs/FoldersFolder.md b/docs/FoldersFolder.md deleted file mode 100644 index b661fbe..0000000 --- a/docs/FoldersFolder.md +++ /dev/null @@ -1,11 +0,0 @@ -# FoldersFolder - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**parent_folder_id** | **str** | | [optional] -**name** | **str** | | [optional] - -[[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/docs/HtmlTemplateData.md b/docs/HtmlTemplateData.md deleted file mode 100644 index 3c89b52..0000000 --- a/docs/HtmlTemplateData.md +++ /dev/null @@ -1,26 +0,0 @@ -# HtmlTemplateData - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**expiration_interval** | **str** | | [optional] -**webhook_url** | **str** | | [optional] -**scss** | **str** | | [optional] -**allow_additional_properties** | **bool** | | [optional] -**expire_after** | **float** | | [optional] -**description** | **str** | | [optional] -**public_submissions** | **bool** | | [optional] -**slack_webhook_url** | **str** | | [optional] -**header_html** | **str** | | [optional] -**public_web_form** | **bool** | | [optional] -**editable_submissions** | **bool** | | [optional] -**expire_submissions** | **bool** | | [optional] -**name** | **str** | | [optional] -**footer_html** | **str** | | [optional] -**html** | **str** | | [optional] -**template_type** | **str** | | [optional] -**redirect_url** | **str** | | [optional] - -[[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/docs/InvalidRequest.md b/docs/InvalidRequest.md deleted file mode 100644 index c4ba301..0000000 --- a/docs/InvalidRequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# InvalidRequest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **str** | | -**errors** | **list[str]** | | - -[[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/docs/JsonSchema.md b/docs/JsonSchema.md new file mode 100644 index 0000000..dcf07ae --- /dev/null +++ b/docs/JsonSchema.md @@ -0,0 +1,37 @@ +# JsonSchema + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_schema** | **str** | | [optional] +**id** | **str** | | [optional] +**title** | **str** | | [optional] +**description** | **str** | | [optional] +**definitions** | **object** | | [optional] +**type** | **str** | | [optional] +**properties** | **object** | | [optional] +**additional_properties** | **bool** | | [optional] +**required** | **List[str]** | | [optional] + +## Example + +```python +from docspring.models.json_schema import JsonSchema + +# TODO update the JSON string below +json = "{}" +# create an instance of JsonSchema from a JSON string +json_schema_instance = JsonSchema.from_json(json) +# print the JSON string representation of the object +print(JsonSchema.to_json()) + +# convert the object into a dict +json_schema_dict = json_schema_instance.to_dict() +# create an instance of JsonSchema from a dict +json_schema_from_dict = JsonSchema.from_dict(json_schema_dict) +``` +[[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/docs/ListSubmissionsResponse.md b/docs/ListSubmissionsResponse.md index aeef6d6..088d1c4 100644 --- a/docs/ListSubmissionsResponse.md +++ b/docs/ListSubmissionsResponse.md @@ -1,12 +1,31 @@ # ListSubmissionsResponse + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**next_cursor** | **str** | | [optional] -**submissions** | [**list[Submission]**](Submission.md) | | [optional] -**limit** | **float** | | [optional] +**submissions** | [**List[Submission]**](Submission.md) | | +**limit** | **float** | | +**next_cursor** | **str** | | + +## Example + +```python +from docspring.models.list_submissions_response import ListSubmissionsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ListSubmissionsResponse from a JSON string +list_submissions_response_instance = ListSubmissionsResponse.from_json(json) +# print the JSON string representation of the object +print(ListSubmissionsResponse.to_json()) +# convert the object into a dict +list_submissions_response_dict = list_submissions_response_instance.to_dict() +# create an instance of ListSubmissionsResponse from a dict +list_submissions_response_from_dict = ListSubmissionsResponse.from_dict(list_submissions_response_dict) +``` [[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/docs/MoveFolderData.md b/docs/MoveFolderData.md index 04b74aa..df0debc 100644 --- a/docs/MoveFolderData.md +++ b/docs/MoveFolderData.md @@ -1,10 +1,29 @@ # MoveFolderData + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **parent_folder_id** | **str** | | [optional] +## Example + +```python +from docspring.models.move_folder_data import MoveFolderData + +# TODO update the JSON string below +json = "{}" +# create an instance of MoveFolderData from a JSON string +move_folder_data_instance = MoveFolderData.from_json(json) +# print the JSON string representation of the object +print(MoveFolderData.to_json()) + +# convert the object into a dict +move_folder_data_dict = move_folder_data_instance.to_dict() +# create an instance of MoveFolderData from a dict +move_folder_data_from_dict = MoveFolderData.from_dict(move_folder_data_dict) +``` [[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/docs/MoveTemplateData.md b/docs/MoveTemplateData.md index 8383bd3..dac95e8 100644 --- a/docs/MoveTemplateData.md +++ b/docs/MoveTemplateData.md @@ -1,10 +1,29 @@ # MoveTemplateData + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **parent_folder_id** | **str** | | +## Example + +```python +from docspring.models.move_template_data import MoveTemplateData + +# TODO update the JSON string below +json = "{}" +# create an instance of MoveTemplateData from a JSON string +move_template_data_instance = MoveTemplateData.from_json(json) +# print the JSON string representation of the object +print(MoveTemplateData.to_json()) + +# convert the object into a dict +move_template_data_dict = move_template_data_instance.to_dict() +# create an instance of MoveTemplateData from a dict +move_template_data_from_dict = MoveTemplateData.from_dict(move_template_data_dict) +``` [[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/docs/MultipleErrorsResponse.md b/docs/MultipleErrorsResponse.md new file mode 100644 index 0000000..13140dc --- /dev/null +++ b/docs/MultipleErrorsResponse.md @@ -0,0 +1,30 @@ +# MultipleErrorsResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | | +**errors** | **List[str]** | | + +## Example + +```python +from docspring.models.multiple_errors_response import MultipleErrorsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of MultipleErrorsResponse from a JSON string +multiple_errors_response_instance = MultipleErrorsResponse.from_json(json) +# print the JSON string representation of the object +print(MultipleErrorsResponse.to_json()) + +# convert the object into a dict +multiple_errors_response_dict = multiple_errors_response_instance.to_dict() +# create an instance of MultipleErrorsResponse from a dict +multiple_errors_response_from_dict = MultipleErrorsResponse.from_dict(multiple_errors_response_dict) +``` +[[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/docs/PDFApi.md b/docs/PDFApi.md index 79b92b2..536699b 100644 --- a/docs/PDFApi.md +++ b/docs/PDFApi.md @@ -1,25 +1,28 @@ # docspring.PDFApi -All URIs are relative to *https://api.docspring.com/api/v1* +All URIs are relative to *https://sync.api.docspring.com/api/v1* Method | HTTP request | Description ------------- | ------------- | ------------- [**add_fields_to_template**](PDFApi.md#add_fields_to_template) | **PUT** /templates/{template_id}/add_fields | Add new fields to a Template -[**batch_generate_pdf_v1**](PDFApi.md#batch_generate_pdf_v1) | **POST** /templates/{template_id}/submissions/batch | Generates multiple PDFs [**batch_generate_pdfs**](PDFApi.md#batch_generate_pdfs) | **POST** /submissions/batches | Generates multiple PDFs [**combine_pdfs**](PDFApi.md#combine_pdfs) | **POST** /combined_submissions?v=2 | Merge submission PDFs, template PDFs, or custom files [**combine_submissions**](PDFApi.md#combine_submissions) | **POST** /combined_submissions | Merge generated PDFs together [**copy_template**](PDFApi.md#copy_template) | **POST** /templates/{template_id}/copy | Copy a Template [**create_custom_file_from_upload**](PDFApi.md#create_custom_file_from_upload) | **POST** /custom_files | Create a new custom file from a cached presign upload +[**create_data_request_event**](PDFApi.md#create_data_request_event) | **POST** /data_requests/{data_request_id}/events | Creates a new event for emailing a signee a request for signature [**create_data_request_token**](PDFApi.md#create_data_request_token) | **POST** /data_requests/{data_request_id}/tokens | Creates a new data request token for form authentication [**create_folder**](PDFApi.md#create_folder) | **POST** /folders/ | Create a folder -[**create_html_template**](PDFApi.md#create_html_template) | **POST** /templates?desc=html | Create a new HTML template +[**create_html_template**](PDFApi.md#create_html_template) | **POST** /templates?endpoint_description=html | Create a new HTML template [**create_pdf_template**](PDFApi.md#create_pdf_template) | **POST** /templates | Create a new PDF template with a form POST file upload -[**create_pdf_template_from_upload**](PDFApi.md#create_pdf_template_from_upload) | **POST** /templates?desc=cached_upload | Create a new PDF template from a cached presign upload +[**create_pdf_template_from_upload**](PDFApi.md#create_pdf_template_from_upload) | **POST** /templates?endpoint_description=cached_upload | Create a new PDF template from a cached presign upload [**delete_folder**](PDFApi.md#delete_folder) | **DELETE** /folders/{folder_id} | Delete a folder +[**delete_template**](PDFApi.md#delete_template) | **DELETE** /templates/{template_id} | Delete a template [**expire_combined_submission**](PDFApi.md#expire_combined_submission) | **DELETE** /combined_submissions/{combined_submission_id} | Expire a combined submission [**expire_submission**](PDFApi.md#expire_submission) | **DELETE** /submissions/{submission_id} | Expire a PDF submission [**generate_pdf**](PDFApi.md#generate_pdf) | **POST** /templates/{template_id}/submissions | Generates a new PDF +[**generate_pdf_for_html_template**](PDFApi.md#generate_pdf_for_html_template) | **POST** /templates/{template_id}/submissions?endpoint_description=html_templates | Generates a new PDF for an HTML template +[**generate_preview**](PDFApi.md#generate_preview) | **POST** /submissions/{submission_id}/generate_preview | Generated a preview PDF for partially completed data requests [**get_combined_submission**](PDFApi.md#get_combined_submission) | **GET** /combined_submissions/{combined_submission_id} | Check the status of a combined submission (merged PDFs) [**get_data_request**](PDFApi.md#get_data_request) | **GET** /data_requests/{data_request_id} | Look up a submission data request [**get_full_template**](PDFApi.md#get_full_template) | **GET** /templates/{template_id}?full=true | Fetch the full template attributes @@ -28,9 +31,10 @@ Method | HTTP request | Description [**get_submission_batch**](PDFApi.md#get_submission_batch) | **GET** /submissions/batches/{submission_batch_id} | Check the status of a submission batch job [**get_template**](PDFApi.md#get_template) | **GET** /templates/{template_id} | Check the status of an uploaded template [**get_template_schema**](PDFApi.md#get_template_schema) | **GET** /templates/{template_id}/schema | Fetch the JSON schema for a template +[**list_combined_submissions**](PDFApi.md#list_combined_submissions) | **GET** /combined_submissions | Get a list of all combined submissions [**list_folders**](PDFApi.md#list_folders) | **GET** /folders/ | Get a list of all folders [**list_submissions**](PDFApi.md#list_submissions) | **GET** /submissions | List all submissions -[**list_submissions_0**](PDFApi.md#list_submissions_0) | **GET** /templates/{template_id}/submissions | List all submissions for a given template +[**list_template_submissions**](PDFApi.md#list_template_submissions) | **GET** /templates/{template_id}/submissions | List all submissions for a given template [**list_templates**](PDFApi.md#list_templates) | **GET** /templates | Get a list of all templates [**move_folder_to_folder**](PDFApi.md#move_folder_to_folder) | **POST** /folders/{folder_id}/move | Move a folder [**move_template_to_folder**](PDFApi.md#move_template_to_folder) | **POST** /templates/{template_id}/move | Move Template to folder @@ -41,48 +45,67 @@ Method | HTTP request | Description # **add_fields_to_template** -> AddFieldsTemplateResponse add_fields_to_template(template_id, add_fields_data) +> TemplateAddFieldsResponse add_fields_to_template(template_id, data) Add new fields to a Template ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.add_fields_data import AddFieldsData +from docspring.models.template_add_fields_response import TemplateAddFieldsResponse from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -template_id = 'tpl_000000000000000002' # str | -add_fields_data = docspring.AddFieldsData() # AddFieldsData | - -try: - # Add new fields to a Template - api_response = api_instance.add_fields_to_template(template_id, add_fields_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->add_fields_to_template: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + template_id = 'tpl_1234567890abcdef02' # str | + data = docspring.AddFieldsData() # AddFieldsData | + + try: + # Add new fields to a Template + api_response = api_instance.add_fields_to_template(template_id, data) + print("The response of PDFApi->add_fields_to_template:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->add_fields_to_template: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **template_id** | **str**| | - **add_fields_data** | [**AddFieldsData**](AddFieldsData.md)| | + **data** | [**AddFieldsData**](AddFieldsData.md)| | ### Return type -[**AddFieldsTemplateResponse**](AddFieldsTemplateResponse.md) +[**TemplateAddFieldsResponse**](TemplateAddFieldsResponse.md) ### Authorization @@ -93,51 +116,77 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | add fields success | - | +**422** | add fields error | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **batch_generate_pdf_v1** -> list[CreateSubmissionResponse] batch_generate_pdf_v1(template_id, request_body) +# **batch_generate_pdfs** +> BatchGeneratePdfs201Response batch_generate_pdfs(data, wait=wait) Generates multiple PDFs ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.batch_generate_pdfs201_response import BatchGeneratePdfs201Response +from docspring.models.submission_batch_data import SubmissionBatchData from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -template_id = 'tpl_000000000000000001' # str | -request_body = NULL # list[object] | - -try: - # Generates multiple PDFs - api_response = api_instance.batch_generate_pdf_v1(template_id, request_body) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->batch_generate_pdf_v1: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + data = docspring.SubmissionBatchData() # SubmissionBatchData | + wait = True # bool | Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (optional) (default to True) + + try: + # Generates multiple PDFs + api_response = api_instance.batch_generate_pdfs(data, wait=wait) + print("The response of PDFApi->batch_generate_pdfs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->batch_generate_pdfs: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **template_id** | **str**| | - **request_body** | [**list[object]**](list.md)| | + **data** | [**SubmissionBatchData**](SubmissionBatchData.md)| | + **wait** | **bool**| Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) | [optional] [default to True] ### Return type -[**list[CreateSubmissionResponse]**](CreateSubmissionResponse.md) +[**BatchGeneratePdfs201Response**](BatchGeneratePdfs201Response.md) ### Authorization @@ -148,49 +197,78 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | submissions created | - | +**200** | some PDFs with invalid data | - | +**401** | authentication failed | - | +**422** | array of arrays | - | +**400** | invalid JSON | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **batch_generate_pdfs** -> CreateSubmissionBatchResponse batch_generate_pdfs(submission_batch_data) +# **combine_pdfs** +> CreateCombinedSubmissionResponse combine_pdfs(data) -Generates multiple PDFs +Merge submission PDFs, template PDFs, or custom files ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.combine_pdfs_data import CombinePdfsData +from docspring.models.create_combined_submission_response import CreateCombinedSubmissionResponse from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -submission_batch_data = docspring.SubmissionBatchData() # SubmissionBatchData | - -try: - # Generates multiple PDFs - api_response = api_instance.batch_generate_pdfs(submission_batch_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->batch_generate_pdfs: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + data = docspring.CombinePdfsData() # CombinePdfsData | + + try: + # Merge submission PDFs, template PDFs, or custom files + api_response = api_instance.combine_pdfs(data) + print("The response of PDFApi->combine_pdfs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->combine_pdfs: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **submission_batch_data** | [**SubmissionBatchData**](SubmissionBatchData.md)| | + **data** | [**CombinePdfsData**](CombinePdfsData.md)| | ### Return type -[**CreateSubmissionBatchResponse**](CreateSubmissionBatchResponse.md) +[**CreateCombinedSubmissionResponse**](CreateCombinedSubmissionResponse.md) ### Authorization @@ -201,45 +279,75 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | combined submission created | - | +**422** | invalid request | - | +**400** | invalid JSON | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **combine_pdfs** -> CreateCombinedSubmissionResponse combine_pdfs(combine_pdfs_data) +# **combine_submissions** +> CreateCombinedSubmissionResponse combine_submissions(data, wait=wait) -Merge submission PDFs, template PDFs, or custom files +Merge generated PDFs together ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.combined_submission_data import CombinedSubmissionData +from docspring.models.create_combined_submission_response import CreateCombinedSubmissionResponse from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -combine_pdfs_data = docspring.CombinePdfsData() # CombinePdfsData | - -try: - # Merge submission PDFs, template PDFs, or custom files - api_response = api_instance.combine_pdfs(combine_pdfs_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->combine_pdfs: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + data = docspring.CombinedSubmissionData() # CombinedSubmissionData | + wait = True # bool | Wait for combined submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (optional) (default to True) + + try: + # Merge generated PDFs together + api_response = api_instance.combine_submissions(data, wait=wait) + print("The response of PDFApi->combine_submissions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->combine_submissions: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **combine_pdfs_data** | [**CombinePdfsData**](CombinePdfsData.md)| | + **data** | [**CombinedSubmissionData**](CombinedSubmissionData.md)| | + **wait** | **bool**| Wait for combined submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) | [optional] [default to True] ### Return type @@ -254,49 +362,79 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | combined submission created | - | +**422** | invalid request | - | +**400** | invalid JSON | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **combine_submissions** -> CreateCombinedSubmissionResponse combine_submissions(combined_submission_data) +# **copy_template** +> TemplatePreview copy_template(template_id, options=options) -Merge generated PDFs together +Copy a Template ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.copy_template_options import CopyTemplateOptions +from docspring.models.template_preview import TemplatePreview from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -combined_submission_data = docspring.CombinedSubmissionData() # CombinedSubmissionData | - -try: - # Merge generated PDFs together - api_response = api_instance.combine_submissions(combined_submission_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->combine_submissions: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + template_id = 'tpl_1234567890abcdef01' # str | + options = docspring.CopyTemplateOptions() # CopyTemplateOptions | (optional) + + try: + # Copy a Template + api_response = api_instance.copy_template(template_id, options=options) + print("The response of PDFApi->copy_template:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->copy_template: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **combined_submission_data** | [**CombinedSubmissionData**](CombinedSubmissionData.md)| | + **template_id** | **str**| | + **options** | [**CopyTemplateOptions**](CopyTemplateOptions.md)| | [optional] ### Return type -[**CreateCombinedSubmissionResponse**](CreateCombinedSubmissionResponse.md) +[**TemplatePreview**](TemplatePreview.md) ### Authorization @@ -307,51 +445,75 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | copy template success | - | +**404** | folder not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **copy_template** -> Template copy_template(template_id, copy_template_data) +# **create_custom_file_from_upload** +> CreateCustomFileResponse create_custom_file_from_upload(data) -Copy a Template +Create a new custom file from a cached presign upload ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.create_custom_file_data import CreateCustomFileData +from docspring.models.create_custom_file_response import CreateCustomFileResponse from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -template_id = 'tpl_000000000000000001' # str | -copy_template_data = docspring.CopyTemplateData() # CopyTemplateData | - -try: - # Copy a Template - api_response = api_instance.copy_template(template_id, copy_template_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->copy_template: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + data = docspring.CreateCustomFileData() # CreateCustomFileData | + + try: + # Create a new custom file from a cached presign upload + api_response = api_instance.create_custom_file_from_upload(data) + print("The response of PDFApi->create_custom_file_from_upload:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->create_custom_file_from_upload: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **template_id** | **str**| | - **copy_template_data** | [**CopyTemplateData**](CopyTemplateData.md)| | + **data** | [**CreateCustomFileData**](CreateCustomFileData.md)| | ### Return type -[**Template**](Template.md) +[**CreateCustomFileResponse**](CreateCustomFileResponse.md) ### Authorization @@ -362,49 +524,77 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | returns the custom file | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **create_custom_file_from_upload** -> CreateCustomFileResponse create_custom_file_from_upload(create_custom_file_data) +# **create_data_request_event** +> CreateSubmissionDataRequestEventResponse create_data_request_event(data_request_id, event) -Create a new custom file from a cached presign upload +Creates a new event for emailing a signee a request for signature ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.create_submission_data_request_event_request import CreateSubmissionDataRequestEventRequest +from docspring.models.create_submission_data_request_event_response import CreateSubmissionDataRequestEventResponse from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -create_custom_file_data = docspring.CreateCustomFileData() # CreateCustomFileData | - -try: - # Create a new custom file from a cached presign upload - api_response = api_instance.create_custom_file_from_upload(create_custom_file_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->create_custom_file_from_upload: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + data_request_id = 'drq_1234567890abcdef01' # str | + event = docspring.CreateSubmissionDataRequestEventRequest() # CreateSubmissionDataRequestEventRequest | + + try: + # Creates a new event for emailing a signee a request for signature + api_response = api_instance.create_data_request_event(data_request_id, event) + print("The response of PDFApi->create_data_request_event:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->create_data_request_event: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **create_custom_file_data** | [**CreateCustomFileData**](CreateCustomFileData.md)| | + **data_request_id** | **str**| | + **event** | [**CreateSubmissionDataRequestEventRequest**](CreateSubmissionDataRequestEventRequest.md)| | ### Return type -[**CreateCustomFileResponse**](CreateCustomFileResponse.md) +[**CreateSubmissionDataRequestEventResponse**](CreateSubmissionDataRequestEventResponse.md) ### Authorization @@ -415,45 +605,73 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | event created | - | +**401** | authentication failed | - | +**422** | message recipient must not be blank | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_data_request_token** -> CreateSubmissionDataRequestTokenResponse create_data_request_token(data_request_id) +> CreateSubmissionDataRequestTokenResponse create_data_request_token(data_request_id, type=type) Creates a new data request token for form authentication ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.create_submission_data_request_token_response import CreateSubmissionDataRequestTokenResponse from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -data_request_id = 'drq_000000000000000001' # str | - -try: - # Creates a new data request token for form authentication - api_response = api_instance.create_data_request_token(data_request_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->create_data_request_token: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + data_request_id = 'drq_1234567890abcdef01' # str | + type = 'api' # str | (optional) + + try: + # Creates a new data request token for form authentication + api_response = api_instance.create_data_request_token(data_request_id, type=type) + print("The response of PDFApi->create_data_request_token:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->create_data_request_token: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **data_request_id** | **str**| | + **type** | **str**| | [optional] ### Return type @@ -468,45 +686,72 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | token created | - | +**401** | authentication failed | - | +**422** | invalid request | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_folder** -> Folder create_folder(create_folder_data) +> Folder create_folder(data) Create a folder ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.create_folder_data import CreateFolderData +from docspring.models.folder import Folder from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -create_folder_data = docspring.CreateFolderData() # CreateFolderData | - -try: - # Create a folder - api_response = api_instance.create_folder(create_folder_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->create_folder: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + data = docspring.CreateFolderData() # CreateFolderData | + + try: + # Create a folder + api_response = api_instance.create_folder(data) + print("The response of PDFApi->create_folder:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->create_folder: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **create_folder_data** | [**CreateFolderData**](CreateFolderData.md)| | + **data** | [**CreateFolderData**](CreateFolderData.md)| | ### Return type @@ -521,49 +766,77 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**422** | name already exist | - | +**404** | parent folder doesn't exist | - | +**200** | folder created inside another folder | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_html_template** -> PendingTemplate create_html_template(create_html_template_data) +> TemplatePreview create_html_template(data) Create a new HTML template ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.create_html_template import CreateHtmlTemplate +from docspring.models.template_preview import TemplatePreview from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -create_html_template_data = docspring.CreateHtmlTemplateData() # CreateHtmlTemplateData | - -try: - # Create a new HTML template - api_response = api_instance.create_html_template(create_html_template_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->create_html_template: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + data = docspring.CreateHtmlTemplate() # CreateHtmlTemplate | + + try: + # Create a new HTML template + api_response = api_instance.create_html_template(data) + print("The response of PDFApi->create_html_template:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->create_html_template: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **create_html_template_data** | [**CreateHtmlTemplateData**](CreateHtmlTemplateData.md)| | + **data** | [**CreateHtmlTemplate**](CreateHtmlTemplate.md)| | ### Return type -[**PendingTemplate**](PendingTemplate.md) +[**TemplatePreview**](TemplatePreview.md) ### Authorization @@ -574,53 +847,82 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | returns a created template | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_pdf_template** -> PendingTemplate create_pdf_template(template_document, template_name, template_parent_folder_id=template_parent_folder_id) +> TemplatePreview create_pdf_template(template_document, template_name, wait=wait, template_description=template_description, template_parent_folder_id=template_parent_folder_id) Create a new PDF template with a form POST file upload ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.template_preview import TemplatePreview from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -template_document = '/path/to/file' # file | -template_name = 'template_name_example' # str | -template_parent_folder_id = 'template_parent_folder_id_example' # str | (optional) - -try: - # Create a new PDF template with a form POST file upload - api_response = api_instance.create_pdf_template(template_document, template_name, template_parent_folder_id=template_parent_folder_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->create_pdf_template: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + template_document = None # bytearray | + template_name = 'template_name_example' # str | + wait = True # bool | Wait for template document to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (optional) (default to True) + template_description = 'template_description_example' # str | (optional) + template_parent_folder_id = 'template_parent_folder_id_example' # str | (optional) + + try: + # Create a new PDF template with a form POST file upload + api_response = api_instance.create_pdf_template(template_document, template_name, wait=wait, template_description=template_description, template_parent_folder_id=template_parent_folder_id) + print("The response of PDFApi->create_pdf_template:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->create_pdf_template: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **template_document** | **file**| | + **template_document** | **bytearray**| | **template_name** | **str**| | + **wait** | **bool**| Wait for template document to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) | [optional] [default to True] + **template_description** | **str**| | [optional] **template_parent_folder_id** | **str**| | [optional] ### Return type -[**PendingTemplate**](PendingTemplate.md) +[**TemplatePreview**](TemplatePreview.md) ### Authorization @@ -631,49 +933,75 @@ Name | Type | Description | Notes - **Content-Type**: multipart/form-data - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | returns a pending template | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **create_pdf_template_from_upload** -> PendingTemplate create_pdf_template_from_upload(create_template_from_upload_data) +> TemplatePreview create_pdf_template_from_upload(data) Create a new PDF template from a cached presign upload ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.create_pdf_template import CreatePdfTemplate +from docspring.models.template_preview import TemplatePreview from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -create_template_from_upload_data = docspring.CreateTemplateFromUploadData() # CreateTemplateFromUploadData | - -try: - # Create a new PDF template from a cached presign upload - api_response = api_instance.create_pdf_template_from_upload(create_template_from_upload_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->create_pdf_template_from_upload: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + data = docspring.CreatePdfTemplate() # CreatePdfTemplate | + + try: + # Create a new PDF template from a cached presign upload + api_response = api_instance.create_pdf_template_from_upload(data) + print("The response of PDFApi->create_pdf_template_from_upload:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->create_pdf_template_from_upload: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **create_template_from_upload_data** | [**CreateTemplateFromUploadData**](CreateTemplateFromUploadData.md)| | + **data** | [**CreatePdfTemplate**](CreatePdfTemplate.md)| | ### Return type -[**PendingTemplate**](PendingTemplate.md) +[**TemplatePreview**](TemplatePreview.md) ### Authorization @@ -684,6 +1012,13 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | returns a pending template | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **delete_folder** @@ -693,33 +1028,51 @@ Delete a folder ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.folder import Folder from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -folder_id = 'fld_000000000000000001' # str | - -try: - # Delete a folder - api_response = api_instance.delete_folder(folder_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->delete_folder: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + folder_id = 'fld_1234567890abcdef01' # str | + + try: + # Delete a folder + api_response = api_instance.delete_folder(folder_id) + print("The response of PDFApi->delete_folder:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->delete_folder: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **folder_id** | **str**| | @@ -737,6 +1090,94 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**404** | folder doesn't exist | - | +**422** | folder has contents | - | +**200** | folder is empty | - | +**401** | authentication failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **delete_template** +> SuccessMultipleErrorsResponse delete_template(template_id) + +Delete a template + +### Example + +* Basic Authentication (api_token_basic): + +```python +import docspring +from docspring.models.success_multiple_errors_response import SuccessMultipleErrorsResponse +from docspring.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: api_token_basic +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + template_id = 'tpl_1234567890abcdef01' # str | + + try: + # Delete a template + api_response = api_instance.delete_template(template_id) + print("The response of PDFApi->delete_template:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->delete_template: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **template_id** | **str**| | + +### Return type + +[**SuccessMultipleErrorsResponse**](SuccessMultipleErrorsResponse.md) + +### Authorization + +[api_token_basic](../README.md#api_token_basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | template deleted | - | +**404** | template not found | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **expire_combined_submission** @@ -746,33 +1187,51 @@ Expire a combined submission ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.combined_submission import CombinedSubmission from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -combined_submission_id = 'com_000000000000000001' # str | - -try: - # Expire a combined submission - api_response = api_instance.expire_combined_submission(combined_submission_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->expire_combined_submission: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + combined_submission_id = 'com_1234567890abcdef01' # str | + + try: + # Expire a combined submission + api_response = api_instance.expire_combined_submission(combined_submission_id) + print("The response of PDFApi->expire_combined_submission:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->expire_combined_submission: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **combined_submission_id** | **str**| | @@ -790,49 +1249,76 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | submission was expired | - | +**404** | combined submission not found | - | +**403** | test API token used | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **expire_submission** -> Submission expire_submission(submission_id) +> SubmissionPreview expire_submission(submission_id) Expire a PDF submission ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.submission_preview import SubmissionPreview from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -submission_id = 'sub_000000000000000001' # str | - -try: - # Expire a PDF submission - api_response = api_instance.expire_submission(submission_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->expire_submission: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + submission_id = 'sub_1234567890abcdef01' # str | + + try: + # Expire a PDF submission + api_response = api_instance.expire_submission(submission_id) + print("The response of PDFApi->expire_submission:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->expire_submission: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **submission_id** | **str**| | ### Return type -[**Submission**](Submission.md) +[**SubmissionPreview**](SubmissionPreview.md) ### Authorization @@ -843,47 +1329,161 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | submission was expired | - | +**404** | submission not found | - | +**401** | authentication failed | - | +**403** | test API token used | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **generate_pdf** -> CreateSubmissionResponse generate_pdf(template_id, submission_data) +> CreateSubmissionResponse generate_pdf(template_id, submission, wait=wait) Generates a new PDF ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + +```python +import docspring +from docspring.models.create_pdf_submission_data import CreatePdfSubmissionData +from docspring.models.create_submission_response import CreateSubmissionResponse +from docspring.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: api_token_basic +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + template_id = 'tpl_1234567890abcdef01' # str | + submission = docspring.CreatePdfSubmissionData() # CreatePdfSubmissionData | + wait = True # bool | Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (optional) (default to True) + + try: + # Generates a new PDF + api_response = api_instance.generate_pdf(template_id, submission, wait=wait) + print("The response of PDFApi->generate_pdf:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->generate_pdf: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **template_id** | **str**| | + **submission** | [**CreatePdfSubmissionData**](CreatePdfSubmissionData.md)| | + **wait** | **bool**| Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) | [optional] [default to True] + +### Return type + +[**CreateSubmissionResponse**](CreateSubmissionResponse.md) + +### Authorization + +[api_token_basic](../README.md#api_token_basic) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | submission created | - | +**422** | invalid request | - | +**401** | authentication failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **generate_pdf_for_html_template** +> CreateSubmissionResponse generate_pdf_for_html_template(template_id, submission, wait=wait) + +Generates a new PDF for an HTML template + +### Example + +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.create_html_submission_data import CreateHtmlSubmissionData +from docspring.models.create_submission_response import CreateSubmissionResponse from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -template_id = 'tpl_000000000000000001' # str | -submission_data = docspring.SubmissionData() # SubmissionData | - -try: - # Generates a new PDF - api_response = api_instance.generate_pdf(template_id, submission_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->generate_pdf: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + template_id = 'tpl_HTML567890abcdef01' # str | + submission = docspring.CreateHtmlSubmissionData() # CreateHtmlSubmissionData | + wait = True # bool | Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) (optional) (default to True) + + try: + # Generates a new PDF for an HTML template + api_response = api_instance.generate_pdf_for_html_template(template_id, submission, wait=wait) + print("The response of PDFApi->generate_pdf_for_html_template:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->generate_pdf_for_html_template: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **template_id** | **str**| | - **submission_data** | [**SubmissionData**](SubmissionData.md)| | + **submission** | [**CreateHtmlSubmissionData**](CreateHtmlSubmissionData.md)| | + **wait** | **bool**| Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) | [optional] [default to True] ### Return type @@ -898,6 +1498,91 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | submission created | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **generate_preview** +> SuccessErrorResponse generate_preview(submission_id) + +Generated a preview PDF for partially completed data requests + +### Example + +* Basic Authentication (api_token_basic): + +```python +import docspring +from docspring.models.success_error_response import SuccessErrorResponse +from docspring.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: api_token_basic +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + submission_id = 'sub_1234567890abcdef01' # str | + + try: + # Generated a preview PDF for partially completed data requests + api_response = api_instance.generate_preview(submission_id) + print("The response of PDFApi->generate_preview:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->generate_preview: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **submission_id** | **str**| | + +### Return type + +[**SuccessErrorResponse**](SuccessErrorResponse.md) + +### Authorization + +[api_token_basic](../README.md#api_token_basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | preview was successfully requested | - | +**404** | submission not found | - | +**422** | error requesting preview | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_combined_submission** @@ -907,33 +1592,51 @@ Check the status of a combined submission (merged PDFs) ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.combined_submission import CombinedSubmission from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -combined_submission_id = 'com_000000000000000001' # str | - -try: - # Check the status of a combined submission (merged PDFs) - api_response = api_instance.get_combined_submission(combined_submission_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->get_combined_submission: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + combined_submission_id = 'com_1234567890abcdef01' # str | + + try: + # Check the status of a combined submission (merged PDFs) + api_response = api_instance.get_combined_submission(combined_submission_id) + print("The response of PDFApi->get_combined_submission:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->get_combined_submission: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **combined_submission_id** | **str**| | @@ -951,49 +1654,75 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | processed combined submission found | - | +**404** | combined submission not found | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_data_request** -> SubmissionDataRequest get_data_request(data_request_id) +> SubmissionDataRequestShow get_data_request(data_request_id) Look up a submission data request ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.submission_data_request_show import SubmissionDataRequestShow from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -data_request_id = 'drq_000000000000000001' # str | - -try: - # Look up a submission data request - api_response = api_instance.get_data_request(data_request_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->get_data_request: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + data_request_id = 'drq_1234567890abcdef01' # str | + + try: + # Look up a submission data request + api_response = api_instance.get_data_request(data_request_id) + print("The response of PDFApi->get_data_request:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->get_data_request: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **data_request_id** | **str**| | ### Return type -[**SubmissionDataRequest**](SubmissionDataRequest.md) +[**SubmissionDataRequestShow**](SubmissionDataRequestShow.md) ### Authorization @@ -1004,49 +1733,75 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | completed submission data request found | - | +**404** | submission data request not found | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_full_template** -> Template1 get_full_template(template_id) +> Template get_full_template(template_id) Fetch the full template attributes ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.template import Template from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -template_id = 'tpl_000000000000000001' # str | - -try: - # Fetch the full template attributes - api_response = api_instance.get_full_template(template_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->get_full_template: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + template_id = 'tpl_1234567890abcdef01' # str | + + try: + # Fetch the full template attributes + api_response = api_instance.get_full_template(template_id) + print("The response of PDFApi->get_full_template:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->get_full_template: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **template_id** | **str**| | ### Return type -[**Template1**](Template1.md) +[**Template**](Template.md) ### Authorization @@ -1057,45 +1812,71 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | template found | - | +**404** | template not found | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_presign_url** -> dict(str, object) get_presign_url() +> UploadPresignResponse get_presign_url() Get a presigned URL so that you can upload a file to our AWS S3 bucket ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.upload_presign_response import UploadPresignResponse from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) - -try: - # Get a presigned URL so that you can upload a file to our AWS S3 bucket - api_response = api_instance.get_presign_url() - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->get_presign_url: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + + try: + # Get a presigned URL so that you can upload a file to our AWS S3 bucket + api_response = api_instance.get_presign_url() + print("The response of PDFApi->get_presign_url:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->get_presign_url: %s\n" % e) ``` + + ### Parameters + This endpoint does not need any parameter. ### Return type -**dict(str, object)** +[**UploadPresignResponse**](UploadPresignResponse.md) ### Authorization @@ -1106,6 +1887,13 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | presign URL generated | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_submission** @@ -1115,34 +1903,52 @@ Check the status of a PDF ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.submission import Submission from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -submission_id = 'sub_000000000000000001' # str | -include_data = true # bool | (optional) - -try: - # Check the status of a PDF - api_response = api_instance.get_submission(submission_id, include_data=include_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->get_submission: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + submission_id = 'sub_1234567890abcdef01' # str | + include_data = true # bool | (optional) + + try: + # Check the status of a PDF + api_response = api_instance.get_submission(submission_id, include_data=include_data) + print("The response of PDFApi->get_submission:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->get_submission: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **submission_id** | **str**| | @@ -1161,43 +1967,69 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | processed submission found | - | +**404** | submission not found | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_submission_batch** -> SubmissionBatch get_submission_batch(submission_batch_id, include_submissions=include_submissions) +> SubmissionBatchWithSubmissions get_submission_batch(submission_batch_id, include_submissions=include_submissions) Check the status of a submission batch job ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.submission_batch_with_submissions import SubmissionBatchWithSubmissions from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -submission_batch_id = 'sbb_000000000000000001' # str | -include_submissions = true # bool | (optional) - -try: - # Check the status of a submission batch job - api_response = api_instance.get_submission_batch(submission_batch_id, include_submissions=include_submissions) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->get_submission_batch: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + submission_batch_id = 'sbb_1234567890abcdef01' # str | + include_submissions = true # bool | (optional) + + try: + # Check the status of a submission batch job + api_response = api_instance.get_submission_batch(submission_batch_id, include_submissions=include_submissions) + print("The response of PDFApi->get_submission_batch:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->get_submission_batch: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **submission_batch_id** | **str**| | @@ -1205,7 +2037,7 @@ Name | Type | Description | Notes ### Return type -[**SubmissionBatch**](SubmissionBatch.md) +[**SubmissionBatchWithSubmissions**](SubmissionBatchWithSubmissions.md) ### Authorization @@ -1216,49 +2048,75 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | processed submission batch found | - | +**404** | submission batch not found | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_template** -> Template get_template(template_id) +> TemplatePreview get_template(template_id) Check the status of an uploaded template ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.template_preview import TemplatePreview from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -template_id = 'tpl_000000000000000001' # str | - -try: - # Check the status of an uploaded template - api_response = api_instance.get_template(template_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->get_template: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + template_id = 'tpl_1234567890abcdef01' # str | + + try: + # Check the status of an uploaded template + api_response = api_instance.get_template(template_id) + print("The response of PDFApi->get_template:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->get_template: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **template_id** | **str**| | ### Return type -[**Template**](Template.md) +[**TemplatePreview**](TemplatePreview.md) ### Authorization @@ -1269,49 +2127,156 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | template found | - | +**404** | template not found | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_template_schema** -> dict(str, object) get_template_schema(template_id) +> JsonSchema get_template_schema(template_id) Fetch the JSON schema for a template ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.json_schema import JsonSchema from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -template_id = 'tpl_000000000000000001' # str | - -try: - # Fetch the JSON schema for a template - api_response = api_instance.get_template_schema(template_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->get_template_schema: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + template_id = 'tpl_1234567890abcdef01' # str | + + try: + # Fetch the JSON schema for a template + api_response = api_instance.get_template_schema(template_id) + print("The response of PDFApi->get_template_schema:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->get_template_schema: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **template_id** | **str**| | ### Return type -**dict(str, object)** +[**JsonSchema**](JsonSchema.md) + +### Authorization + +[api_token_basic](../README.md#api_token_basic) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | template found | - | +**404** | template not found | - | +**401** | authentication failed | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **list_combined_submissions** +> List[CombinedSubmission] list_combined_submissions(page=page, per_page=per_page) + +Get a list of all combined submissions + +### Example + +* Basic Authentication (api_token_basic): + +```python +import docspring +from docspring.models.combined_submission import CombinedSubmission +from docspring.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure HTTP basic authorization: api_token_basic +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + page = 2 # int | Default: 1 (optional) + per_page = 1 # int | Default: 50 (optional) + + try: + # Get a list of all combined submissions + api_response = api_instance.list_combined_submissions(page=page, per_page=per_page) + print("The response of PDFApi->list_combined_submissions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->list_combined_submissions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page** | **int**| Default: 1 | [optional] + **per_page** | **int**| Default: 50 | [optional] + +### Return type + +[**List[CombinedSubmission]**](CombinedSubmission.md) ### Authorization @@ -1322,49 +2287,74 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | enumerate all combined submissions | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_folders** -> list[Folder] list_folders(parent_folder_id=parent_folder_id) +> List[Folder] list_folders(parent_folder_id=parent_folder_id) Get a list of all folders ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.folder import Folder from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -parent_folder_id = 'fld_000000000000000002' # str | Filter By Folder Id (optional) - -try: - # Get a list of all folders - api_response = api_instance.list_folders(parent_folder_id=parent_folder_id) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->list_folders: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + parent_folder_id = 'fld_1234567890abcdef02' # str | Filter By Folder Id (optional) + + try: + # Get a list of all folders + api_response = api_instance.list_folders(parent_folder_id=parent_folder_id) + print("The response of PDFApi->list_folders:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->list_folders: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **parent_folder_id** | **str**| Filter By Folder Id | [optional] ### Return type -[**list[Folder]**](Folder.md) +[**List[Folder]**](Folder.md) ### Authorization @@ -1375,6 +2365,13 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | enumerate all folders | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_submissions** @@ -1384,38 +2381,56 @@ List all submissions ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.list_submissions_response import ListSubmissionsResponse from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -cursor = 'sub_list_000012' # str | (optional) -limit = 3 # float | (optional) -created_after = '2019-01-01T09:00:00-05:00' # str | (optional) -created_before = '2020-01-01T09:00:00-05:00' # str | (optional) -type = 'test' # str | (optional) -include_data = true # bool | (optional) - -try: - # List all submissions - api_response = api_instance.list_submissions(cursor=cursor, limit=limit, created_after=created_after, created_before=created_before, type=type, include_data=include_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->list_submissions: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + cursor = 'sub_1234567890abcdef12' # str | (optional) + limit = 3 # float | (optional) + created_after = '2019-01-01T09:00:00-05:00' # str | (optional) + created_before = '2020-01-01T09:00:00.000+0200' # str | (optional) + type = 'test' # str | (optional) + include_data = true # bool | (optional) + + try: + # List all submissions + api_response = api_instance.list_submissions(cursor=cursor, limit=limit, created_after=created_after, created_before=created_before, type=type, include_data=include_data) + print("The response of PDFApi->list_submissions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->list_submissions: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **cursor** | **str**| | [optional] @@ -1438,48 +2453,74 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | listing submissions | - | +**422** | invalid type | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) -# **list_submissions_0** -> ListSubmissionsResponse list_submissions_0(template_id, cursor=cursor, limit=limit, created_after=created_after, created_before=created_before, type=type, include_data=include_data) +# **list_template_submissions** +> ListSubmissionsResponse list_template_submissions(template_id, cursor=cursor, limit=limit, created_after=created_after, created_before=created_before, type=type, include_data=include_data) List all submissions for a given template ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.list_submissions_response import ListSubmissionsResponse from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -template_id = 'tpl_000000000000000002' # str | -cursor = 'cursor_example' # str | (optional) -limit = 3.4 # float | (optional) -created_after = 'created_after_example' # str | (optional) -created_before = 'created_before_example' # str | (optional) -type = 'type_example' # str | (optional) -include_data = true # bool | (optional) - -try: - # List all submissions for a given template - api_response = api_instance.list_submissions_0(template_id, cursor=cursor, limit=limit, created_after=created_after, created_before=created_before, type=type, include_data=include_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->list_submissions_0: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + template_id = 'tpl_1234567890abcdef02' # str | + cursor = 'cursor_example' # str | (optional) + limit = 3.4 # float | (optional) + created_after = 'created_after_example' # str | (optional) + created_before = 'created_before_example' # str | (optional) + type = 'type_example' # str | (optional) + include_data = true # bool | (optional) + + try: + # List all submissions for a given template + api_response = api_instance.list_template_submissions(template_id, cursor=cursor, limit=limit, created_after=created_after, created_before=created_before, type=type, include_data=include_data) + print("The response of PDFApi->list_template_submissions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->list_template_submissions: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **template_id** | **str**| | @@ -1503,45 +2544,70 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | listing submissions | - | +**404** | invalid template id | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_templates** -> list[Template] list_templates(query=query, parent_folder_id=parent_folder_id, page=page, per_page=per_page) +> List[TemplatePreview] list_templates(query=query, parent_folder_id=parent_folder_id, page=page, per_page=per_page) Get a list of all templates ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.template_preview import TemplatePreview from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -query = '2' # str | Search By Name (optional) -parent_folder_id = 'fld_000000000000000001' # str | Filter By Folder Id (optional) -page = 2 # int | Default: 1 (optional) -per_page = 1 # int | Default: 50 (optional) - -try: - # Get a list of all templates - api_response = api_instance.list_templates(query=query, parent_folder_id=parent_folder_id, page=page, per_page=per_page) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->list_templates: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + query = '2' # str | Search By Name (optional) + parent_folder_id = 'fld_1234567890abcdef01' # str | Filter By Folder Id (optional) + page = 2 # int | Default: 1 (optional) + per_page = 1 # int | Default: 50 (optional) + + try: + # Get a list of all templates + api_response = api_instance.list_templates(query=query, parent_folder_id=parent_folder_id, page=page, per_page=per_page) + print("The response of PDFApi->list_templates:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->list_templates: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **query** | **str**| Search By Name | [optional] @@ -1551,7 +2617,7 @@ Name | Type | Description | Notes ### Return type -[**list[Template]**](Template.md) +[**List[TemplatePreview]**](TemplatePreview.md) ### Authorization @@ -1562,47 +2628,74 @@ Name | Type | Description | Notes - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | enumerate all templates | - | +**404** | filter templates by invalid folder id | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **move_folder_to_folder** -> Folder move_folder_to_folder(folder_id, move_folder_data) +> Folder move_folder_to_folder(folder_id, data) Move a folder ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.folder import Folder +from docspring.models.move_folder_data import MoveFolderData from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -folder_id = 'fld_000000000000000001' # str | -move_folder_data = docspring.MoveFolderData() # MoveFolderData | - -try: - # Move a folder - api_response = api_instance.move_folder_to_folder(folder_id, move_folder_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->move_folder_to_folder: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + folder_id = 'fld_1234567890abcdef01' # str | + data = docspring.MoveFolderData() # MoveFolderData | + + try: + # Move a folder + api_response = api_instance.move_folder_to_folder(folder_id, data) + print("The response of PDFApi->move_folder_to_folder:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->move_folder_to_folder: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **folder_id** | **str**| | - **move_folder_data** | [**MoveFolderData**](MoveFolderData.md)| | + **data** | [**MoveFolderData**](MoveFolderData.md)| | ### Return type @@ -1617,51 +2710,78 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**404** | parent folder doesn't exist | - | +**200** | move to root folder | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **move_template_to_folder** -> Template move_template_to_folder(template_id, move_template_data) +> TemplatePreview move_template_to_folder(template_id, data) Move Template to folder ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.move_template_data import MoveTemplateData +from docspring.models.template_preview import TemplatePreview from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -template_id = 'tpl_000000000000000001' # str | -move_template_data = docspring.MoveTemplateData() # MoveTemplateData | - -try: - # Move Template to folder - api_response = api_instance.move_template_to_folder(template_id, move_template_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->move_template_to_folder: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + template_id = 'tpl_1234567890abcdef01' # str | + data = docspring.MoveTemplateData() # MoveTemplateData | + + try: + # Move Template to folder + api_response = api_instance.move_template_to_folder(template_id, data) + print("The response of PDFApi->move_template_to_folder:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->move_template_to_folder: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **template_id** | **str**| | - **move_template_data** | [**MoveTemplateData**](MoveTemplateData.md)| | + **data** | [**MoveTemplateData**](MoveTemplateData.md)| | ### Return type -[**Template**](Template.md) +[**TemplatePreview**](TemplatePreview.md) ### Authorization @@ -1672,50 +2792,77 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | move template success | - | +**404** | folder not found | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **rename_folder** -> rename_folder(folder_id, rename_folder_data) +> Folder rename_folder(folder_id, data) Rename a folder ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.folder import Folder +from docspring.models.rename_folder_data import RenameFolderData from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -folder_id = 'fld_000000000000000001' # str | -rename_folder_data = docspring.RenameFolderData() # RenameFolderData | - -try: - # Rename a folder - api_instance.rename_folder(folder_id, rename_folder_data) -except ApiException as e: - print("Exception when calling PDFApi->rename_folder: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + folder_id = 'fld_1234567890abcdef01' # str | + data = docspring.RenameFolderData() # RenameFolderData | + + try: + # Rename a folder + api_response = api_instance.rename_folder(folder_id, data) + print("The response of PDFApi->rename_folder:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->rename_folder: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **folder_id** | **str**| | - **rename_folder_data** | [**RenameFolderData**](RenameFolderData.md)| | + **data** | [**RenameFolderData**](RenameFolderData.md)| | ### Return type -void (empty response body) +[**Folder**](Folder.md) ### Authorization @@ -1726,45 +2873,72 @@ void (empty response body) - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**422** | name already exist | - | +**404** | folder doesn't belong to me | - | +**200** | successful rename | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **test_authentication** -> AuthenticationSuccessResponse test_authentication() +> SuccessErrorResponse test_authentication() Test Authentication ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.success_error_response import SuccessErrorResponse from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) - -try: - # Test Authentication - api_response = api_instance.test_authentication() - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->test_authentication: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + + try: + # Test Authentication + api_response = api_instance.test_authentication() + print("The response of PDFApi->test_authentication:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->test_authentication: %s\n" % e) ``` + + ### Parameters + This endpoint does not need any parameter. ### Return type -[**AuthenticationSuccessResponse**](AuthenticationSuccessResponse.md) +[**SuccessErrorResponse**](SuccessErrorResponse.md) ### Authorization @@ -1775,51 +2949,77 @@ This endpoint does not need any parameter. - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | authentication succeeded | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_data_request** -> UpdateDataRequestResponse update_data_request(data_request_id, update_submission_data_request_data) +> CreateSubmissionDataRequestResponse update_data_request(data_request_id, data) Update a submission data request ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.create_submission_data_request_response import CreateSubmissionDataRequestResponse +from docspring.models.update_submission_data_request_data import UpdateSubmissionDataRequestData from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -data_request_id = 'drq_000000000000000001' # str | -update_submission_data_request_data = docspring.UpdateSubmissionDataRequestData() # UpdateSubmissionDataRequestData | - -try: - # Update a submission data request - api_response = api_instance.update_data_request(data_request_id, update_submission_data_request_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->update_data_request: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + data_request_id = 'drq_1234567890abcdef01' # str | + data = docspring.UpdateSubmissionDataRequestData() # UpdateSubmissionDataRequestData | + + try: + # Update a submission data request + api_response = api_instance.update_data_request(data_request_id, data) + print("The response of PDFApi->update_data_request:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->update_data_request: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **data_request_id** | **str**| | - **update_submission_data_request_data** | [**UpdateSubmissionDataRequestData**](UpdateSubmissionDataRequestData.md)| | + **data** | [**UpdateSubmissionDataRequestData**](UpdateSubmissionDataRequestData.md)| | ### Return type -[**UpdateDataRequestResponse**](UpdateDataRequestResponse.md) +[**CreateSubmissionDataRequestResponse**](CreateSubmissionDataRequestResponse.md) ### Authorization @@ -1830,51 +3030,79 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | submission data request updated | - | +**422** | invalid request | - | +**404** | submission data request not found | - | +**401** | authentication failed | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **update_template** -> UpdateTemplateResponse update_template(template_id, update_template_data) +> SuccessMultipleErrorsResponse update_template(template_id, data) Update a Template ### Example -* Basic Authentication (api_token_basic): +* Basic Authentication (api_token_basic): + ```python -from __future__ import print_function -import time import docspring +from docspring.models.success_multiple_errors_response import SuccessMultipleErrorsResponse +from docspring.models.update_html_template import UpdateHtmlTemplate from docspring.rest import ApiException from pprint import pprint +# Defining the host is optional and defaults to https://sync.api.docspring.com/api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = docspring.Configuration( + host = "https://sync.api.docspring.com/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + # Configure HTTP basic authorization: api_token_basic -configuration = docspring.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = docspring.PDFApi(docspring.ApiClient(configuration)) -template_id = 'tpl_000000000000000003' # str | -update_template_data = docspring.UpdateTemplateData() # UpdateTemplateData | - -try: - # Update a Template - api_response = api_instance.update_template(template_id, update_template_data) - pprint(api_response) -except ApiException as e: - print("Exception when calling PDFApi->update_template: %s\n" % e) +configuration = docspring.Configuration( + username = os.environ["USERNAME"], + password = os.environ["PASSWORD"] +) + +# Enter a context with an instance of the API client +with docspring.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = docspring.PDFApi(api_client) + template_id = 'tpl_1234567890abcdef03' # str | + data = docspring.UpdateHtmlTemplate() # UpdateHtmlTemplate | + + try: + # Update a Template + api_response = api_instance.update_template(template_id, data) + print("The response of PDFApi->update_template:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling PDFApi->update_template: %s\n" % e) ``` + + ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **template_id** | **str**| | - **update_template_data** | [**UpdateTemplateData**](UpdateTemplateData.md)| | + **data** | [**UpdateHtmlTemplate**](UpdateHtmlTemplate.md)| | ### Return type -[**UpdateTemplateResponse**](UpdateTemplateResponse.md) +[**SuccessMultipleErrorsResponse**](SuccessMultipleErrorsResponse.md) ### Authorization @@ -1885,5 +3113,11 @@ Name | Type | Description | Notes - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | update template success | - | + [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) diff --git a/docs/PendingTemplate.md b/docs/PendingTemplate.md deleted file mode 100644 index a37c5a8..0000000 --- a/docs/PendingTemplate.md +++ /dev/null @@ -1,26 +0,0 @@ -# PendingTemplate - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**expiration_interval** | **str** | | [optional] -**webhook_url** | **str** | | [optional] -**parent_folder_id** | **str** | | [optional] -**expire_after** | **float** | | [optional] -**allow_additional_properties** | **bool** | | [optional] -**description** | **str** | | [optional] -**public_submissions** | **bool** | | [optional] -**slack_webhook_url** | **str** | | [optional] -**path** | **str** | | [optional] -**public_web_form** | **bool** | | [optional] -**editable_submissions** | **bool** | | [optional] -**expire_submissions** | **bool** | | [optional] -**name** | **str** | | [optional] -**template_type** | **str** | | [optional] -**id** | **str** | | [optional] -**locked** | **bool** | | [optional] -**redirect_url** | **str** | | [optional] - -[[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/docs/RenameFolderData.md b/docs/RenameFolderData.md index 777c1d9..ab8468b 100644 --- a/docs/RenameFolderData.md +++ b/docs/RenameFolderData.md @@ -1,10 +1,29 @@ # RenameFolderData + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | +## Example + +```python +from docspring.models.rename_folder_data import RenameFolderData + +# TODO update the JSON string below +json = "{}" +# create an instance of RenameFolderData from a JSON string +rename_folder_data_instance = RenameFolderData.from_json(json) +# print the JSON string representation of the object +print(RenameFolderData.to_json()) + +# convert the object into a dict +rename_folder_data_dict = rename_folder_data_instance.to_dict() +# create an instance of RenameFolderData from a dict +rename_folder_data_from_dict = RenameFolderData.from_dict(rename_folder_data_dict) +``` [[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/docs/Submission.md b/docs/Submission.md index 6032c71..7562004 100644 --- a/docs/Submission.md +++ b/docs/Submission.md @@ -1,28 +1,52 @@ # Submission + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | | -**template_id** | **str** | | [optional] -**test** | **bool** | | -**editable** | **bool** | | [optional] +**batch_id** | **str** | | +**data_requests** | [**List[SubmissionDataRequest]**](SubmissionDataRequest.md) | | +**editable** | **bool** | | **expired** | **bool** | | -**expires_at** | **str** | | [optional] -**processed_at** | **str** | | [optional] +**expires_at** | **str** | | +**id** | **str** | | +**json_schema_errors** | **List[str]** | | +**metadata** | **object** | | +**password** | **str** | | +**processed_at** | **str** | | **state** | **str** | | -**data** | **object** | | [optional] -**metadata** | **object** | | [optional] -**truncated_text** | **object** | | [optional] -**pdf_hash** | **str** | | [optional] -**download_url** | **str** | | [optional] -**permanent_download_url** | **str** | | [optional] -**batch_id** | **str** | | [optional] -**data_requests** | [**list[SubmissionDataRequest]**](SubmissionDataRequest.md) | | [optional] -**actions** | [**list[SubmissionAction]**](SubmissionAction.md) | | [optional] -**source** | **str** | | [optional] -**referrer** | **str** | | [optional] +**template_id** | **str** | | +**test** | **bool** | | +**truncated_text** | **object** | | +**pdf_hash** | **str** | | +**download_url** | **str** | | +**permanent_download_url** | **str** | | +**preview_download_url** | **str** | | +**preview_generated_at** | **str** | | +**audit_trail_download_url** | **str** | | +**actions** | [**List[SubmissionAction]**](SubmissionAction.md) | | +**source** | **str** | | +**referrer** | **str** | | +**data** | **object** | | + +## Example + +```python +from docspring.models.submission import Submission + +# TODO update the JSON string below +json = "{}" +# create an instance of Submission from a JSON string +submission_instance = Submission.from_json(json) +# print the JSON string representation of the object +print(Submission.to_json()) +# convert the object into a dict +submission_dict = submission_instance.to_dict() +# create an instance of Submission from a dict +submission_from_dict = Submission.from_dict(submission_dict) +``` [[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/docs/SubmissionAction.md b/docs/SubmissionAction.md index 3f808e8..a490cc8 100644 --- a/docs/SubmissionAction.md +++ b/docs/SubmissionAction.md @@ -1,15 +1,34 @@ # SubmissionAction + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | **integration_id** | **str** | | **state** | **str** | | -**action_category** | **str** | | **action_type** | **str** | | +**action_category** | **str** | | **result_data** | **object** | | +## Example + +```python +from docspring.models.submission_action import SubmissionAction + +# TODO update the JSON string below +json = "{}" +# create an instance of SubmissionAction from a JSON string +submission_action_instance = SubmissionAction.from_json(json) +# print the JSON string representation of the object +print(SubmissionAction.to_json()) + +# convert the object into a dict +submission_action_dict = submission_action_instance.to_dict() +# create an instance of SubmissionAction from a dict +submission_action_from_dict = SubmissionAction.from_dict(submission_action_dict) +``` [[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/docs/SubmissionBatch.md b/docs/SubmissionBatch.md index 51e8a12..695687c 100644 --- a/docs/SubmissionBatch.md +++ b/docs/SubmissionBatch.md @@ -1,18 +1,36 @@ # SubmissionBatch + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**pending_count** | **int** | | [optional] -**completion_percentage** | **int** | | [optional] -**metadata** | **object** | | [optional] -**total_count** | **int** | | [optional] -**submissions** | [**list[Submission]**](Submission.md) | | [optional] -**processed_at** | **str** | | [optional] -**id** | **str** | | [optional] -**state** | **str** | | [optional] -**error_count** | **int** | | [optional] +**id** | **str** | | +**state** | **str** | | +**metadata** | **object** | | +**processed_at** | **str** | | +**total_count** | **int** | | +**pending_count** | **int** | | +**error_count** | **int** | | +**completion_percentage** | **float** | | + +## Example + +```python +from docspring.models.submission_batch import SubmissionBatch + +# TODO update the JSON string below +json = "{}" +# create an instance of SubmissionBatch from a JSON string +submission_batch_instance = SubmissionBatch.from_json(json) +# print the JSON string representation of the object +print(SubmissionBatch.to_json()) +# convert the object into a dict +submission_batch_dict = submission_batch_instance.to_dict() +# create an instance of SubmissionBatch from a dict +submission_batch_from_dict = SubmissionBatch.from_dict(submission_batch_dict) +``` [[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/docs/SubmissionBatchData.md b/docs/SubmissionBatchData.md index 471af72..fde40a0 100644 --- a/docs/SubmissionBatchData.md +++ b/docs/SubmissionBatchData.md @@ -1,13 +1,31 @@ # SubmissionBatchData + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **metadata** | **object** | | [optional] -**submissions** | [**list[SubmissionDataBatchRequest]**](SubmissionDataBatchRequest.md) | | -**template_id** | **str** | | [optional] +**submissions** | **List[object]** | | **test** | **bool** | | [optional] +## Example + +```python +from docspring.models.submission_batch_data import SubmissionBatchData + +# TODO update the JSON string below +json = "{}" +# create an instance of SubmissionBatchData from a JSON string +submission_batch_data_instance = SubmissionBatchData.from_json(json) +# print the JSON string representation of the object +print(SubmissionBatchData.to_json()) + +# convert the object into a dict +submission_batch_data_dict = submission_batch_data_instance.to_dict() +# create an instance of SubmissionBatchData from a dict +submission_batch_data_from_dict = SubmissionBatchData.from_dict(submission_batch_data_dict) +``` [[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/docs/SubmissionBatchWithSubmissions.md b/docs/SubmissionBatchWithSubmissions.md new file mode 100644 index 0000000..84fe62b --- /dev/null +++ b/docs/SubmissionBatchWithSubmissions.md @@ -0,0 +1,37 @@ +# SubmissionBatchWithSubmissions + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**state** | **str** | | +**metadata** | **object** | | +**processed_at** | **str** | | +**total_count** | **int** | | +**pending_count** | **int** | | +**error_count** | **int** | | +**completion_percentage** | **float** | | +**submissions** | [**List[SubmissionPreview]**](SubmissionPreview.md) | | [optional] + +## Example + +```python +from docspring.models.submission_batch_with_submissions import SubmissionBatchWithSubmissions + +# TODO update the JSON string below +json = "{}" +# create an instance of SubmissionBatchWithSubmissions from a JSON string +submission_batch_with_submissions_instance = SubmissionBatchWithSubmissions.from_json(json) +# print the JSON string representation of the object +print(SubmissionBatchWithSubmissions.to_json()) + +# convert the object into a dict +submission_batch_with_submissions_dict = submission_batch_with_submissions_instance.to_dict() +# create an instance of SubmissionBatchWithSubmissions from a dict +submission_batch_with_submissions_from_dict = SubmissionBatchWithSubmissions.from_dict(submission_batch_with_submissions_dict) +``` +[[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/docs/SubmissionData.md b/docs/SubmissionData.md deleted file mode 100644 index f181add..0000000 --- a/docs/SubmissionData.md +++ /dev/null @@ -1,17 +0,0 @@ -# SubmissionData - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**css** | **str** | | [optional] -**data** | **object** | | -**data_requests** | [**list[CreateSubmissionDataRequestData]**](CreateSubmissionDataRequestData.md) | | [optional] -**field_overrides** | **object** | | [optional] -**html** | **str** | | [optional] -**metadata** | **object** | | [optional] -**password** | **str** | | [optional] -**test** | **bool** | | [optional] - -[[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/docs/SubmissionDataBatchRequest.md b/docs/SubmissionDataBatchRequest.md deleted file mode 100644 index 7de1e8c..0000000 --- a/docs/SubmissionDataBatchRequest.md +++ /dev/null @@ -1,15 +0,0 @@ -# SubmissionDataBatchRequest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**css** | **str** | | [optional] -**metadata** | **object** | | [optional] -**data** | **object** | | [optional] -**test** | **bool** | | [optional] -**html** | **str** | | [optional] -**template_id** | **str** | | [optional] - -[[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/docs/SubmissionDataRequest.md b/docs/SubmissionDataRequest.md index ca5ce7c..01e2dc4 100644 --- a/docs/SubmissionDataRequest.md +++ b/docs/SubmissionDataRequest.md @@ -1,29 +1,49 @@ # SubmissionDataRequest + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | -**name** | **str** | | **email** | **str** | | +**name** | **str** | | **order** | **int** | | **sort_order** | **int** | | -**fields** | **list[str]** | | +**fields** | **List[str]** | | **metadata** | **object** | | **state** | **str** | | -**viewed_at** | **str** | | [optional] -**completed_at** | **str** | | [optional] -**auth_type** | **str** | | [optional] -**auth_second_factor_type** | **str** | | [optional] -**auth_provider** | **str** | | [optional] -**auth_session_started_at** | **str** | | [optional] -**auth_session_id_hash** | **str** | | [optional] -**auth_user_id_hash** | **str** | | [optional] -**auth_username_hash** | **str** | | [optional] -**auth_phone_number_hash** | **str** | | [optional] -**ip_address** | **str** | | [optional] -**user_agent** | **str** | | [optional] +**viewed_at** | **str** | | +**completed_at** | **str** | | +**data** | **object** | | +**auth_type** | **str** | | +**auth_second_factor_type** | **str** | | +**auth_provider** | **str** | | +**auth_session_started_at** | **str** | | +**auth_session_id_hash** | **str** | | +**auth_user_id_hash** | **str** | | +**auth_username_hash** | **str** | | +**auth_phone_number_hash** | **str** | | +**ip_address** | **str** | | +**user_agent** | **str** | | + +## Example + +```python +from docspring.models.submission_data_request import SubmissionDataRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of SubmissionDataRequest from a JSON string +submission_data_request_instance = SubmissionDataRequest.from_json(json) +# print the JSON string representation of the object +print(SubmissionDataRequest.to_json()) +# convert the object into a dict +submission_data_request_dict = submission_data_request_instance.to_dict() +# create an instance of SubmissionDataRequest from a dict +submission_data_request_from_dict = SubmissionDataRequest.from_dict(submission_data_request_dict) +``` [[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/docs/SubmissionDataRequestEvent.md b/docs/SubmissionDataRequestEvent.md new file mode 100644 index 0000000..07f97d9 --- /dev/null +++ b/docs/SubmissionDataRequestEvent.md @@ -0,0 +1,35 @@ +# SubmissionDataRequestEvent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**submission_id** | **str** | | +**submission_data_request_id** | **str** | | +**event_type** | **str** | | +**message_type** | **str** | | +**message_recipient** | **str** | | +**occurred_at** | **str** | | + +## Example + +```python +from docspring.models.submission_data_request_event import SubmissionDataRequestEvent + +# TODO update the JSON string below +json = "{}" +# create an instance of SubmissionDataRequestEvent from a JSON string +submission_data_request_event_instance = SubmissionDataRequestEvent.from_json(json) +# print the JSON string representation of the object +print(SubmissionDataRequestEvent.to_json()) + +# convert the object into a dict +submission_data_request_event_dict = submission_data_request_event_instance.to_dict() +# create an instance of SubmissionDataRequestEvent from a dict +submission_data_request_event_from_dict = SubmissionDataRequestEvent.from_dict(submission_data_request_event_dict) +``` +[[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/docs/SubmissionDataRequestShow.md b/docs/SubmissionDataRequestShow.md new file mode 100644 index 0000000..6cfb904 --- /dev/null +++ b/docs/SubmissionDataRequestShow.md @@ -0,0 +1,50 @@ +# SubmissionDataRequestShow + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**email** | **str** | | +**name** | **str** | | +**order** | **int** | | +**sort_order** | **int** | | +**fields** | **List[str]** | | +**metadata** | **object** | | +**state** | **str** | | +**viewed_at** | **str** | | +**completed_at** | **str** | | +**data** | **object** | | +**auth_type** | **str** | | +**auth_second_factor_type** | **str** | | +**auth_provider** | **str** | | +**auth_session_started_at** | **str** | | +**auth_session_id_hash** | **str** | | +**auth_user_id_hash** | **str** | | +**auth_username_hash** | **str** | | +**auth_phone_number_hash** | **str** | | +**ip_address** | **str** | | +**user_agent** | **str** | | +**submission_id** | **str** | | + +## Example + +```python +from docspring.models.submission_data_request_show import SubmissionDataRequestShow + +# TODO update the JSON string below +json = "{}" +# create an instance of SubmissionDataRequestShow from a JSON string +submission_data_request_show_instance = SubmissionDataRequestShow.from_json(json) +# print the JSON string representation of the object +print(SubmissionDataRequestShow.to_json()) + +# convert the object into a dict +submission_data_request_show_dict = submission_data_request_show_instance.to_dict() +# create an instance of SubmissionDataRequestShow from a dict +submission_data_request_show_from_dict = SubmissionDataRequestShow.from_dict(submission_data_request_show_dict) +``` +[[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/docs/SubmissionDataRequestToken.md b/docs/SubmissionDataRequestToken.md new file mode 100644 index 0000000..9481db0 --- /dev/null +++ b/docs/SubmissionDataRequestToken.md @@ -0,0 +1,32 @@ +# SubmissionDataRequestToken + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | +**secret** | **str** | | +**expires_at** | **str** | | +**data_request_url** | **str** | | + +## Example + +```python +from docspring.models.submission_data_request_token import SubmissionDataRequestToken + +# TODO update the JSON string below +json = "{}" +# create an instance of SubmissionDataRequestToken from a JSON string +submission_data_request_token_instance = SubmissionDataRequestToken.from_json(json) +# print the JSON string representation of the object +print(SubmissionDataRequestToken.to_json()) + +# convert the object into a dict +submission_data_request_token_dict = submission_data_request_token_instance.to_dict() +# create an instance of SubmissionDataRequestToken from a dict +submission_data_request_token_from_dict = SubmissionDataRequestToken.from_dict(submission_data_request_token_dict) +``` +[[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/docs/SubmissionPreview.md b/docs/SubmissionPreview.md new file mode 100644 index 0000000..d23ac8b --- /dev/null +++ b/docs/SubmissionPreview.md @@ -0,0 +1,49 @@ +# SubmissionPreview + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**batch_id** | **str** | | +**data_requests** | [**List[SubmissionDataRequest]**](SubmissionDataRequest.md) | | +**editable** | **bool** | | +**expired** | **bool** | | +**expires_at** | **str** | | +**id** | **str** | | +**json_schema_errors** | **List[str]** | | +**metadata** | **object** | | +**password** | **str** | | +**processed_at** | **str** | | +**state** | **str** | | +**template_id** | **str** | | +**test** | **bool** | | +**truncated_text** | **object** | | +**pdf_hash** | **str** | | +**download_url** | **str** | | +**permanent_download_url** | **str** | | +**preview_download_url** | **str** | | +**preview_generated_at** | **str** | | +**audit_trail_download_url** | **str** | | +**actions** | [**List[SubmissionAction]**](SubmissionAction.md) | | + +## Example + +```python +from docspring.models.submission_preview import SubmissionPreview + +# TODO update the JSON string below +json = "{}" +# create an instance of SubmissionPreview from a JSON string +submission_preview_instance = SubmissionPreview.from_json(json) +# print the JSON string representation of the object +print(SubmissionPreview.to_json()) + +# convert the object into a dict +submission_preview_dict = submission_preview_instance.to_dict() +# create an instance of SubmissionPreview from a dict +submission_preview_from_dict = SubmissionPreview.from_dict(submission_preview_dict) +``` +[[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/docs/SuccessErrorResponse.md b/docs/SuccessErrorResponse.md new file mode 100644 index 0000000..28538ae --- /dev/null +++ b/docs/SuccessErrorResponse.md @@ -0,0 +1,30 @@ +# SuccessErrorResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | | +**error** | **str** | | [optional] + +## Example + +```python +from docspring.models.success_error_response import SuccessErrorResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of SuccessErrorResponse from a JSON string +success_error_response_instance = SuccessErrorResponse.from_json(json) +# print the JSON string representation of the object +print(SuccessErrorResponse.to_json()) + +# convert the object into a dict +success_error_response_dict = success_error_response_instance.to_dict() +# create an instance of SuccessErrorResponse from a dict +success_error_response_from_dict = SuccessErrorResponse.from_dict(success_error_response_dict) +``` +[[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/docs/SuccessMultipleErrorsResponse.md b/docs/SuccessMultipleErrorsResponse.md new file mode 100644 index 0000000..9a68599 --- /dev/null +++ b/docs/SuccessMultipleErrorsResponse.md @@ -0,0 +1,30 @@ +# SuccessMultipleErrorsResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | | +**errors** | **List[str]** | | [optional] + +## Example + +```python +from docspring.models.success_multiple_errors_response import SuccessMultipleErrorsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of SuccessMultipleErrorsResponse from a JSON string +success_multiple_errors_response_instance = SuccessMultipleErrorsResponse.from_json(json) +# print the JSON string representation of the object +print(SuccessMultipleErrorsResponse.to_json()) + +# convert the object into a dict +success_multiple_errors_response_dict = success_multiple_errors_response_instance.to_dict() +# create an instance of SuccessMultipleErrorsResponse from a dict +success_multiple_errors_response_from_dict = SuccessMultipleErrorsResponse.from_dict(success_multiple_errors_response_dict) +``` +[[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/docs/Template.md b/docs/Template.md index b61895c..6797e60 100644 --- a/docs/Template.md +++ b/docs/Template.md @@ -1,29 +1,74 @@ # Template + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**expiration_interval** | **str** | | [optional] -**webhook_url** | **str** | | [optional] -**parent_folder_id** | **str** | | [optional] -**expire_after** | **float** | | [optional] -**allow_additional_properties** | **bool** | | [optional] -**description** | **str** | | [optional] -**public_submissions** | **bool** | | [optional] -**slack_webhook_url** | **str** | | [optional] -**path** | **str** | | [optional] -**public_web_form** | **bool** | | [optional] -**editable_submissions** | **bool** | | [optional] -**expire_submissions** | **bool** | | [optional] -**name** | **str** | | [optional] -**permanent_document_url** | **str** | | [optional] -**template_type** | **str** | | [optional] -**id** | **str** | | [optional] -**page_dimensions** | **list[list[float]]** | | [optional] -**locked** | **bool** | | [optional] -**redirect_url** | **str** | | [optional] -**document_url** | **str** | | [optional] +**add_data_request_submission_id_footers** | **bool** | | +**allow_additional_properties** | **bool** | | +**description** | **str** | | +**document_filename** | **str** | | +**document_md5** | **str** | | +**document_parse_error** | **bool** | | +**document_processed** | **bool** | | +**document_state** | **str** | | +**document_url** | **str** | | +**editable_submissions** | **bool** | | +**embed_domains** | **str** | | +**encrypt_pdfs_password** | **str** | | +**encrypt_pdfs** | **bool** | | +**expiration_interval** | **str** | | +**expire_after** | **int** | | +**expire_submissions** | **bool** | | +**external_predefined_fields_template_id** | **str** | | +**external_predefined_fields_template_name** | **str** | | +**first_template** | **bool** | | +**id** | **str** | | +**locked** | **bool** | | +**merge_audit_trail_pdf** | **bool** | | +**name** | **str** | | +**page_count** | **int** | | +**page_dimensions** | **List[List[float]]** | | +**parent_folder_id** | **str** | | +**path** | **str** | | +**permanent_document_url** | **str** | | +**public_submissions** | **bool** | | +**public_web_form** | **bool** | | +**redirect_url** | **str** | | +**slack_webhook_url** | **str** | | +**template_type** | **str** | | +**updated_at** | **str** | | +**webhook_url** | **str** | | +**demo** | **bool** | | +**defaults** | **object** | | +**field_order** | **List[List[float]]** | | +**fields** | **object** | | +**footer_html** | **str** | | +**header_html** | **str** | | +**html_engine_options** | **object** | | +**html** | **str** | | +**predefined_fields** | **List[object]** | | +**scss** | **str** | | +**shared_field_data** | **object** | | + +## Example + +```python +from docspring.models.template import Template + +# TODO update the JSON string below +json = "{}" +# create an instance of Template from a JSON string +template_instance = Template.from_json(json) +# print the JSON string representation of the object +print(Template.to_json()) +# convert the object into a dict +template_dict = template_instance.to_dict() +# create an instance of Template from a dict +template_from_dict = Template.from_dict(template_dict) +``` [[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/docs/Template1.md b/docs/Template1.md deleted file mode 100644 index f71ea2f..0000000 --- a/docs/Template1.md +++ /dev/null @@ -1,48 +0,0 @@ -# Template1 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**document_processed** | **bool** | | [optional] -**expiration_interval** | **str** | | [optional] -**scss** | **str** | | [optional] -**document_state** | **str** | | [optional] -**expire_after** | **float** | | [optional] -**description** | **str** | | [optional] -**slack_webhook_url** | **str** | | [optional] -**demo** | **bool** | | [optional] -**path** | **str** | | [optional] -**header_html** | **str** | | [optional] -**public_web_form** | **bool** | | [optional] -**field_order** | **list[list[float]]** | | [optional] -**permanent_document_url** | **str** | | [optional] -**html** | **str** | | [optional] -**template_type** | **str** | | [optional] -**id** | **str** | | [optional] -**page_dimensions** | **list[list[float]]** | | [optional] -**locked** | **bool** | | [optional] -**page_count** | **float** | | [optional] -**encrypt_pdfs** | **bool** | | [optional] -**webhook_url** | **str** | | [optional] -**embed_domains** | **list[str]** | | [optional] -**parent_folder_id** | **str** | | [optional] -**allow_additional_properties** | **bool** | | [optional] -**encrypt_pdfs_password** | **str** | | [optional] -**public_submissions** | **bool** | | [optional] -**shared_field_data** | **object** | | [optional] -**document_md5** | **str** | | [optional] -**first_template** | **bool** | | [optional] -**defaults** | [**Template1Defaults**](Template1Defaults.md) | | [optional] -**editable_submissions** | **bool** | | [optional] -**expire_submissions** | **bool** | | [optional] -**name** | **str** | | [optional] -**footer_html** | **str** | | [optional] -**document_parse_error** | **bool** | | [optional] -**fields** | **object** | | [optional] -**document_filename** | **str** | | [optional] -**redirect_url** | **str** | | [optional] -**document_url** | **str** | | [optional] - -[[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/docs/Template1Defaults.md b/docs/Template1Defaults.md deleted file mode 100644 index fe20ed8..0000000 --- a/docs/Template1Defaults.md +++ /dev/null @@ -1,12 +0,0 @@ -# Template1Defaults - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**color** | **str** | | [optional] -**font_size** | **float** | | [optional] -**typeface** | **str** | | [optional] - -[[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/docs/TemplateAddFieldsResponse.md b/docs/TemplateAddFieldsResponse.md new file mode 100644 index 0000000..fc1a9d3 --- /dev/null +++ b/docs/TemplateAddFieldsResponse.md @@ -0,0 +1,31 @@ +# TemplateAddFieldsResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | | +**errors** | **List[str]** | | [optional] +**new_field_ids** | **List[int]** | | [optional] + +## Example + +```python +from docspring.models.template_add_fields_response import TemplateAddFieldsResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of TemplateAddFieldsResponse from a JSON string +template_add_fields_response_instance = TemplateAddFieldsResponse.from_json(json) +# print the JSON string representation of the object +print(TemplateAddFieldsResponse.to_json()) + +# convert the object into a dict +template_add_fields_response_dict = template_add_fields_response_instance.to_dict() +# create an instance of TemplateAddFieldsResponse from a dict +template_add_fields_response_from_dict = TemplateAddFieldsResponse.from_dict(template_add_fields_response_dict) +``` +[[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/docs/TemplateData.md b/docs/TemplateData.md deleted file mode 100644 index c717700..0000000 --- a/docs/TemplateData.md +++ /dev/null @@ -1,25 +0,0 @@ -# TemplateData - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**expiration_interval** | **str** | | [optional] -**webhook_url** | **str** | | [optional] -**scss** | **str** | | [optional] -**allow_additional_properties** | **bool** | | [optional] -**expire_after** | **float** | | [optional] -**description** | **str** | | [optional] -**public_submissions** | **bool** | | [optional] -**slack_webhook_url** | **str** | | [optional] -**header_html** | **str** | | [optional] -**public_web_form** | **bool** | | [optional] -**editable_submissions** | **bool** | | [optional] -**expire_submissions** | **bool** | | [optional] -**name** | **str** | | [optional] -**footer_html** | **str** | | [optional] -**html** | **str** | | [optional] -**redirect_url** | **str** | | [optional] - -[[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/docs/TemplatePreview.md b/docs/TemplatePreview.md new file mode 100644 index 0000000..d500e67 --- /dev/null +++ b/docs/TemplatePreview.md @@ -0,0 +1,64 @@ +# TemplatePreview + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**add_data_request_submission_id_footers** | **bool** | | +**allow_additional_properties** | **bool** | | +**description** | **str** | | +**document_filename** | **str** | | +**document_md5** | **str** | | +**document_parse_error** | **bool** | | +**document_processed** | **bool** | | +**document_state** | **str** | | +**document_url** | **str** | | +**editable_submissions** | **bool** | | +**embed_domains** | **str** | | +**encrypt_pdfs_password** | **str** | | +**encrypt_pdfs** | **bool** | | +**expiration_interval** | **str** | | +**expire_after** | **int** | | +**expire_submissions** | **bool** | | +**external_predefined_fields_template_id** | **str** | | +**external_predefined_fields_template_name** | **str** | | +**first_template** | **bool** | | +**id** | **str** | | +**locked** | **bool** | | +**merge_audit_trail_pdf** | **bool** | | +**name** | **str** | | +**page_count** | **int** | | +**page_dimensions** | **List[List[float]]** | | +**parent_folder_id** | **str** | | +**path** | **str** | | +**permanent_document_url** | **str** | | +**public_submissions** | **bool** | | +**public_web_form** | **bool** | | +**redirect_url** | **str** | | +**slack_webhook_url** | **str** | | +**template_type** | **str** | | +**updated_at** | **str** | | +**webhook_url** | **str** | | +**demo** | **bool** | | + +## Example + +```python +from docspring.models.template_preview import TemplatePreview + +# TODO update the JSON string below +json = "{}" +# create an instance of TemplatePreview from a JSON string +template_preview_instance = TemplatePreview.from_json(json) +# print the JSON string representation of the object +print(TemplatePreview.to_json()) + +# convert the object into a dict +template_preview_dict = template_preview_instance.to_dict() +# create an instance of TemplatePreview from a dict +template_preview_from_dict = TemplatePreview.from_dict(template_preview_dict) +``` +[[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/docs/TemplatestemplateIdaddFieldsFields.md b/docs/TemplatestemplateIdaddFieldsFields.md deleted file mode 100644 index f09786f..0000000 --- a/docs/TemplatestemplateIdaddFieldsFields.md +++ /dev/null @@ -1,94 +0,0 @@ -# TemplatestemplateIdaddFieldsFields - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**background_color_field_name** | **str** | | [optional] -**uppercase** | **bool** | | [optional] -**metadata** | **str** | | [optional] -**barcode_symbology** | **str** | | [optional] -**min_length** | **float** | | [optional] -**integer** | **bool** | | [optional] -**type** | **str** | | [optional] -**required** | **bool** | | [optional] -**comb_value_offset** | **float** | | [optional] -**image_gravity** | **str** | | [optional] -**overflow** | **str** | | [optional] -**qrcode_color** | **str** | | [optional] -**color_field_required** | **bool** | | [optional] -**background_color_field_required** | **bool** | | [optional] -**id** | **float** | | [optional] -**image_scale_type** | **str** | | [optional] -**exclusive_minimum** | **bool** | | [optional] -**height** | **float** | | [optional] -**number_condition_range_exclusive_max** | **bool** | | [optional] -**invert_boolean_condition** | **bool** | | [optional] -**shape_fill_color_field_name** | **str** | | [optional] -**static** | **bool** | | [optional] -**shape_border_color_field_name** | **str** | | [optional] -**v_alignment** | **str** | | [optional] -**bold** | **bool** | | [optional] -**shape_border_width** | **float** | | [optional] -**comb_number_of_cells** | **float** | | [optional] -**shape_border_color** | **str** | | [optional] -**comb** | **bool** | | [optional] -**typeface** | **str** | | [optional] -**shape_type** | **str** | | [optional] -**condition** | **str** | | [optional] -**display_type** | **str** | | [optional] -**check_color** | **str** | | [optional] -**multiline_lines** | **float** | | [optional] -**multiline** | **bool** | | [optional] -**true_text** | **str** | | [optional] -**name** | **str** | | [optional] -**font_size** | **float** | | [optional] -**page** | **float** | | [optional] -**alignment** | **str** | | [optional] -**max_length** | **float** | | [optional] -**auto_calculate_max_length** | **bool** | | [optional] -**color_field_name** | **str** | | [optional] -**qrcode_color_field_name** | **str** | | [optional] -**number_condition_range_min** | **float** | | [optional] -**color** | **str** | | [optional] -**hidden** | **bool** | | [optional] -**check_color_field_required** | **bool** | | [optional] -**combined_field_format** | **str** | | [optional] -**description** | **str** | | [optional] -**shape_border_color_field_required** | **bool** | | [optional] -**combined_field_names** | **str** | | [optional] -**title** | **str** | | [optional] -**number_condition_range_exclusive_min** | **bool** | | [optional] -**combined_field_separator** | **str** | | [optional] -**exclusive_maximum** | **bool** | | [optional] -**default** | **str** | | [optional] -**combined_field_type** | **str** | | [optional] -**date_time_format** | **str** | | [optional] -**qrcode_color_field_required** | **bool** | | [optional] -**currency** | **bool** | | [optional] -**false_text** | **str** | | [optional] -**strikethrough** | **bool** | | [optional] -**character_spacing** | **float** | | [optional] -**number_condition_range_max** | **float** | | [optional] -**background_color** | **str** | | [optional] -**check_color_field_name** | **str** | | [optional] -**check_character** | **str** | | [optional] -**rotation** | **float** | | [optional] -**option_list** | **str** | | [optional] -**shape_fill_color** | **str** | | [optional] -**string_condition_type** | **str** | | [optional] -**shape_fill_color_field_required** | **bool** | | [optional] -**decimal_places** | **float** | | [optional] -**include_time** | **bool** | | [optional] -**width** | **float** | | [optional] -**x** | **float** | | [optional] -**maximum** | **float** | | [optional] -**y** | **float** | | [optional] -**signature_allow_draw** | **bool** | | [optional] -**number_condition_type** | **str** | | [optional] -**opacity** | **float** | | [optional] -**minimum** | **float** | | [optional] -**signature_allow_type** | **bool** | | [optional] - -[[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/docs/UpdateDataRequestResponse.md b/docs/UpdateDataRequestResponse.md deleted file mode 100644 index 7536aca..0000000 --- a/docs/UpdateDataRequestResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# UpdateDataRequestResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data_request** | [**SubmissionDataRequest**](SubmissionDataRequest.md) | | [optional] -**errors** | **list[str]** | | [optional] -**status** | **str** | | [optional] - -[[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/docs/UpdateHtmlTemplate.md b/docs/UpdateHtmlTemplate.md new file mode 100644 index 0000000..6b8341e --- /dev/null +++ b/docs/UpdateHtmlTemplate.md @@ -0,0 +1,29 @@ +# UpdateHtmlTemplate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**template** | **object** | | + +## Example + +```python +from docspring.models.update_html_template import UpdateHtmlTemplate + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateHtmlTemplate from a JSON string +update_html_template_instance = UpdateHtmlTemplate.from_json(json) +# print the JSON string representation of the object +print(UpdateHtmlTemplate.to_json()) + +# convert the object into a dict +update_html_template_dict = update_html_template_instance.to_dict() +# create an instance of UpdateHtmlTemplate from a dict +update_html_template_from_dict = UpdateHtmlTemplate.from_dict(update_html_template_dict) +``` +[[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/docs/UpdateSubmissionDataRequestData.md b/docs/UpdateSubmissionDataRequestData.md index 77412c9..995a82f 100644 --- a/docs/UpdateSubmissionDataRequestData.md +++ b/docs/UpdateSubmissionDataRequestData.md @@ -1,22 +1,32 @@ # UpdateSubmissionDataRequestData + ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**auth_phone_number_hash** | **str** | | [optional] -**auth_provider** | **str** | | [optional] -**auth_second_factor_type** | **str** | | [optional] -**auth_session_id_hash** | **str** | | [optional] -**auth_session_started_at** | **str** | | [optional] **auth_type** | **str** | | [optional] -**auth_user_id_hash** | **str** | | [optional] -**auth_username_hash** | **str** | | [optional] -**email** | **str** | | [optional] -**fields** | **list[str]** | | [optional] +**fields** | **List[str]** | | [optional] **metadata** | **object** | | [optional] -**name** | **str** | | [optional] **order** | **int** | | [optional] +## Example + +```python +from docspring.models.update_submission_data_request_data import UpdateSubmissionDataRequestData + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateSubmissionDataRequestData from a JSON string +update_submission_data_request_data_instance = UpdateSubmissionDataRequestData.from_json(json) +# print the JSON string representation of the object +print(UpdateSubmissionDataRequestData.to_json()) + +# convert the object into a dict +update_submission_data_request_data_dict = update_submission_data_request_data_instance.to_dict() +# create an instance of UpdateSubmissionDataRequestData from a dict +update_submission_data_request_data_from_dict = UpdateSubmissionDataRequestData.from_dict(update_submission_data_request_data_dict) +``` [[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/docs/UpdateTemplateData.md b/docs/UpdateTemplateData.md deleted file mode 100644 index 80549d7..0000000 --- a/docs/UpdateTemplateData.md +++ /dev/null @@ -1,10 +0,0 @@ -# UpdateTemplateData - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**template** | [**TemplateData**](TemplateData.md) | | - -[[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/docs/UpdateTemplateResponse.md b/docs/UpdateTemplateResponse.md deleted file mode 100644 index e9c8c07..0000000 --- a/docs/UpdateTemplateResponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateTemplateResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**errors** | **list[str]** | | [optional] -**status** | **str** | | [optional] - -[[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/docs/UploadPresignResponse.md b/docs/UploadPresignResponse.md new file mode 100644 index 0000000..9cc8475 --- /dev/null +++ b/docs/UploadPresignResponse.md @@ -0,0 +1,32 @@ +# UploadPresignResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**fields** | **object** | | +**headers** | **object** | | +**url** | **str** | | +**method** | **str** | | [optional] + +## Example + +```python +from docspring.models.upload_presign_response import UploadPresignResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of UploadPresignResponse from a JSON string +upload_presign_response_instance = UploadPresignResponse.from_json(json) +# print the JSON string representation of the object +print(UploadPresignResponse.to_json()) + +# convert the object into a dict +upload_presign_response_dict = upload_presign_response_instance.to_dict() +# create an instance of UploadPresignResponse from a dict +upload_presign_response_from_dict = UploadPresignResponse.from_dict(upload_presign_response_dict) +``` +[[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/docs/UploadTemplateData.md b/docs/UploadTemplateData.md deleted file mode 100644 index 4211fc8..0000000 --- a/docs/UploadTemplateData.md +++ /dev/null @@ -1,27 +0,0 @@ -# UploadTemplateData - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**expiration_interval** | **str** | | [optional] -**webhook_url** | **str** | | [optional] -**scss** | **str** | | [optional] -**allow_additional_properties** | **bool** | | [optional] -**document** | [**UploadTemplateDataDocument**](UploadTemplateDataDocument.md) | | [optional] -**expire_after** | **float** | | [optional] -**description** | **str** | | [optional] -**public_submissions** | **bool** | | [optional] -**slack_webhook_url** | **str** | | [optional] -**header_html** | **str** | | [optional] -**public_web_form** | **bool** | | [optional] -**editable_submissions** | **bool** | | [optional] -**expire_submissions** | **bool** | | [optional] -**name** | **str** | | [optional] -**footer_html** | **str** | | [optional] -**html** | **str** | | [optional] -**template_type** | **str** | | [optional] -**redirect_url** | **str** | | [optional] - -[[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/docs/UploadTemplateDataDocument.md b/docs/UploadTemplateDataDocument.md deleted file mode 100644 index a9bbb3f..0000000 --- a/docs/UploadTemplateDataDocument.md +++ /dev/null @@ -1,12 +0,0 @@ -# UploadTemplateDataDocument - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**metadata** | [**UploadTemplateDataDocumentMetadata**](UploadTemplateDataDocumentMetadata.md) | | [optional] -**id** | **str** | | [optional] -**storage** | **str** | | [optional] - -[[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/docs/UploadTemplateDataDocumentMetadata.md b/docs/UploadTemplateDataDocumentMetadata.md deleted file mode 100644 index 93221de..0000000 --- a/docs/UploadTemplateDataDocumentMetadata.md +++ /dev/null @@ -1,12 +0,0 @@ -# UploadTemplateDataDocumentMetadata - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**filename** | **str** | | [optional] -**size** | **int** | | [optional] -**mime_type** | **str** | | [optional] - -[[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/docspring/__init__.py b/docspring/__init__.py index aba5c7d..efd28ad 100644 --- a/docspring/__init__.py +++ b/docspring/__init__.py @@ -3,77 +3,79 @@ # flake8: noqa """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import -__version__ = "1.3.2" +__version__ = "2.0.0" # import apis into sdk package from docspring.api.pdf_api import PDFApi -from .api.client import Client - # import ApiClient +from docspring.api_response import ApiResponse from docspring.api_client import ApiClient from docspring.configuration import Configuration +from docspring.exceptions import OpenApiException +from docspring.exceptions import ApiTypeError +from docspring.exceptions import ApiValueError +from docspring.exceptions import ApiKeyError +from docspring.exceptions import ApiAttributeError +from docspring.exceptions import ApiException + # import models into sdk package from docspring.models.add_fields_data import AddFieldsData -from docspring.models.add_fields_template_response import AddFieldsTemplateResponse -from docspring.models.authentication_error import AuthenticationError -from docspring.models.authentication_success_response import AuthenticationSuccessResponse +from docspring.models.batch_generate_pdfs201_response import BatchGeneratePdfs201Response from docspring.models.combine_pdfs_data import CombinePdfsData from docspring.models.combined_submission import CombinedSubmission from docspring.models.combined_submission_action import CombinedSubmissionAction from docspring.models.combined_submission_data import CombinedSubmissionData -from docspring.models.copy_template_data import CopyTemplateData +from docspring.models.copy_template_options import CopyTemplateOptions from docspring.models.create_combined_submission_response import CreateCombinedSubmissionResponse from docspring.models.create_custom_file_data import CreateCustomFileData from docspring.models.create_custom_file_response import CreateCustomFileResponse from docspring.models.create_folder_data import CreateFolderData -from docspring.models.create_html_template_data import CreateHtmlTemplateData -from docspring.models.create_submission_batch_response import CreateSubmissionBatchResponse -from docspring.models.create_submission_batch_submissions_response import CreateSubmissionBatchSubmissionsResponse +from docspring.models.create_html_submission_data import CreateHtmlSubmissionData +from docspring.models.create_html_template import CreateHtmlTemplate +from docspring.models.create_pdf_submission_data import CreatePdfSubmissionData +from docspring.models.create_pdf_template import CreatePdfTemplate from docspring.models.create_submission_data_request_data import CreateSubmissionDataRequestData +from docspring.models.create_submission_data_request_event_request import CreateSubmissionDataRequestEventRequest +from docspring.models.create_submission_data_request_event_response import CreateSubmissionDataRequestEventResponse +from docspring.models.create_submission_data_request_response import CreateSubmissionDataRequestResponse from docspring.models.create_submission_data_request_token_response import CreateSubmissionDataRequestTokenResponse -from docspring.models.create_submission_data_request_token_response_token import CreateSubmissionDataRequestTokenResponseToken from docspring.models.create_submission_response import CreateSubmissionResponse -from docspring.models.create_template_from_upload_data import CreateTemplateFromUploadData from docspring.models.custom_file import CustomFile -from docspring.models.error import Error +from docspring.models.error_response import ErrorResponse from docspring.models.folder import Folder -from docspring.models.folders_folder import FoldersFolder -from docspring.models.html_template_data import HtmlTemplateData -from docspring.models.invalid_request import InvalidRequest +from docspring.models.json_schema import JsonSchema from docspring.models.list_submissions_response import ListSubmissionsResponse from docspring.models.move_folder_data import MoveFolderData from docspring.models.move_template_data import MoveTemplateData -from docspring.models.pending_template import PendingTemplate +from docspring.models.multiple_errors_response import MultipleErrorsResponse from docspring.models.rename_folder_data import RenameFolderData from docspring.models.submission import Submission from docspring.models.submission_action import SubmissionAction from docspring.models.submission_batch import SubmissionBatch from docspring.models.submission_batch_data import SubmissionBatchData -from docspring.models.submission_data import SubmissionData -from docspring.models.submission_data_batch_request import SubmissionDataBatchRequest +from docspring.models.submission_batch_with_submissions import SubmissionBatchWithSubmissions from docspring.models.submission_data_request import SubmissionDataRequest +from docspring.models.submission_data_request_event import SubmissionDataRequestEvent +from docspring.models.submission_data_request_show import SubmissionDataRequestShow +from docspring.models.submission_data_request_token import SubmissionDataRequestToken +from docspring.models.submission_preview import SubmissionPreview +from docspring.models.success_error_response import SuccessErrorResponse +from docspring.models.success_multiple_errors_response import SuccessMultipleErrorsResponse from docspring.models.template import Template -from docspring.models.template1 import Template1 -from docspring.models.template1_defaults import Template1Defaults -from docspring.models.template_data import TemplateData -from docspring.models.templatestemplate_idadd_fields_fields import TemplatestemplateIdaddFieldsFields -from docspring.models.update_data_request_response import UpdateDataRequestResponse +from docspring.models.template_add_fields_response import TemplateAddFieldsResponse +from docspring.models.template_preview import TemplatePreview +from docspring.models.update_html_template import UpdateHtmlTemplate from docspring.models.update_submission_data_request_data import UpdateSubmissionDataRequestData -from docspring.models.update_template_data import UpdateTemplateData -from docspring.models.update_template_response import UpdateTemplateResponse -from docspring.models.upload_template_data import UploadTemplateData -from docspring.models.upload_template_data_document import UploadTemplateDataDocument -from docspring.models.upload_template_data_document_metadata import UploadTemplateDataDocumentMetadata - +from docspring.models.upload_presign_response import UploadPresignResponse diff --git a/docspring/api/__init__.py b/docspring/api/__init__.py index a706bc5..6911b9a 100644 --- a/docspring/api/__init__.py +++ b/docspring/api/__init__.py @@ -1,6 +1,5 @@ -from __future__ import absolute_import - # flake8: noqa # import apis into api package from docspring.api.pdf_api import PDFApi + diff --git a/docspring/api/client.py b/docspring/api/client.py deleted file mode 100644 index 1ea7da1..0000000 --- a/docspring/api/client.py +++ /dev/null @@ -1,190 +0,0 @@ -# coding: utf-8 - -""" - API V1 - - No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) - - OpenAPI spec version: v1 - - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import sys -import os -import re -import time - -from .pdf_api import PDFApi -from docspring.models.create_submission_response import CreateSubmissionResponse -from docspring.models.create_combined_submission_response import CreateCombinedSubmissionResponse -from docspring.models.create_submission_batch_response import CreateSubmissionBatchResponse - - -class PollTimeoutError(Exception): - pass - - -class FailedBatchError(Exception): - pass - - -class Client(PDFApi): - """ - DocSpring API Client - """ - - def wait(self): - """ - Just calls sleep(1), but we need to mock this method in tests. - """ - time.sleep(1) - - def generate_pdf(self, template_id, data, **kwargs): - """ - Generates a new PDF and waits for PDF to be ready. - :param string template_id - :param Data data: - :return: CreateSubmissionResponse - """ - kwargs['_return_http_data_only'] = True - - wait = kwargs.pop('wait', True) - - (response) = self.generate_pdf_with_http_info( - template_id, data, **kwargs) - if not wait: - return response - - submission = response.submission - - start_time = time.time() - timeout = 60 - if 'timeout' in kwargs and kwargs['timeout'] is not None: - timeout = kwargs['timeout'] - - # Wait for submission to be ready - while (submission.state == 'pending'): - self.wait() - submission = self.get_submission(submission.id) - - if time.time() - start_time > timeout: - raise PollTimeoutError( - "PDF was not ready after %d seconds!" % timeout) - - return CreateSubmissionResponse( - submission=submission, - status=('success' if submission.state == 'processed' else 'error')) - - def batch_generate_pdfs(self, submission_batch_data, **kwargs): - """ - Batch generate PDFs and waits for PDFs to be ready. - :param SubmissionBatchData submission_batch_data: - :return: CreateSubmissionResponse - """ - kwargs['_return_http_data_only'] = True - - wait = kwargs.pop('wait', True) - - (response) = self.batch_generate_pdfs_with_http_info( - submission_batch_data, **kwargs) - - if not wait: - return response - - batch = response.submission_batch - submission_responses = response.submissions - - start_time = time.time() - timeout = 600 - if 'timeout' in kwargs and kwargs['timeout'] is not None: - timeout = kwargs['timeout'] - - # Wait for batch to be ready - while (batch.state == 'pending'): - self.wait() - batch = self.get_submission_batch(batch.id) - - if time.time() - start_time > timeout: - raise PollTimeoutError( - "PDF was not ready after %d seconds!" % timeout) - - # Now we need to fetch the updated submissions - batch_with_subs = self.get_submission_batch( - batch.id, include_submissions=True) - - updated_submissions_dict = {} - for sub in batch_with_subs.submissions: - if not sub.id: - continue - updated_submissions_dict[sub.id] = sub - for sub in submission_responses: - if not sub.submission: - continue - updated_sub = updated_submissions_dict.get(sub.submission.id) - if not updated_sub: - sub.status = 'error' - continue - sub.submission = updated_sub - sub.status = 'success' if updated_sub.state == 'processed' else 'error' - - return CreateSubmissionBatchResponse( - submission_batch=batch, - submissions=submission_responses, - status=('success' if batch.state == 'processed' else 'error')) - - def combine_submissions(self, data, **kwargs): - """ - Combines multiple submissions into a single PDF, and waits for merged PDF to be ready. - :param Data data - :return: CreateCombinedSubmissionResponse - """ - kwargs['combined_submission_data'] = data - kwargs['_return_http_data_only'] = True - wait = kwargs.pop('wait', True) - - (response) = self.combine_submissions_with_http_info(**kwargs) - - if not wait: - return response - - combined_submission = response.combined_submission - - start_time = time.time() - timeout = 600 - if 'timeout' in kwargs and kwargs['timeout'] is not None: - timeout = kwargs['timeout'] - - # Wait for submission to be ready - while (combined_submission.state == 'pending'): - self.wait() - combined_submission = self.get_combined_submission( - combined_submission.id) - - if time.time() - start_time > timeout: - raise PollTimeoutError( - "Combined PDF was not ready after %d seconds!" % timeout) - - return CreateCombinedSubmissionResponse( - combined_submission=combined_submission, - status=('success' if combined_submission.state == 'processed' else 'error')) - - def batch_generate_and_combine_pdfs(self, submission_batch_data, **kwargs): - """ - Batch generate PDFs and combines them into a single PDF. - :param SubmissionBatchData submission_batch_data: - :return: CreateCombinedSubmissionResponse - """ - wait = kwargs.pop('wait', True) - response = self.batch_generate_pdfs(submission_batch_data, **kwargs) - - if response.status != 'success': - raise FailedBatchError("Batch job failed, cannot combine PDFs!") - - submission_ids = list( - map(lambda s: s.submission.id, response.submissions)) - return self.combine_submissions({ - 'submission_ids': submission_ids - }, wait=wait) diff --git a/docspring/api/pdf_api.py b/docspring/api/pdf_api.py index 7a83af1..4919fd5 100644 --- a/docspring/api/pdf_api.py +++ b/docspring/api/pdf_api.py @@ -1,3423 +1,10888 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from docspring.api_client import ApiClient + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) - -class PDFApi(object): + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictBytes, StrictFloat, StrictInt, StrictStr, field_validator +from typing import List, Optional, Tuple, Union +from typing_extensions import Annotated +from docspring.models.add_fields_data import AddFieldsData +from docspring.models.batch_generate_pdfs201_response import BatchGeneratePdfs201Response +from docspring.models.combine_pdfs_data import CombinePdfsData +from docspring.models.combined_submission import CombinedSubmission +from docspring.models.combined_submission_data import CombinedSubmissionData +from docspring.models.copy_template_options import CopyTemplateOptions +from docspring.models.create_combined_submission_response import CreateCombinedSubmissionResponse +from docspring.models.create_custom_file_data import CreateCustomFileData +from docspring.models.create_custom_file_response import CreateCustomFileResponse +from docspring.models.create_folder_data import CreateFolderData +from docspring.models.create_html_submission_data import CreateHtmlSubmissionData +from docspring.models.create_html_template import CreateHtmlTemplate +from docspring.models.create_pdf_submission_data import CreatePdfSubmissionData +from docspring.models.create_pdf_template import CreatePdfTemplate +from docspring.models.create_submission_data_request_event_request import CreateSubmissionDataRequestEventRequest +from docspring.models.create_submission_data_request_event_response import CreateSubmissionDataRequestEventResponse +from docspring.models.create_submission_data_request_response import CreateSubmissionDataRequestResponse +from docspring.models.create_submission_data_request_token_response import CreateSubmissionDataRequestTokenResponse +from docspring.models.create_submission_response import CreateSubmissionResponse +from docspring.models.folder import Folder +from docspring.models.json_schema import JsonSchema +from docspring.models.list_submissions_response import ListSubmissionsResponse +from docspring.models.move_folder_data import MoveFolderData +from docspring.models.move_template_data import MoveTemplateData +from docspring.models.rename_folder_data import RenameFolderData +from docspring.models.submission import Submission +from docspring.models.submission_batch_data import SubmissionBatchData +from docspring.models.submission_batch_with_submissions import SubmissionBatchWithSubmissions +from docspring.models.submission_data_request_show import SubmissionDataRequestShow +from docspring.models.submission_preview import SubmissionPreview +from docspring.models.success_error_response import SuccessErrorResponse +from docspring.models.success_multiple_errors_response import SuccessMultipleErrorsResponse +from docspring.models.template import Template +from docspring.models.template_add_fields_response import TemplateAddFieldsResponse +from docspring.models.template_preview import TemplatePreview +from docspring.models.update_html_template import UpdateHtmlTemplate +from docspring.models.update_submission_data_request_data import UpdateSubmissionDataRequestData +from docspring.models.upload_presign_response import UploadPresignResponse + +from docspring.api_client import ApiClient, RequestSerialized +from docspring.api_response import ApiResponse +from docspring.rest import RESTResponseType + + +class PDFApi: """NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: - api_client = ApiClient() + api_client = ApiClient.get_default() self.api_client = api_client - def add_fields_to_template(self, template_id, add_fields_data, **kwargs): # noqa: E501 - """Add new fields to a Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_fields_to_template(template_id, add_fields_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :param AddFieldsData add_fields_data: (required) - :return: AddFieldsTemplateResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.add_fields_to_template_with_http_info(template_id, add_fields_data, **kwargs) # noqa: E501 - else: - (data) = self.add_fields_to_template_with_http_info(template_id, add_fields_data, **kwargs) # noqa: E501 - return data - - def add_fields_to_template_with_http_info(self, template_id, add_fields_data, **kwargs): # noqa: E501 - """Add new fields to a Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.add_fields_to_template_with_http_info(template_id, add_fields_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :param AddFieldsData add_fields_data: (required) - :return: AddFieldsTemplateResponse - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['template_id', 'add_fields_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_fields_to_template" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'template_id' is set - if ('template_id' not in local_var_params or - local_var_params['template_id'] is None): - raise ValueError("Missing the required parameter `template_id` when calling `add_fields_to_template`") # noqa: E501 - # verify the required parameter 'add_fields_data' is set - if ('add_fields_data' not in local_var_params or - local_var_params['add_fields_data'] is None): - raise ValueError("Missing the required parameter `add_fields_data` when calling `add_fields_to_template`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'template_id' in local_var_params: - path_params['template_id'] = local_var_params['template_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'add_fields_data' in local_var_params: - body_params = local_var_params['add_fields_data'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/templates/{template_id}/add_fields', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AddFieldsTemplateResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def batch_generate_pdf_v1(self, template_id, request_body, **kwargs): # noqa: E501 - """Generates multiple PDFs # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.batch_generate_pdf_v1(template_id, request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :param list[object] request_body: (required) - :return: list[CreateSubmissionResponse] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.batch_generate_pdf_v1_with_http_info(template_id, request_body, **kwargs) # noqa: E501 - else: - (data) = self.batch_generate_pdf_v1_with_http_info(template_id, request_body, **kwargs) # noqa: E501 - return data - - def batch_generate_pdf_v1_with_http_info(self, template_id, request_body, **kwargs): # noqa: E501 - """Generates multiple PDFs # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.batch_generate_pdf_v1_with_http_info(template_id, request_body, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :param list[object] request_body: (required) - :return: list[CreateSubmissionResponse] - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['template_id', 'request_body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method batch_generate_pdf_v1" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'template_id' is set - if ('template_id' not in local_var_params or - local_var_params['template_id'] is None): - raise ValueError("Missing the required parameter `template_id` when calling `batch_generate_pdf_v1`") # noqa: E501 - # verify the required parameter 'request_body' is set - if ('request_body' not in local_var_params or - local_var_params['request_body'] is None): - raise ValueError("Missing the required parameter `request_body` when calling `batch_generate_pdf_v1`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'template_id' in local_var_params: - path_params['template_id'] = local_var_params['template_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'request_body' in local_var_params: - body_params = local_var_params['request_body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/templates/{template_id}/submissions/batch', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[CreateSubmissionResponse]', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def batch_generate_pdfs(self, submission_batch_data, **kwargs): # noqa: E501 - """Generates multiple PDFs # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.batch_generate_pdfs(submission_batch_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param SubmissionBatchData submission_batch_data: (required) - :return: CreateSubmissionBatchResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.batch_generate_pdfs_with_http_info(submission_batch_data, **kwargs) # noqa: E501 - else: - (data) = self.batch_generate_pdfs_with_http_info(submission_batch_data, **kwargs) # noqa: E501 - return data - - def batch_generate_pdfs_with_http_info(self, submission_batch_data, **kwargs): # noqa: E501 - """Generates multiple PDFs # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.batch_generate_pdfs_with_http_info(submission_batch_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param SubmissionBatchData submission_batch_data: (required) - :return: CreateSubmissionBatchResponse - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['submission_batch_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method batch_generate_pdfs" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'submission_batch_data' is set - if ('submission_batch_data' not in local_var_params or - local_var_params['submission_batch_data'] is None): - raise ValueError("Missing the required parameter `submission_batch_data` when calling `batch_generate_pdfs`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'submission_batch_data' in local_var_params: - body_params = local_var_params['submission_batch_data'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/submissions/batches', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CreateSubmissionBatchResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def combine_pdfs(self, combine_pdfs_data, **kwargs): # noqa: E501 - """Merge submission PDFs, template PDFs, or custom files # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.combine_pdfs(combine_pdfs_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CombinePdfsData combine_pdfs_data: (required) - :return: CreateCombinedSubmissionResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.combine_pdfs_with_http_info(combine_pdfs_data, **kwargs) # noqa: E501 - else: - (data) = self.combine_pdfs_with_http_info(combine_pdfs_data, **kwargs) # noqa: E501 - return data - - def combine_pdfs_with_http_info(self, combine_pdfs_data, **kwargs): # noqa: E501 - """Merge submission PDFs, template PDFs, or custom files # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.combine_pdfs_with_http_info(combine_pdfs_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CombinePdfsData combine_pdfs_data: (required) - :return: CreateCombinedSubmissionResponse - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['combine_pdfs_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method combine_pdfs" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'combine_pdfs_data' is set - if ('combine_pdfs_data' not in local_var_params or - local_var_params['combine_pdfs_data'] is None): - raise ValueError("Missing the required parameter `combine_pdfs_data` when calling `combine_pdfs`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'combine_pdfs_data' in local_var_params: - body_params = local_var_params['combine_pdfs_data'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/combined_submissions?v=2', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CreateCombinedSubmissionResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def combine_submissions(self, combined_submission_data, **kwargs): # noqa: E501 - """Merge generated PDFs together # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.combine_submissions(combined_submission_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CombinedSubmissionData combined_submission_data: (required) - :return: CreateCombinedSubmissionResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.combine_submissions_with_http_info(combined_submission_data, **kwargs) # noqa: E501 - else: - (data) = self.combine_submissions_with_http_info(combined_submission_data, **kwargs) # noqa: E501 - return data - - def combine_submissions_with_http_info(self, combined_submission_data, **kwargs): # noqa: E501 - """Merge generated PDFs together # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.combine_submissions_with_http_info(combined_submission_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CombinedSubmissionData combined_submission_data: (required) - :return: CreateCombinedSubmissionResponse - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['combined_submission_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method combine_submissions" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'combined_submission_data' is set - if ('combined_submission_data' not in local_var_params or - local_var_params['combined_submission_data'] is None): - raise ValueError("Missing the required parameter `combined_submission_data` when calling `combine_submissions`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'combined_submission_data' in local_var_params: - body_params = local_var_params['combined_submission_data'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/combined_submissions', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CreateCombinedSubmissionResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def copy_template(self, template_id, copy_template_data, **kwargs): # noqa: E501 - """Copy a Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.copy_template(template_id, copy_template_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :param CopyTemplateData copy_template_data: (required) - :return: Template - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.copy_template_with_http_info(template_id, copy_template_data, **kwargs) # noqa: E501 - else: - (data) = self.copy_template_with_http_info(template_id, copy_template_data, **kwargs) # noqa: E501 - return data - - def copy_template_with_http_info(self, template_id, copy_template_data, **kwargs): # noqa: E501 - """Copy a Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.copy_template_with_http_info(template_id, copy_template_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :param CopyTemplateData copy_template_data: (required) - :return: Template - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['template_id', 'copy_template_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method copy_template" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'template_id' is set - if ('template_id' not in local_var_params or - local_var_params['template_id'] is None): - raise ValueError("Missing the required parameter `template_id` when calling `copy_template`") # noqa: E501 - # verify the required parameter 'copy_template_data' is set - if ('copy_template_data' not in local_var_params or - local_var_params['copy_template_data'] is None): - raise ValueError("Missing the required parameter `copy_template_data` when calling `copy_template`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'template_id' in local_var_params: - path_params['template_id'] = local_var_params['template_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'copy_template_data' in local_var_params: - body_params = local_var_params['copy_template_data'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/templates/{template_id}/copy', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Template', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_custom_file_from_upload(self, create_custom_file_data, **kwargs): # noqa: E501 - """Create a new custom file from a cached presign upload # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_custom_file_from_upload(create_custom_file_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CreateCustomFileData create_custom_file_data: (required) - :return: CreateCustomFileResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_custom_file_from_upload_with_http_info(create_custom_file_data, **kwargs) # noqa: E501 - else: - (data) = self.create_custom_file_from_upload_with_http_info(create_custom_file_data, **kwargs) # noqa: E501 - return data - - def create_custom_file_from_upload_with_http_info(self, create_custom_file_data, **kwargs): # noqa: E501 - """Create a new custom file from a cached presign upload # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_custom_file_from_upload_with_http_info(create_custom_file_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CreateCustomFileData create_custom_file_data: (required) - :return: CreateCustomFileResponse - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['create_custom_file_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_custom_file_from_upload" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'create_custom_file_data' is set - if ('create_custom_file_data' not in local_var_params or - local_var_params['create_custom_file_data'] is None): - raise ValueError("Missing the required parameter `create_custom_file_data` when calling `create_custom_file_from_upload`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'create_custom_file_data' in local_var_params: - body_params = local_var_params['create_custom_file_data'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/custom_files', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CreateCustomFileResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_data_request_token(self, data_request_id, **kwargs): # noqa: E501 - """Creates a new data request token for form authentication # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_data_request_token(data_request_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str data_request_id: (required) - :return: CreateSubmissionDataRequestTokenResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_data_request_token_with_http_info(data_request_id, **kwargs) # noqa: E501 - else: - (data) = self.create_data_request_token_with_http_info(data_request_id, **kwargs) # noqa: E501 - return data - - def create_data_request_token_with_http_info(self, data_request_id, **kwargs): # noqa: E501 - """Creates a new data request token for form authentication # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_data_request_token_with_http_info(data_request_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str data_request_id: (required) - :return: CreateSubmissionDataRequestTokenResponse - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['data_request_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_data_request_token" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'data_request_id' is set - if ('data_request_id' not in local_var_params or - local_var_params['data_request_id'] is None): - raise ValueError("Missing the required parameter `data_request_id` when calling `create_data_request_token`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'data_request_id' in local_var_params: - path_params['data_request_id'] = local_var_params['data_request_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/data_requests/{data_request_id}/tokens', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CreateSubmissionDataRequestTokenResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_folder(self, create_folder_data, **kwargs): # noqa: E501 - """Create a folder # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_folder(create_folder_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CreateFolderData create_folder_data: (required) - :return: Folder - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_folder_with_http_info(create_folder_data, **kwargs) # noqa: E501 - else: - (data) = self.create_folder_with_http_info(create_folder_data, **kwargs) # noqa: E501 - return data - - def create_folder_with_http_info(self, create_folder_data, **kwargs): # noqa: E501 - """Create a folder # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_folder_with_http_info(create_folder_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CreateFolderData create_folder_data: (required) - :return: Folder - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['create_folder_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_folder" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'create_folder_data' is set - if ('create_folder_data' not in local_var_params or - local_var_params['create_folder_data'] is None): - raise ValueError("Missing the required parameter `create_folder_data` when calling `create_folder`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'create_folder_data' in local_var_params: - body_params = local_var_params['create_folder_data'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/folders/', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Folder', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_html_template(self, create_html_template_data, **kwargs): # noqa: E501 - """Create a new HTML template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_html_template(create_html_template_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CreateHtmlTemplateData create_html_template_data: (required) - :return: PendingTemplate - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_html_template_with_http_info(create_html_template_data, **kwargs) # noqa: E501 - else: - (data) = self.create_html_template_with_http_info(create_html_template_data, **kwargs) # noqa: E501 - return data - - def create_html_template_with_http_info(self, create_html_template_data, **kwargs): # noqa: E501 - """Create a new HTML template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_html_template_with_http_info(create_html_template_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CreateHtmlTemplateData create_html_template_data: (required) - :return: PendingTemplate - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['create_html_template_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_html_template" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'create_html_template_data' is set - if ('create_html_template_data' not in local_var_params or - local_var_params['create_html_template_data'] is None): - raise ValueError("Missing the required parameter `create_html_template_data` when calling `create_html_template`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'create_html_template_data' in local_var_params: - body_params = local_var_params['create_html_template_data'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/templates?desc=html', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PendingTemplate', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_pdf_template(self, template_document, template_name, **kwargs): # noqa: E501 - """Create a new PDF template with a form POST file upload # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_pdf_template(template_document, template_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param file template_document: (required) - :param str template_name: (required) - :param str template_parent_folder_id: - :return: PendingTemplate - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_pdf_template_with_http_info(template_document, template_name, **kwargs) # noqa: E501 - else: - (data) = self.create_pdf_template_with_http_info(template_document, template_name, **kwargs) # noqa: E501 - return data - - def create_pdf_template_with_http_info(self, template_document, template_name, **kwargs): # noqa: E501 - """Create a new PDF template with a form POST file upload # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_pdf_template_with_http_info(template_document, template_name, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param file template_document: (required) - :param str template_name: (required) - :param str template_parent_folder_id: - :return: PendingTemplate - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['template_document', 'template_name', 'template_parent_folder_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_pdf_template" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'template_document' is set - if ('template_document' not in local_var_params or - local_var_params['template_document'] is None): - raise ValueError("Missing the required parameter `template_document` when calling `create_pdf_template`") # noqa: E501 - # verify the required parameter 'template_name' is set - if ('template_name' not in local_var_params or - local_var_params['template_name'] is None): - raise ValueError("Missing the required parameter `template_name` when calling `create_pdf_template`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - if 'template_document' in local_var_params: - local_var_files['template[document]'] = local_var_params['template_document'] # noqa: E501 - if 'template_name' in local_var_params: - form_params.append(('template[name]', local_var_params['template_name'])) # noqa: E501 - if 'template_parent_folder_id' in local_var_params: - form_params.append(('template[parent_folder_id]', local_var_params['template_parent_folder_id'])) # noqa: E501 - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['multipart/form-data']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/templates', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PendingTemplate', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def create_pdf_template_from_upload(self, create_template_from_upload_data, **kwargs): # noqa: E501 - """Create a new PDF template from a cached presign upload # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_pdf_template_from_upload(create_template_from_upload_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CreateTemplateFromUploadData create_template_from_upload_data: (required) - :return: PendingTemplate - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.create_pdf_template_from_upload_with_http_info(create_template_from_upload_data, **kwargs) # noqa: E501 - else: - (data) = self.create_pdf_template_from_upload_with_http_info(create_template_from_upload_data, **kwargs) # noqa: E501 - return data - - def create_pdf_template_from_upload_with_http_info(self, create_template_from_upload_data, **kwargs): # noqa: E501 - """Create a new PDF template from a cached presign upload # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_pdf_template_from_upload_with_http_info(create_template_from_upload_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param CreateTemplateFromUploadData create_template_from_upload_data: (required) - :return: PendingTemplate - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['create_template_from_upload_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method create_pdf_template_from_upload" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'create_template_from_upload_data' is set - if ('create_template_from_upload_data' not in local_var_params or - local_var_params['create_template_from_upload_data'] is None): - raise ValueError("Missing the required parameter `create_template_from_upload_data` when calling `create_pdf_template_from_upload`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'create_template_from_upload_data' in local_var_params: - body_params = local_var_params['create_template_from_upload_data'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/templates?desc=cached_upload', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='PendingTemplate', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def delete_folder(self, folder_id, **kwargs): # noqa: E501 - """Delete a folder # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_folder(folder_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str folder_id: (required) - :return: Folder - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_folder_with_http_info(folder_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_folder_with_http_info(folder_id, **kwargs) # noqa: E501 - return data - - def delete_folder_with_http_info(self, folder_id, **kwargs): # noqa: E501 - """Delete a folder # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_folder_with_http_info(folder_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str folder_id: (required) - :return: Folder - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['folder_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_folder" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'folder_id' is set - if ('folder_id' not in local_var_params or - local_var_params['folder_id'] is None): - raise ValueError("Missing the required parameter `folder_id` when calling `delete_folder`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'folder_id' in local_var_params: - path_params['folder_id'] = local_var_params['folder_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/folders/{folder_id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Folder', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def expire_combined_submission(self, combined_submission_id, **kwargs): # noqa: E501 - """Expire a combined submission # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.expire_combined_submission(combined_submission_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str combined_submission_id: (required) - :return: CombinedSubmission - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.expire_combined_submission_with_http_info(combined_submission_id, **kwargs) # noqa: E501 - else: - (data) = self.expire_combined_submission_with_http_info(combined_submission_id, **kwargs) # noqa: E501 - return data - - def expire_combined_submission_with_http_info(self, combined_submission_id, **kwargs): # noqa: E501 - """Expire a combined submission # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.expire_combined_submission_with_http_info(combined_submission_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str combined_submission_id: (required) - :return: CombinedSubmission - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['combined_submission_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method expire_combined_submission" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'combined_submission_id' is set - if ('combined_submission_id' not in local_var_params or - local_var_params['combined_submission_id'] is None): - raise ValueError("Missing the required parameter `combined_submission_id` when calling `expire_combined_submission`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'combined_submission_id' in local_var_params: - path_params['combined_submission_id'] = local_var_params['combined_submission_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/combined_submissions/{combined_submission_id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CombinedSubmission', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def expire_submission(self, submission_id, **kwargs): # noqa: E501 - """Expire a PDF submission # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.expire_submission(submission_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str submission_id: (required) - :return: Submission - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.expire_submission_with_http_info(submission_id, **kwargs) # noqa: E501 - else: - (data) = self.expire_submission_with_http_info(submission_id, **kwargs) # noqa: E501 - return data - - def expire_submission_with_http_info(self, submission_id, **kwargs): # noqa: E501 - """Expire a PDF submission # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.expire_submission_with_http_info(submission_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str submission_id: (required) - :return: Submission - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['submission_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method expire_submission" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'submission_id' is set - if ('submission_id' not in local_var_params or - local_var_params['submission_id'] is None): - raise ValueError("Missing the required parameter `submission_id` when calling `expire_submission`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'submission_id' in local_var_params: - path_params['submission_id'] = local_var_params['submission_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/submissions/{submission_id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Submission', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def generate_pdf(self, template_id, submission_data, **kwargs): # noqa: E501 - """Generates a new PDF # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.generate_pdf(template_id, submission_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :param SubmissionData submission_data: (required) - :return: CreateSubmissionResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.generate_pdf_with_http_info(template_id, submission_data, **kwargs) # noqa: E501 - else: - (data) = self.generate_pdf_with_http_info(template_id, submission_data, **kwargs) # noqa: E501 - return data - - def generate_pdf_with_http_info(self, template_id, submission_data, **kwargs): # noqa: E501 - """Generates a new PDF # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.generate_pdf_with_http_info(template_id, submission_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :param SubmissionData submission_data: (required) - :return: CreateSubmissionResponse - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['template_id', 'submission_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method generate_pdf" % key - ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'template_id' is set - if ('template_id' not in local_var_params or - local_var_params['template_id'] is None): - raise ValueError("Missing the required parameter `template_id` when calling `generate_pdf`") # noqa: E501 - # verify the required parameter 'submission_data' is set - if ('submission_data' not in local_var_params or - local_var_params['submission_data'] is None): - raise ValueError("Missing the required parameter `submission_data` when calling `generate_pdf`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'template_id' in local_var_params: - path_params['template_id'] = local_var_params['template_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'submission_data' in local_var_params: - body_params = local_var_params['submission_data'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/templates/{template_id}/submissions', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CreateSubmissionResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_combined_submission(self, combined_submission_id, **kwargs): # noqa: E501 - """Check the status of a combined submission (merged PDFs) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_combined_submission(combined_submission_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str combined_submission_id: (required) - :return: CombinedSubmission - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_combined_submission_with_http_info(combined_submission_id, **kwargs) # noqa: E501 + + @validate_call + def add_fields_to_template( + self, + template_id: StrictStr, + data: AddFieldsData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TemplateAddFieldsResponse: + """Add new fields to a Template + + + :param template_id: (required) + :type template_id: str + :param data: (required) + :type data: AddFieldsData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_fields_to_template_serialize( + template_id=template_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateAddFieldsResponse", + '422': "TemplateAddFieldsResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def add_fields_to_template_with_http_info( + self, + template_id: StrictStr, + data: AddFieldsData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TemplateAddFieldsResponse]: + """Add new fields to a Template + + + :param template_id: (required) + :type template_id: str + :param data: (required) + :type data: AddFieldsData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_fields_to_template_serialize( + template_id=template_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateAddFieldsResponse", + '422': "TemplateAddFieldsResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def add_fields_to_template_without_preload_content( + self, + template_id: StrictStr, + data: AddFieldsData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add new fields to a Template + + + :param template_id: (required) + :type template_id: str + :param data: (required) + :type data: AddFieldsData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_fields_to_template_serialize( + template_id=template_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplateAddFieldsResponse", + '422': "TemplateAddFieldsResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_fields_to_template_serialize( + self, + template_id, + data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if data is not None: + _body_params = data + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.get_combined_submission_with_http_info(combined_submission_id, **kwargs) # noqa: E501 - return data - - def get_combined_submission_with_http_info(self, combined_submission_id, **kwargs): # noqa: E501 - """Check the status of a combined submission (merged PDFs) # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_combined_submission_with_http_info(combined_submission_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str combined_submission_id: (required) - :return: CombinedSubmission - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['combined_submission_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_combined_submission" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'combined_submission_id' is set - if ('combined_submission_id' not in local_var_params or - local_var_params['combined_submission_id'] is None): - raise ValueError("Missing the required parameter `combined_submission_id` when calling `get_combined_submission`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'combined_submission_id' in local_var_params: - path_params['combined_submission_id'] = local_var_params['combined_submission_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/combined_submissions/{combined_submission_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='CombinedSubmission', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_data_request(self, data_request_id, **kwargs): # noqa: E501 - """Look up a submission data request # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_data_request(data_request_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str data_request_id: (required) - :return: SubmissionDataRequest - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_data_request_with_http_info(data_request_id, **kwargs) # noqa: E501 + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/templates/{template_id}/add_fields', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def batch_generate_pdfs( + self, + data: SubmissionBatchData, + wait: Annotated[Optional[StrictBool], Field(description="Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> BatchGeneratePdfs201Response: + """Generates multiple PDFs + + + :param data: (required) + :type data: SubmissionBatchData + :param wait: Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) + :type wait: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._batch_generate_pdfs_serialize( + data=data, + wait=wait, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BatchGeneratePdfs201Response", + '200': "BatchGeneratePdfs201Response", + '401': "ErrorResponse", + '422': "MultipleErrorsResponse", + '400': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def batch_generate_pdfs_with_http_info( + self, + data: SubmissionBatchData, + wait: Annotated[Optional[StrictBool], Field(description="Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[BatchGeneratePdfs201Response]: + """Generates multiple PDFs + + + :param data: (required) + :type data: SubmissionBatchData + :param wait: Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) + :type wait: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._batch_generate_pdfs_serialize( + data=data, + wait=wait, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BatchGeneratePdfs201Response", + '200': "BatchGeneratePdfs201Response", + '401': "ErrorResponse", + '422': "MultipleErrorsResponse", + '400': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def batch_generate_pdfs_without_preload_content( + self, + data: SubmissionBatchData, + wait: Annotated[Optional[StrictBool], Field(description="Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Generates multiple PDFs + + + :param data: (required) + :type data: SubmissionBatchData + :param wait: Wait for submission batch to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) + :type wait: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._batch_generate_pdfs_serialize( + data=data, + wait=wait, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "BatchGeneratePdfs201Response", + '200': "BatchGeneratePdfs201Response", + '401': "ErrorResponse", + '422': "MultipleErrorsResponse", + '400': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _batch_generate_pdfs_serialize( + self, + data, + wait, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if wait is not None: + + _query_params.append(('wait', wait)) + + # process the header parameters + # process the form parameters + # process the body parameter + if data is not None: + _body_params = data + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.get_data_request_with_http_info(data_request_id, **kwargs) # noqa: E501 - return data - - def get_data_request_with_http_info(self, data_request_id, **kwargs): # noqa: E501 - """Look up a submission data request # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_data_request_with_http_info(data_request_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str data_request_id: (required) - :return: SubmissionDataRequest - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['data_request_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_data_request" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'data_request_id' is set - if ('data_request_id' not in local_var_params or - local_var_params['data_request_id'] is None): - raise ValueError("Missing the required parameter `data_request_id` when calling `get_data_request`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'data_request_id' in local_var_params: - path_params['data_request_id'] = local_var_params['data_request_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/data_requests/{data_request_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='SubmissionDataRequest', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_full_template(self, template_id, **kwargs): # noqa: E501 - """Fetch the full template attributes # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_full_template(template_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :return: Template1 - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_full_template_with_http_info(template_id, **kwargs) # noqa: E501 + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/submissions/batches', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def combine_pdfs( + self, + data: CombinePdfsData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateCombinedSubmissionResponse: + """Merge submission PDFs, template PDFs, or custom files + + + :param data: (required) + :type data: CombinePdfsData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._combine_pdfs_serialize( + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateCombinedSubmissionResponse", + '422': "MultipleErrorsResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def combine_pdfs_with_http_info( + self, + data: CombinePdfsData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateCombinedSubmissionResponse]: + """Merge submission PDFs, template PDFs, or custom files + + + :param data: (required) + :type data: CombinePdfsData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._combine_pdfs_serialize( + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateCombinedSubmissionResponse", + '422': "MultipleErrorsResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def combine_pdfs_without_preload_content( + self, + data: CombinePdfsData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Merge submission PDFs, template PDFs, or custom files + + + :param data: (required) + :type data: CombinePdfsData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._combine_pdfs_serialize( + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateCombinedSubmissionResponse", + '422': "MultipleErrorsResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _combine_pdfs_serialize( + self, + data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if data is not None: + _body_params = data + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.get_full_template_with_http_info(template_id, **kwargs) # noqa: E501 - return data - - def get_full_template_with_http_info(self, template_id, **kwargs): # noqa: E501 - """Fetch the full template attributes # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_full_template_with_http_info(template_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :return: Template1 - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['template_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_full_template" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'template_id' is set - if ('template_id' not in local_var_params or - local_var_params['template_id'] is None): - raise ValueError("Missing the required parameter `template_id` when calling `get_full_template`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'template_id' in local_var_params: - path_params['template_id'] = local_var_params['template_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/templates/{template_id}?full=true', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Template1', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_presign_url(self, **kwargs): # noqa: E501 - """Get a presigned URL so that you can upload a file to our AWS S3 bucket # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_presign_url(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_presign_url_with_http_info(**kwargs) # noqa: E501 + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/combined_submissions?v=2', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def combine_submissions( + self, + data: CombinedSubmissionData, + wait: Annotated[Optional[StrictBool], Field(description="Wait for combined submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateCombinedSubmissionResponse: + """Merge generated PDFs together + + + :param data: (required) + :type data: CombinedSubmissionData + :param wait: Wait for combined submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) + :type wait: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._combine_submissions_serialize( + data=data, + wait=wait, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateCombinedSubmissionResponse", + '422': "MultipleErrorsResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def combine_submissions_with_http_info( + self, + data: CombinedSubmissionData, + wait: Annotated[Optional[StrictBool], Field(description="Wait for combined submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateCombinedSubmissionResponse]: + """Merge generated PDFs together + + + :param data: (required) + :type data: CombinedSubmissionData + :param wait: Wait for combined submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) + :type wait: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._combine_submissions_serialize( + data=data, + wait=wait, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateCombinedSubmissionResponse", + '422': "MultipleErrorsResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def combine_submissions_without_preload_content( + self, + data: CombinedSubmissionData, + wait: Annotated[Optional[StrictBool], Field(description="Wait for combined submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Merge generated PDFs together + + + :param data: (required) + :type data: CombinedSubmissionData + :param wait: Wait for combined submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) + :type wait: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._combine_submissions_serialize( + data=data, + wait=wait, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateCombinedSubmissionResponse", + '422': "MultipleErrorsResponse", + '400': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _combine_submissions_serialize( + self, + data, + wait, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if wait is not None: + + _query_params.append(('wait', wait)) + + # process the header parameters + # process the form parameters + # process the body parameter + if data is not None: + _body_params = data + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.get_presign_url_with_http_info(**kwargs) # noqa: E501 - return data - - def get_presign_url_with_http_info(self, **kwargs): # noqa: E501 - """Get a presigned URL so that you can upload a file to our AWS S3 bucket # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_presign_url_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_presign_url" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/uploads/presign', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, object)', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_submission(self, submission_id, **kwargs): # noqa: E501 - """Check the status of a PDF # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_submission(submission_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str submission_id: (required) - :param bool include_data: - :return: Submission - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_submission_with_http_info(submission_id, **kwargs) # noqa: E501 + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/combined_submissions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def copy_template( + self, + template_id: StrictStr, + options: Optional[CopyTemplateOptions] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TemplatePreview: + """Copy a Template + + + :param template_id: (required) + :type template_id: str + :param options: + :type options: CopyTemplateOptions + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._copy_template_serialize( + template_id=template_id, + options=options, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplatePreview", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def copy_template_with_http_info( + self, + template_id: StrictStr, + options: Optional[CopyTemplateOptions] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TemplatePreview]: + """Copy a Template + + + :param template_id: (required) + :type template_id: str + :param options: + :type options: CopyTemplateOptions + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._copy_template_serialize( + template_id=template_id, + options=options, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplatePreview", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def copy_template_without_preload_content( + self, + template_id: StrictStr, + options: Optional[CopyTemplateOptions] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Copy a Template + + + :param template_id: (required) + :type template_id: str + :param options: + :type options: CopyTemplateOptions + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._copy_template_serialize( + template_id=template_id, + options=options, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplatePreview", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _copy_template_serialize( + self, + template_id, + options, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if options is not None: + _body_params = options + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.get_submission_with_http_info(submission_id, **kwargs) # noqa: E501 - return data - - def get_submission_with_http_info(self, submission_id, **kwargs): # noqa: E501 - """Check the status of a PDF # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_submission_with_http_info(submission_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str submission_id: (required) - :param bool include_data: - :return: Submission - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['submission_id', 'include_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_submission" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'submission_id' is set - if ('submission_id' not in local_var_params or - local_var_params['submission_id'] is None): - raise ValueError("Missing the required parameter `submission_id` when calling `get_submission`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'submission_id' in local_var_params: - path_params['submission_id'] = local_var_params['submission_id'] # noqa: E501 - - query_params = [] - if 'include_data' in local_var_params: - query_params.append(('include_data', local_var_params['include_data'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/submissions/{submission_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Submission', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_submission_batch(self, submission_batch_id, **kwargs): # noqa: E501 - """Check the status of a submission batch job # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_submission_batch(submission_batch_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str submission_batch_id: (required) - :param bool include_submissions: - :return: SubmissionBatch - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_submission_batch_with_http_info(submission_batch_id, **kwargs) # noqa: E501 + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/templates/{template_id}/copy', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_custom_file_from_upload( + self, + data: CreateCustomFileData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateCustomFileResponse: + """Create a new custom file from a cached presign upload + + + :param data: (required) + :type data: CreateCustomFileData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_custom_file_from_upload_serialize( + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateCustomFileResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_custom_file_from_upload_with_http_info( + self, + data: CreateCustomFileData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateCustomFileResponse]: + """Create a new custom file from a cached presign upload + + + :param data: (required) + :type data: CreateCustomFileData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_custom_file_from_upload_serialize( + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateCustomFileResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_custom_file_from_upload_without_preload_content( + self, + data: CreateCustomFileData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new custom file from a cached presign upload + + + :param data: (required) + :type data: CreateCustomFileData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_custom_file_from_upload_serialize( + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateCustomFileResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_custom_file_from_upload_serialize( + self, + data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if data is not None: + _body_params = data + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.get_submission_batch_with_http_info(submission_batch_id, **kwargs) # noqa: E501 - return data - - def get_submission_batch_with_http_info(self, submission_batch_id, **kwargs): # noqa: E501 - """Check the status of a submission batch job # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_submission_batch_with_http_info(submission_batch_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str submission_batch_id: (required) - :param bool include_submissions: - :return: SubmissionBatch - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['submission_batch_id', 'include_submissions'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_submission_batch" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'submission_batch_id' is set - if ('submission_batch_id' not in local_var_params or - local_var_params['submission_batch_id'] is None): - raise ValueError("Missing the required parameter `submission_batch_id` when calling `get_submission_batch`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'submission_batch_id' in local_var_params: - path_params['submission_batch_id'] = local_var_params['submission_batch_id'] # noqa: E501 - - query_params = [] - if 'include_submissions' in local_var_params: - query_params.append(('include_submissions', local_var_params['include_submissions'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/submissions/batches/{submission_batch_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='SubmissionBatch', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_template(self, template_id, **kwargs): # noqa: E501 - """Check the status of an uploaded template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_template(template_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :return: Template - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_template_with_http_info(template_id, **kwargs) # noqa: E501 + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/custom_files', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_data_request_event( + self, + data_request_id: StrictStr, + event: CreateSubmissionDataRequestEventRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateSubmissionDataRequestEventResponse: + """Creates a new event for emailing a signee a request for signature + + + :param data_request_id: (required) + :type data_request_id: str + :param event: (required) + :type event: CreateSubmissionDataRequestEventRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_data_request_event_serialize( + data_request_id=data_request_id, + event=event, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSubmissionDataRequestEventResponse", + '401': "ErrorResponse", + '422': "MultipleErrorsResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_data_request_event_with_http_info( + self, + data_request_id: StrictStr, + event: CreateSubmissionDataRequestEventRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateSubmissionDataRequestEventResponse]: + """Creates a new event for emailing a signee a request for signature + + + :param data_request_id: (required) + :type data_request_id: str + :param event: (required) + :type event: CreateSubmissionDataRequestEventRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_data_request_event_serialize( + data_request_id=data_request_id, + event=event, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSubmissionDataRequestEventResponse", + '401': "ErrorResponse", + '422': "MultipleErrorsResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_data_request_event_without_preload_content( + self, + data_request_id: StrictStr, + event: CreateSubmissionDataRequestEventRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Creates a new event for emailing a signee a request for signature + + + :param data_request_id: (required) + :type data_request_id: str + :param event: (required) + :type event: CreateSubmissionDataRequestEventRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_data_request_event_serialize( + data_request_id=data_request_id, + event=event, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSubmissionDataRequestEventResponse", + '401': "ErrorResponse", + '422': "MultipleErrorsResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_data_request_event_serialize( + self, + data_request_id, + event, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if data_request_id is not None: + _path_params['data_request_id'] = data_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if event is not None: + _body_params = event + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.get_template_with_http_info(template_id, **kwargs) # noqa: E501 - return data - - def get_template_with_http_info(self, template_id, **kwargs): # noqa: E501 - """Check the status of an uploaded template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_template_with_http_info(template_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :return: Template - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['template_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_template" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'template_id' is set - if ('template_id' not in local_var_params or - local_var_params['template_id'] is None): - raise ValueError("Missing the required parameter `template_id` when calling `get_template`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'template_id' in local_var_params: - path_params['template_id'] = local_var_params['template_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/templates/{template_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Template', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def get_template_schema(self, template_id, **kwargs): # noqa: E501 - """Fetch the JSON schema for a template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_template_schema(template_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_template_schema_with_http_info(template_id, **kwargs) # noqa: E501 + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/data_requests/{data_request_id}/events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_data_request_token( + self, + data_request_id: StrictStr, + type: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateSubmissionDataRequestTokenResponse: + """Creates a new data request token for form authentication + + + :param data_request_id: (required) + :type data_request_id: str + :param type: + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_data_request_token_serialize( + data_request_id=data_request_id, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSubmissionDataRequestTokenResponse", + '401': "ErrorResponse", + '422': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_data_request_token_with_http_info( + self, + data_request_id: StrictStr, + type: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateSubmissionDataRequestTokenResponse]: + """Creates a new data request token for form authentication + + + :param data_request_id: (required) + :type data_request_id: str + :param type: + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_data_request_token_serialize( + data_request_id=data_request_id, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSubmissionDataRequestTokenResponse", + '401': "ErrorResponse", + '422': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_data_request_token_without_preload_content( + self, + data_request_id: StrictStr, + type: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Creates a new data request token for form authentication + + + :param data_request_id: (required) + :type data_request_id: str + :param type: + :type type: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_data_request_token_serialize( + data_request_id=data_request_id, + type=type, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSubmissionDataRequestTokenResponse", + '401': "ErrorResponse", + '422': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_data_request_token_serialize( + self, + data_request_id, + type, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if data_request_id is not None: + _path_params['data_request_id'] = data_request_id + # process the query parameters + if type is not None: + + _query_params.append(('type', type)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/data_requests/{data_request_id}/tokens', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_folder( + self, + data: CreateFolderData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Folder: + """Create a folder + + + :param data: (required) + :type data: CreateFolderData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_folder_serialize( + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '422': "MultipleErrorsResponse", + '404': "ErrorResponse", + '200': "Folder", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_folder_with_http_info( + self, + data: CreateFolderData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Folder]: + """Create a folder + + + :param data: (required) + :type data: CreateFolderData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_folder_serialize( + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '422': "MultipleErrorsResponse", + '404': "ErrorResponse", + '200': "Folder", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_folder_without_preload_content( + self, + data: CreateFolderData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a folder + + + :param data: (required) + :type data: CreateFolderData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_folder_serialize( + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '422': "MultipleErrorsResponse", + '404': "ErrorResponse", + '200': "Folder", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_folder_serialize( + self, + data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if data is not None: + _body_params = data + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.get_template_schema_with_http_info(template_id, **kwargs) # noqa: E501 - return data - - def get_template_schema_with_http_info(self, template_id, **kwargs): # noqa: E501 - """Fetch the JSON schema for a template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_template_schema_with_http_info(template_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :return: dict(str, object) - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['template_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_template_schema" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'template_id' is set - if ('template_id' not in local_var_params or - local_var_params['template_id'] is None): - raise ValueError("Missing the required parameter `template_id` when calling `get_template_schema`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'template_id' in local_var_params: - path_params['template_id'] = local_var_params['template_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/templates/{template_id}/schema', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='dict(str, object)', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def list_folders(self, **kwargs): # noqa: E501 - """Get a list of all folders # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_folders(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str parent_folder_id: Filter By Folder Id - :return: list[Folder] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_folders_with_http_info(**kwargs) # noqa: E501 + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/folders/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_html_template( + self, + data: CreateHtmlTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TemplatePreview: + """Create a new HTML template + + + :param data: (required) + :type data: CreateHtmlTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_html_template_serialize( + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TemplatePreview", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_html_template_with_http_info( + self, + data: CreateHtmlTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TemplatePreview]: + """Create a new HTML template + + + :param data: (required) + :type data: CreateHtmlTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_html_template_serialize( + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TemplatePreview", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_html_template_without_preload_content( + self, + data: CreateHtmlTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new HTML template + + + :param data: (required) + :type data: CreateHtmlTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_html_template_serialize( + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TemplatePreview", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_html_template_serialize( + self, + data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if data is not None: + _body_params = data + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.list_folders_with_http_info(**kwargs) # noqa: E501 - return data - - def list_folders_with_http_info(self, **kwargs): # noqa: E501 - """Get a list of all folders # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_folders_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str parent_folder_id: Filter By Folder Id - :return: list[Folder] - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['parent_folder_id'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method list_folders" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'parent_folder_id' in local_var_params: - query_params.append(('parent_folder_id', local_var_params['parent_folder_id'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/folders/', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Folder]', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def list_submissions(self, **kwargs): # noqa: E501 - """List all submissions # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_submissions(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str cursor: - :param float limit: - :param str created_after: - :param str created_before: - :param str type: - :param bool include_data: - :return: ListSubmissionsResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_submissions_with_http_info(**kwargs) # noqa: E501 + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/templates?endpoint_description=html', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_pdf_template( + self, + template_document: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], + template_name: StrictStr, + wait: Annotated[Optional[StrictBool], Field(description="Wait for template document to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)")] = None, + template_description: Optional[StrictStr] = None, + template_parent_folder_id: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TemplatePreview: + """Create a new PDF template with a form POST file upload + + + :param template_document: (required) + :type template_document: bytearray + :param template_name: (required) + :type template_name: str + :param wait: Wait for template document to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) + :type wait: bool + :param template_description: + :type template_description: str + :param template_parent_folder_id: + :type template_parent_folder_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_pdf_template_serialize( + template_document=template_document, + template_name=template_name, + wait=wait, + template_description=template_description, + template_parent_folder_id=template_parent_folder_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TemplatePreview", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_pdf_template_with_http_info( + self, + template_document: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], + template_name: StrictStr, + wait: Annotated[Optional[StrictBool], Field(description="Wait for template document to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)")] = None, + template_description: Optional[StrictStr] = None, + template_parent_folder_id: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TemplatePreview]: + """Create a new PDF template with a form POST file upload + + + :param template_document: (required) + :type template_document: bytearray + :param template_name: (required) + :type template_name: str + :param wait: Wait for template document to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) + :type wait: bool + :param template_description: + :type template_description: str + :param template_parent_folder_id: + :type template_parent_folder_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_pdf_template_serialize( + template_document=template_document, + template_name=template_name, + wait=wait, + template_description=template_description, + template_parent_folder_id=template_parent_folder_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TemplatePreview", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_pdf_template_without_preload_content( + self, + template_document: Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]], + template_name: StrictStr, + wait: Annotated[Optional[StrictBool], Field(description="Wait for template document to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)")] = None, + template_description: Optional[StrictStr] = None, + template_parent_folder_id: Optional[StrictStr] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new PDF template with a form POST file upload + + + :param template_document: (required) + :type template_document: bytearray + :param template_name: (required) + :type template_name: str + :param wait: Wait for template document to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) + :type wait: bool + :param template_description: + :type template_description: str + :param template_parent_folder_id: + :type template_parent_folder_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_pdf_template_serialize( + template_document=template_document, + template_name=template_name, + wait=wait, + template_description=template_description, + template_parent_folder_id=template_parent_folder_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TemplatePreview", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_pdf_template_serialize( + self, + template_document, + template_name, + wait, + template_description, + template_parent_folder_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if wait is not None: + + _query_params.append(('wait', wait)) + + # process the header parameters + # process the form parameters + if template_document is not None: + _files['template[document]'] = template_document + if template_name is not None: + _form_params.append(('template[name]', template_name)) + if template_description is not None: + _form_params.append(('template[description]', template_description)) + if template_parent_folder_id is not None: + _form_params.append(('template[parent_folder_id]', template_parent_folder_id)) + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.list_submissions_with_http_info(**kwargs) # noqa: E501 - return data - - def list_submissions_with_http_info(self, **kwargs): # noqa: E501 - """List all submissions # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_submissions_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str cursor: - :param float limit: - :param str created_after: - :param str created_before: - :param str type: - :param bool include_data: - :return: ListSubmissionsResponse - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['cursor', 'limit', 'created_after', 'created_before', 'type', 'include_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method list_submissions" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'multipart/form-data' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'cursor' in local_var_params: - query_params.append(('cursor', local_var_params['cursor'])) # noqa: E501 - if 'limit' in local_var_params: - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'created_after' in local_var_params: - query_params.append(('created_after', local_var_params['created_after'])) # noqa: E501 - if 'created_before' in local_var_params: - query_params.append(('created_before', local_var_params['created_before'])) # noqa: E501 - if 'type' in local_var_params: - query_params.append(('type', local_var_params['type'])) # noqa: E501 - if 'include_data' in local_var_params: - query_params.append(('include_data', local_var_params['include_data'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/submissions', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ListSubmissionsResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def list_submissions_0(self, template_id, **kwargs): # noqa: E501 - """List all submissions for a given template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_submissions_0(template_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :param str cursor: - :param float limit: - :param str created_after: - :param str created_before: - :param str type: - :param bool include_data: - :return: ListSubmissionsResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_submissions_0_with_http_info(template_id, **kwargs) # noqa: E501 + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/templates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_pdf_template_from_upload( + self, + data: CreatePdfTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TemplatePreview: + """Create a new PDF template from a cached presign upload + + + :param data: (required) + :type data: CreatePdfTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_pdf_template_from_upload_serialize( + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TemplatePreview", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_pdf_template_from_upload_with_http_info( + self, + data: CreatePdfTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TemplatePreview]: + """Create a new PDF template from a cached presign upload + + + :param data: (required) + :type data: CreatePdfTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_pdf_template_from_upload_serialize( + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TemplatePreview", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_pdf_template_from_upload_without_preload_content( + self, + data: CreatePdfTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new PDF template from a cached presign upload + + + :param data: (required) + :type data: CreatePdfTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_pdf_template_from_upload_serialize( + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "TemplatePreview", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_pdf_template_from_upload_serialize( + self, + data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if data is not None: + _body_params = data + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.list_submissions_0_with_http_info(template_id, **kwargs) # noqa: E501 - return data - - def list_submissions_0_with_http_info(self, template_id, **kwargs): # noqa: E501 - """List all submissions for a given template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_submissions_0_with_http_info(template_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :param str cursor: - :param float limit: - :param str created_after: - :param str created_before: - :param str type: - :param bool include_data: - :return: ListSubmissionsResponse - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['template_id', 'cursor', 'limit', 'created_after', 'created_before', 'type', 'include_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method list_submissions_0" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'template_id' is set - if ('template_id' not in local_var_params or - local_var_params['template_id'] is None): - raise ValueError("Missing the required parameter `template_id` when calling `list_submissions_0`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'template_id' in local_var_params: - path_params['template_id'] = local_var_params['template_id'] # noqa: E501 - - query_params = [] - if 'cursor' in local_var_params: - query_params.append(('cursor', local_var_params['cursor'])) # noqa: E501 - if 'limit' in local_var_params: - query_params.append(('limit', local_var_params['limit'])) # noqa: E501 - if 'created_after' in local_var_params: - query_params.append(('created_after', local_var_params['created_after'])) # noqa: E501 - if 'created_before' in local_var_params: - query_params.append(('created_before', local_var_params['created_before'])) # noqa: E501 - if 'type' in local_var_params: - query_params.append(('type', local_var_params['type'])) # noqa: E501 - if 'include_data' in local_var_params: - query_params.append(('include_data', local_var_params['include_data'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/templates/{template_id}/submissions', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='ListSubmissionsResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def list_templates(self, **kwargs): # noqa: E501 - """Get a list of all templates # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_templates(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str query: Search By Name - :param str parent_folder_id: Filter By Folder Id - :param int page: Default: 1 - :param int per_page: Default: 50 - :return: list[Template] - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.list_templates_with_http_info(**kwargs) # noqa: E501 + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/templates?endpoint_description=cached_upload', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_folder( + self, + folder_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Folder: + """Delete a folder + + + :param folder_id: (required) + :type folder_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_folder_serialize( + folder_id=folder_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '404': "ErrorResponse", + '422': "ErrorResponse", + '200': "Folder", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_folder_with_http_info( + self, + folder_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Folder]: + """Delete a folder + + + :param folder_id: (required) + :type folder_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_folder_serialize( + folder_id=folder_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '404': "ErrorResponse", + '422': "ErrorResponse", + '200': "Folder", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_folder_without_preload_content( + self, + folder_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a folder + + + :param folder_id: (required) + :type folder_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_folder_serialize( + folder_id=folder_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '404': "ErrorResponse", + '422': "ErrorResponse", + '200': "Folder", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_folder_serialize( + self, + folder_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if folder_id is not None: + _path_params['folder_id'] = folder_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/folders/{folder_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_template( + self, + template_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SuccessMultipleErrorsResponse: + """Delete a template + + + :param template_id: (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_template_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessMultipleErrorsResponse", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_template_with_http_info( + self, + template_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SuccessMultipleErrorsResponse]: + """Delete a template + + + :param template_id: (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_template_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessMultipleErrorsResponse", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_template_without_preload_content( + self, + template_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a template + + + :param template_id: (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_template_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessMultipleErrorsResponse", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_template_serialize( + self, + template_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/templates/{template_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def expire_combined_submission( + self, + combined_submission_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CombinedSubmission: + """Expire a combined submission + + + :param combined_submission_id: (required) + :type combined_submission_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._expire_combined_submission_serialize( + combined_submission_id=combined_submission_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CombinedSubmission", + '404': "ErrorResponse", + '403': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def expire_combined_submission_with_http_info( + self, + combined_submission_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CombinedSubmission]: + """Expire a combined submission + + + :param combined_submission_id: (required) + :type combined_submission_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._expire_combined_submission_serialize( + combined_submission_id=combined_submission_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CombinedSubmission", + '404': "ErrorResponse", + '403': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def expire_combined_submission_without_preload_content( + self, + combined_submission_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Expire a combined submission + + + :param combined_submission_id: (required) + :type combined_submission_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._expire_combined_submission_serialize( + combined_submission_id=combined_submission_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CombinedSubmission", + '404': "ErrorResponse", + '403': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _expire_combined_submission_serialize( + self, + combined_submission_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if combined_submission_id is not None: + _path_params['combined_submission_id'] = combined_submission_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/combined_submissions/{combined_submission_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def expire_submission( + self, + submission_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SubmissionPreview: + """Expire a PDF submission + + + :param submission_id: (required) + :type submission_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._expire_submission_serialize( + submission_id=submission_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SubmissionPreview", + '404': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def expire_submission_with_http_info( + self, + submission_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SubmissionPreview]: + """Expire a PDF submission + + + :param submission_id: (required) + :type submission_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._expire_submission_serialize( + submission_id=submission_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SubmissionPreview", + '404': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def expire_submission_without_preload_content( + self, + submission_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Expire a PDF submission + + + :param submission_id: (required) + :type submission_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._expire_submission_serialize( + submission_id=submission_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SubmissionPreview", + '404': "ErrorResponse", + '401': "ErrorResponse", + '403': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _expire_submission_serialize( + self, + submission_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if submission_id is not None: + _path_params['submission_id'] = submission_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/submissions/{submission_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def generate_pdf( + self, + template_id: StrictStr, + submission: CreatePdfSubmissionData, + wait: Annotated[Optional[StrictBool], Field(description="Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateSubmissionResponse: + """Generates a new PDF + + + :param template_id: (required) + :type template_id: str + :param submission: (required) + :type submission: CreatePdfSubmissionData + :param wait: Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) + :type wait: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_pdf_serialize( + template_id=template_id, + submission=submission, + wait=wait, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSubmissionResponse", + '422': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def generate_pdf_with_http_info( + self, + template_id: StrictStr, + submission: CreatePdfSubmissionData, + wait: Annotated[Optional[StrictBool], Field(description="Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateSubmissionResponse]: + """Generates a new PDF + + + :param template_id: (required) + :type template_id: str + :param submission: (required) + :type submission: CreatePdfSubmissionData + :param wait: Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) + :type wait: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_pdf_serialize( + template_id=template_id, + submission=submission, + wait=wait, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSubmissionResponse", + '422': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def generate_pdf_without_preload_content( + self, + template_id: StrictStr, + submission: CreatePdfSubmissionData, + wait: Annotated[Optional[StrictBool], Field(description="Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Generates a new PDF + + + :param template_id: (required) + :type template_id: str + :param submission: (required) + :type submission: CreatePdfSubmissionData + :param wait: Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) + :type wait: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_pdf_serialize( + template_id=template_id, + submission=submission, + wait=wait, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSubmissionResponse", + '422': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _generate_pdf_serialize( + self, + template_id, + submission, + wait, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + if wait is not None: + + _query_params.append(('wait', wait)) + + # process the header parameters + # process the form parameters + # process the body parameter + if submission is not None: + _body_params = submission + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.list_templates_with_http_info(**kwargs) # noqa: E501 - return data - - def list_templates_with_http_info(self, **kwargs): # noqa: E501 - """Get a list of all templates # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_templates_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str query: Search By Name - :param str parent_folder_id: Filter By Folder Id - :param int page: Default: 1 - :param int per_page: Default: 50 - :return: list[Template] - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['query', 'parent_folder_id', 'page', 'per_page'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method list_templates" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - - if 'page' in local_var_params and local_var_params['page'] < 1: # noqa: E501 - raise ValueError("Invalid value for parameter `page` when calling `list_templates`, must be a value greater than or equal to `1`") # noqa: E501 - if 'per_page' in local_var_params and local_var_params['per_page'] > 50: # noqa: E501 - raise ValueError("Invalid value for parameter `per_page` when calling `list_templates`, must be a value less than or equal to `50`") # noqa: E501 - if 'per_page' in local_var_params and local_var_params['per_page'] < 1: # noqa: E501 - raise ValueError("Invalid value for parameter `per_page` when calling `list_templates`, must be a value greater than or equal to `1`") # noqa: E501 - collection_formats = {} - - path_params = {} - - query_params = [] - if 'query' in local_var_params: - query_params.append(('query', local_var_params['query'])) # noqa: E501 - if 'parent_folder_id' in local_var_params: - query_params.append(('parent_folder_id', local_var_params['parent_folder_id'])) # noqa: E501 - if 'page' in local_var_params: - query_params.append(('page', local_var_params['page'])) # noqa: E501 - if 'per_page' in local_var_params: - query_params.append(('per_page', local_var_params['per_page'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/templates', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Template]', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def move_folder_to_folder(self, folder_id, move_folder_data, **kwargs): # noqa: E501 - """Move a folder # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.move_folder_to_folder(folder_id, move_folder_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str folder_id: (required) - :param MoveFolderData move_folder_data: (required) - :return: Folder - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.move_folder_to_folder_with_http_info(folder_id, move_folder_data, **kwargs) # noqa: E501 + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/templates/{template_id}/submissions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def generate_pdf_for_html_template( + self, + template_id: StrictStr, + submission: CreateHtmlSubmissionData, + wait: Annotated[Optional[StrictBool], Field(description="Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateSubmissionResponse: + """Generates a new PDF for an HTML template + + + :param template_id: (required) + :type template_id: str + :param submission: (required) + :type submission: CreateHtmlSubmissionData + :param wait: Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) + :type wait: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_pdf_for_html_template_serialize( + template_id=template_id, + submission=submission, + wait=wait, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSubmissionResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def generate_pdf_for_html_template_with_http_info( + self, + template_id: StrictStr, + submission: CreateHtmlSubmissionData, + wait: Annotated[Optional[StrictBool], Field(description="Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateSubmissionResponse]: + """Generates a new PDF for an HTML template + + + :param template_id: (required) + :type template_id: str + :param submission: (required) + :type submission: CreateHtmlSubmissionData + :param wait: Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) + :type wait: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_pdf_for_html_template_serialize( + template_id=template_id, + submission=submission, + wait=wait, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSubmissionResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def generate_pdf_for_html_template_without_preload_content( + self, + template_id: StrictStr, + submission: CreateHtmlSubmissionData, + wait: Annotated[Optional[StrictBool], Field(description="Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Generates a new PDF for an HTML template + + + :param template_id: (required) + :type template_id: str + :param submission: (required) + :type submission: CreateHtmlSubmissionData + :param wait: Wait for submission to be processed before returning. Set to false to return immediately. Default: true (on sync.* subdomain) + :type wait: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_pdf_for_html_template_serialize( + template_id=template_id, + submission=submission, + wait=wait, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateSubmissionResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _generate_pdf_for_html_template_serialize( + self, + template_id, + submission, + wait, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + if wait is not None: + + _query_params.append(('wait', wait)) + + # process the header parameters + # process the form parameters + # process the body parameter + if submission is not None: + _body_params = submission + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.move_folder_to_folder_with_http_info(folder_id, move_folder_data, **kwargs) # noqa: E501 - return data - - def move_folder_to_folder_with_http_info(self, folder_id, move_folder_data, **kwargs): # noqa: E501 - """Move a folder # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.move_folder_to_folder_with_http_info(folder_id, move_folder_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str folder_id: (required) - :param MoveFolderData move_folder_data: (required) - :return: Folder - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['folder_id', 'move_folder_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method move_folder_to_folder" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'folder_id' is set - if ('folder_id' not in local_var_params or - local_var_params['folder_id'] is None): - raise ValueError("Missing the required parameter `folder_id` when calling `move_folder_to_folder`") # noqa: E501 - # verify the required parameter 'move_folder_data' is set - if ('move_folder_data' not in local_var_params or - local_var_params['move_folder_data'] is None): - raise ValueError("Missing the required parameter `move_folder_data` when calling `move_folder_to_folder`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'folder_id' in local_var_params: - path_params['folder_id'] = local_var_params['folder_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'move_folder_data' in local_var_params: - body_params = local_var_params['move_folder_data'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/folders/{folder_id}/move', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Folder', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def move_template_to_folder(self, template_id, move_template_data, **kwargs): # noqa: E501 - """Move Template to folder # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.move_template_to_folder(template_id, move_template_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :param MoveTemplateData move_template_data: (required) - :return: Template - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.move_template_to_folder_with_http_info(template_id, move_template_data, **kwargs) # noqa: E501 + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/templates/{template_id}/submissions?endpoint_description=html_templates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def generate_preview( + self, + submission_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SuccessErrorResponse: + """Generated a preview PDF for partially completed data requests + + + :param submission_id: (required) + :type submission_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_preview_serialize( + submission_id=submission_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessErrorResponse", + '404': "ErrorResponse", + '422': "SuccessErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def generate_preview_with_http_info( + self, + submission_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SuccessErrorResponse]: + """Generated a preview PDF for partially completed data requests + + + :param submission_id: (required) + :type submission_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_preview_serialize( + submission_id=submission_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessErrorResponse", + '404': "ErrorResponse", + '422': "SuccessErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def generate_preview_without_preload_content( + self, + submission_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Generated a preview PDF for partially completed data requests + + + :param submission_id: (required) + :type submission_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_preview_serialize( + submission_id=submission_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessErrorResponse", + '404': "ErrorResponse", + '422': "SuccessErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _generate_preview_serialize( + self, + submission_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if submission_id is not None: + _path_params['submission_id'] = submission_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/submissions/{submission_id}/generate_preview', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_combined_submission( + self, + combined_submission_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CombinedSubmission: + """Check the status of a combined submission (merged PDFs) + + + :param combined_submission_id: (required) + :type combined_submission_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_combined_submission_serialize( + combined_submission_id=combined_submission_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CombinedSubmission", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_combined_submission_with_http_info( + self, + combined_submission_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CombinedSubmission]: + """Check the status of a combined submission (merged PDFs) + + + :param combined_submission_id: (required) + :type combined_submission_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_combined_submission_serialize( + combined_submission_id=combined_submission_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CombinedSubmission", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_combined_submission_without_preload_content( + self, + combined_submission_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Check the status of a combined submission (merged PDFs) + + + :param combined_submission_id: (required) + :type combined_submission_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_combined_submission_serialize( + combined_submission_id=combined_submission_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CombinedSubmission", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_combined_submission_serialize( + self, + combined_submission_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if combined_submission_id is not None: + _path_params['combined_submission_id'] = combined_submission_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/combined_submissions/{combined_submission_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_data_request( + self, + data_request_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SubmissionDataRequestShow: + """Look up a submission data request + + + :param data_request_id: (required) + :type data_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_data_request_serialize( + data_request_id=data_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SubmissionDataRequestShow", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_data_request_with_http_info( + self, + data_request_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SubmissionDataRequestShow]: + """Look up a submission data request + + + :param data_request_id: (required) + :type data_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_data_request_serialize( + data_request_id=data_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SubmissionDataRequestShow", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_data_request_without_preload_content( + self, + data_request_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Look up a submission data request + + + :param data_request_id: (required) + :type data_request_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_data_request_serialize( + data_request_id=data_request_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SubmissionDataRequestShow", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_data_request_serialize( + self, + data_request_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if data_request_id is not None: + _path_params['data_request_id'] = data_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/data_requests/{data_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_full_template( + self, + template_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Template: + """Fetch the full template attributes + + + :param template_id: (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_full_template_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Template", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_full_template_with_http_info( + self, + template_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Template]: + """Fetch the full template attributes + + + :param template_id: (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_full_template_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Template", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_full_template_without_preload_content( + self, + template_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch the full template attributes + + + :param template_id: (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_full_template_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Template", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_full_template_serialize( + self, + template_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/templates/{template_id}?full=true', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_presign_url( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UploadPresignResponse: + """Get a presigned URL so that you can upload a file to our AWS S3 bucket + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_presign_url_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UploadPresignResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_presign_url_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UploadPresignResponse]: + """Get a presigned URL so that you can upload a file to our AWS S3 bucket + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_presign_url_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UploadPresignResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_presign_url_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a presigned URL so that you can upload a file to our AWS S3 bucket + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_presign_url_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UploadPresignResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_presign_url_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/uploads/presign', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_submission( + self, + submission_id: StrictStr, + include_data: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Submission: + """Check the status of a PDF + + + :param submission_id: (required) + :type submission_id: str + :param include_data: + :type include_data: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submission_serialize( + submission_id=submission_id, + include_data=include_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Submission", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_submission_with_http_info( + self, + submission_id: StrictStr, + include_data: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Submission]: + """Check the status of a PDF + + + :param submission_id: (required) + :type submission_id: str + :param include_data: + :type include_data: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submission_serialize( + submission_id=submission_id, + include_data=include_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Submission", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_submission_without_preload_content( + self, + submission_id: StrictStr, + include_data: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Check the status of a PDF + + + :param submission_id: (required) + :type submission_id: str + :param include_data: + :type include_data: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submission_serialize( + submission_id=submission_id, + include_data=include_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Submission", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_submission_serialize( + self, + submission_id, + include_data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if submission_id is not None: + _path_params['submission_id'] = submission_id + # process the query parameters + if include_data is not None: + + _query_params.append(('include_data', include_data)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/submissions/{submission_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_submission_batch( + self, + submission_batch_id: StrictStr, + include_submissions: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SubmissionBatchWithSubmissions: + """Check the status of a submission batch job + + + :param submission_batch_id: (required) + :type submission_batch_id: str + :param include_submissions: + :type include_submissions: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submission_batch_serialize( + submission_batch_id=submission_batch_id, + include_submissions=include_submissions, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SubmissionBatchWithSubmissions", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_submission_batch_with_http_info( + self, + submission_batch_id: StrictStr, + include_submissions: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SubmissionBatchWithSubmissions]: + """Check the status of a submission batch job + + + :param submission_batch_id: (required) + :type submission_batch_id: str + :param include_submissions: + :type include_submissions: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submission_batch_serialize( + submission_batch_id=submission_batch_id, + include_submissions=include_submissions, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SubmissionBatchWithSubmissions", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_submission_batch_without_preload_content( + self, + submission_batch_id: StrictStr, + include_submissions: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Check the status of a submission batch job + + + :param submission_batch_id: (required) + :type submission_batch_id: str + :param include_submissions: + :type include_submissions: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submission_batch_serialize( + submission_batch_id=submission_batch_id, + include_submissions=include_submissions, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SubmissionBatchWithSubmissions", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_submission_batch_serialize( + self, + submission_batch_id, + include_submissions, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if submission_batch_id is not None: + _path_params['submission_batch_id'] = submission_batch_id + # process the query parameters + if include_submissions is not None: + + _query_params.append(('include_submissions', include_submissions)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/submissions/batches/{submission_batch_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_template( + self, + template_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TemplatePreview: + """Check the status of an uploaded template + + + :param template_id: (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_template_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplatePreview", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_template_with_http_info( + self, + template_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TemplatePreview]: + """Check the status of an uploaded template + + + :param template_id: (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_template_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplatePreview", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_template_without_preload_content( + self, + template_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Check the status of an uploaded template + + + :param template_id: (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_template_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplatePreview", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_template_serialize( + self, + template_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/templates/{template_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_template_schema( + self, + template_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> JsonSchema: + """Fetch the JSON schema for a template + + + :param template_id: (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_template_schema_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JsonSchema", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_template_schema_with_http_info( + self, + template_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[JsonSchema]: + """Fetch the JSON schema for a template + + + :param template_id: (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_template_schema_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JsonSchema", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_template_schema_without_preload_content( + self, + template_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fetch the JSON schema for a template + + + :param template_id: (required) + :type template_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_template_schema_serialize( + template_id=template_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "JsonSchema", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_template_schema_serialize( + self, + template_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/templates/{template_id}/schema', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_combined_submissions( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Default: 1")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="Default: 50")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[CombinedSubmission]: + """Get a list of all combined submissions + + + :param page: Default: 1 + :type page: int + :param per_page: Default: 50 + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_combined_submissions_serialize( + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CombinedSubmission]", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_combined_submissions_with_http_info( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Default: 1")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="Default: 50")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[CombinedSubmission]]: + """Get a list of all combined submissions + + + :param page: Default: 1 + :type page: int + :param per_page: Default: 50 + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_combined_submissions_serialize( + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CombinedSubmission]", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_combined_submissions_without_preload_content( + self, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Default: 1")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="Default: 50")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a list of all combined submissions + + + :param page: Default: 1 + :type page: int + :param per_page: Default: 50 + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_combined_submissions_serialize( + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CombinedSubmission]", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_combined_submissions_serialize( + self, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/combined_submissions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_folders( + self, + parent_folder_id: Annotated[Optional[StrictStr], Field(description="Filter By Folder Id")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Folder]: + """Get a list of all folders + + + :param parent_folder_id: Filter By Folder Id + :type parent_folder_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_folders_serialize( + parent_folder_id=parent_folder_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Folder]", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_folders_with_http_info( + self, + parent_folder_id: Annotated[Optional[StrictStr], Field(description="Filter By Folder Id")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Folder]]: + """Get a list of all folders + + + :param parent_folder_id: Filter By Folder Id + :type parent_folder_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_folders_serialize( + parent_folder_id=parent_folder_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Folder]", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_folders_without_preload_content( + self, + parent_folder_id: Annotated[Optional[StrictStr], Field(description="Filter By Folder Id")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a list of all folders + + + :param parent_folder_id: Filter By Folder Id + :type parent_folder_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_folders_serialize( + parent_folder_id=parent_folder_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Folder]", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_folders_serialize( + self, + parent_folder_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if parent_folder_id is not None: + + _query_params.append(('parent_folder_id', parent_folder_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/folders/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_submissions( + self, + cursor: Optional[StrictStr] = None, + limit: Optional[Union[StrictFloat, StrictInt]] = None, + created_after: Optional[StrictStr] = None, + created_before: Optional[StrictStr] = None, + type: Optional[StrictStr] = None, + include_data: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListSubmissionsResponse: + """List all submissions + + + :param cursor: + :type cursor: str + :param limit: + :type limit: float + :param created_after: + :type created_after: str + :param created_before: + :type created_before: str + :param type: + :type type: str + :param include_data: + :type include_data: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_submissions_serialize( + cursor=cursor, + limit=limit, + created_after=created_after, + created_before=created_before, + type=type, + include_data=include_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSubmissionsResponse", + '422': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_submissions_with_http_info( + self, + cursor: Optional[StrictStr] = None, + limit: Optional[Union[StrictFloat, StrictInt]] = None, + created_after: Optional[StrictStr] = None, + created_before: Optional[StrictStr] = None, + type: Optional[StrictStr] = None, + include_data: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListSubmissionsResponse]: + """List all submissions + + + :param cursor: + :type cursor: str + :param limit: + :type limit: float + :param created_after: + :type created_after: str + :param created_before: + :type created_before: str + :param type: + :type type: str + :param include_data: + :type include_data: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_submissions_serialize( + cursor=cursor, + limit=limit, + created_after=created_after, + created_before=created_before, + type=type, + include_data=include_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSubmissionsResponse", + '422': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_submissions_without_preload_content( + self, + cursor: Optional[StrictStr] = None, + limit: Optional[Union[StrictFloat, StrictInt]] = None, + created_after: Optional[StrictStr] = None, + created_before: Optional[StrictStr] = None, + type: Optional[StrictStr] = None, + include_data: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all submissions + + + :param cursor: + :type cursor: str + :param limit: + :type limit: float + :param created_after: + :type created_after: str + :param created_before: + :type created_before: str + :param type: + :type type: str + :param include_data: + :type include_data: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_submissions_serialize( + cursor=cursor, + limit=limit, + created_after=created_after, + created_before=created_before, + type=type, + include_data=include_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSubmissionsResponse", + '422': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_submissions_serialize( + self, + cursor, + limit, + created_after, + created_before, + type, + include_data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if created_after is not None: + + _query_params.append(('created_after', created_after)) + + if created_before is not None: + + _query_params.append(('created_before', created_before)) + + if type is not None: + + _query_params.append(('type', type)) + + if include_data is not None: + + _query_params.append(('include_data', include_data)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/submissions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_template_submissions( + self, + template_id: StrictStr, + cursor: Optional[StrictStr] = None, + limit: Optional[Union[StrictFloat, StrictInt]] = None, + created_after: Optional[StrictStr] = None, + created_before: Optional[StrictStr] = None, + type: Optional[StrictStr] = None, + include_data: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ListSubmissionsResponse: + """List all submissions for a given template + + + :param template_id: (required) + :type template_id: str + :param cursor: + :type cursor: str + :param limit: + :type limit: float + :param created_after: + :type created_after: str + :param created_before: + :type created_before: str + :param type: + :type type: str + :param include_data: + :type include_data: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_template_submissions_serialize( + template_id=template_id, + cursor=cursor, + limit=limit, + created_after=created_after, + created_before=created_before, + type=type, + include_data=include_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSubmissionsResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_template_submissions_with_http_info( + self, + template_id: StrictStr, + cursor: Optional[StrictStr] = None, + limit: Optional[Union[StrictFloat, StrictInt]] = None, + created_after: Optional[StrictStr] = None, + created_before: Optional[StrictStr] = None, + type: Optional[StrictStr] = None, + include_data: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ListSubmissionsResponse]: + """List all submissions for a given template + + + :param template_id: (required) + :type template_id: str + :param cursor: + :type cursor: str + :param limit: + :type limit: float + :param created_after: + :type created_after: str + :param created_before: + :type created_before: str + :param type: + :type type: str + :param include_data: + :type include_data: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_template_submissions_serialize( + template_id=template_id, + cursor=cursor, + limit=limit, + created_after=created_after, + created_before=created_before, + type=type, + include_data=include_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSubmissionsResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_template_submissions_without_preload_content( + self, + template_id: StrictStr, + cursor: Optional[StrictStr] = None, + limit: Optional[Union[StrictFloat, StrictInt]] = None, + created_after: Optional[StrictStr] = None, + created_before: Optional[StrictStr] = None, + type: Optional[StrictStr] = None, + include_data: Optional[StrictBool] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all submissions for a given template + + + :param template_id: (required) + :type template_id: str + :param cursor: + :type cursor: str + :param limit: + :type limit: float + :param created_after: + :type created_after: str + :param created_before: + :type created_before: str + :param type: + :type type: str + :param include_data: + :type include_data: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_template_submissions_serialize( + template_id=template_id, + cursor=cursor, + limit=limit, + created_after=created_after, + created_before=created_before, + type=type, + include_data=include_data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListSubmissionsResponse", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_template_submissions_serialize( + self, + template_id, + cursor, + limit, + created_after, + created_before, + type, + include_data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if created_after is not None: + + _query_params.append(('created_after', created_after)) + + if created_before is not None: + + _query_params.append(('created_before', created_before)) + + if type is not None: + + _query_params.append(('type', type)) + + if include_data is not None: + + _query_params.append(('include_data', include_data)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/templates/{template_id}/submissions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_templates( + self, + query: Annotated[Optional[StrictStr], Field(description="Search By Name")] = None, + parent_folder_id: Annotated[Optional[StrictStr], Field(description="Filter By Folder Id")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Default: 1")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="Default: 50")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[TemplatePreview]: + """Get a list of all templates + + + :param query: Search By Name + :type query: str + :param parent_folder_id: Filter By Folder Id + :type parent_folder_id: str + :param page: Default: 1 + :type page: int + :param per_page: Default: 50 + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_templates_serialize( + query=query, + parent_folder_id=parent_folder_id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[TemplatePreview]", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_templates_with_http_info( + self, + query: Annotated[Optional[StrictStr], Field(description="Search By Name")] = None, + parent_folder_id: Annotated[Optional[StrictStr], Field(description="Filter By Folder Id")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Default: 1")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="Default: 50")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[TemplatePreview]]: + """Get a list of all templates + + + :param query: Search By Name + :type query: str + :param parent_folder_id: Filter By Folder Id + :type parent_folder_id: str + :param page: Default: 1 + :type page: int + :param per_page: Default: 50 + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_templates_serialize( + query=query, + parent_folder_id=parent_folder_id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[TemplatePreview]", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_templates_without_preload_content( + self, + query: Annotated[Optional[StrictStr], Field(description="Search By Name")] = None, + parent_folder_id: Annotated[Optional[StrictStr], Field(description="Filter By Folder Id")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Default: 1")] = None, + per_page: Annotated[Optional[Annotated[int, Field(le=50, strict=True, ge=1)]], Field(description="Default: 50")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a list of all templates + + + :param query: Search By Name + :type query: str + :param parent_folder_id: Filter By Folder Id + :type parent_folder_id: str + :param page: Default: 1 + :type page: int + :param per_page: Default: 50 + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_templates_serialize( + query=query, + parent_folder_id=parent_folder_id, + page=page, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[TemplatePreview]", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_templates_serialize( + self, + query, + parent_folder_id, + page, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if query is not None: + + _query_params.append(('query', query)) + + if parent_folder_id is not None: + + _query_params.append(('parent_folder_id', parent_folder_id)) + + if page is not None: + + _query_params.append(('page', page)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/templates', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def move_folder_to_folder( + self, + folder_id: StrictStr, + data: MoveFolderData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Folder: + """Move a folder + + + :param folder_id: (required) + :type folder_id: str + :param data: (required) + :type data: MoveFolderData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._move_folder_to_folder_serialize( + folder_id=folder_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '404': "ErrorResponse", + '200': "Folder", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def move_folder_to_folder_with_http_info( + self, + folder_id: StrictStr, + data: MoveFolderData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Folder]: + """Move a folder + + + :param folder_id: (required) + :type folder_id: str + :param data: (required) + :type data: MoveFolderData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._move_folder_to_folder_serialize( + folder_id=folder_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '404': "ErrorResponse", + '200': "Folder", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def move_folder_to_folder_without_preload_content( + self, + folder_id: StrictStr, + data: MoveFolderData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Move a folder + + + :param folder_id: (required) + :type folder_id: str + :param data: (required) + :type data: MoveFolderData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._move_folder_to_folder_serialize( + folder_id=folder_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '404': "ErrorResponse", + '200': "Folder", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _move_folder_to_folder_serialize( + self, + folder_id, + data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if folder_id is not None: + _path_params['folder_id'] = folder_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if data is not None: + _body_params = data + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.move_template_to_folder_with_http_info(template_id, move_template_data, **kwargs) # noqa: E501 - return data - - def move_template_to_folder_with_http_info(self, template_id, move_template_data, **kwargs): # noqa: E501 - """Move Template to folder # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.move_template_to_folder_with_http_info(template_id, move_template_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :param MoveTemplateData move_template_data: (required) - :return: Template - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['template_id', 'move_template_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method move_template_to_folder" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'template_id' is set - if ('template_id' not in local_var_params or - local_var_params['template_id'] is None): - raise ValueError("Missing the required parameter `template_id` when calling `move_template_to_folder`") # noqa: E501 - # verify the required parameter 'move_template_data' is set - if ('move_template_data' not in local_var_params or - local_var_params['move_template_data'] is None): - raise ValueError("Missing the required parameter `move_template_data` when calling `move_template_to_folder`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'template_id' in local_var_params: - path_params['template_id'] = local_var_params['template_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'move_template_data' in local_var_params: - body_params = local_var_params['move_template_data'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/templates/{template_id}/move', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Template', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def rename_folder(self, folder_id, rename_folder_data, **kwargs): # noqa: E501 - """Rename a folder # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.rename_folder(folder_id, rename_folder_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str folder_id: (required) - :param RenameFolderData rename_folder_data: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.rename_folder_with_http_info(folder_id, rename_folder_data, **kwargs) # noqa: E501 + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/folders/{folder_id}/move', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def move_template_to_folder( + self, + template_id: StrictStr, + data: MoveTemplateData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TemplatePreview: + """Move Template to folder + + + :param template_id: (required) + :type template_id: str + :param data: (required) + :type data: MoveTemplateData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._move_template_to_folder_serialize( + template_id=template_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplatePreview", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def move_template_to_folder_with_http_info( + self, + template_id: StrictStr, + data: MoveTemplateData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TemplatePreview]: + """Move Template to folder + + + :param template_id: (required) + :type template_id: str + :param data: (required) + :type data: MoveTemplateData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._move_template_to_folder_serialize( + template_id=template_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplatePreview", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def move_template_to_folder_without_preload_content( + self, + template_id: StrictStr, + data: MoveTemplateData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Move Template to folder + + + :param template_id: (required) + :type template_id: str + :param data: (required) + :type data: MoveTemplateData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._move_template_to_folder_serialize( + template_id=template_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "TemplatePreview", + '404': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _move_template_to_folder_serialize( + self, + template_id, + data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if data is not None: + _body_params = data + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.rename_folder_with_http_info(folder_id, rename_folder_data, **kwargs) # noqa: E501 - return data - - def rename_folder_with_http_info(self, folder_id, rename_folder_data, **kwargs): # noqa: E501 - """Rename a folder # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.rename_folder_with_http_info(folder_id, rename_folder_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str folder_id: (required) - :param RenameFolderData rename_folder_data: (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['folder_id', 'rename_folder_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method rename_folder" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'folder_id' is set - if ('folder_id' not in local_var_params or - local_var_params['folder_id'] is None): - raise ValueError("Missing the required parameter `folder_id` when calling `rename_folder`") # noqa: E501 - # verify the required parameter 'rename_folder_data' is set - if ('rename_folder_data' not in local_var_params or - local_var_params['rename_folder_data'] is None): - raise ValueError("Missing the required parameter `rename_folder_data` when calling `rename_folder`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'folder_id' in local_var_params: - path_params['folder_id'] = local_var_params['folder_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'rename_folder_data' in local_var_params: - body_params = local_var_params['rename_folder_data'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/folders/{folder_id}/rename', 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def test_authentication(self, **kwargs): # noqa: E501 - """Test Authentication # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_authentication(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: AuthenticationSuccessResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.test_authentication_with_http_info(**kwargs) # noqa: E501 + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/templates/{template_id}/move', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def rename_folder( + self, + folder_id: StrictStr, + data: RenameFolderData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Folder: + """Rename a folder + + + :param folder_id: (required) + :type folder_id: str + :param data: (required) + :type data: RenameFolderData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rename_folder_serialize( + folder_id=folder_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '422': "MultipleErrorsResponse", + '404': "ErrorResponse", + '200': "Folder", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def rename_folder_with_http_info( + self, + folder_id: StrictStr, + data: RenameFolderData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Folder]: + """Rename a folder + + + :param folder_id: (required) + :type folder_id: str + :param data: (required) + :type data: RenameFolderData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rename_folder_serialize( + folder_id=folder_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '422': "MultipleErrorsResponse", + '404': "ErrorResponse", + '200': "Folder", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def rename_folder_without_preload_content( + self, + folder_id: StrictStr, + data: RenameFolderData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Rename a folder + + + :param folder_id: (required) + :type folder_id: str + :param data: (required) + :type data: RenameFolderData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rename_folder_serialize( + folder_id=folder_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '422': "MultipleErrorsResponse", + '404': "ErrorResponse", + '200': "Folder", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _rename_folder_serialize( + self, + folder_id, + data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if folder_id is not None: + _path_params['folder_id'] = folder_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if data is not None: + _body_params = data + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.test_authentication_with_http_info(**kwargs) # noqa: E501 - return data - - def test_authentication_with_http_info(self, **kwargs): # noqa: E501 - """Test Authentication # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.test_authentication_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: AuthenticationSuccessResponse - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method test_authentication" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/authentication', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='AuthenticationSuccessResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_data_request(self, data_request_id, update_submission_data_request_data, **kwargs): # noqa: E501 - """Update a submission data request # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_data_request(data_request_id, update_submission_data_request_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str data_request_id: (required) - :param UpdateSubmissionDataRequestData update_submission_data_request_data: (required) - :return: UpdateDataRequestResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_data_request_with_http_info(data_request_id, update_submission_data_request_data, **kwargs) # noqa: E501 + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/folders/{folder_id}/rename', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def test_authentication( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SuccessErrorResponse: + """Test Authentication + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_authentication_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessErrorResponse", + '401': "SuccessErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def test_authentication_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SuccessErrorResponse]: + """Test Authentication + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_authentication_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessErrorResponse", + '401': "SuccessErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def test_authentication_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Test Authentication + + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._test_authentication_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessErrorResponse", + '401': "SuccessErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _test_authentication_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/authentication', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_data_request( + self, + data_request_id: StrictStr, + data: UpdateSubmissionDataRequestData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateSubmissionDataRequestResponse: + """Update a submission data request + + + :param data_request_id: (required) + :type data_request_id: str + :param data: (required) + :type data: UpdateSubmissionDataRequestData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_data_request_serialize( + data_request_id=data_request_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateSubmissionDataRequestResponse", + '422': "MultipleErrorsResponse", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_data_request_with_http_info( + self, + data_request_id: StrictStr, + data: UpdateSubmissionDataRequestData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateSubmissionDataRequestResponse]: + """Update a submission data request + + + :param data_request_id: (required) + :type data_request_id: str + :param data: (required) + :type data: UpdateSubmissionDataRequestData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_data_request_serialize( + data_request_id=data_request_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateSubmissionDataRequestResponse", + '422': "MultipleErrorsResponse", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_data_request_without_preload_content( + self, + data_request_id: StrictStr, + data: UpdateSubmissionDataRequestData, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a submission data request + + + :param data_request_id: (required) + :type data_request_id: str + :param data: (required) + :type data: UpdateSubmissionDataRequestData + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_data_request_serialize( + data_request_id=data_request_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateSubmissionDataRequestResponse", + '422': "MultipleErrorsResponse", + '404': "ErrorResponse", + '401': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_data_request_serialize( + self, + data_request_id, + data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if data_request_id is not None: + _path_params['data_request_id'] = data_request_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if data is not None: + _body_params = data + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.update_data_request_with_http_info(data_request_id, update_submission_data_request_data, **kwargs) # noqa: E501 - return data - - def update_data_request_with_http_info(self, data_request_id, update_submission_data_request_data, **kwargs): # noqa: E501 - """Update a submission data request # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_data_request_with_http_info(data_request_id, update_submission_data_request_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str data_request_id: (required) - :param UpdateSubmissionDataRequestData update_submission_data_request_data: (required) - :return: UpdateDataRequestResponse - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['data_request_id', 'update_submission_data_request_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_data_request" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'data_request_id' is set - if ('data_request_id' not in local_var_params or - local_var_params['data_request_id'] is None): - raise ValueError("Missing the required parameter `data_request_id` when calling `update_data_request`") # noqa: E501 - # verify the required parameter 'update_submission_data_request_data' is set - if ('update_submission_data_request_data' not in local_var_params or - local_var_params['update_submission_data_request_data'] is None): - raise ValueError("Missing the required parameter `update_submission_data_request_data` when calling `update_data_request`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'data_request_id' in local_var_params: - path_params['data_request_id'] = local_var_params['data_request_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'update_submission_data_request_data' in local_var_params: - body_params = local_var_params['update_submission_data_request_data'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/data_requests/{data_request_id}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='UpdateDataRequestResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) - - def update_template(self, template_id, update_template_data, **kwargs): # noqa: E501 - """Update a Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_template(template_id, update_template_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :param UpdateTemplateData update_template_data: (required) - :return: UpdateTemplateResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_template_with_http_info(template_id, update_template_data, **kwargs) # noqa: E501 + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/data_requests/{data_request_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_template( + self, + template_id: StrictStr, + data: UpdateHtmlTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> SuccessMultipleErrorsResponse: + """Update a Template + + + :param template_id: (required) + :type template_id: str + :param data: (required) + :type data: UpdateHtmlTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_template_serialize( + template_id=template_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessMultipleErrorsResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_template_with_http_info( + self, + template_id: StrictStr, + data: UpdateHtmlTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[SuccessMultipleErrorsResponse]: + """Update a Template + + + :param template_id: (required) + :type template_id: str + :param data: (required) + :type data: UpdateHtmlTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_template_serialize( + template_id=template_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessMultipleErrorsResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_template_without_preload_content( + self, + template_id: StrictStr, + data: UpdateHtmlTemplate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a Template + + + :param template_id: (required) + :type template_id: str + :param data: (required) + :type data: UpdateHtmlTemplate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_template_serialize( + template_id=template_id, + data=data, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "SuccessMultipleErrorsResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_template_serialize( + self, + template_id, + data, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if template_id is not None: + _path_params['template_id'] = template_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if data is not None: + _body_params = data + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.update_template_with_http_info(template_id, update_template_data, **kwargs) # noqa: E501 - return data - - def update_template_with_http_info(self, template_id, update_template_data, **kwargs): # noqa: E501 - """Update a Template # noqa: E501 - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_template_with_http_info(template_id, update_template_data, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str template_id: (required) - :param UpdateTemplateData update_template_data: (required) - :return: UpdateTemplateResponse - If the method is called asynchronously, - returns the request thread. - """ - - local_var_params = locals() - - all_params = ['template_id', 'update_template_data'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - for key, val in six.iteritems(local_var_params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_template" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - local_var_params[key] = val - del local_var_params['kwargs'] - # verify the required parameter 'template_id' is set - if ('template_id' not in local_var_params or - local_var_params['template_id'] is None): - raise ValueError("Missing the required parameter `template_id` when calling `update_template`") # noqa: E501 - # verify the required parameter 'update_template_data' is set - if ('update_template_data' not in local_var_params or - local_var_params['update_template_data'] is None): - raise ValueError("Missing the required parameter `update_template_data` when calling `update_template`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'template_id' in local_var_params: - path_params['template_id'] = local_var_params['template_id'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'update_template_data' in local_var_params: - body_params = local_var_params['update_template_data'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['api_token_basic'] # noqa: E501 - - return self.api_client.call_api( - '/templates/{template_id}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='UpdateTemplateResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=local_var_params.get('async_req'), - _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=local_var_params.get('_preload_content', True), - _request_timeout=local_var_params.get('_request_timeout'), - collection_formats=collection_formats) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_token_basic' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/templates/{template_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/docspring/api_client.py b/docspring/api_client.py index 10802c7..e882818 100644 --- a/docspring/api_client.py +++ b/docspring/api_client.py @@ -1,33 +1,48 @@ # coding: utf-8 + """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import datetime +from dateutil.parser import parse +from enum import Enum +import decimal import json import mimetypes -from multiprocessing.pool import ThreadPool import os import re import tempfile -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr from docspring.configuration import Configuration +from docspring.api_response import ApiResponse, T as ApiResponseT import docspring.models from docspring import rest - - -class ApiClient(object): +from docspring.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: """Generic API client for OpenAPI client library builds. OpenAPI generic API client. This client handles the client- @@ -35,10 +50,6 @@ class ApiClient(object): the methods and models for each application are generated from the OpenAPI templates. - NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - Do not edit the class manually. - :param configuration: .Configuration object for this client :param header_name: a header to pass when making calls to the API. :param header_value: a header value to pass when making calls to @@ -47,40 +58,46 @@ class ApiClient(object): to the API """ - PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + PRIMITIVE_TYPES = (float, bool, bytes, str, int) NATIVE_TYPES_MAPPING = { 'int': int, - 'long': int if six.PY3 else long, # noqa: F821 + 'long': int, # TODO remove as only py3 is supported? 'float': float, 'str': str, 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, 'object': object, } - - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None): + _pool = None + + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided if configuration is None: - configuration = Configuration() + configuration = Configuration.get_default() self.configuration = configuration - self.pool = ThreadPool() self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} if header_name is not None: self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'docspring-python-#{VERSION}' + self.user_agent = 'docspring-python-2.0.0' + self.client_side_validation = configuration.client_side_validation - def __del__(self): - # Ignore RuntimeError("cannot join current thread") from threading.py - try: - self.pool.close() - self.pool.join() - except RuntimeError: - pass + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + pass @property def user_agent(self): @@ -94,12 +111,69 @@ def user_agent(self, value): def set_default_header(self, header_name, header_value): self.default_headers[header_name] = header_value - def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None): + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ config = self.configuration @@ -110,14 +184,17 @@ def __call_api( header_params['Cookie'] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( @@ -125,59 +202,145 @@ def __call_api( quote(str(v), safe=config.safe_chars_for_path_param) ) - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - # post parameters if post_params or files: - post_params = self.prepare_post_parameters(post_params, files) + post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings) + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) # body if body: body = self.sanitize_for_serialization(body) # request url - url = self.configuration.host + resource_path - - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - - self.last_response = response_data - - return_data = response_data - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - - if _return_http_data_only: - return (return_data) + if _host is None or self.configuration.ignore_operation_servers: + url = self.configuration.host + resource_path else: - return (return_data, response_data.status, - response_data.getheaders()) + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + raise e + + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) def sanitize_for_serialization(self, obj): """Builds a JSON POST object. If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -187,18 +350,26 @@ def sanitize_for_serialization(self, obj): """ if obj is None: return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() elif isinstance(obj, self.PRIMITIVE_TYPES): return obj elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) - if isinstance(obj, dict): + elif isinstance(obj, dict): obj_dict = obj else: # Convert model obj to dict except @@ -206,32 +377,45 @@ def sanitize_for_serialization(self, obj): # and attributes which value is not None. # Convert attribute name to json key in # model definition for request. - obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) - for attr, _ in six.iteritems(obj.openapi_types) - if getattr(obj, attr) is not None} + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ - return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } - def deserialize(self, response, response_type): + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) # fetch data from response object - try: - data = json.loads(response.data) - except ValueError: - data = response.data + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) return self.__deserialize(data, response_type) @@ -246,16 +430,20 @@ def __deserialize(self, data, klass): if data is None: return None - if type(klass) == str: - if klass.startswith('list['): - sub_kls = re.match('list\[(.*)\]', klass).group(1) + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] - if klass.startswith('dict('): - sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2) + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) return {k: self.__deserialize(v, sub_kls) - for k, v in six.iteritems(data)} + for k, v in data.items()} # convert str to class if klass in self.NATIVE_TYPES_MAPPING: @@ -270,131 +458,14 @@ def __deserialize(self, data, klass): elif klass == datetime.date: return self.__deserialize_date(data) elif klass == datetime.datetime: - return self.__deserialize_datatime(data) + return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) else: return self.__deserialize_model(data, klass) - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, async_req=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout) - else: - thread = self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, _request_timeout)) - return thread - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -402,10 +473,10 @@ def parameters_to_tuples(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -425,49 +496,94 @@ def parameters_to_tuples(self, params, collection_formats): new_params.append((k, v)) return new_params - def prepare_post_parameters(self, post_params=None, files=None): + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, quote(str(value))) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. - :param post_params: Normal form parameters. :param files: File parameters. :return: Form parameters with files. """ params = [] - - if post_params: - params = post_params - - if files: - for k, v in six.iteritems(files): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params - def select_header_accept(self, accepts): + def select_header_accept(self, accepts: List[str]) -> Optional[str]: """Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json). """ if not accepts: - return + return None - accepts = [x.lower() for x in accepts] + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) + return accepts[0] def select_header_content_type(self, content_types): """Returns `Content-Type` based on an array of content_types provided. @@ -476,45 +592,101 @@ def select_header_content_type(self, content_types): :return: Content-Type (e.g. application/json). """ if not content_types: - return 'application/json' - - content_types = [x.lower() for x in content_types] - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] + return None - def update_params_for_auth(self, headers, querys, auth_settings): + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. - :param querys: Query parameters tuple list to be updated. + :param queries: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. """ if not auth_settings: return - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - if not auth_setting['value']: - continue - elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - querys.append((auth_setting['key'], auth_setting['value'])) - else: - raise ValueError( - 'Authentication token must be in `query` or `header`' + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting ) + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + def __deserialize_file(self, response): """Deserializes body to file Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. + handle file downloading + save response body into a tmp file and return the instance + :param response: RESTResponse. :return: file path. """ @@ -524,8 +696,12 @@ def __deserialize_file(self, response): content_disposition = response.getheader("Content-Disposition") if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: @@ -544,7 +720,7 @@ def __deserialize_primitive(self, data, klass): try: return klass(data) except UnicodeEncodeError: - return six.text_type(data) + return str(data) except TypeError: return data @@ -562,7 +738,6 @@ def __deserialize_date(self, string): :return: date. """ try: - from dateutil.parser import parse return parse(string).date() except ImportError: return string @@ -572,7 +747,7 @@ def __deserialize_date(self, string): reason="Failed to parse `{0}` as date object".format(string) ) - def __deserialize_datatime(self, string): + def __deserialize_datetime(self, string): """Deserializes string to datetime. The string should be in iso8601 datetime format. @@ -581,7 +756,6 @@ def __deserialize_datatime(self, string): :return: datetime. """ try: - from dateutil.parser import parse return parse(string) except ImportError: return string @@ -594,6 +768,24 @@ def __deserialize_datatime(self, string): ) ) + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + def __deserialize_model(self, data, klass): """Deserializes list or dict to model. @@ -602,23 +794,4 @@ def __deserialize_model(self, data, klass): :return: model object. """ - if not klass.openapi_types and not hasattr(klass, - 'get_real_child_model'): - return data - - kwargs = {} - if klass.openapi_types is not None: - for attr, attr_type in six.iteritems(klass.openapi_types): - if (data is not None and - klass.attribute_map[attr] in data and - isinstance(data, (list, dict))): - value = data[klass.attribute_map[attr]] - kwargs[attr] = self.__deserialize(value, attr_type) - - instance = klass(**kwargs) - - if hasattr(instance, 'get_real_child_model'): - klass_name = instance.get_real_child_model(data) - if klass_name: - instance = self.__deserialize(data, klass_name) - return instance + return klass.from_dict(data) diff --git a/docspring/api_response.py b/docspring/api_response.py new file mode 100644 index 0000000..9bc7c11 --- /dev/null +++ b/docspring/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/docspring/configuration.py b/docspring/configuration.py index 525cb63..d9113a0 100644 --- a/docspring/configuration.py +++ b/docspring/configuration.py @@ -1,116 +1,383 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import -import os import copy +import http.client as httplib import logging +from logging import FileHandler import multiprocessing import sys -import urllib3 - -import six -from six.moves import http_client as httplib - +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict +from typing_extensions import NotRequired, Self -class TypeWithDefault(type): - def __init__(cls, name, bases, dct): - super(TypeWithDefault, cls).__init__(name, bases, dct) - cls._default = None - - def __call__(cls): - if cls._default is None: - cls._default = type.__call__(cls) - return copy.copy(cls._default) - - def set_default(cls, default): - cls._default = copy.copy(default) +import urllib3 -class Configuration(six.with_metaclass(TypeWithDefault, object)): - """NOTE: This class is auto generated by OpenAPI Generator +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + "api_token_basic": BasicAuthSetting, + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + :param retries: Number of retries for API requests. + + :Example: + + HTTP Basic Authentication Example. + Given the following security scheme in the OpenAPI specification: + components: + securitySchemes: + http_basic_auth: + type: http + scheme: basic + + Configure API client with HTTP basic authentication: + +conf = docspring.Configuration( + username='the-user', + password='the-password', +) - Ref: https://openapi-generator.tech - Do not edit the class manually. """ - def __init__(self): - """Constructor""" - # Default Base url - self.host = "https://api.docspring.com/api/v1" - # Temp file folder for downloading files + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + host: Optional[str]=None, + api_key: Optional[Dict[str, str]]=None, + api_key_prefix: Optional[Dict[str, str]]=None, + username: Optional[str]=None, + password: Optional[str]=None, + access_token: Optional[str]=None, + server_index: Optional[int]=None, + server_variables: Optional[ServerVariablesT]=None, + server_operation_index: Optional[Dict[int, int]]=None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, + ignore_operation_servers: bool=False, + ssl_ca_cert: Optional[str]=None, + retries: Optional[int] = None, + *, + debug: Optional[bool] = None, + ) -> None: + """Constructor + """ + self._base_path = "https://sync.api.docspring.com/api/v1" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None - + """Temp file folder for downloading files + """ # Authentication Settings - # dict to store API key(s) self.api_key = {} - # dict to store API prefix (e.g. Bearer) + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ self.api_key_prefix = {} - - # DocSpring change: Fetch api tokens from ENV variable if provided - # Username for HTTP basic authentication - self.username = "" - # Password for HTTP basic authentication - self.password = "" - - # Alternatively the user can provide api_token_id and api_token_secret - self.api_token_id = "" - self.api_token_secret = "" - - - - # Logging Settings + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ self.logger = {} + """Logging Settings + """ self.logger["package_logger"] = logging.getLogger("docspring") self.logger["urllib3_logger"] = logging.getLogger("urllib3") - # Log format self.logger_format = '%(asctime)s %(levelname)s %(message)s' - # Log stream handler + """Log format + """ self.logger_stream_handler = None - # Log file handler - self.logger_file_handler = None - # Debug file location + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ self.logger_file = None - # Debug switch - self.debug = False + """Debug file location + """ + if debug is not None: + self.debug = debug + else: + self.__debug = False + """Debug switch + """ - # SSL/TLS verification - # Set this to false to skip verifying SSL certificate when calling API - # from https server. self.verify_ssl = True - # Set this to customize the certificate file to verify the peer. - self.ssl_ca_cert = None - # client certificate file + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ self.cert_file = None - # client key file + """client certificate file + """ self.key_file = None - # Set this to True/False to enable/disable SSL hostname verification. + """client key file + """ self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ - # urllib3 connection pool's maximum number of connections saved - # per pool. urllib3 uses 1 connection as default value, but this is - # not the best value when you are making a lot of possibly parallel - # requests to the same host, which is often the case here. - # cpu_count * 5 is used as default value to increase performance. self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ - # Proxy URL - self.proxy = None - # Safe chars for path_param + self.proxy: Optional[str] = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ self.safe_chars_for_path_param = '' + """Safe chars for path_param + """ + self.retries = retries + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ + + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name: str, value: Any) -> None: + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default: Optional[Self]) -> None: + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls) -> Self: + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls) -> Self: + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = cls() + return cls._default @property - def logger_file(self): + def logger_file(self) -> Optional[str]: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -122,7 +389,7 @@ def logger_file(self): return self.__logger_file @logger_file.setter - def logger_file(self, value): + def logger_file(self, value: Optional[str]) -> None: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -137,11 +404,11 @@ def logger_file(self, value): # then add file handler and remove stream handler. self.logger_file_handler = logging.FileHandler(self.__logger_file) self.logger_file_handler.setFormatter(self.logger_formatter) - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.addHandler(self.logger_file_handler) @property - def debug(self): + def debug(self) -> bool: """Debug status :param value: The debug status, True or False. @@ -150,7 +417,7 @@ def debug(self): return self.__debug @debug.setter - def debug(self, value): + def debug(self, value: bool) -> None: """Debug status :param value: The debug status, True or False. @@ -159,20 +426,20 @@ def debug(self, value): self.__debug = value if self.__debug: # if debug status is True, turn on debug logging - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.DEBUG) # turn on httplib debug httplib.HTTPConnection.debuglevel = 1 else: # if debug status is False, turn off debug logging, # setting log level to default `logging.WARNING` - for _, logger in six.iteritems(self.logger): + for _, logger in self.logger.items(): logger.setLevel(logging.WARNING) # turn off httplib debug httplib.HTTPConnection.debuglevel = 0 @property - def logger_format(self): + def logger_format(self) -> str: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -183,7 +450,7 @@ def logger_format(self): return self.__logger_format @logger_format.setter - def logger_format(self, value): + def logger_format(self, value: str) -> None: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -194,47 +461,56 @@ def logger_format(self, value): self.__logger_format = value self.logger_formatter = logging.Formatter(self.__logger_format) - def get_api_key_with_prefix(self, identifier): + def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]: """Gets API key (with prefix if set). :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. :return: The token for api key authentication. """ - if (self.api_key.get(identifier) and - self.api_key_prefix.get(identifier)): - return self.api_key_prefix[identifier] + ' ' + self.api_key[identifier] # noqa: E501 - elif self.api_key.get(identifier): - return self.api_key[identifier] - - def get_basic_auth_token(self): + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + return None + + def get_basic_auth_token(self) -> Optional[str]: """Gets HTTP basic authentication header (string). :return: The token for basic HTTP authentication. """ - username = self.username or self.api_token_id or os.environ.get('DOCSPRING_TOKEN_ID') - password = self.password or self.api_token_secret or os.environ.get('DOCSPRING_TOKEN_SECRET') - + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password return urllib3.util.make_headers( basic_auth=username + ':' + password ).get('authorization') - def auth_settings(self): + def auth_settings(self)-> AuthSettings: """Gets Auth Settings dict for api client. :return: The Auth Settings information dict. """ - return { - 'api_token_basic': - { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() - }, - - } - - def to_debug_report(self): + auth: AuthSettings = {} + if self.username is not None and self.password is not None: + auth['api_token_basic'] = { + 'type': 'basic', + 'in': 'header', + 'key': 'Authorization', + 'value': self.get_basic_auth_token() + } + return auth + + def to_debug_report(self) -> str: """Gets the essential information for debugging. :return: The report for debugging. @@ -243,5 +519,72 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: v1\n"\ - "SDK Package Version: 1.3.2".\ + "SDK Package Version: 2.0.0".\ format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self) -> List[HostSetting]: + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "https://sync.api.docspring.com/api/v1", + 'description': "No description provided", + } + ] + + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT]=None, + servers: Optional[List[HostSetting]]=None, + ) -> str: + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self) -> str: + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value: str) -> None: + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/docspring/exceptions.py b/docspring/exceptions.py new file mode 100644 index 0000000..2dfdfaa --- /dev/null +++ b/docspring/exceptions.py @@ -0,0 +1,216 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from typing import Any, Optional +from typing_extensions import Self + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass + self.headers = http_resp.getheaders() + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/docspring/models/__init__.py b/docspring/models/__init__.py index be2027b..429bdda 100644 --- a/docspring/models/__init__.py +++ b/docspring/models/__init__.py @@ -2,66 +2,63 @@ # flake8: noqa """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import # import models into model package from docspring.models.add_fields_data import AddFieldsData -from docspring.models.add_fields_template_response import AddFieldsTemplateResponse -from docspring.models.authentication_error import AuthenticationError -from docspring.models.authentication_success_response import AuthenticationSuccessResponse +from docspring.models.batch_generate_pdfs201_response import BatchGeneratePdfs201Response from docspring.models.combine_pdfs_data import CombinePdfsData from docspring.models.combined_submission import CombinedSubmission from docspring.models.combined_submission_action import CombinedSubmissionAction from docspring.models.combined_submission_data import CombinedSubmissionData -from docspring.models.copy_template_data import CopyTemplateData +from docspring.models.copy_template_options import CopyTemplateOptions from docspring.models.create_combined_submission_response import CreateCombinedSubmissionResponse from docspring.models.create_custom_file_data import CreateCustomFileData from docspring.models.create_custom_file_response import CreateCustomFileResponse from docspring.models.create_folder_data import CreateFolderData -from docspring.models.create_html_template_data import CreateHtmlTemplateData -from docspring.models.create_submission_batch_response import CreateSubmissionBatchResponse -from docspring.models.create_submission_batch_submissions_response import CreateSubmissionBatchSubmissionsResponse +from docspring.models.create_html_submission_data import CreateHtmlSubmissionData +from docspring.models.create_html_template import CreateHtmlTemplate +from docspring.models.create_pdf_submission_data import CreatePdfSubmissionData +from docspring.models.create_pdf_template import CreatePdfTemplate from docspring.models.create_submission_data_request_data import CreateSubmissionDataRequestData +from docspring.models.create_submission_data_request_event_request import CreateSubmissionDataRequestEventRequest +from docspring.models.create_submission_data_request_event_response import CreateSubmissionDataRequestEventResponse +from docspring.models.create_submission_data_request_response import CreateSubmissionDataRequestResponse from docspring.models.create_submission_data_request_token_response import CreateSubmissionDataRequestTokenResponse -from docspring.models.create_submission_data_request_token_response_token import CreateSubmissionDataRequestTokenResponseToken from docspring.models.create_submission_response import CreateSubmissionResponse -from docspring.models.create_template_from_upload_data import CreateTemplateFromUploadData from docspring.models.custom_file import CustomFile -from docspring.models.error import Error +from docspring.models.error_response import ErrorResponse from docspring.models.folder import Folder -from docspring.models.folders_folder import FoldersFolder -from docspring.models.html_template_data import HtmlTemplateData -from docspring.models.invalid_request import InvalidRequest +from docspring.models.json_schema import JsonSchema from docspring.models.list_submissions_response import ListSubmissionsResponse from docspring.models.move_folder_data import MoveFolderData from docspring.models.move_template_data import MoveTemplateData -from docspring.models.pending_template import PendingTemplate +from docspring.models.multiple_errors_response import MultipleErrorsResponse from docspring.models.rename_folder_data import RenameFolderData from docspring.models.submission import Submission from docspring.models.submission_action import SubmissionAction from docspring.models.submission_batch import SubmissionBatch from docspring.models.submission_batch_data import SubmissionBatchData -from docspring.models.submission_data import SubmissionData -from docspring.models.submission_data_batch_request import SubmissionDataBatchRequest +from docspring.models.submission_batch_with_submissions import SubmissionBatchWithSubmissions from docspring.models.submission_data_request import SubmissionDataRequest +from docspring.models.submission_data_request_event import SubmissionDataRequestEvent +from docspring.models.submission_data_request_show import SubmissionDataRequestShow +from docspring.models.submission_data_request_token import SubmissionDataRequestToken +from docspring.models.submission_preview import SubmissionPreview +from docspring.models.success_error_response import SuccessErrorResponse +from docspring.models.success_multiple_errors_response import SuccessMultipleErrorsResponse from docspring.models.template import Template -from docspring.models.template1 import Template1 -from docspring.models.template1_defaults import Template1Defaults -from docspring.models.template_data import TemplateData -from docspring.models.templatestemplate_idadd_fields_fields import TemplatestemplateIdaddFieldsFields -from docspring.models.update_data_request_response import UpdateDataRequestResponse +from docspring.models.template_add_fields_response import TemplateAddFieldsResponse +from docspring.models.template_preview import TemplatePreview +from docspring.models.update_html_template import UpdateHtmlTemplate from docspring.models.update_submission_data_request_data import UpdateSubmissionDataRequestData -from docspring.models.update_template_data import UpdateTemplateData -from docspring.models.update_template_response import UpdateTemplateResponse -from docspring.models.upload_template_data import UploadTemplateData -from docspring.models.upload_template_data_document import UploadTemplateDataDocument -from docspring.models.upload_template_data_document_metadata import UploadTemplateDataDocumentMetadata +from docspring.models.upload_presign_response import UploadPresignResponse diff --git a/docspring/models/add_fields_data.py b/docspring/models/add_fields_data.py index 7fee7ec..2705038 100644 --- a/docspring/models/add_fields_data.py +++ b/docspring/models/add_fields_data.py @@ -1,113 +1,87 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self - -class AddFieldsData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. +class AddFieldsData(BaseModel): """ + AddFieldsData + """ # noqa: E501 + fields: List[Dict[str, Any]] + __properties: ClassVar[List[str]] = ["fields"] - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'fields': 'list[TemplatestemplateIdaddFieldsFields]' - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'fields': 'fields' - } - def __init__(self, fields=None): # noqa: E501 - """AddFieldsData - a model defined in OpenAPI""" # noqa: E501 + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - self._fields = None - self.discriminator = None + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - self.fields = fields + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AddFieldsData from a JSON string""" + return cls.from_dict(json.loads(json_str)) - @property - def fields(self): - """Gets the fields of this AddFieldsData. # noqa: E501 + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - :return: The fields of this AddFieldsData. # noqa: E501 - :rtype: list[TemplatestemplateIdaddFieldsFields] + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return self._fields + excluded_fields: Set[str] = set([ + ]) - @fields.setter - def fields(self, fields): - """Sets the fields of this AddFieldsData. + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AddFieldsData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fields": obj.get("fields") + }) + return _obj - :param fields: The fields of this AddFieldsData. # noqa: E501 - :type: list[TemplatestemplateIdaddFieldsFields] - """ - if fields is None: - raise ValueError("Invalid value for `fields`, must not be `None`") # noqa: E501 - - self._fields = fields - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, AddFieldsData): - 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/docspring/models/add_fields_template_response.py b/docspring/models/add_fields_template_response.py deleted file mode 100644 index e8f21c2..0000000 --- a/docspring/models/add_fields_template_response.py +++ /dev/null @@ -1,170 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class AddFieldsTemplateResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'new_field_ids': 'list[int]', - 'errors': 'list[str]', - 'status': 'str' - } - - attribute_map = { - 'new_field_ids': 'new_field_ids', - 'errors': 'errors', - 'status': 'status' - } - - def __init__(self, new_field_ids=None, errors=None, status=None): # noqa: E501 - """AddFieldsTemplateResponse - a model defined in OpenAPI""" # noqa: E501 - - self._new_field_ids = None - self._errors = None - self._status = None - self.discriminator = None - - if new_field_ids is not None: - self.new_field_ids = new_field_ids - if errors is not None: - self.errors = errors - if status is not None: - self.status = status - - @property - def new_field_ids(self): - """Gets the new_field_ids of this AddFieldsTemplateResponse. # noqa: E501 - - - :return: The new_field_ids of this AddFieldsTemplateResponse. # noqa: E501 - :rtype: list[int] - """ - return self._new_field_ids - - @new_field_ids.setter - def new_field_ids(self, new_field_ids): - """Sets the new_field_ids of this AddFieldsTemplateResponse. - - - :param new_field_ids: The new_field_ids of this AddFieldsTemplateResponse. # noqa: E501 - :type: list[int] - """ - - self._new_field_ids = new_field_ids - - @property - def errors(self): - """Gets the errors of this AddFieldsTemplateResponse. # noqa: E501 - - - :return: The errors of this AddFieldsTemplateResponse. # noqa: E501 - :rtype: list[str] - """ - return self._errors - - @errors.setter - def errors(self, errors): - """Sets the errors of this AddFieldsTemplateResponse. - - - :param errors: The errors of this AddFieldsTemplateResponse. # noqa: E501 - :type: list[str] - """ - - self._errors = errors - - @property - def status(self): - """Gets the status of this AddFieldsTemplateResponse. # noqa: E501 - - - :return: The status of this AddFieldsTemplateResponse. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this AddFieldsTemplateResponse. - - - :param status: The status of this AddFieldsTemplateResponse. # noqa: E501 - :type: str - """ - allowed_values = ["success", "error"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, AddFieldsTemplateResponse): - 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/docspring/models/authentication_error.py b/docspring/models/authentication_error.py deleted file mode 100644 index 81f0374..0000000 --- a/docspring/models/authentication_error.py +++ /dev/null @@ -1,145 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class AuthenticationError(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'status': 'str', - 'error': 'str' - } - - attribute_map = { - 'status': 'status', - 'error': 'error' - } - - def __init__(self, status=None, error=None): # noqa: E501 - """AuthenticationError - a model defined in OpenAPI""" # noqa: E501 - - self._status = None - self._error = None - self.discriminator = None - - if status is not None: - self.status = status - self.error = error - - @property - def status(self): - """Gets the status of this AuthenticationError. # noqa: E501 - - - :return: The status of this AuthenticationError. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this AuthenticationError. - - - :param status: The status of this AuthenticationError. # noqa: E501 - :type: str - """ - allowed_values = ["error"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - @property - def error(self): - """Gets the error of this AuthenticationError. # noqa: E501 - - - :return: The error of this AuthenticationError. # noqa: E501 - :rtype: str - """ - return self._error - - @error.setter - def error(self, error): - """Sets the error of this AuthenticationError. - - - :param error: The error of this AuthenticationError. # noqa: E501 - :type: str - """ - if error is None: - raise ValueError("Invalid value for `error`, must not be `None`") # noqa: E501 - - self._error = error - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, AuthenticationError): - 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/docspring/models/authentication_success_response.py b/docspring/models/authentication_success_response.py deleted file mode 100644 index bc52602..0000000 --- a/docspring/models/authentication_success_response.py +++ /dev/null @@ -1,118 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class AuthenticationSuccessResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'status': 'str' - } - - attribute_map = { - 'status': 'status' - } - - def __init__(self, status=None): # noqa: E501 - """AuthenticationSuccessResponse - a model defined in OpenAPI""" # noqa: E501 - - self._status = None - self.discriminator = None - - if status is not None: - self.status = status - - @property - def status(self): - """Gets the status of this AuthenticationSuccessResponse. # noqa: E501 - - - :return: The status of this AuthenticationSuccessResponse. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this AuthenticationSuccessResponse. - - - :param status: The status of this AuthenticationSuccessResponse. # noqa: E501 - :type: str - """ - allowed_values = ["success"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, AuthenticationSuccessResponse): - 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/docspring/models/batch_generate_pdfs201_response.py b/docspring/models/batch_generate_pdfs201_response.py new file mode 100644 index 0000000..7ddbf22 --- /dev/null +++ b/docspring/models/batch_generate_pdfs201_response.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from docspring.models.submission_batch import SubmissionBatch +from typing import Optional, Set +from typing_extensions import Self + +class BatchGeneratePdfs201Response(BaseModel): + """ + BatchGeneratePdfs201Response + """ # noqa: E501 + status: StrictStr + error: Optional[StrictStr] = None + errors: Optional[List[StrictStr]] = None + submission_batch: SubmissionBatch + submissions: List[Dict[str, Any]] + __properties: ClassVar[List[str]] = ["status", "error", "errors", "submission_batch", "submissions"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'error']): + raise ValueError("must be one of enum values ('success', 'error')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BatchGeneratePdfs201Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of submission_batch + if self.submission_batch: + _dict['submission_batch'] = self.submission_batch.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BatchGeneratePdfs201Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "error": obj.get("error"), + "errors": obj.get("errors"), + "submission_batch": SubmissionBatch.from_dict(obj["submission_batch"]) if obj.get("submission_batch") is not None else None, + "submissions": obj.get("submissions") + }) + return _obj + + diff --git a/docspring/models/combine_pdfs_data.py b/docspring/models/combine_pdfs_data.py index 8783f5f..9eec34f 100644 --- a/docspring/models/combine_pdfs_data.py +++ b/docspring/models/combine_pdfs_data.py @@ -1,243 +1,97 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - - -class CombinePdfsData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +class CombinePdfsData(BaseModel): """ - Attributes: - openapi_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. - """ - openapi_types = { - 'delete_custom_files': 'bool', - 'expires_in': 'int', - 'metadata': 'object', - 'password': 'str', - 'source_pdfs': 'list[object]', - 'test': 'bool' - } - - attribute_map = { - 'delete_custom_files': 'delete_custom_files', - 'expires_in': 'expires_in', - 'metadata': 'metadata', - 'password': 'password', - 'source_pdfs': 'source_pdfs', - 'test': 'test' - } - - def __init__(self, delete_custom_files=None, expires_in=None, metadata=None, password=None, source_pdfs=None, test=None): # noqa: E501 - """CombinePdfsData - a model defined in OpenAPI""" # noqa: E501 - - self._delete_custom_files = None - self._expires_in = None - self._metadata = None - self._password = None - self._source_pdfs = None - self._test = None - self.discriminator = None - - if delete_custom_files is not None: - self.delete_custom_files = delete_custom_files - if expires_in is not None: - self.expires_in = expires_in - if metadata is not None: - self.metadata = metadata - if password is not None: - self.password = password - self.source_pdfs = source_pdfs - if test is not None: - self.test = test - - @property - def delete_custom_files(self): - """Gets the delete_custom_files of this CombinePdfsData. # noqa: E501 - - - :return: The delete_custom_files of this CombinePdfsData. # noqa: E501 - :rtype: bool + CombinePdfsData + """ # noqa: E501 + delete_custom_files: Optional[StrictBool] = None + expires_in: Optional[StrictInt] = None + metadata: Optional[Dict[str, Any]] = None + password: Optional[StrictStr] = None + source_pdfs: List[Dict[str, Any]] + test: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["delete_custom_files", "expires_in", "metadata", "password", "source_pdfs", "test"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CombinePdfsData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return self._delete_custom_files - - @delete_custom_files.setter - def delete_custom_files(self, delete_custom_files): - """Sets the delete_custom_files of this CombinePdfsData. - - - :param delete_custom_files: The delete_custom_files of this CombinePdfsData. # noqa: E501 - :type: bool - """ - - self._delete_custom_files = delete_custom_files - - @property - def expires_in(self): - """Gets the expires_in of this CombinePdfsData. # noqa: E501 - - - :return: The expires_in of this CombinePdfsData. # noqa: E501 - :rtype: int - """ - return self._expires_in - - @expires_in.setter - def expires_in(self, expires_in): - """Sets the expires_in of this CombinePdfsData. - - - :param expires_in: The expires_in of this CombinePdfsData. # noqa: E501 - :type: int - """ - - self._expires_in = expires_in - - @property - def metadata(self): - """Gets the metadata of this CombinePdfsData. # noqa: E501 - - - :return: The metadata of this CombinePdfsData. # noqa: E501 - :rtype: object - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this CombinePdfsData. - + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CombinePdfsData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "delete_custom_files": obj.get("delete_custom_files"), + "expires_in": obj.get("expires_in"), + "metadata": obj.get("metadata"), + "password": obj.get("password"), + "source_pdfs": obj.get("source_pdfs"), + "test": obj.get("test") + }) + return _obj - :param metadata: The metadata of this CombinePdfsData. # noqa: E501 - :type: object - """ - - self._metadata = metadata - - @property - def password(self): - """Gets the password of this CombinePdfsData. # noqa: E501 - - - :return: The password of this CombinePdfsData. # noqa: E501 - :rtype: str - """ - return self._password - - @password.setter - def password(self, password): - """Sets the password of this CombinePdfsData. - - - :param password: The password of this CombinePdfsData. # noqa: E501 - :type: str - """ - - self._password = password - - @property - def source_pdfs(self): - """Gets the source_pdfs of this CombinePdfsData. # noqa: E501 - - - :return: The source_pdfs of this CombinePdfsData. # noqa: E501 - :rtype: list[object] - """ - return self._source_pdfs - - @source_pdfs.setter - def source_pdfs(self, source_pdfs): - """Sets the source_pdfs of this CombinePdfsData. - - - :param source_pdfs: The source_pdfs of this CombinePdfsData. # noqa: E501 - :type: list[object] - """ - if source_pdfs is None: - raise ValueError("Invalid value for `source_pdfs`, must not be `None`") # noqa: E501 - - self._source_pdfs = source_pdfs - - @property - def test(self): - """Gets the test of this CombinePdfsData. # noqa: E501 - - - :return: The test of this CombinePdfsData. # noqa: E501 - :rtype: bool - """ - return self._test - - @test.setter - def test(self, test): - """Sets the test of this CombinePdfsData. - - - :param test: The test of this CombinePdfsData. # noqa: E501 - :type: bool - """ - self._test = test - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CombinePdfsData): - 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/docspring/models/combined_submission.py b/docspring/models/combined_submission.py index db545bb..6381d39 100644 --- a/docspring/models/combined_submission.py +++ b/docspring/models/combined_submission.py @@ -1,374 +1,168 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - - -class CombinedSubmission(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from docspring.models.combined_submission_action import CombinedSubmissionAction +from typing import Optional, Set +from typing_extensions import Self +class CombinedSubmission(BaseModel): """ - Attributes: - openapi_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. - """ - openapi_types = { - 'metadata': 'object', - 'password': 'str', - 'expired': 'bool', - 'expires_at': 'str', - 'source_pdfs': 'list[object]', - 'pdf_hash': 'str', - 'download_url': 'str', - 'submission_ids': 'list[str]', - 'id': 'str', - 'state': 'str', - 'actions': 'list[CombinedSubmissionAction]' - } - - attribute_map = { - 'metadata': 'metadata', - 'password': 'password', - 'expired': 'expired', - 'expires_at': 'expires_at', - 'source_pdfs': 'source_pdfs', - 'pdf_hash': 'pdf_hash', - 'download_url': 'download_url', - 'submission_ids': 'submission_ids', - 'id': 'id', - 'state': 'state', - 'actions': 'actions' - } - - def __init__(self, metadata=None, password=None, expired=None, expires_at=None, source_pdfs=None, pdf_hash=None, download_url=None, submission_ids=None, id=None, state=None, actions=None): # noqa: E501 - """CombinedSubmission - a model defined in OpenAPI""" # noqa: E501 - - self._metadata = None - self._password = None - self._expired = None - self._expires_at = None - self._source_pdfs = None - self._pdf_hash = None - self._download_url = None - self._submission_ids = None - self._id = None - self._state = None - self._actions = None - self.discriminator = None - - if metadata is not None: - self.metadata = metadata - self.password = password - if expired is not None: - self.expired = expired - self.expires_at = expires_at - if source_pdfs is not None: - self.source_pdfs = source_pdfs - self.pdf_hash = pdf_hash - self.download_url = download_url - if submission_ids is not None: - self.submission_ids = submission_ids - if id is not None: - self.id = id - if state is not None: - self.state = state - if actions is not None: - self.actions = actions - - @property - def metadata(self): - """Gets the metadata of this CombinedSubmission. # noqa: E501 - - - :return: The metadata of this CombinedSubmission. # noqa: E501 - :rtype: object - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this CombinedSubmission. - - - :param metadata: The metadata of this CombinedSubmission. # noqa: E501 - :type: object - """ - - self._metadata = metadata - - @property - def password(self): - """Gets the password of this CombinedSubmission. # noqa: E501 - - - :return: The password of this CombinedSubmission. # noqa: E501 - :rtype: str - """ - return self._password - - @password.setter - def password(self, password): - """Sets the password of this CombinedSubmission. - - - :param password: The password of this CombinedSubmission. # noqa: E501 - :type: str - """ - - self._password = password - - @property - def expired(self): - """Gets the expired of this CombinedSubmission. # noqa: E501 - - - :return: The expired of this CombinedSubmission. # noqa: E501 - :rtype: bool - """ - return self._expired - - @expired.setter - def expired(self, expired): - """Sets the expired of this CombinedSubmission. - - - :param expired: The expired of this CombinedSubmission. # noqa: E501 - :type: bool - """ - - self._expired = expired - - @property - def expires_at(self): - """Gets the expires_at of this CombinedSubmission. # noqa: E501 - - - :return: The expires_at of this CombinedSubmission. # noqa: E501 - :rtype: str - """ - return self._expires_at - - @expires_at.setter - def expires_at(self, expires_at): - """Sets the expires_at of this CombinedSubmission. - - - :param expires_at: The expires_at of this CombinedSubmission. # noqa: E501 - :type: str - """ - - self._expires_at = expires_at - - @property - def source_pdfs(self): - """Gets the source_pdfs of this CombinedSubmission. # noqa: E501 - - - :return: The source_pdfs of this CombinedSubmission. # noqa: E501 - :rtype: list[object] - """ - return self._source_pdfs - - @source_pdfs.setter - def source_pdfs(self, source_pdfs): - """Sets the source_pdfs of this CombinedSubmission. - - - :param source_pdfs: The source_pdfs of this CombinedSubmission. # noqa: E501 - :type: list[object] - """ - - self._source_pdfs = source_pdfs - - @property - def pdf_hash(self): - """Gets the pdf_hash of this CombinedSubmission. # noqa: E501 - - - :return: The pdf_hash of this CombinedSubmission. # noqa: E501 - :rtype: str - """ - return self._pdf_hash - - @pdf_hash.setter - def pdf_hash(self, pdf_hash): - """Sets the pdf_hash of this CombinedSubmission. - - - :param pdf_hash: The pdf_hash of this CombinedSubmission. # noqa: E501 - :type: str - """ - - self._pdf_hash = pdf_hash - - @property - def download_url(self): - """Gets the download_url of this CombinedSubmission. # noqa: E501 - - - :return: The download_url of this CombinedSubmission. # noqa: E501 - :rtype: str - """ - return self._download_url - - @download_url.setter - def download_url(self, download_url): - """Sets the download_url of this CombinedSubmission. - - - :param download_url: The download_url of this CombinedSubmission. # noqa: E501 - :type: str - """ - - self._download_url = download_url - - @property - def submission_ids(self): - """Gets the submission_ids of this CombinedSubmission. # noqa: E501 - - - :return: The submission_ids of this CombinedSubmission. # noqa: E501 - :rtype: list[str] - """ - return self._submission_ids - - @submission_ids.setter - def submission_ids(self, submission_ids): - """Sets the submission_ids of this CombinedSubmission. - - - :param submission_ids: The submission_ids of this CombinedSubmission. # noqa: E501 - :type: list[str] - """ - - self._submission_ids = submission_ids - - @property - def id(self): - """Gets the id of this CombinedSubmission. # noqa: E501 - - - :return: The id of this CombinedSubmission. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this CombinedSubmission. - - - :param id: The id of this CombinedSubmission. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def state(self): - """Gets the state of this CombinedSubmission. # noqa: E501 - - - :return: The state of this CombinedSubmission. # noqa: E501 - :rtype: str - """ - return self._state - - @state.setter - def state(self, state): - """Sets the state of this CombinedSubmission. - - - :param state: The state of this CombinedSubmission. # noqa: E501 - :type: str - """ - allowed_values = ["pending", "processed", "error"] # noqa: E501 - if state not in allowed_values: - raise ValueError( - "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 - .format(state, allowed_values) - ) - - self._state = state - - @property - def actions(self): - """Gets the actions of this CombinedSubmission. # noqa: E501 - - - :return: The actions of this CombinedSubmission. # noqa: E501 - :rtype: list[CombinedSubmissionAction] - """ - return self._actions - - @actions.setter - def actions(self, actions): - """Sets the actions of this CombinedSubmission. - - - :param actions: The actions of this CombinedSubmission. # noqa: E501 - :type: list[CombinedSubmissionAction] - """ - - self._actions = actions - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CombinedSubmission): - return False + CombinedSubmission + """ # noqa: E501 + id: Optional[StrictStr] + state: StrictStr + expired: StrictBool + expires_in: Optional[StrictInt] + expires_at: Optional[StrictStr] + processed_at: Optional[StrictStr] + error_message: Optional[StrictStr] + submission_ids: List[StrictStr] + source_pdfs: List[Dict[str, Any]] + metadata: Dict[str, Any] + password: Optional[StrictStr] + pdf_hash: Optional[StrictStr] + download_url: Optional[StrictStr] + actions: List[CombinedSubmissionAction] + __properties: ClassVar[List[str]] = ["id", "state", "expired", "expires_in", "expires_at", "processed_at", "error_message", "submission_ids", "source_pdfs", "metadata", "password", "pdf_hash", "download_url", "actions"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending', 'processed', 'error']): + raise ValueError("must be one of enum values ('pending', 'processed', 'error')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CombinedSubmission from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in actions (list) + _items = [] + if self.actions: + for _item_actions in self.actions: + if _item_actions: + _items.append(_item_actions.to_dict()) + _dict['actions'] = _items + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if expires_in (nullable) is None + # and model_fields_set contains the field + if self.expires_in is None and "expires_in" in self.model_fields_set: + _dict['expires_in'] = None + + # set to None if expires_at (nullable) is None + # and model_fields_set contains the field + if self.expires_at is None and "expires_at" in self.model_fields_set: + _dict['expires_at'] = None + + # set to None if processed_at (nullable) is None + # and model_fields_set contains the field + if self.processed_at is None and "processed_at" in self.model_fields_set: + _dict['processed_at'] = None + + # set to None if error_message (nullable) is None + # and model_fields_set contains the field + if self.error_message is None and "error_message" in self.model_fields_set: + _dict['error_message'] = None + + # set to None if password (nullable) is None + # and model_fields_set contains the field + if self.password is None and "password" in self.model_fields_set: + _dict['password'] = None + + # set to None if pdf_hash (nullable) is None + # and model_fields_set contains the field + if self.pdf_hash is None and "pdf_hash" in self.model_fields_set: + _dict['pdf_hash'] = None + + # set to None if download_url (nullable) is None + # and model_fields_set contains the field + if self.download_url is None and "download_url" in self.model_fields_set: + _dict['download_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CombinedSubmission from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "state": obj.get("state"), + "expired": obj.get("expired"), + "expires_in": obj.get("expires_in"), + "expires_at": obj.get("expires_at"), + "processed_at": obj.get("processed_at"), + "error_message": obj.get("error_message"), + "submission_ids": obj.get("submission_ids"), + "source_pdfs": obj.get("source_pdfs"), + "metadata": obj.get("metadata"), + "password": obj.get("password"), + "pdf_hash": obj.get("pdf_hash"), + "download_url": obj.get("download_url"), + "actions": [CombinedSubmissionAction.from_dict(_item) for _item in obj["actions"]] if obj.get("actions") is not None else None + }) + return _obj - return self.__dict__ == other.__dict__ - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/docspring/models/combined_submission_action.py b/docspring/models/combined_submission_action.py index 484c60b..f96c246 100644 --- a/docspring/models/combined_submission_action.py +++ b/docspring/models/combined_submission_action.py @@ -1,264 +1,128 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - - -class CombinedSubmissionAction(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. +class CombinedSubmissionAction(BaseModel): """ - openapi_types = { - 'id': 'str', - 'integration_id': 'str', - 'state': 'str', - 'action_category': 'str', - 'action_type': 'str', - 'result_data': 'object' - } - - attribute_map = { - 'id': 'id', - 'integration_id': 'integration_id', - 'state': 'state', - 'action_category': 'action_category', - 'action_type': 'action_type', - 'result_data': 'result_data' - } - - def __init__(self, id=None, integration_id=None, state=None, action_category=None, action_type=None, result_data=None): # noqa: E501 - """CombinedSubmissionAction - a model defined in OpenAPI""" # noqa: E501 - - self._id = None - self._integration_id = None - self._state = None - self._action_category = None - self._action_type = None - self._result_data = None - self.discriminator = None - - self.id = id - self.integration_id = integration_id - self.state = state - self.action_category = action_category - self.action_type = action_type - self.result_data = result_data - - @property - def id(self): - """Gets the id of this CombinedSubmissionAction. # noqa: E501 - - - :return: The id of this CombinedSubmissionAction. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this CombinedSubmissionAction. - - - :param id: The id of this CombinedSubmissionAction. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def integration_id(self): - """Gets the integration_id of this CombinedSubmissionAction. # noqa: E501 - - - :return: The integration_id of this CombinedSubmissionAction. # noqa: E501 - :rtype: str - """ - return self._integration_id - - @integration_id.setter - def integration_id(self, integration_id): - """Sets the integration_id of this CombinedSubmissionAction. - - - :param integration_id: The integration_id of this CombinedSubmissionAction. # noqa: E501 - :type: str - """ - - self._integration_id = integration_id - - @property - def state(self): - """Gets the state of this CombinedSubmissionAction. # noqa: E501 - - - :return: The state of this CombinedSubmissionAction. # noqa: E501 - :rtype: str - """ - return self._state - - @state.setter - def state(self, state): - """Sets the state of this CombinedSubmissionAction. - - - :param state: The state of this CombinedSubmissionAction. # noqa: E501 - :type: str - """ - if state is None: - raise ValueError("Invalid value for `state`, must not be `None`") # noqa: E501 - allowed_values = ["pending", "processed", "failed", "error"] # noqa: E501 - if state not in allowed_values: - raise ValueError( - "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 - .format(state, allowed_values) - ) - - self._state = state - - @property - def action_category(self): - """Gets the action_category of this CombinedSubmissionAction. # noqa: E501 - - - :return: The action_category of this CombinedSubmissionAction. # noqa: E501 - :rtype: str - """ - return self._action_category - - @action_category.setter - def action_category(self, action_category): - """Sets the action_category of this CombinedSubmissionAction. - - - :param action_category: The action_category of this CombinedSubmissionAction. # noqa: E501 - :type: str - """ - if action_category is None: - raise ValueError("Invalid value for `action_category`, must not be `None`") # noqa: E501 - allowed_values = ["notification", "file_upload"] # noqa: E501 - if action_category not in allowed_values: - raise ValueError( - "Invalid value for `action_category` ({0}), must be one of {1}" # noqa: E501 - .format(action_category, allowed_values) - ) - - self._action_category = action_category - - @property - def action_type(self): - """Gets the action_type of this CombinedSubmissionAction. # noqa: E501 - - - :return: The action_type of this CombinedSubmissionAction. # noqa: E501 - :rtype: str - """ - return self._action_type - - @action_type.setter - def action_type(self, action_type): - """Sets the action_type of this CombinedSubmissionAction. - - - :param action_type: The action_type of this CombinedSubmissionAction. # noqa: E501 - :type: str - """ - if action_type is None: - raise ValueError("Invalid value for `action_type`, must not be `None`") # noqa: E501 - allowed_values = ["webhook", "slack_webhook", "email", "aws_s3_upload"] # noqa: E501 - if action_type not in allowed_values: - raise ValueError( - "Invalid value for `action_type` ({0}), must be one of {1}" # noqa: E501 - .format(action_type, allowed_values) - ) - - self._action_type = action_type - - @property - def result_data(self): - """Gets the result_data of this CombinedSubmissionAction. # noqa: E501 - - - :return: The result_data of this CombinedSubmissionAction. # noqa: E501 - :rtype: object - """ - return self._result_data - - @result_data.setter - def result_data(self, result_data): - """Sets the result_data of this CombinedSubmissionAction. - - - :param result_data: The result_data of this CombinedSubmissionAction. # noqa: E501 - :type: object + CombinedSubmissionAction + """ # noqa: E501 + id: Optional[StrictStr] + integration_id: Optional[StrictStr] + state: StrictStr + action_type: StrictStr + action_category: StrictStr + result_data: Dict[str, Any] + __properties: ClassVar[List[str]] = ["id", "integration_id", "state", "action_type", "action_category", "result_data"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending', 'processed', 'failed', 'error']): + raise ValueError("must be one of enum values ('pending', 'processed', 'failed', 'error')") + return value + + @field_validator('action_type') + def action_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['webhook', 'slack_webhook', 'email', 'aws_s3_upload']): + raise ValueError("must be one of enum values ('webhook', 'slack_webhook', 'email', 'aws_s3_upload')") + return value + + @field_validator('action_category') + def action_category_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['notification', 'file_upload']): + raise ValueError("must be one of enum values ('notification', 'file_upload')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CombinedSubmissionAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - if result_data is None: - raise ValueError("Invalid value for `result_data`, must not be `None`") # noqa: E501 - - self._result_data = result_data - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CombinedSubmissionAction): - return False + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if integration_id (nullable) is None + # and model_fields_set contains the field + if self.integration_id is None and "integration_id" in self.model_fields_set: + _dict['integration_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CombinedSubmissionAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "integration_id": obj.get("integration_id"), + "state": obj.get("state"), + "action_type": obj.get("action_type"), + "action_category": obj.get("action_category"), + "result_data": obj.get("result_data") + }) + return _obj - return self.__dict__ == other.__dict__ - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/docspring/models/combined_submission_data.py b/docspring/models/combined_submission_data.py index c282f14..097d7c4 100644 --- a/docspring/models/combined_submission_data.py +++ b/docspring/models/combined_submission_data.py @@ -1,217 +1,95 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - - -class CombinedSubmissionData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +class CombinedSubmissionData(BaseModel): """ - Attributes: - openapi_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. - """ - openapi_types = { - 'expires_in': 'int', - 'metadata': 'object', - 'password': 'str', - 'submission_ids': 'list[str]', - 'test': 'bool' - } - - attribute_map = { - 'expires_in': 'expires_in', - 'metadata': 'metadata', - 'password': 'password', - 'submission_ids': 'submission_ids', - 'test': 'test' - } - - def __init__(self, expires_in=None, metadata=None, password=None, submission_ids=None, test=None): # noqa: E501 - """CombinedSubmissionData - a model defined in OpenAPI""" # noqa: E501 - - self._expires_in = None - self._metadata = None - self._password = None - self._submission_ids = None - self._test = None - self.discriminator = None - - if expires_in is not None: - self.expires_in = expires_in - if metadata is not None: - self.metadata = metadata - if password is not None: - self.password = password - self.submission_ids = submission_ids - if test is not None: - self.test = test - - @property - def expires_in(self): - """Gets the expires_in of this CombinedSubmissionData. # noqa: E501 - - - :return: The expires_in of this CombinedSubmissionData. # noqa: E501 - :rtype: int - """ - return self._expires_in - - @expires_in.setter - def expires_in(self, expires_in): - """Sets the expires_in of this CombinedSubmissionData. - - - :param expires_in: The expires_in of this CombinedSubmissionData. # noqa: E501 - :type: int - """ - - self._expires_in = expires_in - - @property - def metadata(self): - """Gets the metadata of this CombinedSubmissionData. # noqa: E501 - - - :return: The metadata of this CombinedSubmissionData. # noqa: E501 - :rtype: object - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this CombinedSubmissionData. - - - :param metadata: The metadata of this CombinedSubmissionData. # noqa: E501 - :type: object - """ - - self._metadata = metadata - - @property - def password(self): - """Gets the password of this CombinedSubmissionData. # noqa: E501 - - - :return: The password of this CombinedSubmissionData. # noqa: E501 - :rtype: str - """ - return self._password - - @password.setter - def password(self, password): - """Sets the password of this CombinedSubmissionData. - - - :param password: The password of this CombinedSubmissionData. # noqa: E501 - :type: str - """ - - self._password = password - - @property - def submission_ids(self): - """Gets the submission_ids of this CombinedSubmissionData. # noqa: E501 - - - :return: The submission_ids of this CombinedSubmissionData. # noqa: E501 - :rtype: list[str] + CombinedSubmissionData + """ # noqa: E501 + expires_in: Optional[StrictInt] = None + metadata: Optional[Dict[str, Any]] = None + password: Optional[StrictStr] = None + submission_ids: List[StrictStr] + test: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["expires_in", "metadata", "password", "submission_ids", "test"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CombinedSubmissionData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return self._submission_ids + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CombinedSubmissionData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "expires_in": obj.get("expires_in"), + "metadata": obj.get("metadata"), + "password": obj.get("password"), + "submission_ids": obj.get("submission_ids"), + "test": obj.get("test") + }) + return _obj - @submission_ids.setter - def submission_ids(self, submission_ids): - """Sets the submission_ids of this CombinedSubmissionData. - - - :param submission_ids: The submission_ids of this CombinedSubmissionData. # noqa: E501 - :type: list[str] - """ - if submission_ids is None: - raise ValueError("Invalid value for `submission_ids`, must not be `None`") # noqa: E501 - - self._submission_ids = submission_ids - - @property - def test(self): - """Gets the test of this CombinedSubmissionData. # noqa: E501 - - - :return: The test of this CombinedSubmissionData. # noqa: E501 - :rtype: bool - """ - return self._test - - @test.setter - def test(self, test): - """Sets the test of this CombinedSubmissionData. - - - :param test: The test of this CombinedSubmissionData. # noqa: E501 - :type: bool - """ - self._test = test - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CombinedSubmissionData): - 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/docspring/models/copy_template_data.py b/docspring/models/copy_template_data.py deleted file mode 100644 index 3a730fa..0000000 --- a/docspring/models/copy_template_data.py +++ /dev/null @@ -1,139 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class CopyTemplateData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'name': 'str', - 'parent_folder_id': 'str' - } - - attribute_map = { - 'name': 'name', - 'parent_folder_id': 'parent_folder_id' - } - - def __init__(self, name=None, parent_folder_id=None): # noqa: E501 - """CopyTemplateData - a model defined in OpenAPI""" # noqa: E501 - - self._name = None - self._parent_folder_id = None - self.discriminator = None - - if name is not None: - self.name = name - self.parent_folder_id = parent_folder_id - - @property - def name(self): - """Gets the name of this CopyTemplateData. # noqa: E501 - - - :return: The name of this CopyTemplateData. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this CopyTemplateData. - - - :param name: The name of this CopyTemplateData. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def parent_folder_id(self): - """Gets the parent_folder_id of this CopyTemplateData. # noqa: E501 - - - :return: The parent_folder_id of this CopyTemplateData. # noqa: E501 - :rtype: str - """ - return self._parent_folder_id - - @parent_folder_id.setter - def parent_folder_id(self, parent_folder_id): - """Sets the parent_folder_id of this CopyTemplateData. - - - :param parent_folder_id: The parent_folder_id of this CopyTemplateData. # noqa: E501 - :type: str - """ - if parent_folder_id is None: - raise ValueError("Invalid value for `parent_folder_id`, must not be `None`") # noqa: E501 - - self._parent_folder_id = parent_folder_id - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CopyTemplateData): - 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/docspring/models/copy_template_options.py b/docspring/models/copy_template_options.py new file mode 100644 index 0000000..0f677b7 --- /dev/null +++ b/docspring/models/copy_template_options.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CopyTemplateOptions(BaseModel): + """ + CopyTemplateOptions + """ # noqa: E501 + name: Optional[StrictStr] = None + parent_folder_id: StrictStr + __properties: ClassVar[List[str]] = ["name", "parent_folder_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CopyTemplateOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CopyTemplateOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "parent_folder_id": obj.get("parent_folder_id") + }) + return _obj + + diff --git a/docspring/models/create_combined_submission_response.py b/docspring/models/create_combined_submission_response.py index e7bc3fa..b906ee6 100644 --- a/docspring/models/create_combined_submission_response.py +++ b/docspring/models/create_combined_submission_response.py @@ -1,170 +1,102 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - - -class CreateCombinedSubmissionResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from docspring.models.combined_submission import CombinedSubmission +from typing import Optional, Set +from typing_extensions import Self +class CreateCombinedSubmissionResponse(BaseModel): """ - Attributes: - openapi_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. - """ - openapi_types = { - 'combined_submission': 'CombinedSubmission', - 'errors': 'list[str]', - 'status': 'str' - } - - attribute_map = { - 'combined_submission': 'combined_submission', - 'errors': 'errors', - 'status': 'status' - } - - def __init__(self, combined_submission=None, errors=None, status=None): # noqa: E501 - """CreateCombinedSubmissionResponse - a model defined in OpenAPI""" # noqa: E501 - - self._combined_submission = None - self._errors = None - self._status = None - self.discriminator = None - - if combined_submission is not None: - self.combined_submission = combined_submission - if errors is not None: - self.errors = errors - if status is not None: - self.status = status - - @property - def combined_submission(self): - """Gets the combined_submission of this CreateCombinedSubmissionResponse. # noqa: E501 - - - :return: The combined_submission of this CreateCombinedSubmissionResponse. # noqa: E501 - :rtype: CombinedSubmission + CreateCombinedSubmissionResponse + """ # noqa: E501 + status: StrictStr + combined_submission: CombinedSubmission + errors: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["status", "combined_submission", "errors"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'error']): + raise ValueError("must be one of enum values ('success', 'error')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateCombinedSubmissionResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return self._combined_submission - - @combined_submission.setter - def combined_submission(self, combined_submission): - """Sets the combined_submission of this CreateCombinedSubmissionResponse. - - - :param combined_submission: The combined_submission of this CreateCombinedSubmissionResponse. # noqa: E501 - :type: CombinedSubmission - """ - - self._combined_submission = combined_submission - - @property - def errors(self): - """Gets the errors of this CreateCombinedSubmissionResponse. # noqa: E501 + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of combined_submission + if self.combined_submission: + _dict['combined_submission'] = self.combined_submission.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateCombinedSubmissionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "combined_submission": CombinedSubmission.from_dict(obj["combined_submission"]) if obj.get("combined_submission") is not None else None, + "errors": obj.get("errors") + }) + return _obj - :return: The errors of this CreateCombinedSubmissionResponse. # noqa: E501 - :rtype: list[str] - """ - return self._errors - - @errors.setter - def errors(self, errors): - """Sets the errors of this CreateCombinedSubmissionResponse. - - - :param errors: The errors of this CreateCombinedSubmissionResponse. # noqa: E501 - :type: list[str] - """ - - self._errors = errors - - @property - def status(self): - """Gets the status of this CreateCombinedSubmissionResponse. # noqa: E501 - - - :return: The status of this CreateCombinedSubmissionResponse. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this CreateCombinedSubmissionResponse. - - - :param status: The status of this CreateCombinedSubmissionResponse. # noqa: E501 - :type: str - """ - allowed_values = ["success", "error"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateCombinedSubmissionResponse): - 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/docspring/models/create_custom_file_data.py b/docspring/models/create_custom_file_data.py index ac0a103..7936133 100644 --- a/docspring/models/create_custom_file_data.py +++ b/docspring/models/create_custom_file_data.py @@ -1,115 +1,88 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - -class CreateCustomFileData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. +class CreateCustomFileData(BaseModel): """ + CreateCustomFileData + """ # noqa: E501 + cache_id: Annotated[str, Field(min_length=1, strict=True)] + __properties: ClassVar[List[str]] = ["cache_id"] - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'cache_id': 'str' - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'cache_id': 'cache_id' - } - def __init__(self, cache_id=None): # noqa: E501 - """CreateCustomFileData - a model defined in OpenAPI""" # noqa: E501 + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - self._cache_id = None - self.discriminator = None + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - self.cache_id = cache_id + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateCustomFileData from a JSON string""" + return cls.from_dict(json.loads(json_str)) - @property - def cache_id(self): - """Gets the cache_id of this CreateCustomFileData. # noqa: E501 + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - :return: The cache_id of this CreateCustomFileData. # noqa: E501 - :rtype: str + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return self._cache_id + excluded_fields: Set[str] = set([ + ]) - @cache_id.setter - def cache_id(self, cache_id): - """Sets the cache_id of this CreateCustomFileData. + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateCustomFileData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "cache_id": obj.get("cache_id") + }) + return _obj - :param cache_id: The cache_id of this CreateCustomFileData. # noqa: E501 - :type: str - """ - if cache_id is None: - raise ValueError("Invalid value for `cache_id`, must not be `None`") # noqa: E501 - if cache_id is not None and len(cache_id) < 1: - raise ValueError("Invalid value for `cache_id`, length must be greater than or equal to `1`") # noqa: E501 - - self._cache_id = cache_id - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateCustomFileData): - 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/docspring/models/create_custom_file_response.py b/docspring/models/create_custom_file_response.py index 43fc5c6..f7ce89e 100644 --- a/docspring/models/create_custom_file_response.py +++ b/docspring/models/create_custom_file_response.py @@ -1,170 +1,102 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - - -class CreateCustomFileResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from docspring.models.custom_file import CustomFile +from typing import Optional, Set +from typing_extensions import Self +class CreateCustomFileResponse(BaseModel): """ - Attributes: - openapi_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. - """ - openapi_types = { - 'custom_file': 'CustomFile', - 'errors': 'list[str]', - 'status': 'str' - } - - attribute_map = { - 'custom_file': 'custom_file', - 'errors': 'errors', - 'status': 'status' - } - - def __init__(self, custom_file=None, errors=None, status=None): # noqa: E501 - """CreateCustomFileResponse - a model defined in OpenAPI""" # noqa: E501 - - self._custom_file = None - self._errors = None - self._status = None - self.discriminator = None - - if custom_file is not None: - self.custom_file = custom_file - if errors is not None: - self.errors = errors - if status is not None: - self.status = status - - @property - def custom_file(self): - """Gets the custom_file of this CreateCustomFileResponse. # noqa: E501 - - - :return: The custom_file of this CreateCustomFileResponse. # noqa: E501 - :rtype: CustomFile + CreateCustomFileResponse + """ # noqa: E501 + status: StrictStr + custom_file: CustomFile + errors: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["status", "custom_file", "errors"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'error']): + raise ValueError("must be one of enum values ('success', 'error')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateCustomFileResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return self._custom_file - - @custom_file.setter - def custom_file(self, custom_file): - """Sets the custom_file of this CreateCustomFileResponse. - - - :param custom_file: The custom_file of this CreateCustomFileResponse. # noqa: E501 - :type: CustomFile - """ - - self._custom_file = custom_file - - @property - def errors(self): - """Gets the errors of this CreateCustomFileResponse. # noqa: E501 + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of custom_file + if self.custom_file: + _dict['custom_file'] = self.custom_file.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateCustomFileResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "custom_file": CustomFile.from_dict(obj["custom_file"]) if obj.get("custom_file") is not None else None, + "errors": obj.get("errors") + }) + return _obj - :return: The errors of this CreateCustomFileResponse. # noqa: E501 - :rtype: list[str] - """ - return self._errors - - @errors.setter - def errors(self, errors): - """Sets the errors of this CreateCustomFileResponse. - - - :param errors: The errors of this CreateCustomFileResponse. # noqa: E501 - :type: list[str] - """ - - self._errors = errors - - @property - def status(self): - """Gets the status of this CreateCustomFileResponse. # noqa: E501 - - - :return: The status of this CreateCustomFileResponse. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this CreateCustomFileResponse. - - - :param status: The status of this CreateCustomFileResponse. # noqa: E501 - :type: str - """ - allowed_values = ["success", "error"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateCustomFileResponse): - 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/docspring/models/create_folder_data.py b/docspring/models/create_folder_data.py index 0302a02..701dde0 100644 --- a/docspring/models/create_folder_data.py +++ b/docspring/models/create_folder_data.py @@ -1,113 +1,87 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self - -class CreateFolderData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. +class CreateFolderData(BaseModel): """ + CreateFolderData + """ # noqa: E501 + folder: Dict[str, Any] + __properties: ClassVar[List[str]] = ["folder"] - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'folder': 'FoldersFolder' - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'folder': 'folder' - } - def __init__(self, folder=None): # noqa: E501 - """CreateFolderData - a model defined in OpenAPI""" # noqa: E501 + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - self._folder = None - self.discriminator = None + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - self.folder = folder + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateFolderData from a JSON string""" + return cls.from_dict(json.loads(json_str)) - @property - def folder(self): - """Gets the folder of this CreateFolderData. # noqa: E501 + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - :return: The folder of this CreateFolderData. # noqa: E501 - :rtype: FoldersFolder + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return self._folder + excluded_fields: Set[str] = set([ + ]) - @folder.setter - def folder(self, folder): - """Sets the folder of this CreateFolderData. + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateFolderData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "folder": obj.get("folder") + }) + return _obj - :param folder: The folder of this CreateFolderData. # noqa: E501 - :type: FoldersFolder - """ - if folder is None: - raise ValueError("Invalid value for `folder`, must not be `None`") # noqa: E501 - - self._folder = folder - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateFolderData): - 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/docspring/models/create_html_submission_data.py b/docspring/models/create_html_submission_data.py new file mode 100644 index 0000000..3895d59 --- /dev/null +++ b/docspring/models/create_html_submission_data.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CreateHtmlSubmissionData(BaseModel): + """ + CreateHtmlSubmissionData + """ # noqa: E501 + css: Optional[StrictStr] = None + data: Optional[Dict[str, Any]] = None + editable: Optional[StrictBool] = None + expires_in: Optional[StrictInt] = None + field_overrides: Optional[Dict[str, Any]] = None + html: Optional[StrictStr] = None + metadata: Optional[Dict[str, Any]] = None + password: Optional[StrictStr] = None + test: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["css", "data", "editable", "expires_in", "field_overrides", "html", "metadata", "password", "test"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateHtmlSubmissionData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateHtmlSubmissionData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "css": obj.get("css"), + "data": obj.get("data"), + "editable": obj.get("editable"), + "expires_in": obj.get("expires_in"), + "field_overrides": obj.get("field_overrides"), + "html": obj.get("html"), + "metadata": obj.get("metadata"), + "password": obj.get("password"), + "test": obj.get("test") + }) + return _obj + + diff --git a/docspring/models/create_html_template.py b/docspring/models/create_html_template.py new file mode 100644 index 0000000..102bc2e --- /dev/null +++ b/docspring/models/create_html_template.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CreateHtmlTemplate(BaseModel): + """ + CreateHtmlTemplate + """ # noqa: E501 + template: Dict[str, Any] + __properties: ClassVar[List[str]] = ["template"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateHtmlTemplate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateHtmlTemplate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template": obj.get("template") + }) + return _obj + + diff --git a/docspring/models/create_html_template_data.py b/docspring/models/create_html_template_data.py deleted file mode 100644 index 038faa8..0000000 --- a/docspring/models/create_html_template_data.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class CreateHtmlTemplateData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'template': 'HtmlTemplateData' - } - - attribute_map = { - 'template': 'template' - } - - def __init__(self, template=None): # noqa: E501 - """CreateHtmlTemplateData - a model defined in OpenAPI""" # noqa: E501 - - self._template = None - self.discriminator = None - - self.template = template - - @property - def template(self): - """Gets the template of this CreateHtmlTemplateData. # noqa: E501 - - - :return: The template of this CreateHtmlTemplateData. # noqa: E501 - :rtype: HtmlTemplateData - """ - return self._template - - @template.setter - def template(self, template): - """Sets the template of this CreateHtmlTemplateData. - - - :param template: The template of this CreateHtmlTemplateData. # noqa: E501 - :type: HtmlTemplateData - """ - if template is None: - raise ValueError("Invalid value for `template`, must not be `None`") # noqa: E501 - - self._template = template - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateHtmlTemplateData): - 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/docspring/models/create_pdf_submission_data.py b/docspring/models/create_pdf_submission_data.py new file mode 100644 index 0000000..ee090c9 --- /dev/null +++ b/docspring/models/create_pdf_submission_data.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from docspring.models.create_submission_data_request_data import CreateSubmissionDataRequestData +from typing import Optional, Set +from typing_extensions import Self + +class CreatePdfSubmissionData(BaseModel): + """ + CreatePdfSubmissionData + """ # noqa: E501 + data: Dict[str, Any] + data_requests: Optional[List[CreateSubmissionDataRequestData]] = None + editable: Optional[StrictBool] = None + expires_in: Optional[StrictInt] = None + field_overrides: Optional[Dict[str, Any]] = None + metadata: Optional[Dict[str, Any]] = None + password: Optional[StrictStr] = None + test: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["data", "data_requests", "editable", "expires_in", "field_overrides", "metadata", "password", "test"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreatePdfSubmissionData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data_requests (list) + _items = [] + if self.data_requests: + for _item_data_requests in self.data_requests: + if _item_data_requests: + _items.append(_item_data_requests.to_dict()) + _dict['data_requests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreatePdfSubmissionData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": obj.get("data"), + "data_requests": [CreateSubmissionDataRequestData.from_dict(_item) for _item in obj["data_requests"]] if obj.get("data_requests") is not None else None, + "editable": obj.get("editable"), + "expires_in": obj.get("expires_in"), + "field_overrides": obj.get("field_overrides"), + "metadata": obj.get("metadata"), + "password": obj.get("password"), + "test": obj.get("test") + }) + return _obj + + diff --git a/docspring/models/create_pdf_template.py b/docspring/models/create_pdf_template.py new file mode 100644 index 0000000..9fb21cd --- /dev/null +++ b/docspring/models/create_pdf_template.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class CreatePdfTemplate(BaseModel): + """ + CreatePdfTemplate + """ # noqa: E501 + template: Dict[str, Any] + __properties: ClassVar[List[str]] = ["template"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreatePdfTemplate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreatePdfTemplate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template": obj.get("template") + }) + return _obj + + diff --git a/docspring/models/create_submission_batch_response.py b/docspring/models/create_submission_batch_response.py deleted file mode 100644 index 0d49eb6..0000000 --- a/docspring/models/create_submission_batch_response.py +++ /dev/null @@ -1,222 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class CreateSubmissionBatchResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'submission_batch': 'SubmissionBatch', - 'submissions': 'list[CreateSubmissionBatchSubmissionsResponse]', - 'error': 'str', - 'errors': 'list[str]', - 'status': 'str' - } - - attribute_map = { - 'submission_batch': 'submission_batch', - 'submissions': 'submissions', - 'error': 'error', - 'errors': 'errors', - 'status': 'status' - } - - def __init__(self, submission_batch=None, submissions=None, error=None, errors=None, status=None): # noqa: E501 - """CreateSubmissionBatchResponse - a model defined in OpenAPI""" # noqa: E501 - - self._submission_batch = None - self._submissions = None - self._error = None - self._errors = None - self._status = None - self.discriminator = None - - if submission_batch is not None: - self.submission_batch = submission_batch - if submissions is not None: - self.submissions = submissions - if error is not None: - self.error = error - if errors is not None: - self.errors = errors - if status is not None: - self.status = status - - @property - def submission_batch(self): - """Gets the submission_batch of this CreateSubmissionBatchResponse. # noqa: E501 - - - :return: The submission_batch of this CreateSubmissionBatchResponse. # noqa: E501 - :rtype: SubmissionBatch - """ - return self._submission_batch - - @submission_batch.setter - def submission_batch(self, submission_batch): - """Sets the submission_batch of this CreateSubmissionBatchResponse. - - - :param submission_batch: The submission_batch of this CreateSubmissionBatchResponse. # noqa: E501 - :type: SubmissionBatch - """ - - self._submission_batch = submission_batch - - @property - def submissions(self): - """Gets the submissions of this CreateSubmissionBatchResponse. # noqa: E501 - - - :return: The submissions of this CreateSubmissionBatchResponse. # noqa: E501 - :rtype: list[CreateSubmissionBatchSubmissionsResponse] - """ - return self._submissions - - @submissions.setter - def submissions(self, submissions): - """Sets the submissions of this CreateSubmissionBatchResponse. - - - :param submissions: The submissions of this CreateSubmissionBatchResponse. # noqa: E501 - :type: list[CreateSubmissionBatchSubmissionsResponse] - """ - - self._submissions = submissions - - @property - def error(self): - """Gets the error of this CreateSubmissionBatchResponse. # noqa: E501 - - - :return: The error of this CreateSubmissionBatchResponse. # noqa: E501 - :rtype: str - """ - return self._error - - @error.setter - def error(self, error): - """Sets the error of this CreateSubmissionBatchResponse. - - - :param error: The error of this CreateSubmissionBatchResponse. # noqa: E501 - :type: str - """ - - self._error = error - - @property - def errors(self): - """Gets the errors of this CreateSubmissionBatchResponse. # noqa: E501 - - - :return: The errors of this CreateSubmissionBatchResponse. # noqa: E501 - :rtype: list[str] - """ - return self._errors - - @errors.setter - def errors(self, errors): - """Sets the errors of this CreateSubmissionBatchResponse. - - - :param errors: The errors of this CreateSubmissionBatchResponse. # noqa: E501 - :type: list[str] - """ - - self._errors = errors - - @property - def status(self): - """Gets the status of this CreateSubmissionBatchResponse. # noqa: E501 - - - :return: The status of this CreateSubmissionBatchResponse. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this CreateSubmissionBatchResponse. - - - :param status: The status of this CreateSubmissionBatchResponse. # noqa: E501 - :type: str - """ - allowed_values = ["success", "error"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateSubmissionBatchResponse): - 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/docspring/models/create_submission_batch_submissions_response.py b/docspring/models/create_submission_batch_submissions_response.py deleted file mode 100644 index 659d31c..0000000 --- a/docspring/models/create_submission_batch_submissions_response.py +++ /dev/null @@ -1,170 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class CreateSubmissionBatchSubmissionsResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'submission': 'Submission', - 'errors': 'list[str]', - 'status': 'str' - } - - attribute_map = { - 'submission': 'submission', - 'errors': 'errors', - 'status': 'status' - } - - def __init__(self, submission=None, errors=None, status=None): # noqa: E501 - """CreateSubmissionBatchSubmissionsResponse - a model defined in OpenAPI""" # noqa: E501 - - self._submission = None - self._errors = None - self._status = None - self.discriminator = None - - if submission is not None: - self.submission = submission - if errors is not None: - self.errors = errors - if status is not None: - self.status = status - - @property - def submission(self): - """Gets the submission of this CreateSubmissionBatchSubmissionsResponse. # noqa: E501 - - - :return: The submission of this CreateSubmissionBatchSubmissionsResponse. # noqa: E501 - :rtype: Submission - """ - return self._submission - - @submission.setter - def submission(self, submission): - """Sets the submission of this CreateSubmissionBatchSubmissionsResponse. - - - :param submission: The submission of this CreateSubmissionBatchSubmissionsResponse. # noqa: E501 - :type: Submission - """ - - self._submission = submission - - @property - def errors(self): - """Gets the errors of this CreateSubmissionBatchSubmissionsResponse. # noqa: E501 - - - :return: The errors of this CreateSubmissionBatchSubmissionsResponse. # noqa: E501 - :rtype: list[str] - """ - return self._errors - - @errors.setter - def errors(self, errors): - """Sets the errors of this CreateSubmissionBatchSubmissionsResponse. - - - :param errors: The errors of this CreateSubmissionBatchSubmissionsResponse. # noqa: E501 - :type: list[str] - """ - - self._errors = errors - - @property - def status(self): - """Gets the status of this CreateSubmissionBatchSubmissionsResponse. # noqa: E501 - - - :return: The status of this CreateSubmissionBatchSubmissionsResponse. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this CreateSubmissionBatchSubmissionsResponse. - - - :param status: The status of this CreateSubmissionBatchSubmissionsResponse. # noqa: E501 - :type: str - """ - allowed_values = ["success", "error", "valid_but_not_saved"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateSubmissionBatchSubmissionsResponse): - 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/docspring/models/create_submission_data_request_data.py b/docspring/models/create_submission_data_request_data.py index a3e3b0b..84f3097 100644 --- a/docspring/models/create_submission_data_request_data.py +++ b/docspring/models/create_submission_data_request_data.py @@ -1,427 +1,115 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - - -class CreateSubmissionDataRequestData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. +class CreateSubmissionDataRequestData(BaseModel): """ - openapi_types = { - 'auth_type': 'str', - 'metadata': 'object', - 'auth_second_factor_type': 'str', - 'auth_phone_number_hash': 'str', - 'auth_session_started_at': 'str', - 'auth_user_id_hash': 'str', - 'auth_session_id_hash': 'str', - 'auth_username_hash': 'str', - 'name': 'str', - 'fields': 'list[str]', - 'auth_provider': 'str', - 'email': 'str', - 'order': 'int' - } - - attribute_map = { - 'auth_type': 'auth_type', - 'metadata': 'metadata', - 'auth_second_factor_type': 'auth_second_factor_type', - 'auth_phone_number_hash': 'auth_phone_number_hash', - 'auth_session_started_at': 'auth_session_started_at', - 'auth_user_id_hash': 'auth_user_id_hash', - 'auth_session_id_hash': 'auth_session_id_hash', - 'auth_username_hash': 'auth_username_hash', - 'name': 'name', - 'fields': 'fields', - 'auth_provider': 'auth_provider', - 'email': 'email', - 'order': 'order' - } - - def __init__(self, auth_type=None, metadata=None, auth_second_factor_type=None, auth_phone_number_hash=None, auth_session_started_at=None, auth_user_id_hash=None, auth_session_id_hash=None, auth_username_hash=None, name=None, fields=None, auth_provider=None, email=None, order=None): # noqa: E501 - """CreateSubmissionDataRequestData - a model defined in OpenAPI""" # noqa: E501 - - self._auth_type = None - self._metadata = None - self._auth_second_factor_type = None - self._auth_phone_number_hash = None - self._auth_session_started_at = None - self._auth_user_id_hash = None - self._auth_session_id_hash = None - self._auth_username_hash = None - self._name = None - self._fields = None - self._auth_provider = None - self._email = None - self._order = None - self.discriminator = None - - if auth_type is not None: - self.auth_type = auth_type - if metadata is not None: - self.metadata = metadata - if auth_second_factor_type is not None: - self.auth_second_factor_type = auth_second_factor_type - self.auth_phone_number_hash = auth_phone_number_hash - self.auth_session_started_at = auth_session_started_at - self.auth_user_id_hash = auth_user_id_hash - self.auth_session_id_hash = auth_session_id_hash - self.auth_username_hash = auth_username_hash - self.name = name - self.fields = fields - self.auth_provider = auth_provider - self.email = email - if order is not None: - self.order = order - - @property - def auth_type(self): - """Gets the auth_type of this CreateSubmissionDataRequestData. # noqa: E501 - - - :return: The auth_type of this CreateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._auth_type - - @auth_type.setter - def auth_type(self, auth_type): - """Sets the auth_type of this CreateSubmissionDataRequestData. - - - :param auth_type: The auth_type of this CreateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - allowed_values = ["none", "password", "oauth", "email_link", "phone_number", "ldap", "saml"] # noqa: E501 - if auth_type not in allowed_values: - raise ValueError( - "Invalid value for `auth_type` ({0}), must be one of {1}" # noqa: E501 - .format(auth_type, allowed_values) - ) - - self._auth_type = auth_type - - @property - def metadata(self): - """Gets the metadata of this CreateSubmissionDataRequestData. # noqa: E501 - - - :return: The metadata of this CreateSubmissionDataRequestData. # noqa: E501 - :rtype: object - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this CreateSubmissionDataRequestData. - - - :param metadata: The metadata of this CreateSubmissionDataRequestData. # noqa: E501 - :type: object - """ - - self._metadata = metadata - - @property - def auth_second_factor_type(self): - """Gets the auth_second_factor_type of this CreateSubmissionDataRequestData. # noqa: E501 - - - :return: The auth_second_factor_type of this CreateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._auth_second_factor_type - - @auth_second_factor_type.setter - def auth_second_factor_type(self, auth_second_factor_type): - """Sets the auth_second_factor_type of this CreateSubmissionDataRequestData. - - - :param auth_second_factor_type: The auth_second_factor_type of this CreateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - allowed_values = ["none", "phone_number", "totp", "mobile_push", "security_key", "fingerprint"] # noqa: E501 - if auth_second_factor_type not in allowed_values: - raise ValueError( - "Invalid value for `auth_second_factor_type` ({0}), must be one of {1}" # noqa: E501 - .format(auth_second_factor_type, allowed_values) - ) - - self._auth_second_factor_type = auth_second_factor_type - - @property - def auth_phone_number_hash(self): - """Gets the auth_phone_number_hash of this CreateSubmissionDataRequestData. # noqa: E501 - - - :return: The auth_phone_number_hash of this CreateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._auth_phone_number_hash - - @auth_phone_number_hash.setter - def auth_phone_number_hash(self, auth_phone_number_hash): - """Sets the auth_phone_number_hash of this CreateSubmissionDataRequestData. - - - :param auth_phone_number_hash: The auth_phone_number_hash of this CreateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - - self._auth_phone_number_hash = auth_phone_number_hash - - @property - def auth_session_started_at(self): - """Gets the auth_session_started_at of this CreateSubmissionDataRequestData. # noqa: E501 - - - :return: The auth_session_started_at of this CreateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._auth_session_started_at - - @auth_session_started_at.setter - def auth_session_started_at(self, auth_session_started_at): - """Sets the auth_session_started_at of this CreateSubmissionDataRequestData. - - - :param auth_session_started_at: The auth_session_started_at of this CreateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - - self._auth_session_started_at = auth_session_started_at - - @property - def auth_user_id_hash(self): - """Gets the auth_user_id_hash of this CreateSubmissionDataRequestData. # noqa: E501 - - - :return: The auth_user_id_hash of this CreateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._auth_user_id_hash - - @auth_user_id_hash.setter - def auth_user_id_hash(self, auth_user_id_hash): - """Sets the auth_user_id_hash of this CreateSubmissionDataRequestData. - - - :param auth_user_id_hash: The auth_user_id_hash of this CreateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - - self._auth_user_id_hash = auth_user_id_hash - - @property - def auth_session_id_hash(self): - """Gets the auth_session_id_hash of this CreateSubmissionDataRequestData. # noqa: E501 - - - :return: The auth_session_id_hash of this CreateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._auth_session_id_hash - - @auth_session_id_hash.setter - def auth_session_id_hash(self, auth_session_id_hash): - """Sets the auth_session_id_hash of this CreateSubmissionDataRequestData. - - - :param auth_session_id_hash: The auth_session_id_hash of this CreateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - - self._auth_session_id_hash = auth_session_id_hash - - @property - def auth_username_hash(self): - """Gets the auth_username_hash of this CreateSubmissionDataRequestData. # noqa: E501 - - - :return: The auth_username_hash of this CreateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._auth_username_hash - - @auth_username_hash.setter - def auth_username_hash(self, auth_username_hash): - """Sets the auth_username_hash of this CreateSubmissionDataRequestData. - - - :param auth_username_hash: The auth_username_hash of this CreateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - - self._auth_username_hash = auth_username_hash - - @property - def name(self): - """Gets the name of this CreateSubmissionDataRequestData. # noqa: E501 - - - :return: The name of this CreateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this CreateSubmissionDataRequestData. - - - :param name: The name of this CreateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def fields(self): - """Gets the fields of this CreateSubmissionDataRequestData. # noqa: E501 - - - :return: The fields of this CreateSubmissionDataRequestData. # noqa: E501 - :rtype: list[str] - """ - return self._fields - - @fields.setter - def fields(self, fields): - """Sets the fields of this CreateSubmissionDataRequestData. - - - :param fields: The fields of this CreateSubmissionDataRequestData. # noqa: E501 - :type: list[str] - """ - - self._fields = fields - - @property - def auth_provider(self): - """Gets the auth_provider of this CreateSubmissionDataRequestData. # noqa: E501 - - - :return: The auth_provider of this CreateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._auth_provider - - @auth_provider.setter - def auth_provider(self, auth_provider): - """Sets the auth_provider of this CreateSubmissionDataRequestData. - - - :param auth_provider: The auth_provider of this CreateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - - self._auth_provider = auth_provider - - @property - def email(self): - """Gets the email of this CreateSubmissionDataRequestData. # noqa: E501 - - - :return: The email of this CreateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._email - - @email.setter - def email(self, email): - """Sets the email of this CreateSubmissionDataRequestData. - - - :param email: The email of this CreateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - - self._email = email - - @property - def order(self): - """Gets the order of this CreateSubmissionDataRequestData. # noqa: E501 - - - :return: The order of this CreateSubmissionDataRequestData. # noqa: E501 - :rtype: int - """ - return self._order - - @order.setter - def order(self, order): - """Sets the order of this CreateSubmissionDataRequestData. - - - :param order: The order of this CreateSubmissionDataRequestData. # noqa: E501 - :type: int - """ - - self._order = order - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateSubmissionDataRequestData): - return False + CreateSubmissionDataRequestData + """ # noqa: E501 + auth_second_factor_type: Optional[StrictStr] = None + auth_type: Optional[StrictStr] = None + fields: Optional[List[StrictStr]] = None + metadata: Optional[Dict[str, Any]] = None + order: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["auth_second_factor_type", "auth_type", "fields", "metadata", "order"] + + @field_validator('auth_second_factor_type') + def auth_second_factor_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['none', 'phone_number', 'totp', 'mobile_push', 'security_key', 'fingerprint']): + raise ValueError("must be one of enum values ('none', 'phone_number', 'totp', 'mobile_push', 'security_key', 'fingerprint')") + return value + + @field_validator('auth_type') + def auth_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['none', 'password', 'oauth', 'email_link', 'phone_number', 'ldap', 'saml']): + raise ValueError("must be one of enum values ('none', 'password', 'oauth', 'email_link', 'phone_number', 'ldap', 'saml')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateSubmissionDataRequestData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateSubmissionDataRequestData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "auth_second_factor_type": obj.get("auth_second_factor_type"), + "auth_type": obj.get("auth_type"), + "fields": obj.get("fields"), + "metadata": obj.get("metadata"), + "order": obj.get("order") + }) + return _obj - return self.__dict__ == other.__dict__ - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/docspring/models/create_submission_data_request_event_request.py b/docspring/models/create_submission_data_request_event_request.py new file mode 100644 index 0000000..5aa95ff --- /dev/null +++ b/docspring/models/create_submission_data_request_event_request.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class CreateSubmissionDataRequestEventRequest(BaseModel): + """ + CreateSubmissionDataRequestEventRequest + """ # noqa: E501 + event_type: StrictStr + message_type: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["event_type", "message_type"] + + @field_validator('event_type') + def event_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['send_request', 'view_request', 'accepted_terms', 'decline_request', 'sign_request', 'all_completed']): + raise ValueError("must be one of enum values ('send_request', 'view_request', 'accepted_terms', 'decline_request', 'sign_request', 'all_completed')") + return value + + @field_validator('message_type') + def message_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['email', 'sms', 'fax', 'mail', 'slack', 'msteams', 'discord', 'telegram', 'whatsapp']): + raise ValueError("must be one of enum values ('email', 'sms', 'fax', 'mail', 'slack', 'msteams', 'discord', 'telegram', 'whatsapp')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateSubmissionDataRequestEventRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if message_type (nullable) is None + # and model_fields_set contains the field + if self.message_type is None and "message_type" in self.model_fields_set: + _dict['message_type'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateSubmissionDataRequestEventRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "event_type": obj.get("event_type"), + "message_type": obj.get("message_type") + }) + return _obj + + diff --git a/docspring/models/create_submission_data_request_event_response.py b/docspring/models/create_submission_data_request_event_response.py new file mode 100644 index 0000000..2b0349c --- /dev/null +++ b/docspring/models/create_submission_data_request_event_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from docspring.models.submission_data_request_event import SubmissionDataRequestEvent +from typing import Optional, Set +from typing_extensions import Self + +class CreateSubmissionDataRequestEventResponse(BaseModel): + """ + CreateSubmissionDataRequestEventResponse + """ # noqa: E501 + status: StrictStr + event: SubmissionDataRequestEvent + errors: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["status", "event", "errors"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'error']): + raise ValueError("must be one of enum values ('success', 'error')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateSubmissionDataRequestEventResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of event + if self.event: + _dict['event'] = self.event.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateSubmissionDataRequestEventResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "event": SubmissionDataRequestEvent.from_dict(obj["event"]) if obj.get("event") is not None else None, + "errors": obj.get("errors") + }) + return _obj + + diff --git a/docspring/models/create_submission_data_request_response.py b/docspring/models/create_submission_data_request_response.py new file mode 100644 index 0000000..2354f15 --- /dev/null +++ b/docspring/models/create_submission_data_request_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from docspring.models.submission_data_request_show import SubmissionDataRequestShow +from typing import Optional, Set +from typing_extensions import Self + +class CreateSubmissionDataRequestResponse(BaseModel): + """ + CreateSubmissionDataRequestResponse + """ # noqa: E501 + status: StrictStr + data_request: SubmissionDataRequestShow + errors: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["status", "data_request", "errors"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'error']): + raise ValueError("must be one of enum values ('success', 'error')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateSubmissionDataRequestResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data_request + if self.data_request: + _dict['data_request'] = self.data_request.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateSubmissionDataRequestResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "data_request": SubmissionDataRequestShow.from_dict(obj["data_request"]) if obj.get("data_request") is not None else None, + "errors": obj.get("errors") + }) + return _obj + + diff --git a/docspring/models/create_submission_data_request_token_response.py b/docspring/models/create_submission_data_request_token_response.py index b208552..4f511af 100644 --- a/docspring/models/create_submission_data_request_token_response.py +++ b/docspring/models/create_submission_data_request_token_response.py @@ -1,170 +1,102 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - - -class CreateSubmissionDataRequestTokenResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from docspring.models.submission_data_request_token import SubmissionDataRequestToken +from typing import Optional, Set +from typing_extensions import Self +class CreateSubmissionDataRequestTokenResponse(BaseModel): """ - Attributes: - openapi_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. - """ - openapi_types = { - 'errors': 'list[str]', - 'status': 'str', - 'token': 'CreateSubmissionDataRequestTokenResponseToken' - } - - attribute_map = { - 'errors': 'errors', - 'status': 'status', - 'token': 'token' - } - - def __init__(self, errors=None, status=None, token=None): # noqa: E501 - """CreateSubmissionDataRequestTokenResponse - a model defined in OpenAPI""" # noqa: E501 - - self._errors = None - self._status = None - self._token = None - self.discriminator = None - - if errors is not None: - self.errors = errors - if status is not None: - self.status = status - if token is not None: - self.token = token - - @property - def errors(self): - """Gets the errors of this CreateSubmissionDataRequestTokenResponse. # noqa: E501 - - - :return: The errors of this CreateSubmissionDataRequestTokenResponse. # noqa: E501 - :rtype: list[str] - """ - return self._errors - - @errors.setter - def errors(self, errors): - """Sets the errors of this CreateSubmissionDataRequestTokenResponse. - - - :param errors: The errors of this CreateSubmissionDataRequestTokenResponse. # noqa: E501 - :type: list[str] - """ - - self._errors = errors - - @property - def status(self): - """Gets the status of this CreateSubmissionDataRequestTokenResponse. # noqa: E501 - - - :return: The status of this CreateSubmissionDataRequestTokenResponse. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this CreateSubmissionDataRequestTokenResponse. - - - :param status: The status of this CreateSubmissionDataRequestTokenResponse. # noqa: E501 - :type: str + CreateSubmissionDataRequestTokenResponse + """ # noqa: E501 + status: StrictStr + token: SubmissionDataRequestToken + errors: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["status", "token", "errors"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'error']): + raise ValueError("must be one of enum values ('success', 'error')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateSubmissionDataRequestTokenResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - allowed_values = ["success", "error"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of token + if self.token: + _dict['token'] = self.token.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateSubmissionDataRequestTokenResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "token": SubmissionDataRequestToken.from_dict(obj["token"]) if obj.get("token") is not None else None, + "errors": obj.get("errors") + }) + return _obj - @property - def token(self): - """Gets the token of this CreateSubmissionDataRequestTokenResponse. # noqa: E501 - - - :return: The token of this CreateSubmissionDataRequestTokenResponse. # noqa: E501 - :rtype: CreateSubmissionDataRequestTokenResponseToken - """ - return self._token - - @token.setter - def token(self, token): - """Sets the token of this CreateSubmissionDataRequestTokenResponse. - - - :param token: The token of this CreateSubmissionDataRequestTokenResponse. # noqa: E501 - :type: CreateSubmissionDataRequestTokenResponseToken - """ - self._token = token - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateSubmissionDataRequestTokenResponse): - 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/docspring/models/create_submission_data_request_token_response_token.py b/docspring/models/create_submission_data_request_token_response_token.py deleted file mode 100644 index ec4c904..0000000 --- a/docspring/models/create_submission_data_request_token_response_token.py +++ /dev/null @@ -1,190 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class CreateSubmissionDataRequestTokenResponseToken(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'expires_at': 'str', - 'id': 'str', - 'secret': 'str', - 'data_request_url': 'str' - } - - attribute_map = { - 'expires_at': 'expires_at', - 'id': 'id', - 'secret': 'secret', - 'data_request_url': 'data_request_url' - } - - def __init__(self, expires_at=None, id=None, secret=None, data_request_url=None): # noqa: E501 - """CreateSubmissionDataRequestTokenResponseToken - a model defined in OpenAPI""" # noqa: E501 - - self._expires_at = None - self._id = None - self._secret = None - self._data_request_url = None - self.discriminator = None - - if expires_at is not None: - self.expires_at = expires_at - if id is not None: - self.id = id - if secret is not None: - self.secret = secret - if data_request_url is not None: - self.data_request_url = data_request_url - - @property - def expires_at(self): - """Gets the expires_at of this CreateSubmissionDataRequestTokenResponseToken. # noqa: E501 - - - :return: The expires_at of this CreateSubmissionDataRequestTokenResponseToken. # noqa: E501 - :rtype: str - """ - return self._expires_at - - @expires_at.setter - def expires_at(self, expires_at): - """Sets the expires_at of this CreateSubmissionDataRequestTokenResponseToken. - - - :param expires_at: The expires_at of this CreateSubmissionDataRequestTokenResponseToken. # noqa: E501 - :type: str - """ - - self._expires_at = expires_at - - @property - def id(self): - """Gets the id of this CreateSubmissionDataRequestTokenResponseToken. # noqa: E501 - - - :return: The id of this CreateSubmissionDataRequestTokenResponseToken. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this CreateSubmissionDataRequestTokenResponseToken. - - - :param id: The id of this CreateSubmissionDataRequestTokenResponseToken. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def secret(self): - """Gets the secret of this CreateSubmissionDataRequestTokenResponseToken. # noqa: E501 - - - :return: The secret of this CreateSubmissionDataRequestTokenResponseToken. # noqa: E501 - :rtype: str - """ - return self._secret - - @secret.setter - def secret(self, secret): - """Sets the secret of this CreateSubmissionDataRequestTokenResponseToken. - - - :param secret: The secret of this CreateSubmissionDataRequestTokenResponseToken. # noqa: E501 - :type: str - """ - - self._secret = secret - - @property - def data_request_url(self): - """Gets the data_request_url of this CreateSubmissionDataRequestTokenResponseToken. # noqa: E501 - - - :return: The data_request_url of this CreateSubmissionDataRequestTokenResponseToken. # noqa: E501 - :rtype: str - """ - return self._data_request_url - - @data_request_url.setter - def data_request_url(self, data_request_url): - """Sets the data_request_url of this CreateSubmissionDataRequestTokenResponseToken. - - - :param data_request_url: The data_request_url of this CreateSubmissionDataRequestTokenResponseToken. # noqa: E501 - :type: str - """ - - self._data_request_url = data_request_url - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateSubmissionDataRequestTokenResponseToken): - 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/docspring/models/create_submission_response.py b/docspring/models/create_submission_response.py index d802612..8543660 100644 --- a/docspring/models/create_submission_response.py +++ b/docspring/models/create_submission_response.py @@ -1,170 +1,102 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - - -class CreateSubmissionResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from docspring.models.submission_preview import SubmissionPreview +from typing import Optional, Set +from typing_extensions import Self +class CreateSubmissionResponse(BaseModel): """ - Attributes: - openapi_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. - """ - openapi_types = { - 'submission': 'Submission', - 'errors': 'list[str]', - 'status': 'str' - } - - attribute_map = { - 'submission': 'submission', - 'errors': 'errors', - 'status': 'status' - } - - def __init__(self, submission=None, errors=None, status=None): # noqa: E501 - """CreateSubmissionResponse - a model defined in OpenAPI""" # noqa: E501 - - self._submission = None - self._errors = None - self._status = None - self.discriminator = None - - if submission is not None: - self.submission = submission - if errors is not None: - self.errors = errors - if status is not None: - self.status = status - - @property - def submission(self): - """Gets the submission of this CreateSubmissionResponse. # noqa: E501 - - - :return: The submission of this CreateSubmissionResponse. # noqa: E501 - :rtype: Submission + CreateSubmissionResponse + """ # noqa: E501 + status: StrictStr + submission: SubmissionPreview + errors: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["status", "submission", "errors"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'error']): + raise ValueError("must be one of enum values ('success', 'error')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateSubmissionResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return self._submission - - @submission.setter - def submission(self, submission): - """Sets the submission of this CreateSubmissionResponse. - - - :param submission: The submission of this CreateSubmissionResponse. # noqa: E501 - :type: Submission - """ - - self._submission = submission - - @property - def errors(self): - """Gets the errors of this CreateSubmissionResponse. # noqa: E501 + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of submission + if self.submission: + _dict['submission'] = self.submission.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateSubmissionResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "submission": SubmissionPreview.from_dict(obj["submission"]) if obj.get("submission") is not None else None, + "errors": obj.get("errors") + }) + return _obj - :return: The errors of this CreateSubmissionResponse. # noqa: E501 - :rtype: list[str] - """ - return self._errors - - @errors.setter - def errors(self, errors): - """Sets the errors of this CreateSubmissionResponse. - - - :param errors: The errors of this CreateSubmissionResponse. # noqa: E501 - :type: list[str] - """ - - self._errors = errors - - @property - def status(self): - """Gets the status of this CreateSubmissionResponse. # noqa: E501 - - - :return: The status of this CreateSubmissionResponse. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this CreateSubmissionResponse. - - - :param status: The status of this CreateSubmissionResponse. # noqa: E501 - :type: str - """ - allowed_values = ["success", "error"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateSubmissionResponse): - 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/docspring/models/create_template_from_upload_data.py b/docspring/models/create_template_from_upload_data.py deleted file mode 100644 index b80fac8..0000000 --- a/docspring/models/create_template_from_upload_data.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class CreateTemplateFromUploadData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'template': 'UploadTemplateData' - } - - attribute_map = { - 'template': 'template' - } - - def __init__(self, template=None): # noqa: E501 - """CreateTemplateFromUploadData - a model defined in OpenAPI""" # noqa: E501 - - self._template = None - self.discriminator = None - - self.template = template - - @property - def template(self): - """Gets the template of this CreateTemplateFromUploadData. # noqa: E501 - - - :return: The template of this CreateTemplateFromUploadData. # noqa: E501 - :rtype: UploadTemplateData - """ - return self._template - - @template.setter - def template(self, template): - """Sets the template of this CreateTemplateFromUploadData. - - - :param template: The template of this CreateTemplateFromUploadData. # noqa: E501 - :type: UploadTemplateData - """ - if template is None: - raise ValueError("Invalid value for `template`, must not be `None`") # noqa: E501 - - self._template = template - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CreateTemplateFromUploadData): - 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/docspring/models/custom_file.py b/docspring/models/custom_file.py index ee04c11..3fb52b5 100644 --- a/docspring/models/custom_file.py +++ b/docspring/models/custom_file.py @@ -1,138 +1,99 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - - -class CustomFile(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +class CustomFile(BaseModel): """ - Attributes: - openapi_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. - """ - openapi_types = { - 'id': 'str', - 'url': 'str' - } - - attribute_map = { - 'id': 'id', - 'url': 'url' - } - - def __init__(self, id=None, url=None): # noqa: E501 - """CustomFile - a model defined in OpenAPI""" # noqa: E501 - - self._id = None - self._url = None - self.discriminator = None - - if id is not None: - self.id = id - if url is not None: - self.url = url - - @property - def id(self): - """Gets the id of this CustomFile. # noqa: E501 - - - :return: The id of this CustomFile. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this CustomFile. - - - :param id: The id of this CustomFile. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def url(self): - """Gets the url of this CustomFile. # noqa: E501 - - - :return: The url of this CustomFile. # noqa: E501 - :rtype: str + CustomFile + """ # noqa: E501 + id: Optional[StrictStr] + url: Optional[StrictStr] + __properties: ClassVar[List[str]] = ["id", "url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CustomFile from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return self._url + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if url (nullable) is None + # and model_fields_set contains the field + if self.url is None and "url" in self.model_fields_set: + _dict['url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CustomFile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "url": obj.get("url") + }) + return _obj - @url.setter - def url(self, url): - """Sets the url of this CustomFile. - - - :param url: The url of this CustomFile. # noqa: E501 - :type: str - """ - self._url = url - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, CustomFile): - 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/docspring/models/error.py b/docspring/models/error.py deleted file mode 100644 index 2a7ea00..0000000 --- a/docspring/models/error.py +++ /dev/null @@ -1,146 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Error(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'status': 'str', - 'error': 'str' - } - - attribute_map = { - 'status': 'status', - 'error': 'error' - } - - def __init__(self, status=None, error=None): # noqa: E501 - """Error - a model defined in OpenAPI""" # noqa: E501 - - self._status = None - self._error = None - self.discriminator = None - - self.status = status - self.error = error - - @property - def status(self): - """Gets the status of this Error. # noqa: E501 - - - :return: The status of this Error. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this Error. - - - :param status: The status of this Error. # noqa: E501 - :type: str - """ - if status is None: - raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 - allowed_values = ["error"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - @property - def error(self): - """Gets the error of this Error. # noqa: E501 - - - :return: The error of this Error. # noqa: E501 - :rtype: str - """ - return self._error - - @error.setter - def error(self, error): - """Sets the error of this Error. - - - :param error: The error of this Error. # noqa: E501 - :type: str - """ - if error is None: - raise ValueError("Invalid value for `error`, must not be `None`") # noqa: E501 - - self._error = error - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, Error): - 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/docspring/models/error_response.py b/docspring/models/error_response.py new file mode 100644 index 0000000..08ddbdb --- /dev/null +++ b/docspring/models/error_response.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class ErrorResponse(BaseModel): + """ + ErrorResponse + """ # noqa: E501 + status: StrictStr + error: StrictStr + __properties: ClassVar[List[str]] = ["status", "error"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['error']): + raise ValueError("must be one of enum values ('error')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ErrorResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "error": obj.get("error") + }) + return _obj + + diff --git a/docspring/models/folder.py b/docspring/models/folder.py index b5990b6..034eebf 100644 --- a/docspring/models/folder.py +++ b/docspring/models/folder.py @@ -1,189 +1,113 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - - -class Folder(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +class Folder(BaseModel): """ - Attributes: - openapi_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. - """ - openapi_types = { - 'path': 'str', - 'parent_folder_id': 'str', - 'name': 'str', - 'id': 'str' - } - - attribute_map = { - 'path': 'path', - 'parent_folder_id': 'parent_folder_id', - 'name': 'name', - 'id': 'id' - } - - def __init__(self, path=None, parent_folder_id=None, name=None, id=None): # noqa: E501 - """Folder - a model defined in OpenAPI""" # noqa: E501 - - self._path = None - self._parent_folder_id = None - self._name = None - self._id = None - self.discriminator = None - - if path is not None: - self.path = path - self.parent_folder_id = parent_folder_id - if name is not None: - self.name = name - if id is not None: - self.id = id - - @property - def path(self): - """Gets the path of this Folder. # noqa: E501 - - - :return: The path of this Folder. # noqa: E501 - :rtype: str - """ - return self._path - - @path.setter - def path(self, path): - """Sets the path of this Folder. - - - :param path: The path of this Folder. # noqa: E501 - :type: str - """ - - self._path = path - - @property - def parent_folder_id(self): - """Gets the parent_folder_id of this Folder. # noqa: E501 - - - :return: The parent_folder_id of this Folder. # noqa: E501 - :rtype: str + Folder + """ # noqa: E501 + id: Optional[StrictStr] + name: Optional[StrictStr] + path: Optional[StrictStr] + parent_folder_id: Optional[StrictStr] + __properties: ClassVar[List[str]] = ["id", "name", "path", "parent_folder_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Folder from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return self._parent_folder_id - - @parent_folder_id.setter - def parent_folder_id(self, parent_folder_id): - """Sets the parent_folder_id of this Folder. - + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if path (nullable) is None + # and model_fields_set contains the field + if self.path is None and "path" in self.model_fields_set: + _dict['path'] = None + + # set to None if parent_folder_id (nullable) is None + # and model_fields_set contains the field + if self.parent_folder_id is None and "parent_folder_id" in self.model_fields_set: + _dict['parent_folder_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Folder from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "path": obj.get("path"), + "parent_folder_id": obj.get("parent_folder_id") + }) + return _obj - :param parent_folder_id: The parent_folder_id of this Folder. # noqa: E501 - :type: str - """ - - self._parent_folder_id = parent_folder_id - - @property - def name(self): - """Gets the name of this Folder. # noqa: E501 - - - :return: The name of this Folder. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Folder. - - - :param name: The name of this Folder. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def id(self): - """Gets the id of this Folder. # noqa: E501 - - - :return: The id of this Folder. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Folder. - - - :param id: The id of this Folder. # noqa: E501 - :type: str - """ - self._id = id - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, Folder): - 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/docspring/models/folders_folder.py b/docspring/models/folders_folder.py deleted file mode 100644 index 8a7d7c7..0000000 --- a/docspring/models/folders_folder.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class FoldersFolder(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'parent_folder_id': 'str', - 'name': 'str' - } - - attribute_map = { - 'parent_folder_id': 'parent_folder_id', - 'name': 'name' - } - - def __init__(self, parent_folder_id=None, name=None): # noqa: E501 - """FoldersFolder - a model defined in OpenAPI""" # noqa: E501 - - self._parent_folder_id = None - self._name = None - self.discriminator = None - - if parent_folder_id is not None: - self.parent_folder_id = parent_folder_id - if name is not None: - self.name = name - - @property - def parent_folder_id(self): - """Gets the parent_folder_id of this FoldersFolder. # noqa: E501 - - - :return: The parent_folder_id of this FoldersFolder. # noqa: E501 - :rtype: str - """ - return self._parent_folder_id - - @parent_folder_id.setter - def parent_folder_id(self, parent_folder_id): - """Sets the parent_folder_id of this FoldersFolder. - - - :param parent_folder_id: The parent_folder_id of this FoldersFolder. # noqa: E501 - :type: str - """ - - self._parent_folder_id = parent_folder_id - - @property - def name(self): - """Gets the name of this FoldersFolder. # noqa: E501 - - - :return: The name of this FoldersFolder. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this FoldersFolder. - - - :param name: The name of this FoldersFolder. # noqa: E501 - :type: str - """ - - self._name = name - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, FoldersFolder): - 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/docspring/models/html_template_data.py b/docspring/models/html_template_data.py deleted file mode 100644 index cf54be7..0000000 --- a/docspring/models/html_template_data.py +++ /dev/null @@ -1,531 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class HtmlTemplateData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'expiration_interval': 'str', - 'webhook_url': 'str', - 'scss': 'str', - 'allow_additional_properties': 'bool', - 'expire_after': 'float', - 'description': 'str', - 'public_submissions': 'bool', - 'slack_webhook_url': 'str', - 'header_html': 'str', - 'public_web_form': 'bool', - 'editable_submissions': 'bool', - 'expire_submissions': 'bool', - 'name': 'str', - 'footer_html': 'str', - 'html': 'str', - 'template_type': 'str', - 'redirect_url': 'str' - } - - attribute_map = { - 'expiration_interval': 'expiration_interval', - 'webhook_url': 'webhook_url', - 'scss': 'scss', - 'allow_additional_properties': 'allow_additional_properties', - 'expire_after': 'expire_after', - 'description': 'description', - 'public_submissions': 'public_submissions', - 'slack_webhook_url': 'slack_webhook_url', - 'header_html': 'header_html', - 'public_web_form': 'public_web_form', - 'editable_submissions': 'editable_submissions', - 'expire_submissions': 'expire_submissions', - 'name': 'name', - 'footer_html': 'footer_html', - 'html': 'html', - 'template_type': 'template_type', - 'redirect_url': 'redirect_url' - } - - def __init__(self, expiration_interval=None, webhook_url=None, scss=None, allow_additional_properties=None, expire_after=None, description=None, public_submissions=None, slack_webhook_url=None, header_html=None, public_web_form=None, editable_submissions=None, expire_submissions=None, name=None, footer_html=None, html=None, template_type=None, redirect_url=None): # noqa: E501 - """HtmlTemplateData - a model defined in OpenAPI""" # noqa: E501 - - self._expiration_interval = None - self._webhook_url = None - self._scss = None - self._allow_additional_properties = None - self._expire_after = None - self._description = None - self._public_submissions = None - self._slack_webhook_url = None - self._header_html = None - self._public_web_form = None - self._editable_submissions = None - self._expire_submissions = None - self._name = None - self._footer_html = None - self._html = None - self._template_type = None - self._redirect_url = None - self.discriminator = None - - if expiration_interval is not None: - self.expiration_interval = expiration_interval - self.webhook_url = webhook_url - self.scss = scss - if allow_additional_properties is not None: - self.allow_additional_properties = allow_additional_properties - if expire_after is not None: - self.expire_after = expire_after - self.description = description - if public_submissions is not None: - self.public_submissions = public_submissions - self.slack_webhook_url = slack_webhook_url - self.header_html = header_html - if public_web_form is not None: - self.public_web_form = public_web_form - if editable_submissions is not None: - self.editable_submissions = editable_submissions - if expire_submissions is not None: - self.expire_submissions = expire_submissions - self.name = name - self.footer_html = footer_html - self.html = html - if template_type is not None: - self.template_type = template_type - self.redirect_url = redirect_url - - @property - def expiration_interval(self): - """Gets the expiration_interval of this HtmlTemplateData. # noqa: E501 - - - :return: The expiration_interval of this HtmlTemplateData. # noqa: E501 - :rtype: str - """ - return self._expiration_interval - - @expiration_interval.setter - def expiration_interval(self, expiration_interval): - """Sets the expiration_interval of this HtmlTemplateData. - - - :param expiration_interval: The expiration_interval of this HtmlTemplateData. # noqa: E501 - :type: str - """ - allowed_values = ["minutes", "hours", "days"] # noqa: E501 - if expiration_interval not in allowed_values: - raise ValueError( - "Invalid value for `expiration_interval` ({0}), must be one of {1}" # noqa: E501 - .format(expiration_interval, allowed_values) - ) - - self._expiration_interval = expiration_interval - - @property - def webhook_url(self): - """Gets the webhook_url of this HtmlTemplateData. # noqa: E501 - - - :return: The webhook_url of this HtmlTemplateData. # noqa: E501 - :rtype: str - """ - return self._webhook_url - - @webhook_url.setter - def webhook_url(self, webhook_url): - """Sets the webhook_url of this HtmlTemplateData. - - - :param webhook_url: The webhook_url of this HtmlTemplateData. # noqa: E501 - :type: str - """ - - self._webhook_url = webhook_url - - @property - def scss(self): - """Gets the scss of this HtmlTemplateData. # noqa: E501 - - - :return: The scss of this HtmlTemplateData. # noqa: E501 - :rtype: str - """ - return self._scss - - @scss.setter - def scss(self, scss): - """Sets the scss of this HtmlTemplateData. - - - :param scss: The scss of this HtmlTemplateData. # noqa: E501 - :type: str - """ - - self._scss = scss - - @property - def allow_additional_properties(self): - """Gets the allow_additional_properties of this HtmlTemplateData. # noqa: E501 - - - :return: The allow_additional_properties of this HtmlTemplateData. # noqa: E501 - :rtype: bool - """ - return self._allow_additional_properties - - @allow_additional_properties.setter - def allow_additional_properties(self, allow_additional_properties): - """Sets the allow_additional_properties of this HtmlTemplateData. - - - :param allow_additional_properties: The allow_additional_properties of this HtmlTemplateData. # noqa: E501 - :type: bool - """ - - self._allow_additional_properties = allow_additional_properties - - @property - def expire_after(self): - """Gets the expire_after of this HtmlTemplateData. # noqa: E501 - - - :return: The expire_after of this HtmlTemplateData. # noqa: E501 - :rtype: float - """ - return self._expire_after - - @expire_after.setter - def expire_after(self, expire_after): - """Sets the expire_after of this HtmlTemplateData. - - - :param expire_after: The expire_after of this HtmlTemplateData. # noqa: E501 - :type: float - """ - - self._expire_after = expire_after - - @property - def description(self): - """Gets the description of this HtmlTemplateData. # noqa: E501 - - - :return: The description of this HtmlTemplateData. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this HtmlTemplateData. - - - :param description: The description of this HtmlTemplateData. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def public_submissions(self): - """Gets the public_submissions of this HtmlTemplateData. # noqa: E501 - - - :return: The public_submissions of this HtmlTemplateData. # noqa: E501 - :rtype: bool - """ - return self._public_submissions - - @public_submissions.setter - def public_submissions(self, public_submissions): - """Sets the public_submissions of this HtmlTemplateData. - - - :param public_submissions: The public_submissions of this HtmlTemplateData. # noqa: E501 - :type: bool - """ - - self._public_submissions = public_submissions - - @property - def slack_webhook_url(self): - """Gets the slack_webhook_url of this HtmlTemplateData. # noqa: E501 - - - :return: The slack_webhook_url of this HtmlTemplateData. # noqa: E501 - :rtype: str - """ - return self._slack_webhook_url - - @slack_webhook_url.setter - def slack_webhook_url(self, slack_webhook_url): - """Sets the slack_webhook_url of this HtmlTemplateData. - - - :param slack_webhook_url: The slack_webhook_url of this HtmlTemplateData. # noqa: E501 - :type: str - """ - - self._slack_webhook_url = slack_webhook_url - - @property - def header_html(self): - """Gets the header_html of this HtmlTemplateData. # noqa: E501 - - - :return: The header_html of this HtmlTemplateData. # noqa: E501 - :rtype: str - """ - return self._header_html - - @header_html.setter - def header_html(self, header_html): - """Sets the header_html of this HtmlTemplateData. - - - :param header_html: The header_html of this HtmlTemplateData. # noqa: E501 - :type: str - """ - - self._header_html = header_html - - @property - def public_web_form(self): - """Gets the public_web_form of this HtmlTemplateData. # noqa: E501 - - - :return: The public_web_form of this HtmlTemplateData. # noqa: E501 - :rtype: bool - """ - return self._public_web_form - - @public_web_form.setter - def public_web_form(self, public_web_form): - """Sets the public_web_form of this HtmlTemplateData. - - - :param public_web_form: The public_web_form of this HtmlTemplateData. # noqa: E501 - :type: bool - """ - - self._public_web_form = public_web_form - - @property - def editable_submissions(self): - """Gets the editable_submissions of this HtmlTemplateData. # noqa: E501 - - - :return: The editable_submissions of this HtmlTemplateData. # noqa: E501 - :rtype: bool - """ - return self._editable_submissions - - @editable_submissions.setter - def editable_submissions(self, editable_submissions): - """Sets the editable_submissions of this HtmlTemplateData. - - - :param editable_submissions: The editable_submissions of this HtmlTemplateData. # noqa: E501 - :type: bool - """ - - self._editable_submissions = editable_submissions - - @property - def expire_submissions(self): - """Gets the expire_submissions of this HtmlTemplateData. # noqa: E501 - - - :return: The expire_submissions of this HtmlTemplateData. # noqa: E501 - :rtype: bool - """ - return self._expire_submissions - - @expire_submissions.setter - def expire_submissions(self, expire_submissions): - """Sets the expire_submissions of this HtmlTemplateData. - - - :param expire_submissions: The expire_submissions of this HtmlTemplateData. # noqa: E501 - :type: bool - """ - - self._expire_submissions = expire_submissions - - @property - def name(self): - """Gets the name of this HtmlTemplateData. # noqa: E501 - - - :return: The name of this HtmlTemplateData. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this HtmlTemplateData. - - - :param name: The name of this HtmlTemplateData. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def footer_html(self): - """Gets the footer_html of this HtmlTemplateData. # noqa: E501 - - - :return: The footer_html of this HtmlTemplateData. # noqa: E501 - :rtype: str - """ - return self._footer_html - - @footer_html.setter - def footer_html(self, footer_html): - """Sets the footer_html of this HtmlTemplateData. - - - :param footer_html: The footer_html of this HtmlTemplateData. # noqa: E501 - :type: str - """ - - self._footer_html = footer_html - - @property - def html(self): - """Gets the html of this HtmlTemplateData. # noqa: E501 - - - :return: The html of this HtmlTemplateData. # noqa: E501 - :rtype: str - """ - return self._html - - @html.setter - def html(self, html): - """Sets the html of this HtmlTemplateData. - - - :param html: The html of this HtmlTemplateData. # noqa: E501 - :type: str - """ - - self._html = html - - @property - def template_type(self): - """Gets the template_type of this HtmlTemplateData. # noqa: E501 - - - :return: The template_type of this HtmlTemplateData. # noqa: E501 - :rtype: str - """ - return self._template_type - - @template_type.setter - def template_type(self, template_type): - """Sets the template_type of this HtmlTemplateData. - - - :param template_type: The template_type of this HtmlTemplateData. # noqa: E501 - :type: str - """ - allowed_values = ["pdf", "html"] # noqa: E501 - if template_type not in allowed_values: - raise ValueError( - "Invalid value for `template_type` ({0}), must be one of {1}" # noqa: E501 - .format(template_type, allowed_values) - ) - - self._template_type = template_type - - @property - def redirect_url(self): - """Gets the redirect_url of this HtmlTemplateData. # noqa: E501 - - - :return: The redirect_url of this HtmlTemplateData. # noqa: E501 - :rtype: str - """ - return self._redirect_url - - @redirect_url.setter - def redirect_url(self, redirect_url): - """Sets the redirect_url of this HtmlTemplateData. - - - :param redirect_url: The redirect_url of this HtmlTemplateData. # noqa: E501 - :type: str - """ - - self._redirect_url = redirect_url - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, HtmlTemplateData): - 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/docspring/models/invalid_request.py b/docspring/models/invalid_request.py deleted file mode 100644 index 85fdc02..0000000 --- a/docspring/models/invalid_request.py +++ /dev/null @@ -1,146 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class InvalidRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'status': 'str', - 'errors': 'list[str]' - } - - attribute_map = { - 'status': 'status', - 'errors': 'errors' - } - - def __init__(self, status=None, errors=None): # noqa: E501 - """InvalidRequest - a model defined in OpenAPI""" # noqa: E501 - - self._status = None - self._errors = None - self.discriminator = None - - self.status = status - self.errors = errors - - @property - def status(self): - """Gets the status of this InvalidRequest. # noqa: E501 - - - :return: The status of this InvalidRequest. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this InvalidRequest. - - - :param status: The status of this InvalidRequest. # noqa: E501 - :type: str - """ - if status is None: - raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 - allowed_values = ["error"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - @property - def errors(self): - """Gets the errors of this InvalidRequest. # noqa: E501 - - - :return: The errors of this InvalidRequest. # noqa: E501 - :rtype: list[str] - """ - return self._errors - - @errors.setter - def errors(self, errors): - """Sets the errors of this InvalidRequest. - - - :param errors: The errors of this InvalidRequest. # noqa: E501 - :type: list[str] - """ - if errors is None: - raise ValueError("Invalid value for `errors`, must not be `None`") # noqa: E501 - - self._errors = errors - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, InvalidRequest): - 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/docspring/models/json_schema.py b/docspring/models/json_schema.py new file mode 100644 index 0000000..6cf735c --- /dev/null +++ b/docspring/models/json_schema.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class JsonSchema(BaseModel): + """ + JsonSchema + """ # noqa: E501 + var_schema: Optional[StrictStr] = Field(default=None, alias="$schema") + id: Optional[StrictStr] = None + title: Optional[StrictStr] = None + description: Optional[StrictStr] = None + definitions: Optional[Dict[str, Any]] = None + type: Optional[StrictStr] = None + properties: Optional[Dict[str, Any]] = None + additional_properties: Optional[StrictBool] = Field(default=None, alias="additionalProperties") + required: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["$schema", "id", "title", "description", "definitions", "type", "properties", "additionalProperties", "required"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of JsonSchema from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of JsonSchema from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "$schema": obj.get("$schema"), + "id": obj.get("id"), + "title": obj.get("title"), + "description": obj.get("description"), + "definitions": obj.get("definitions"), + "type": obj.get("type"), + "properties": obj.get("properties"), + "additionalProperties": obj.get("additionalProperties"), + "required": obj.get("required") + }) + return _obj + + diff --git a/docspring/models/list_submissions_response.py b/docspring/models/list_submissions_response.py index 46e266b..e8666e9 100644 --- a/docspring/models/list_submissions_response.py +++ b/docspring/models/list_submissions_response.py @@ -1,163 +1,104 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - - -class ListSubmissionsResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from docspring.models.submission import Submission +from typing import Optional, Set +from typing_extensions import Self +class ListSubmissionsResponse(BaseModel): """ - Attributes: - openapi_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. - """ - openapi_types = { - 'next_cursor': 'str', - 'submissions': 'list[Submission]', - 'limit': 'float' - } - - attribute_map = { - 'next_cursor': 'next_cursor', - 'submissions': 'submissions', - 'limit': 'limit' - } - - def __init__(self, next_cursor=None, submissions=None, limit=None): # noqa: E501 - """ListSubmissionsResponse - a model defined in OpenAPI""" # noqa: E501 - - self._next_cursor = None - self._submissions = None - self._limit = None - self.discriminator = None - - self.next_cursor = next_cursor - if submissions is not None: - self.submissions = submissions - if limit is not None: - self.limit = limit - - @property - def next_cursor(self): - """Gets the next_cursor of this ListSubmissionsResponse. # noqa: E501 - - - :return: The next_cursor of this ListSubmissionsResponse. # noqa: E501 - :rtype: str - """ - return self._next_cursor - - @next_cursor.setter - def next_cursor(self, next_cursor): - """Sets the next_cursor of this ListSubmissionsResponse. - - - :param next_cursor: The next_cursor of this ListSubmissionsResponse. # noqa: E501 - :type: str - """ - - self._next_cursor = next_cursor - - @property - def submissions(self): - """Gets the submissions of this ListSubmissionsResponse. # noqa: E501 - - - :return: The submissions of this ListSubmissionsResponse. # noqa: E501 - :rtype: list[Submission] - """ - return self._submissions - - @submissions.setter - def submissions(self, submissions): - """Sets the submissions of this ListSubmissionsResponse. - - - :param submissions: The submissions of this ListSubmissionsResponse. # noqa: E501 - :type: list[Submission] + ListSubmissionsResponse + """ # noqa: E501 + submissions: List[Submission] + limit: Union[StrictFloat, StrictInt] + next_cursor: Optional[StrictStr] + __properties: ClassVar[List[str]] = ["submissions", "limit", "next_cursor"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ListSubmissionsResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in submissions (list) + _items = [] + if self.submissions: + for _item_submissions in self.submissions: + if _item_submissions: + _items.append(_item_submissions.to_dict()) + _dict['submissions'] = _items + # set to None if next_cursor (nullable) is None + # and model_fields_set contains the field + if self.next_cursor is None and "next_cursor" in self.model_fields_set: + _dict['next_cursor'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListSubmissionsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "submissions": [Submission.from_dict(_item) for _item in obj["submissions"]] if obj.get("submissions") is not None else None, + "limit": obj.get("limit"), + "next_cursor": obj.get("next_cursor") + }) + return _obj - self._submissions = submissions - - @property - def limit(self): - """Gets the limit of this ListSubmissionsResponse. # noqa: E501 - - - :return: The limit of this ListSubmissionsResponse. # noqa: E501 - :rtype: float - """ - return self._limit - - @limit.setter - def limit(self, limit): - """Sets the limit of this ListSubmissionsResponse. - - - :param limit: The limit of this ListSubmissionsResponse. # noqa: E501 - :type: float - """ - self._limit = limit - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, ListSubmissionsResponse): - 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/docspring/models/move_folder_data.py b/docspring/models/move_folder_data.py index f4eefd4..0ed1950 100644 --- a/docspring/models/move_folder_data.py +++ b/docspring/models/move_folder_data.py @@ -1,112 +1,87 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self - -class MoveFolderData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. +class MoveFolderData(BaseModel): """ + MoveFolderData + """ # noqa: E501 + parent_folder_id: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["parent_folder_id"] - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'parent_folder_id': 'str' - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'parent_folder_id': 'parent_folder_id' - } - def __init__(self, parent_folder_id=None): # noqa: E501 - """MoveFolderData - a model defined in OpenAPI""" # noqa: E501 + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - self._parent_folder_id = None - self.discriminator = None + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - if parent_folder_id is not None: - self.parent_folder_id = parent_folder_id + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MoveFolderData from a JSON string""" + return cls.from_dict(json.loads(json_str)) - @property - def parent_folder_id(self): - """Gets the parent_folder_id of this MoveFolderData. # noqa: E501 + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - :return: The parent_folder_id of this MoveFolderData. # noqa: E501 - :rtype: str + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return self._parent_folder_id + excluded_fields: Set[str] = set([ + ]) - @parent_folder_id.setter - def parent_folder_id(self, parent_folder_id): - """Sets the parent_folder_id of this MoveFolderData. + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MoveFolderData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "parent_folder_id": obj.get("parent_folder_id") + }) + return _obj - :param parent_folder_id: The parent_folder_id of this MoveFolderData. # noqa: E501 - :type: str - """ - self._parent_folder_id = parent_folder_id - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, MoveFolderData): - 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/docspring/models/move_template_data.py b/docspring/models/move_template_data.py index 1122705..1f4f432 100644 --- a/docspring/models/move_template_data.py +++ b/docspring/models/move_template_data.py @@ -1,113 +1,87 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self - -class MoveTemplateData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. +class MoveTemplateData(BaseModel): """ + MoveTemplateData + """ # noqa: E501 + parent_folder_id: StrictStr + __properties: ClassVar[List[str]] = ["parent_folder_id"] - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'parent_folder_id': 'str' - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'parent_folder_id': 'parent_folder_id' - } - def __init__(self, parent_folder_id=None): # noqa: E501 - """MoveTemplateData - a model defined in OpenAPI""" # noqa: E501 + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - self._parent_folder_id = None - self.discriminator = None + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - self.parent_folder_id = parent_folder_id + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MoveTemplateData from a JSON string""" + return cls.from_dict(json.loads(json_str)) - @property - def parent_folder_id(self): - """Gets the parent_folder_id of this MoveTemplateData. # noqa: E501 + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - :return: The parent_folder_id of this MoveTemplateData. # noqa: E501 - :rtype: str + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return self._parent_folder_id + excluded_fields: Set[str] = set([ + ]) - @parent_folder_id.setter - def parent_folder_id(self, parent_folder_id): - """Sets the parent_folder_id of this MoveTemplateData. + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MoveTemplateData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "parent_folder_id": obj.get("parent_folder_id") + }) + return _obj - :param parent_folder_id: The parent_folder_id of this MoveTemplateData. # noqa: E501 - :type: str - """ - if parent_folder_id is None: - raise ValueError("Invalid value for `parent_folder_id`, must not be `None`") # noqa: E501 - - self._parent_folder_id = parent_folder_id - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, MoveTemplateData): - 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/docspring/models/multiple_errors_response.py b/docspring/models/multiple_errors_response.py new file mode 100644 index 0000000..68bb33b --- /dev/null +++ b/docspring/models/multiple_errors_response.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class MultipleErrorsResponse(BaseModel): + """ + MultipleErrorsResponse + """ # noqa: E501 + status: StrictStr + errors: List[StrictStr] + __properties: ClassVar[List[str]] = ["status", "errors"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['error']): + raise ValueError("must be one of enum values ('error')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MultipleErrorsResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MultipleErrorsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "errors": obj.get("errors") + }) + return _obj + + diff --git a/docspring/models/pending_template.py b/docspring/models/pending_template.py deleted file mode 100644 index 5ce6e40..0000000 --- a/docspring/models/pending_template.py +++ /dev/null @@ -1,528 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class PendingTemplate(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'expiration_interval': 'str', - 'webhook_url': 'str', - 'parent_folder_id': 'str', - 'expire_after': 'float', - 'allow_additional_properties': 'bool', - 'description': 'str', - 'public_submissions': 'bool', - 'slack_webhook_url': 'str', - 'path': 'str', - 'public_web_form': 'bool', - 'editable_submissions': 'bool', - 'expire_submissions': 'bool', - 'name': 'str', - 'template_type': 'str', - 'id': 'str', - 'locked': 'bool', - 'redirect_url': 'str' - } - - attribute_map = { - 'expiration_interval': 'expiration_interval', - 'webhook_url': 'webhook_url', - 'parent_folder_id': 'parent_folder_id', - 'expire_after': 'expire_after', - 'allow_additional_properties': 'allow_additional_properties', - 'description': 'description', - 'public_submissions': 'public_submissions', - 'slack_webhook_url': 'slack_webhook_url', - 'path': 'path', - 'public_web_form': 'public_web_form', - 'editable_submissions': 'editable_submissions', - 'expire_submissions': 'expire_submissions', - 'name': 'name', - 'template_type': 'template_type', - 'id': 'id', - 'locked': 'locked', - 'redirect_url': 'redirect_url' - } - - def __init__(self, expiration_interval=None, webhook_url=None, parent_folder_id=None, expire_after=None, allow_additional_properties=None, description=None, public_submissions=None, slack_webhook_url=None, path=None, public_web_form=None, editable_submissions=None, expire_submissions=None, name=None, template_type=None, id=None, locked=None, redirect_url=None): # noqa: E501 - """PendingTemplate - a model defined in OpenAPI""" # noqa: E501 - - self._expiration_interval = None - self._webhook_url = None - self._parent_folder_id = None - self._expire_after = None - self._allow_additional_properties = None - self._description = None - self._public_submissions = None - self._slack_webhook_url = None - self._path = None - self._public_web_form = None - self._editable_submissions = None - self._expire_submissions = None - self._name = None - self._template_type = None - self._id = None - self._locked = None - self._redirect_url = None - self.discriminator = None - - if expiration_interval is not None: - self.expiration_interval = expiration_interval - self.webhook_url = webhook_url - self.parent_folder_id = parent_folder_id - if expire_after is not None: - self.expire_after = expire_after - if allow_additional_properties is not None: - self.allow_additional_properties = allow_additional_properties - self.description = description - if public_submissions is not None: - self.public_submissions = public_submissions - self.slack_webhook_url = slack_webhook_url - if path is not None: - self.path = path - if public_web_form is not None: - self.public_web_form = public_web_form - if editable_submissions is not None: - self.editable_submissions = editable_submissions - if expire_submissions is not None: - self.expire_submissions = expire_submissions - self.name = name - if template_type is not None: - self.template_type = template_type - if id is not None: - self.id = id - if locked is not None: - self.locked = locked - self.redirect_url = redirect_url - - @property - def expiration_interval(self): - """Gets the expiration_interval of this PendingTemplate. # noqa: E501 - - - :return: The expiration_interval of this PendingTemplate. # noqa: E501 - :rtype: str - """ - return self._expiration_interval - - @expiration_interval.setter - def expiration_interval(self, expiration_interval): - """Sets the expiration_interval of this PendingTemplate. - - - :param expiration_interval: The expiration_interval of this PendingTemplate. # noqa: E501 - :type: str - """ - allowed_values = ["minutes", "hours", "days"] # noqa: E501 - if expiration_interval not in allowed_values: - raise ValueError( - "Invalid value for `expiration_interval` ({0}), must be one of {1}" # noqa: E501 - .format(expiration_interval, allowed_values) - ) - - self._expiration_interval = expiration_interval - - @property - def webhook_url(self): - """Gets the webhook_url of this PendingTemplate. # noqa: E501 - - - :return: The webhook_url of this PendingTemplate. # noqa: E501 - :rtype: str - """ - return self._webhook_url - - @webhook_url.setter - def webhook_url(self, webhook_url): - """Sets the webhook_url of this PendingTemplate. - - - :param webhook_url: The webhook_url of this PendingTemplate. # noqa: E501 - :type: str - """ - - self._webhook_url = webhook_url - - @property - def parent_folder_id(self): - """Gets the parent_folder_id of this PendingTemplate. # noqa: E501 - - - :return: The parent_folder_id of this PendingTemplate. # noqa: E501 - :rtype: str - """ - return self._parent_folder_id - - @parent_folder_id.setter - def parent_folder_id(self, parent_folder_id): - """Sets the parent_folder_id of this PendingTemplate. - - - :param parent_folder_id: The parent_folder_id of this PendingTemplate. # noqa: E501 - :type: str - """ - - self._parent_folder_id = parent_folder_id - - @property - def expire_after(self): - """Gets the expire_after of this PendingTemplate. # noqa: E501 - - - :return: The expire_after of this PendingTemplate. # noqa: E501 - :rtype: float - """ - return self._expire_after - - @expire_after.setter - def expire_after(self, expire_after): - """Sets the expire_after of this PendingTemplate. - - - :param expire_after: The expire_after of this PendingTemplate. # noqa: E501 - :type: float - """ - - self._expire_after = expire_after - - @property - def allow_additional_properties(self): - """Gets the allow_additional_properties of this PendingTemplate. # noqa: E501 - - - :return: The allow_additional_properties of this PendingTemplate. # noqa: E501 - :rtype: bool - """ - return self._allow_additional_properties - - @allow_additional_properties.setter - def allow_additional_properties(self, allow_additional_properties): - """Sets the allow_additional_properties of this PendingTemplate. - - - :param allow_additional_properties: The allow_additional_properties of this PendingTemplate. # noqa: E501 - :type: bool - """ - - self._allow_additional_properties = allow_additional_properties - - @property - def description(self): - """Gets the description of this PendingTemplate. # noqa: E501 - - - :return: The description of this PendingTemplate. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this PendingTemplate. - - - :param description: The description of this PendingTemplate. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def public_submissions(self): - """Gets the public_submissions of this PendingTemplate. # noqa: E501 - - - :return: The public_submissions of this PendingTemplate. # noqa: E501 - :rtype: bool - """ - return self._public_submissions - - @public_submissions.setter - def public_submissions(self, public_submissions): - """Sets the public_submissions of this PendingTemplate. - - - :param public_submissions: The public_submissions of this PendingTemplate. # noqa: E501 - :type: bool - """ - - self._public_submissions = public_submissions - - @property - def slack_webhook_url(self): - """Gets the slack_webhook_url of this PendingTemplate. # noqa: E501 - - - :return: The slack_webhook_url of this PendingTemplate. # noqa: E501 - :rtype: str - """ - return self._slack_webhook_url - - @slack_webhook_url.setter - def slack_webhook_url(self, slack_webhook_url): - """Sets the slack_webhook_url of this PendingTemplate. - - - :param slack_webhook_url: The slack_webhook_url of this PendingTemplate. # noqa: E501 - :type: str - """ - - self._slack_webhook_url = slack_webhook_url - - @property - def path(self): - """Gets the path of this PendingTemplate. # noqa: E501 - - - :return: The path of this PendingTemplate. # noqa: E501 - :rtype: str - """ - return self._path - - @path.setter - def path(self, path): - """Sets the path of this PendingTemplate. - - - :param path: The path of this PendingTemplate. # noqa: E501 - :type: str - """ - - self._path = path - - @property - def public_web_form(self): - """Gets the public_web_form of this PendingTemplate. # noqa: E501 - - - :return: The public_web_form of this PendingTemplate. # noqa: E501 - :rtype: bool - """ - return self._public_web_form - - @public_web_form.setter - def public_web_form(self, public_web_form): - """Sets the public_web_form of this PendingTemplate. - - - :param public_web_form: The public_web_form of this PendingTemplate. # noqa: E501 - :type: bool - """ - - self._public_web_form = public_web_form - - @property - def editable_submissions(self): - """Gets the editable_submissions of this PendingTemplate. # noqa: E501 - - - :return: The editable_submissions of this PendingTemplate. # noqa: E501 - :rtype: bool - """ - return self._editable_submissions - - @editable_submissions.setter - def editable_submissions(self, editable_submissions): - """Sets the editable_submissions of this PendingTemplate. - - - :param editable_submissions: The editable_submissions of this PendingTemplate. # noqa: E501 - :type: bool - """ - - self._editable_submissions = editable_submissions - - @property - def expire_submissions(self): - """Gets the expire_submissions of this PendingTemplate. # noqa: E501 - - - :return: The expire_submissions of this PendingTemplate. # noqa: E501 - :rtype: bool - """ - return self._expire_submissions - - @expire_submissions.setter - def expire_submissions(self, expire_submissions): - """Sets the expire_submissions of this PendingTemplate. - - - :param expire_submissions: The expire_submissions of this PendingTemplate. # noqa: E501 - :type: bool - """ - - self._expire_submissions = expire_submissions - - @property - def name(self): - """Gets the name of this PendingTemplate. # noqa: E501 - - - :return: The name of this PendingTemplate. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this PendingTemplate. - - - :param name: The name of this PendingTemplate. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def template_type(self): - """Gets the template_type of this PendingTemplate. # noqa: E501 - - - :return: The template_type of this PendingTemplate. # noqa: E501 - :rtype: str - """ - return self._template_type - - @template_type.setter - def template_type(self, template_type): - """Sets the template_type of this PendingTemplate. - - - :param template_type: The template_type of this PendingTemplate. # noqa: E501 - :type: str - """ - - self._template_type = template_type - - @property - def id(self): - """Gets the id of this PendingTemplate. # noqa: E501 - - - :return: The id of this PendingTemplate. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this PendingTemplate. - - - :param id: The id of this PendingTemplate. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def locked(self): - """Gets the locked of this PendingTemplate. # noqa: E501 - - - :return: The locked of this PendingTemplate. # noqa: E501 - :rtype: bool - """ - return self._locked - - @locked.setter - def locked(self, locked): - """Sets the locked of this PendingTemplate. - - - :param locked: The locked of this PendingTemplate. # noqa: E501 - :type: bool - """ - - self._locked = locked - - @property - def redirect_url(self): - """Gets the redirect_url of this PendingTemplate. # noqa: E501 - - - :return: The redirect_url of this PendingTemplate. # noqa: E501 - :rtype: str - """ - return self._redirect_url - - @redirect_url.setter - def redirect_url(self, redirect_url): - """Sets the redirect_url of this PendingTemplate. - - - :param redirect_url: The redirect_url of this PendingTemplate. # noqa: E501 - :type: str - """ - - self._redirect_url = redirect_url - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, PendingTemplate): - 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/docspring/models/rename_folder_data.py b/docspring/models/rename_folder_data.py index 61cc3a3..0f4383d 100644 --- a/docspring/models/rename_folder_data.py +++ b/docspring/models/rename_folder_data.py @@ -1,113 +1,87 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self - -class RenameFolderData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. +class RenameFolderData(BaseModel): """ + RenameFolderData + """ # noqa: E501 + name: StrictStr + __properties: ClassVar[List[str]] = ["name"] - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'name': 'str' - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - attribute_map = { - 'name': 'name' - } - def __init__(self, name=None): # noqa: E501 - """RenameFolderData - a model defined in OpenAPI""" # noqa: E501 + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - self._name = None - self.discriminator = None + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - self.name = name + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RenameFolderData from a JSON string""" + return cls.from_dict(json.loads(json_str)) - @property - def name(self): - """Gets the name of this RenameFolderData. # noqa: E501 + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - :return: The name of this RenameFolderData. # noqa: E501 - :rtype: str + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return self._name + excluded_fields: Set[str] = set([ + ]) - @name.setter - def name(self, name): - """Sets the name of this RenameFolderData. + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RenameFolderData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name") + }) + return _obj - :param name: The name of this RenameFolderData. # noqa: E501 - :type: str - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, RenameFolderData): - 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/docspring/models/submission.py b/docspring/models/submission.py index 2131bcd..0e4a698 100644 --- a/docspring/models/submission.py +++ b/docspring/models/submission.py @@ -1,580 +1,248 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from docspring.models.submission_action import SubmissionAction +from docspring.models.submission_data_request import SubmissionDataRequest +from typing import Optional, Set +from typing_extensions import Self - -class Submission(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. +class Submission(BaseModel): """ + Submission + """ # noqa: E501 + batch_id: Optional[StrictStr] + data_requests: List[SubmissionDataRequest] + editable: Optional[StrictBool] + expired: StrictBool + expires_at: Optional[StrictStr] + id: Optional[StrictStr] + json_schema_errors: Optional[List[StrictStr]] + metadata: Dict[str, Any] + password: Optional[StrictStr] + processed_at: Optional[StrictStr] + state: StrictStr + template_id: Optional[StrictStr] + test: StrictBool + truncated_text: Optional[Dict[str, Any]] + pdf_hash: Optional[StrictStr] + download_url: Optional[StrictStr] + permanent_download_url: Optional[StrictStr] + preview_download_url: Optional[StrictStr] + preview_generated_at: Optional[StrictStr] + audit_trail_download_url: Optional[StrictStr] + actions: List[SubmissionAction] + source: StrictStr + referrer: Optional[StrictStr] + data: Optional[Dict[str, Any]] + __properties: ClassVar[List[str]] = ["batch_id", "data_requests", "editable", "expired", "expires_at", "id", "json_schema_errors", "metadata", "password", "processed_at", "state", "template_id", "test", "truncated_text", "pdf_hash", "download_url", "permanent_download_url", "preview_download_url", "preview_generated_at", "audit_trail_download_url", "actions", "source", "referrer", "data"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending', 'processed', 'invalid_data', 'error', 'image_download_failed', 'image_processing_failed', 'waiting_for_data_requests', 'syntax_error', 'account_suspended', 'license_revoked', 'accidental']): + raise ValueError("must be one of enum values ('pending', 'processed', 'invalid_data', 'error', 'image_download_failed', 'image_processing_failed', 'waiting_for_data_requests', 'syntax_error', 'account_suspended', 'license_revoked', 'accidental')") + return value + + @field_validator('source') + def source_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['api', 'web', 'reprocess', 'webhook']): + raise ValueError("must be one of enum values ('api', 'web', 'reprocess', 'webhook')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Submission from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data_requests (list) + _items = [] + if self.data_requests: + for _item_data_requests in self.data_requests: + if _item_data_requests: + _items.append(_item_data_requests.to_dict()) + _dict['data_requests'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in actions (list) + _items = [] + if self.actions: + for _item_actions in self.actions: + if _item_actions: + _items.append(_item_actions.to_dict()) + _dict['actions'] = _items + # set to None if batch_id (nullable) is None + # and model_fields_set contains the field + if self.batch_id is None and "batch_id" in self.model_fields_set: + _dict['batch_id'] = None + + # set to None if editable (nullable) is None + # and model_fields_set contains the field + if self.editable is None and "editable" in self.model_fields_set: + _dict['editable'] = None + + # set to None if expires_at (nullable) is None + # and model_fields_set contains the field + if self.expires_at is None and "expires_at" in self.model_fields_set: + _dict['expires_at'] = None + + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if json_schema_errors (nullable) is None + # and model_fields_set contains the field + if self.json_schema_errors is None and "json_schema_errors" in self.model_fields_set: + _dict['json_schema_errors'] = None + + # set to None if password (nullable) is None + # and model_fields_set contains the field + if self.password is None and "password" in self.model_fields_set: + _dict['password'] = None + + # set to None if processed_at (nullable) is None + # and model_fields_set contains the field + if self.processed_at is None and "processed_at" in self.model_fields_set: + _dict['processed_at'] = None + + # set to None if template_id (nullable) is None + # and model_fields_set contains the field + if self.template_id is None and "template_id" in self.model_fields_set: + _dict['template_id'] = None + + # set to None if truncated_text (nullable) is None + # and model_fields_set contains the field + if self.truncated_text is None and "truncated_text" in self.model_fields_set: + _dict['truncated_text'] = None + + # set to None if pdf_hash (nullable) is None + # and model_fields_set contains the field + if self.pdf_hash is None and "pdf_hash" in self.model_fields_set: + _dict['pdf_hash'] = None + + # set to None if download_url (nullable) is None + # and model_fields_set contains the field + if self.download_url is None and "download_url" in self.model_fields_set: + _dict['download_url'] = None + + # set to None if permanent_download_url (nullable) is None + # and model_fields_set contains the field + if self.permanent_download_url is None and "permanent_download_url" in self.model_fields_set: + _dict['permanent_download_url'] = None + + # set to None if preview_download_url (nullable) is None + # and model_fields_set contains the field + if self.preview_download_url is None and "preview_download_url" in self.model_fields_set: + _dict['preview_download_url'] = None + + # set to None if preview_generated_at (nullable) is None + # and model_fields_set contains the field + if self.preview_generated_at is None and "preview_generated_at" in self.model_fields_set: + _dict['preview_generated_at'] = None + + # set to None if audit_trail_download_url (nullable) is None + # and model_fields_set contains the field + if self.audit_trail_download_url is None and "audit_trail_download_url" in self.model_fields_set: + _dict['audit_trail_download_url'] = None + + # set to None if referrer (nullable) is None + # and model_fields_set contains the field + if self.referrer is None and "referrer" in self.model_fields_set: + _dict['referrer'] = None + + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Submission from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "batch_id": obj.get("batch_id"), + "data_requests": [SubmissionDataRequest.from_dict(_item) for _item in obj["data_requests"]] if obj.get("data_requests") is not None else None, + "editable": obj.get("editable"), + "expired": obj.get("expired"), + "expires_at": obj.get("expires_at"), + "id": obj.get("id"), + "json_schema_errors": obj.get("json_schema_errors"), + "metadata": obj.get("metadata"), + "password": obj.get("password"), + "processed_at": obj.get("processed_at"), + "state": obj.get("state"), + "template_id": obj.get("template_id"), + "test": obj.get("test"), + "truncated_text": obj.get("truncated_text"), + "pdf_hash": obj.get("pdf_hash"), + "download_url": obj.get("download_url"), + "permanent_download_url": obj.get("permanent_download_url"), + "preview_download_url": obj.get("preview_download_url"), + "preview_generated_at": obj.get("preview_generated_at"), + "audit_trail_download_url": obj.get("audit_trail_download_url"), + "actions": [SubmissionAction.from_dict(_item) for _item in obj["actions"]] if obj.get("actions") is not None else None, + "source": obj.get("source"), + "referrer": obj.get("referrer"), + "data": obj.get("data") + }) + return _obj - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'id': 'str', - 'template_id': 'str', - 'test': 'bool', - 'editable': 'bool', - 'expired': 'bool', - 'expires_at': 'str', - 'processed_at': 'str', - 'state': 'str', - 'data': 'object', - 'metadata': 'object', - 'truncated_text': 'object', - 'pdf_hash': 'str', - 'download_url': 'str', - 'permanent_download_url': 'str', - 'batch_id': 'str', - 'data_requests': 'list[SubmissionDataRequest]', - 'actions': 'list[SubmissionAction]', - 'source': 'str', - 'referrer': 'str' - } - - attribute_map = { - 'id': 'id', - 'template_id': 'template_id', - 'test': 'test', - 'editable': 'editable', - 'expired': 'expired', - 'expires_at': 'expires_at', - 'processed_at': 'processed_at', - 'state': 'state', - 'data': 'data', - 'metadata': 'metadata', - 'truncated_text': 'truncated_text', - 'pdf_hash': 'pdf_hash', - 'download_url': 'download_url', - 'permanent_download_url': 'permanent_download_url', - 'batch_id': 'batch_id', - 'data_requests': 'data_requests', - 'actions': 'actions', - 'source': 'source', - 'referrer': 'referrer' - } - - def __init__(self, id=None, template_id=None, test=None, editable=None, expired=None, expires_at=None, processed_at=None, state=None, data=None, metadata=None, truncated_text=None, pdf_hash=None, download_url=None, permanent_download_url=None, batch_id=None, data_requests=None, actions=None, source=None, referrer=None): # noqa: E501 - """Submission - a model defined in OpenAPI""" # noqa: E501 - - self._id = None - self._template_id = None - self._test = None - self._editable = None - self._expired = None - self._expires_at = None - self._processed_at = None - self._state = None - self._data = None - self._metadata = None - self._truncated_text = None - self._pdf_hash = None - self._download_url = None - self._permanent_download_url = None - self._batch_id = None - self._data_requests = None - self._actions = None - self._source = None - self._referrer = None - self.discriminator = None - - self.id = id - if template_id is not None: - self.template_id = template_id - self.test = test - self.editable = editable - self.expired = expired - self.expires_at = expires_at - self.processed_at = processed_at - self.state = state - self.data = data - if metadata is not None: - self.metadata = metadata - if truncated_text is not None: - self.truncated_text = truncated_text - self.pdf_hash = pdf_hash - self.download_url = download_url - self.permanent_download_url = permanent_download_url - self.batch_id = batch_id - if data_requests is not None: - self.data_requests = data_requests - if actions is not None: - self.actions = actions - self.source = source - self.referrer = referrer - - @property - def id(self): - """Gets the id of this Submission. # noqa: E501 - - - :return: The id of this Submission. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Submission. - - - :param id: The id of this Submission. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def template_id(self): - """Gets the template_id of this Submission. # noqa: E501 - - - :return: The template_id of this Submission. # noqa: E501 - :rtype: str - """ - return self._template_id - - @template_id.setter - def template_id(self, template_id): - """Sets the template_id of this Submission. - - - :param template_id: The template_id of this Submission. # noqa: E501 - :type: str - """ - - self._template_id = template_id - - @property - def test(self): - """Gets the test of this Submission. # noqa: E501 - - - :return: The test of this Submission. # noqa: E501 - :rtype: bool - """ - return self._test - - @test.setter - def test(self, test): - """Sets the test of this Submission. - - - :param test: The test of this Submission. # noqa: E501 - :type: bool - """ - if test is None: - raise ValueError("Invalid value for `test`, must not be `None`") # noqa: E501 - - self._test = test - - @property - def editable(self): - """Gets the editable of this Submission. # noqa: E501 - - - :return: The editable of this Submission. # noqa: E501 - :rtype: bool - """ - return self._editable - - @editable.setter - def editable(self, editable): - """Sets the editable of this Submission. - - - :param editable: The editable of this Submission. # noqa: E501 - :type: bool - """ - - self._editable = editable - - @property - def expired(self): - """Gets the expired of this Submission. # noqa: E501 - - - :return: The expired of this Submission. # noqa: E501 - :rtype: bool - """ - return self._expired - - @expired.setter - def expired(self, expired): - """Sets the expired of this Submission. - - - :param expired: The expired of this Submission. # noqa: E501 - :type: bool - """ - if expired is None: - raise ValueError("Invalid value for `expired`, must not be `None`") # noqa: E501 - - self._expired = expired - - @property - def expires_at(self): - """Gets the expires_at of this Submission. # noqa: E501 - - - :return: The expires_at of this Submission. # noqa: E501 - :rtype: str - """ - return self._expires_at - - @expires_at.setter - def expires_at(self, expires_at): - """Sets the expires_at of this Submission. - - - :param expires_at: The expires_at of this Submission. # noqa: E501 - :type: str - """ - - self._expires_at = expires_at - - @property - def processed_at(self): - """Gets the processed_at of this Submission. # noqa: E501 - - - :return: The processed_at of this Submission. # noqa: E501 - :rtype: str - """ - return self._processed_at - - @processed_at.setter - def processed_at(self, processed_at): - """Sets the processed_at of this Submission. - - - :param processed_at: The processed_at of this Submission. # noqa: E501 - :type: str - """ - - self._processed_at = processed_at - - @property - def state(self): - """Gets the state of this Submission. # noqa: E501 - - - :return: The state of this Submission. # noqa: E501 - :rtype: str - """ - return self._state - - @state.setter - def state(self, state): - """Sets the state of this Submission. - - - :param state: The state of this Submission. # noqa: E501 - :type: str - """ - if state is None: - raise ValueError("Invalid value for `state`, must not be `None`") # noqa: E501 - allowed_values = ["pending", "processed", "invalid_data", "error", "image_download_failed", "image_processing_failed", "waiting_for_data_requests", "syntax_error", "account_suspended", "license_revoked", "accidental"] # noqa: E501 - if state not in allowed_values: - raise ValueError( - "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 - .format(state, allowed_values) - ) - - self._state = state - - @property - def data(self): - """Gets the data of this Submission. # noqa: E501 - - - :return: The data of this Submission. # noqa: E501 - :rtype: object - """ - return self._data - - @data.setter - def data(self, data): - """Sets the data of this Submission. - - - :param data: The data of this Submission. # noqa: E501 - :type: object - """ - - self._data = data - - @property - def metadata(self): - """Gets the metadata of this Submission. # noqa: E501 - - - :return: The metadata of this Submission. # noqa: E501 - :rtype: object - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this Submission. - - - :param metadata: The metadata of this Submission. # noqa: E501 - :type: object - """ - - self._metadata = metadata - - @property - def truncated_text(self): - """Gets the truncated_text of this Submission. # noqa: E501 - - - :return: The truncated_text of this Submission. # noqa: E501 - :rtype: object - """ - return self._truncated_text - - @truncated_text.setter - def truncated_text(self, truncated_text): - """Sets the truncated_text of this Submission. - - - :param truncated_text: The truncated_text of this Submission. # noqa: E501 - :type: object - """ - - self._truncated_text = truncated_text - - @property - def pdf_hash(self): - """Gets the pdf_hash of this Submission. # noqa: E501 - - - :return: The pdf_hash of this Submission. # noqa: E501 - :rtype: str - """ - return self._pdf_hash - - @pdf_hash.setter - def pdf_hash(self, pdf_hash): - """Sets the pdf_hash of this Submission. - - - :param pdf_hash: The pdf_hash of this Submission. # noqa: E501 - :type: str - """ - - self._pdf_hash = pdf_hash - - @property - def download_url(self): - """Gets the download_url of this Submission. # noqa: E501 - - - :return: The download_url of this Submission. # noqa: E501 - :rtype: str - """ - return self._download_url - - @download_url.setter - def download_url(self, download_url): - """Sets the download_url of this Submission. - - - :param download_url: The download_url of this Submission. # noqa: E501 - :type: str - """ - - self._download_url = download_url - - @property - def permanent_download_url(self): - """Gets the permanent_download_url of this Submission. # noqa: E501 - - - :return: The permanent_download_url of this Submission. # noqa: E501 - :rtype: str - """ - return self._permanent_download_url - - @permanent_download_url.setter - def permanent_download_url(self, permanent_download_url): - """Sets the permanent_download_url of this Submission. - - - :param permanent_download_url: The permanent_download_url of this Submission. # noqa: E501 - :type: str - """ - - self._permanent_download_url = permanent_download_url - - @property - def batch_id(self): - """Gets the batch_id of this Submission. # noqa: E501 - - - :return: The batch_id of this Submission. # noqa: E501 - :rtype: str - """ - return self._batch_id - - @batch_id.setter - def batch_id(self, batch_id): - """Sets the batch_id of this Submission. - - - :param batch_id: The batch_id of this Submission. # noqa: E501 - :type: str - """ - - self._batch_id = batch_id - - @property - def data_requests(self): - """Gets the data_requests of this Submission. # noqa: E501 - - - :return: The data_requests of this Submission. # noqa: E501 - :rtype: list[SubmissionDataRequest] - """ - return self._data_requests - - @data_requests.setter - def data_requests(self, data_requests): - """Sets the data_requests of this Submission. - - - :param data_requests: The data_requests of this Submission. # noqa: E501 - :type: list[SubmissionDataRequest] - """ - - self._data_requests = data_requests - - @property - def actions(self): - """Gets the actions of this Submission. # noqa: E501 - - - :return: The actions of this Submission. # noqa: E501 - :rtype: list[SubmissionAction] - """ - return self._actions - - @actions.setter - def actions(self, actions): - """Sets the actions of this Submission. - - - :param actions: The actions of this Submission. # noqa: E501 - :type: list[SubmissionAction] - """ - - self._actions = actions - - @property - def source(self): - """Gets the source of this Submission. # noqa: E501 - - - :return: The source of this Submission. # noqa: E501 - :rtype: str - """ - return self._source - - @source.setter - def source(self, source): - """Sets the source of this Submission. - - - :param source: The source of this Submission. # noqa: E501 - :type: str - """ - - self._source = source - - @property - def referrer(self): - """Gets the referrer of this Submission. # noqa: E501 - - - :return: The referrer of this Submission. # noqa: E501 - :rtype: str - """ - return self._referrer - - @referrer.setter - def referrer(self, referrer): - """Sets the referrer of this Submission. - - - :param referrer: The referrer of this Submission. # noqa: E501 - :type: str - """ - self._referrer = referrer - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, Submission): - 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/docspring/models/submission_action.py b/docspring/models/submission_action.py index d21515e..87debb5 100644 --- a/docspring/models/submission_action.py +++ b/docspring/models/submission_action.py @@ -1,264 +1,128 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - - -class SubmissionAction(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. +class SubmissionAction(BaseModel): """ - openapi_types = { - 'id': 'str', - 'integration_id': 'str', - 'state': 'str', - 'action_category': 'str', - 'action_type': 'str', - 'result_data': 'object' - } - - attribute_map = { - 'id': 'id', - 'integration_id': 'integration_id', - 'state': 'state', - 'action_category': 'action_category', - 'action_type': 'action_type', - 'result_data': 'result_data' - } - - def __init__(self, id=None, integration_id=None, state=None, action_category=None, action_type=None, result_data=None): # noqa: E501 - """SubmissionAction - a model defined in OpenAPI""" # noqa: E501 - - self._id = None - self._integration_id = None - self._state = None - self._action_category = None - self._action_type = None - self._result_data = None - self.discriminator = None - - self.id = id - self.integration_id = integration_id - self.state = state - self.action_category = action_category - self.action_type = action_type - self.result_data = result_data - - @property - def id(self): - """Gets the id of this SubmissionAction. # noqa: E501 - - - :return: The id of this SubmissionAction. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this SubmissionAction. - - - :param id: The id of this SubmissionAction. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def integration_id(self): - """Gets the integration_id of this SubmissionAction. # noqa: E501 - - - :return: The integration_id of this SubmissionAction. # noqa: E501 - :rtype: str - """ - return self._integration_id - - @integration_id.setter - def integration_id(self, integration_id): - """Sets the integration_id of this SubmissionAction. - - - :param integration_id: The integration_id of this SubmissionAction. # noqa: E501 - :type: str - """ - - self._integration_id = integration_id - - @property - def state(self): - """Gets the state of this SubmissionAction. # noqa: E501 - - - :return: The state of this SubmissionAction. # noqa: E501 - :rtype: str - """ - return self._state - - @state.setter - def state(self, state): - """Sets the state of this SubmissionAction. - - - :param state: The state of this SubmissionAction. # noqa: E501 - :type: str - """ - if state is None: - raise ValueError("Invalid value for `state`, must not be `None`") # noqa: E501 - allowed_values = ["pending", "processed", "failed", "error"] # noqa: E501 - if state not in allowed_values: - raise ValueError( - "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 - .format(state, allowed_values) - ) - - self._state = state - - @property - def action_category(self): - """Gets the action_category of this SubmissionAction. # noqa: E501 - - - :return: The action_category of this SubmissionAction. # noqa: E501 - :rtype: str - """ - return self._action_category - - @action_category.setter - def action_category(self, action_category): - """Sets the action_category of this SubmissionAction. - - - :param action_category: The action_category of this SubmissionAction. # noqa: E501 - :type: str - """ - if action_category is None: - raise ValueError("Invalid value for `action_category`, must not be `None`") # noqa: E501 - allowed_values = ["notification", "file_upload"] # noqa: E501 - if action_category not in allowed_values: - raise ValueError( - "Invalid value for `action_category` ({0}), must be one of {1}" # noqa: E501 - .format(action_category, allowed_values) - ) - - self._action_category = action_category - - @property - def action_type(self): - """Gets the action_type of this SubmissionAction. # noqa: E501 - - - :return: The action_type of this SubmissionAction. # noqa: E501 - :rtype: str - """ - return self._action_type - - @action_type.setter - def action_type(self, action_type): - """Sets the action_type of this SubmissionAction. - - - :param action_type: The action_type of this SubmissionAction. # noqa: E501 - :type: str - """ - if action_type is None: - raise ValueError("Invalid value for `action_type`, must not be `None`") # noqa: E501 - allowed_values = ["webhook", "slack_webhook", "email", "aws_s3_upload"] # noqa: E501 - if action_type not in allowed_values: - raise ValueError( - "Invalid value for `action_type` ({0}), must be one of {1}" # noqa: E501 - .format(action_type, allowed_values) - ) - - self._action_type = action_type - - @property - def result_data(self): - """Gets the result_data of this SubmissionAction. # noqa: E501 - - - :return: The result_data of this SubmissionAction. # noqa: E501 - :rtype: object - """ - return self._result_data - - @result_data.setter - def result_data(self, result_data): - """Sets the result_data of this SubmissionAction. - - - :param result_data: The result_data of this SubmissionAction. # noqa: E501 - :type: object + SubmissionAction + """ # noqa: E501 + id: Optional[StrictStr] + integration_id: Optional[StrictStr] + state: StrictStr + action_type: StrictStr + action_category: StrictStr + result_data: Dict[str, Any] + __properties: ClassVar[List[str]] = ["id", "integration_id", "state", "action_type", "action_category", "result_data"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending', 'processed', 'failed', 'error']): + raise ValueError("must be one of enum values ('pending', 'processed', 'failed', 'error')") + return value + + @field_validator('action_type') + def action_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['webhook', 'slack_webhook', 'email', 'aws_s3_upload']): + raise ValueError("must be one of enum values ('webhook', 'slack_webhook', 'email', 'aws_s3_upload')") + return value + + @field_validator('action_category') + def action_category_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['notification', 'file_upload']): + raise ValueError("must be one of enum values ('notification', 'file_upload')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubmissionAction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - if result_data is None: - raise ValueError("Invalid value for `result_data`, must not be `None`") # noqa: E501 - - self._result_data = result_data - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, SubmissionAction): - return False + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if integration_id (nullable) is None + # and model_fields_set contains the field + if self.integration_id is None and "integration_id" in self.model_fields_set: + _dict['integration_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubmissionAction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "integration_id": obj.get("integration_id"), + "state": obj.get("state"), + "action_type": obj.get("action_type"), + "action_category": obj.get("action_category"), + "result_data": obj.get("result_data") + }) + return _obj - return self.__dict__ == other.__dict__ - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/docspring/models/submission_batch.py b/docspring/models/submission_batch.py index f62db54..4e8d516 100644 --- a/docspring/models/submission_batch.py +++ b/docspring/models/submission_batch.py @@ -1,325 +1,118 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self -class SubmissionBatch(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. +class SubmissionBatch(BaseModel): """ + SubmissionBatch + """ # noqa: E501 + id: Optional[StrictStr] + state: StrictStr + metadata: Dict[str, Any] + processed_at: Optional[StrictStr] + total_count: StrictInt + pending_count: StrictInt + error_count: StrictInt + completion_percentage: Union[StrictFloat, StrictInt] + __properties: ClassVar[List[str]] = ["id", "state", "metadata", "processed_at", "total_count", "pending_count", "error_count", "completion_percentage"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending', 'processed', 'error']): + raise ValueError("must be one of enum values ('pending', 'processed', 'error')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubmissionBatch from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if processed_at (nullable) is None + # and model_fields_set contains the field + if self.processed_at is None and "processed_at" in self.model_fields_set: + _dict['processed_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubmissionBatch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "state": obj.get("state"), + "metadata": obj.get("metadata"), + "processed_at": obj.get("processed_at"), + "total_count": obj.get("total_count"), + "pending_count": obj.get("pending_count"), + "error_count": obj.get("error_count"), + "completion_percentage": obj.get("completion_percentage") + }) + return _obj - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'pending_count': 'int', - 'completion_percentage': 'int', - 'metadata': 'object', - 'total_count': 'int', - 'submissions': 'list[Submission]', - 'processed_at': 'str', - 'id': 'str', - 'state': 'str', - 'error_count': 'int' - } - - attribute_map = { - 'pending_count': 'pending_count', - 'completion_percentage': 'completion_percentage', - 'metadata': 'metadata', - 'total_count': 'total_count', - 'submissions': 'submissions', - 'processed_at': 'processed_at', - 'id': 'id', - 'state': 'state', - 'error_count': 'error_count' - } - - def __init__(self, pending_count=None, completion_percentage=None, metadata=None, total_count=None, submissions=None, processed_at=None, id=None, state=None, error_count=None): # noqa: E501 - """SubmissionBatch - a model defined in OpenAPI""" # noqa: E501 - - self._pending_count = None - self._completion_percentage = None - self._metadata = None - self._total_count = None - self._submissions = None - self._processed_at = None - self._id = None - self._state = None - self._error_count = None - self.discriminator = None - - if pending_count is not None: - self.pending_count = pending_count - if completion_percentage is not None: - self.completion_percentage = completion_percentage - if metadata is not None: - self.metadata = metadata - if total_count is not None: - self.total_count = total_count - if submissions is not None: - self.submissions = submissions - self.processed_at = processed_at - if id is not None: - self.id = id - if state is not None: - self.state = state - if error_count is not None: - self.error_count = error_count - - @property - def pending_count(self): - """Gets the pending_count of this SubmissionBatch. # noqa: E501 - - - :return: The pending_count of this SubmissionBatch. # noqa: E501 - :rtype: int - """ - return self._pending_count - - @pending_count.setter - def pending_count(self, pending_count): - """Sets the pending_count of this SubmissionBatch. - - - :param pending_count: The pending_count of this SubmissionBatch. # noqa: E501 - :type: int - """ - - self._pending_count = pending_count - - @property - def completion_percentage(self): - """Gets the completion_percentage of this SubmissionBatch. # noqa: E501 - - - :return: The completion_percentage of this SubmissionBatch. # noqa: E501 - :rtype: int - """ - return self._completion_percentage - - @completion_percentage.setter - def completion_percentage(self, completion_percentage): - """Sets the completion_percentage of this SubmissionBatch. - - - :param completion_percentage: The completion_percentage of this SubmissionBatch. # noqa: E501 - :type: int - """ - - self._completion_percentage = completion_percentage - - @property - def metadata(self): - """Gets the metadata of this SubmissionBatch. # noqa: E501 - - - :return: The metadata of this SubmissionBatch. # noqa: E501 - :rtype: object - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this SubmissionBatch. - - - :param metadata: The metadata of this SubmissionBatch. # noqa: E501 - :type: object - """ - - self._metadata = metadata - - @property - def total_count(self): - """Gets the total_count of this SubmissionBatch. # noqa: E501 - - - :return: The total_count of this SubmissionBatch. # noqa: E501 - :rtype: int - """ - return self._total_count - - @total_count.setter - def total_count(self, total_count): - """Sets the total_count of this SubmissionBatch. - - - :param total_count: The total_count of this SubmissionBatch. # noqa: E501 - :type: int - """ - - self._total_count = total_count - - @property - def submissions(self): - """Gets the submissions of this SubmissionBatch. # noqa: E501 - - - :return: The submissions of this SubmissionBatch. # noqa: E501 - :rtype: list[Submission] - """ - return self._submissions - - @submissions.setter - def submissions(self, submissions): - """Sets the submissions of this SubmissionBatch. - - - :param submissions: The submissions of this SubmissionBatch. # noqa: E501 - :type: list[Submission] - """ - - self._submissions = submissions - - @property - def processed_at(self): - """Gets the processed_at of this SubmissionBatch. # noqa: E501 - - - :return: The processed_at of this SubmissionBatch. # noqa: E501 - :rtype: str - """ - return self._processed_at - - @processed_at.setter - def processed_at(self, processed_at): - """Sets the processed_at of this SubmissionBatch. - - - :param processed_at: The processed_at of this SubmissionBatch. # noqa: E501 - :type: str - """ - - self._processed_at = processed_at - - @property - def id(self): - """Gets the id of this SubmissionBatch. # noqa: E501 - - - :return: The id of this SubmissionBatch. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this SubmissionBatch. - - - :param id: The id of this SubmissionBatch. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def state(self): - """Gets the state of this SubmissionBatch. # noqa: E501 - - - :return: The state of this SubmissionBatch. # noqa: E501 - :rtype: str - """ - return self._state - - @state.setter - def state(self, state): - """Sets the state of this SubmissionBatch. - - - :param state: The state of this SubmissionBatch. # noqa: E501 - :type: str - """ - allowed_values = ["pending", "processed", "error"] # noqa: E501 - if state not in allowed_values: - raise ValueError( - "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 - .format(state, allowed_values) - ) - - self._state = state - - @property - def error_count(self): - """Gets the error_count of this SubmissionBatch. # noqa: E501 - - - :return: The error_count of this SubmissionBatch. # noqa: E501 - :rtype: int - """ - return self._error_count - - @error_count.setter - def error_count(self, error_count): - """Sets the error_count of this SubmissionBatch. - - - :param error_count: The error_count of this SubmissionBatch. # noqa: E501 - :type: int - """ - - self._error_count = error_count - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, SubmissionBatch): - 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/docspring/models/submission_batch_data.py b/docspring/models/submission_batch_data.py index 7d9f2c0..5a209d8 100644 --- a/docspring/models/submission_batch_data.py +++ b/docspring/models/submission_batch_data.py @@ -1,190 +1,91 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - - -class SubmissionBatchData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. +class SubmissionBatchData(BaseModel): """ - openapi_types = { - 'metadata': 'object', - 'submissions': 'list[SubmissionDataBatchRequest]', - 'template_id': 'str', - 'test': 'bool' - } - - attribute_map = { - 'metadata': 'metadata', - 'submissions': 'submissions', - 'template_id': 'template_id', - 'test': 'test' - } - - def __init__(self, metadata=None, submissions=None, template_id=None, test=None): # noqa: E501 - """SubmissionBatchData - a model defined in OpenAPI""" # noqa: E501 - - self._metadata = None - self._submissions = None - self._template_id = None - self._test = None - self.discriminator = None - - if metadata is not None: - self.metadata = metadata - self.submissions = submissions - self.template_id = template_id - if test is not None: - self.test = test - - @property - def metadata(self): - """Gets the metadata of this SubmissionBatchData. # noqa: E501 - - - :return: The metadata of this SubmissionBatchData. # noqa: E501 - :rtype: object + SubmissionBatchData + """ # noqa: E501 + metadata: Optional[Dict[str, Any]] = None + submissions: List[Dict[str, Any]] + test: Optional[StrictBool] = None + __properties: ClassVar[List[str]] = ["metadata", "submissions", "test"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubmissionBatchData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - return self._metadata + excluded_fields: Set[str] = set([ + ]) - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this SubmissionBatchData. + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubmissionBatchData from a dict""" + if obj is None: + return None - :param metadata: The metadata of this SubmissionBatchData. # noqa: E501 - :type: object - """ - - self._metadata = metadata - - @property - def submissions(self): - """Gets the submissions of this SubmissionBatchData. # noqa: E501 + if not isinstance(obj, dict): + return cls.model_validate(obj) + _obj = cls.model_validate({ + "metadata": obj.get("metadata"), + "submissions": obj.get("submissions"), + "test": obj.get("test") + }) + return _obj - :return: The submissions of this SubmissionBatchData. # noqa: E501 - :rtype: list[SubmissionDataBatchRequest] - """ - return self._submissions - - @submissions.setter - def submissions(self, submissions): - """Sets the submissions of this SubmissionBatchData. - - - :param submissions: The submissions of this SubmissionBatchData. # noqa: E501 - :type: list[SubmissionDataBatchRequest] - """ - if submissions is None: - raise ValueError("Invalid value for `submissions`, must not be `None`") # noqa: E501 - - self._submissions = submissions - - @property - def template_id(self): - """Gets the template_id of this SubmissionBatchData. # noqa: E501 - - - :return: The template_id of this SubmissionBatchData. # noqa: E501 - :rtype: str - """ - return self._template_id - - @template_id.setter - def template_id(self, template_id): - """Sets the template_id of this SubmissionBatchData. - - - :param template_id: The template_id of this SubmissionBatchData. # noqa: E501 - :type: str - """ - - self._template_id = template_id - - @property - def test(self): - """Gets the test of this SubmissionBatchData. # noqa: E501 - - - :return: The test of this SubmissionBatchData. # noqa: E501 - :rtype: bool - """ - return self._test - - @test.setter - def test(self, test): - """Sets the test of this SubmissionBatchData. - - - :param test: The test of this SubmissionBatchData. # noqa: E501 - :type: bool - """ - self._test = test - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, SubmissionBatchData): - 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/docspring/models/submission_batch_with_submissions.py b/docspring/models/submission_batch_with_submissions.py new file mode 100644 index 0000000..8c67432 --- /dev/null +++ b/docspring/models/submission_batch_with_submissions.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from docspring.models.submission_preview import SubmissionPreview +from typing import Optional, Set +from typing_extensions import Self + +class SubmissionBatchWithSubmissions(BaseModel): + """ + SubmissionBatchWithSubmissions + """ # noqa: E501 + id: Optional[StrictStr] + state: StrictStr + metadata: Dict[str, Any] + processed_at: Optional[StrictStr] + total_count: StrictInt + pending_count: StrictInt + error_count: StrictInt + completion_percentage: Union[StrictFloat, StrictInt] + submissions: Optional[List[SubmissionPreview]] = None + __properties: ClassVar[List[str]] = ["id", "state", "metadata", "processed_at", "total_count", "pending_count", "error_count", "completion_percentage", "submissions"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending', 'processed', 'error']): + raise ValueError("must be one of enum values ('pending', 'processed', 'error')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubmissionBatchWithSubmissions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in submissions (list) + _items = [] + if self.submissions: + for _item_submissions in self.submissions: + if _item_submissions: + _items.append(_item_submissions.to_dict()) + _dict['submissions'] = _items + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if processed_at (nullable) is None + # and model_fields_set contains the field + if self.processed_at is None and "processed_at" in self.model_fields_set: + _dict['processed_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubmissionBatchWithSubmissions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "state": obj.get("state"), + "metadata": obj.get("metadata"), + "processed_at": obj.get("processed_at"), + "total_count": obj.get("total_count"), + "pending_count": obj.get("pending_count"), + "error_count": obj.get("error_count"), + "completion_percentage": obj.get("completion_percentage"), + "submissions": [SubmissionPreview.from_dict(_item) for _item in obj["submissions"]] if obj.get("submissions") is not None else None + }) + return _obj + + diff --git a/docspring/models/submission_data.py b/docspring/models/submission_data.py deleted file mode 100644 index 94b4f3b..0000000 --- a/docspring/models/submission_data.py +++ /dev/null @@ -1,295 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class SubmissionData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'css': 'str', - 'data': 'object', - 'data_requests': 'list[CreateSubmissionDataRequestData]', - 'field_overrides': 'object', - 'html': 'str', - 'metadata': 'object', - 'password': 'str', - 'test': 'bool' - } - - attribute_map = { - 'css': 'css', - 'data': 'data', - 'data_requests': 'data_requests', - 'field_overrides': 'field_overrides', - 'html': 'html', - 'metadata': 'metadata', - 'password': 'password', - 'test': 'test' - } - - def __init__(self, css=None, data=None, data_requests=None, field_overrides=None, html=None, metadata=None, password=None, test=None): # noqa: E501 - """SubmissionData - a model defined in OpenAPI""" # noqa: E501 - - self._css = None - self._data = None - self._data_requests = None - self._field_overrides = None - self._html = None - self._metadata = None - self._password = None - self._test = None - self.discriminator = None - - if css is not None: - self.css = css - self.data = data - if data_requests is not None: - self.data_requests = data_requests - if field_overrides is not None: - self.field_overrides = field_overrides - if html is not None: - self.html = html - if metadata is not None: - self.metadata = metadata - if password is not None: - self.password = password - if test is not None: - self.test = test - - @property - def css(self): - """Gets the css of this SubmissionData. # noqa: E501 - - - :return: The css of this SubmissionData. # noqa: E501 - :rtype: str - """ - return self._css - - @css.setter - def css(self, css): - """Sets the css of this SubmissionData. - - - :param css: The css of this SubmissionData. # noqa: E501 - :type: str - """ - - self._css = css - - @property - def data(self): - """Gets the data of this SubmissionData. # noqa: E501 - - - :return: The data of this SubmissionData. # noqa: E501 - :rtype: object - """ - return self._data - - @data.setter - def data(self, data): - """Sets the data of this SubmissionData. - - - :param data: The data of this SubmissionData. # noqa: E501 - :type: object - """ - if data is None: - raise ValueError("Invalid value for `data`, must not be `None`") # noqa: E501 - - self._data = data - - @property - def data_requests(self): - """Gets the data_requests of this SubmissionData. # noqa: E501 - - - :return: The data_requests of this SubmissionData. # noqa: E501 - :rtype: list[CreateSubmissionDataRequestData] - """ - return self._data_requests - - @data_requests.setter - def data_requests(self, data_requests): - """Sets the data_requests of this SubmissionData. - - - :param data_requests: The data_requests of this SubmissionData. # noqa: E501 - :type: list[CreateSubmissionDataRequestData] - """ - - self._data_requests = data_requests - - @property - def field_overrides(self): - """Gets the field_overrides of this SubmissionData. # noqa: E501 - - - :return: The field_overrides of this SubmissionData. # noqa: E501 - :rtype: object - """ - return self._field_overrides - - @field_overrides.setter - def field_overrides(self, field_overrides): - """Sets the field_overrides of this SubmissionData. - - - :param field_overrides: The field_overrides of this SubmissionData. # noqa: E501 - :type: object - """ - - self._field_overrides = field_overrides - - @property - def html(self): - """Gets the html of this SubmissionData. # noqa: E501 - - - :return: The html of this SubmissionData. # noqa: E501 - :rtype: str - """ - return self._html - - @html.setter - def html(self, html): - """Sets the html of this SubmissionData. - - - :param html: The html of this SubmissionData. # noqa: E501 - :type: str - """ - - self._html = html - - @property - def metadata(self): - """Gets the metadata of this SubmissionData. # noqa: E501 - - - :return: The metadata of this SubmissionData. # noqa: E501 - :rtype: object - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this SubmissionData. - - - :param metadata: The metadata of this SubmissionData. # noqa: E501 - :type: object - """ - - self._metadata = metadata - - @property - def password(self): - """Gets the password of this SubmissionData. # noqa: E501 - - - :return: The password of this SubmissionData. # noqa: E501 - :rtype: str - """ - return self._password - - @password.setter - def password(self, password): - """Sets the password of this SubmissionData. - - - :param password: The password of this SubmissionData. # noqa: E501 - :type: str - """ - - self._password = password - - @property - def test(self): - """Gets the test of this SubmissionData. # noqa: E501 - - - :return: The test of this SubmissionData. # noqa: E501 - :rtype: bool - """ - return self._test - - @test.setter - def test(self, test): - """Sets the test of this SubmissionData. - - - :param test: The test of this SubmissionData. # noqa: E501 - :type: bool - """ - - self._test = test - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, SubmissionData): - 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/docspring/models/submission_data_batch_request.py b/docspring/models/submission_data_batch_request.py deleted file mode 100644 index 7a8f45e..0000000 --- a/docspring/models/submission_data_batch_request.py +++ /dev/null @@ -1,241 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class SubmissionDataBatchRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'css': 'str', - 'metadata': 'object', - 'data': 'object', - 'test': 'bool', - 'html': 'str', - 'template_id': 'str' - } - - attribute_map = { - 'css': 'css', - 'metadata': 'metadata', - 'data': 'data', - 'test': 'test', - 'html': 'html', - 'template_id': 'template_id' - } - - def __init__(self, css=None, metadata=None, data=None, test=None, html=None, template_id=None): # noqa: E501 - """SubmissionDataBatchRequest - a model defined in OpenAPI""" # noqa: E501 - - self._css = None - self._metadata = None - self._data = None - self._test = None - self._html = None - self._template_id = None - self.discriminator = None - - if css is not None: - self.css = css - if metadata is not None: - self.metadata = metadata - if data is not None: - self.data = data - if test is not None: - self.test = test - if html is not None: - self.html = html - self.template_id = template_id - - @property - def css(self): - """Gets the css of this SubmissionDataBatchRequest. # noqa: E501 - - - :return: The css of this SubmissionDataBatchRequest. # noqa: E501 - :rtype: str - """ - return self._css - - @css.setter - def css(self, css): - """Sets the css of this SubmissionDataBatchRequest. - - - :param css: The css of this SubmissionDataBatchRequest. # noqa: E501 - :type: str - """ - - self._css = css - - @property - def metadata(self): - """Gets the metadata of this SubmissionDataBatchRequest. # noqa: E501 - - - :return: The metadata of this SubmissionDataBatchRequest. # noqa: E501 - :rtype: object - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this SubmissionDataBatchRequest. - - - :param metadata: The metadata of this SubmissionDataBatchRequest. # noqa: E501 - :type: object - """ - - self._metadata = metadata - - @property - def data(self): - """Gets the data of this SubmissionDataBatchRequest. # noqa: E501 - - - :return: The data of this SubmissionDataBatchRequest. # noqa: E501 - :rtype: object - """ - return self._data - - @data.setter - def data(self, data): - """Sets the data of this SubmissionDataBatchRequest. - - - :param data: The data of this SubmissionDataBatchRequest. # noqa: E501 - :type: object - """ - - self._data = data - - @property - def test(self): - """Gets the test of this SubmissionDataBatchRequest. # noqa: E501 - - - :return: The test of this SubmissionDataBatchRequest. # noqa: E501 - :rtype: bool - """ - return self._test - - @test.setter - def test(self, test): - """Sets the test of this SubmissionDataBatchRequest. - - - :param test: The test of this SubmissionDataBatchRequest. # noqa: E501 - :type: bool - """ - - self._test = test - - @property - def html(self): - """Gets the html of this SubmissionDataBatchRequest. # noqa: E501 - - - :return: The html of this SubmissionDataBatchRequest. # noqa: E501 - :rtype: str - """ - return self._html - - @html.setter - def html(self, html): - """Sets the html of this SubmissionDataBatchRequest. - - - :param html: The html of this SubmissionDataBatchRequest. # noqa: E501 - :type: str - """ - - self._html = html - - @property - def template_id(self): - """Gets the template_id of this SubmissionDataBatchRequest. # noqa: E501 - - - :return: The template_id of this SubmissionDataBatchRequest. # noqa: E501 - :rtype: str - """ - return self._template_id - - @template_id.setter - def template_id(self, template_id): - """Sets the template_id of this SubmissionDataBatchRequest. - - - :param template_id: The template_id of this SubmissionDataBatchRequest. # noqa: E501 - :type: str - """ - - self._template_id = template_id - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, SubmissionDataBatchRequest): - 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/docspring/models/submission_data_request.py b/docspring/models/submission_data_request.py index 52bfeeb..472105f 100644 --- a/docspring/models/submission_data_request.py +++ b/docspring/models/submission_data_request.py @@ -1,616 +1,233 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - - -class SubmissionDataRequest(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +class SubmissionDataRequest(BaseModel): """ - Attributes: - openapi_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. - """ - openapi_types = { - 'id': 'str', - 'name': 'str', - 'email': 'str', - 'order': 'int', - 'sort_order': 'int', - 'fields': 'list[str]', - 'metadata': 'object', - 'state': 'str', - 'viewed_at': 'str', - 'completed_at': 'str', - 'auth_type': 'str', - 'auth_second_factor_type': 'str', - 'auth_provider': 'str', - 'auth_session_started_at': 'str', - 'auth_session_id_hash': 'str', - 'auth_user_id_hash': 'str', - 'auth_username_hash': 'str', - 'auth_phone_number_hash': 'str', - 'ip_address': 'str', - 'user_agent': 'str' - } - - attribute_map = { - 'id': 'id', - 'name': 'name', - 'email': 'email', - 'order': 'order', - 'sort_order': 'sort_order', - 'fields': 'fields', - 'metadata': 'metadata', - 'state': 'state', - 'viewed_at': 'viewed_at', - 'completed_at': 'completed_at', - 'auth_type': 'auth_type', - 'auth_second_factor_type': 'auth_second_factor_type', - 'auth_provider': 'auth_provider', - 'auth_session_started_at': 'auth_session_started_at', - 'auth_session_id_hash': 'auth_session_id_hash', - 'auth_user_id_hash': 'auth_user_id_hash', - 'auth_username_hash': 'auth_username_hash', - 'auth_phone_number_hash': 'auth_phone_number_hash', - 'ip_address': 'ip_address', - 'user_agent': 'user_agent' - } - - def __init__(self, id=None, name=None, email=None, order=None, sort_order=None, fields=None, metadata=None, state=None, viewed_at=None, completed_at=None, auth_type=None, auth_second_factor_type=None, auth_provider=None, auth_session_started_at=None, auth_session_id_hash=None, auth_user_id_hash=None, auth_username_hash=None, auth_phone_number_hash=None, ip_address=None, user_agent=None): # noqa: E501 - """SubmissionDataRequest - a model defined in OpenAPI""" # noqa: E501 - - self._id = None - self._name = None - self._email = None - self._order = None - self._sort_order = None - self._fields = None - self._metadata = None - self._state = None - self._viewed_at = None - self._completed_at = None - self._auth_type = None - self._auth_second_factor_type = None - self._auth_provider = None - self._auth_session_started_at = None - self._auth_session_id_hash = None - self._auth_user_id_hash = None - self._auth_username_hash = None - self._auth_phone_number_hash = None - self._ip_address = None - self._user_agent = None - self.discriminator = None - - self.id = id - self.name = name - self.email = email - self.order = order - self.sort_order = sort_order - self.fields = fields - self.metadata = metadata - self.state = state - self.viewed_at = viewed_at - self.completed_at = completed_at - if auth_type is not None: - self.auth_type = auth_type - if auth_second_factor_type is not None: - self.auth_second_factor_type = auth_second_factor_type - self.auth_provider = auth_provider - self.auth_session_started_at = auth_session_started_at - self.auth_session_id_hash = auth_session_id_hash - self.auth_user_id_hash = auth_user_id_hash - self.auth_username_hash = auth_username_hash - self.auth_phone_number_hash = auth_phone_number_hash - self.ip_address = ip_address - self.user_agent = user_agent - - @property - def id(self): - """Gets the id of this SubmissionDataRequest. # noqa: E501 - - - :return: The id of this SubmissionDataRequest. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this SubmissionDataRequest. - - - :param id: The id of this SubmissionDataRequest. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def name(self): - """Gets the name of this SubmissionDataRequest. # noqa: E501 - - - :return: The name of this SubmissionDataRequest. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this SubmissionDataRequest. - - - :param name: The name of this SubmissionDataRequest. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def email(self): - """Gets the email of this SubmissionDataRequest. # noqa: E501 - - - :return: The email of this SubmissionDataRequest. # noqa: E501 - :rtype: str - """ - return self._email - - @email.setter - def email(self, email): - """Sets the email of this SubmissionDataRequest. - - - :param email: The email of this SubmissionDataRequest. # noqa: E501 - :type: str - """ - - self._email = email - - @property - def order(self): - """Gets the order of this SubmissionDataRequest. # noqa: E501 - - - :return: The order of this SubmissionDataRequest. # noqa: E501 - :rtype: int - """ - return self._order - - @order.setter - def order(self, order): - """Sets the order of this SubmissionDataRequest. - - - :param order: The order of this SubmissionDataRequest. # noqa: E501 - :type: int - """ - if order is None: - raise ValueError("Invalid value for `order`, must not be `None`") # noqa: E501 - - self._order = order - - @property - def sort_order(self): - """Gets the sort_order of this SubmissionDataRequest. # noqa: E501 - - - :return: The sort_order of this SubmissionDataRequest. # noqa: E501 - :rtype: int - """ - return self._sort_order - - @sort_order.setter - def sort_order(self, sort_order): - """Sets the sort_order of this SubmissionDataRequest. - - - :param sort_order: The sort_order of this SubmissionDataRequest. # noqa: E501 - :type: int - """ - if sort_order is None: - raise ValueError("Invalid value for `sort_order`, must not be `None`") # noqa: E501 - - self._sort_order = sort_order - - @property - def fields(self): - """Gets the fields of this SubmissionDataRequest. # noqa: E501 - - - :return: The fields of this SubmissionDataRequest. # noqa: E501 - :rtype: list[str] - """ - return self._fields - - @fields.setter - def fields(self, fields): - """Sets the fields of this SubmissionDataRequest. - - - :param fields: The fields of this SubmissionDataRequest. # noqa: E501 - :type: list[str] - """ - - self._fields = fields - - @property - def metadata(self): - """Gets the metadata of this SubmissionDataRequest. # noqa: E501 - - - :return: The metadata of this SubmissionDataRequest. # noqa: E501 - :rtype: object - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this SubmissionDataRequest. - - - :param metadata: The metadata of this SubmissionDataRequest. # noqa: E501 - :type: object - """ - if metadata is None: - raise ValueError("Invalid value for `metadata`, must not be `None`") # noqa: E501 - - self._metadata = metadata - - @property - def state(self): - """Gets the state of this SubmissionDataRequest. # noqa: E501 - - - :return: The state of this SubmissionDataRequest. # noqa: E501 - :rtype: str - """ - return self._state - - @state.setter - def state(self, state): - """Sets the state of this SubmissionDataRequest. - - - :param state: The state of this SubmissionDataRequest. # noqa: E501 - :type: str - """ - if state is None: - raise ValueError("Invalid value for `state`, must not be `None`") # noqa: E501 - allowed_values = ["pending", "completed"] # noqa: E501 - if state not in allowed_values: - raise ValueError( - "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501 - .format(state, allowed_values) - ) - - self._state = state - - @property - def viewed_at(self): - """Gets the viewed_at of this SubmissionDataRequest. # noqa: E501 - - - :return: The viewed_at of this SubmissionDataRequest. # noqa: E501 - :rtype: str - """ - return self._viewed_at - - @viewed_at.setter - def viewed_at(self, viewed_at): - """Sets the viewed_at of this SubmissionDataRequest. - - - :param viewed_at: The viewed_at of this SubmissionDataRequest. # noqa: E501 - :type: str - """ - - self._viewed_at = viewed_at - - @property - def completed_at(self): - """Gets the completed_at of this SubmissionDataRequest. # noqa: E501 - - - :return: The completed_at of this SubmissionDataRequest. # noqa: E501 - :rtype: str - """ - return self._completed_at - - @completed_at.setter - def completed_at(self, completed_at): - """Sets the completed_at of this SubmissionDataRequest. + SubmissionDataRequest + """ # noqa: E501 + id: Optional[StrictStr] + email: Optional[StrictStr] + name: Optional[StrictStr] + order: Optional[StrictInt] + sort_order: StrictInt + fields: Optional[List[StrictStr]] + metadata: Optional[Dict[str, Any]] + state: StrictStr + viewed_at: Optional[StrictStr] + completed_at: Optional[StrictStr] + data: Optional[Dict[str, Any]] + auth_type: StrictStr + auth_second_factor_type: StrictStr + auth_provider: Optional[StrictStr] + auth_session_started_at: Optional[StrictStr] + auth_session_id_hash: Optional[StrictStr] + auth_user_id_hash: Optional[StrictStr] + auth_username_hash: Optional[StrictStr] + auth_phone_number_hash: Optional[StrictStr] + ip_address: Optional[StrictStr] + user_agent: Optional[StrictStr] + __properties: ClassVar[List[str]] = ["id", "email", "name", "order", "sort_order", "fields", "metadata", "state", "viewed_at", "completed_at", "data", "auth_type", "auth_second_factor_type", "auth_provider", "auth_session_started_at", "auth_session_id_hash", "auth_user_id_hash", "auth_username_hash", "auth_phone_number_hash", "ip_address", "user_agent"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending', 'completed']): + raise ValueError("must be one of enum values ('pending', 'completed')") + return value + + @field_validator('auth_type') + def auth_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['none', 'password', 'oauth', 'email_link', 'phone_number', 'ldap', 'saml']): + raise ValueError("must be one of enum values ('none', 'password', 'oauth', 'email_link', 'phone_number', 'ldap', 'saml')") + return value + + @field_validator('auth_second_factor_type') + def auth_second_factor_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['none', 'phone_number', 'totp', 'mobile_push', 'security_key', 'fingerprint']): + raise ValueError("must be one of enum values ('none', 'phone_number', 'totp', 'mobile_push', 'security_key', 'fingerprint')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubmissionDataRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if order (nullable) is None + # and model_fields_set contains the field + if self.order is None and "order" in self.model_fields_set: + _dict['order'] = None + + # set to None if fields (nullable) is None + # and model_fields_set contains the field + if self.fields is None and "fields" in self.model_fields_set: + _dict['fields'] = None + + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict['metadata'] = None + + # set to None if viewed_at (nullable) is None + # and model_fields_set contains the field + if self.viewed_at is None and "viewed_at" in self.model_fields_set: + _dict['viewed_at'] = None + + # set to None if completed_at (nullable) is None + # and model_fields_set contains the field + if self.completed_at is None and "completed_at" in self.model_fields_set: + _dict['completed_at'] = None + + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + # set to None if auth_provider (nullable) is None + # and model_fields_set contains the field + if self.auth_provider is None and "auth_provider" in self.model_fields_set: + _dict['auth_provider'] = None + + # set to None if auth_session_started_at (nullable) is None + # and model_fields_set contains the field + if self.auth_session_started_at is None and "auth_session_started_at" in self.model_fields_set: + _dict['auth_session_started_at'] = None + + # set to None if auth_session_id_hash (nullable) is None + # and model_fields_set contains the field + if self.auth_session_id_hash is None and "auth_session_id_hash" in self.model_fields_set: + _dict['auth_session_id_hash'] = None + + # set to None if auth_user_id_hash (nullable) is None + # and model_fields_set contains the field + if self.auth_user_id_hash is None and "auth_user_id_hash" in self.model_fields_set: + _dict['auth_user_id_hash'] = None + + # set to None if auth_username_hash (nullable) is None + # and model_fields_set contains the field + if self.auth_username_hash is None and "auth_username_hash" in self.model_fields_set: + _dict['auth_username_hash'] = None + + # set to None if auth_phone_number_hash (nullable) is None + # and model_fields_set contains the field + if self.auth_phone_number_hash is None and "auth_phone_number_hash" in self.model_fields_set: + _dict['auth_phone_number_hash'] = None + + # set to None if ip_address (nullable) is None + # and model_fields_set contains the field + if self.ip_address is None and "ip_address" in self.model_fields_set: + _dict['ip_address'] = None + + # set to None if user_agent (nullable) is None + # and model_fields_set contains the field + if self.user_agent is None and "user_agent" in self.model_fields_set: + _dict['user_agent'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubmissionDataRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "email": obj.get("email"), + "name": obj.get("name"), + "order": obj.get("order"), + "sort_order": obj.get("sort_order"), + "fields": obj.get("fields"), + "metadata": obj.get("metadata"), + "state": obj.get("state"), + "viewed_at": obj.get("viewed_at"), + "completed_at": obj.get("completed_at"), + "data": obj.get("data"), + "auth_type": obj.get("auth_type"), + "auth_second_factor_type": obj.get("auth_second_factor_type"), + "auth_provider": obj.get("auth_provider"), + "auth_session_started_at": obj.get("auth_session_started_at"), + "auth_session_id_hash": obj.get("auth_session_id_hash"), + "auth_user_id_hash": obj.get("auth_user_id_hash"), + "auth_username_hash": obj.get("auth_username_hash"), + "auth_phone_number_hash": obj.get("auth_phone_number_hash"), + "ip_address": obj.get("ip_address"), + "user_agent": obj.get("user_agent") + }) + return _obj - :param completed_at: The completed_at of this SubmissionDataRequest. # noqa: E501 - :type: str - """ - - self._completed_at = completed_at - - @property - def auth_type(self): - """Gets the auth_type of this SubmissionDataRequest. # noqa: E501 - - - :return: The auth_type of this SubmissionDataRequest. # noqa: E501 - :rtype: str - """ - return self._auth_type - - @auth_type.setter - def auth_type(self, auth_type): - """Sets the auth_type of this SubmissionDataRequest. - - - :param auth_type: The auth_type of this SubmissionDataRequest. # noqa: E501 - :type: str - """ - allowed_values = ["none", "password", "oauth", "email_link", "phone_number", "ldap", "saml"] # noqa: E501 - if auth_type not in allowed_values: - raise ValueError( - "Invalid value for `auth_type` ({0}), must be one of {1}" # noqa: E501 - .format(auth_type, allowed_values) - ) - - self._auth_type = auth_type - - @property - def auth_second_factor_type(self): - """Gets the auth_second_factor_type of this SubmissionDataRequest. # noqa: E501 - - - :return: The auth_second_factor_type of this SubmissionDataRequest. # noqa: E501 - :rtype: str - """ - return self._auth_second_factor_type - - @auth_second_factor_type.setter - def auth_second_factor_type(self, auth_second_factor_type): - """Sets the auth_second_factor_type of this SubmissionDataRequest. - - - :param auth_second_factor_type: The auth_second_factor_type of this SubmissionDataRequest. # noqa: E501 - :type: str - """ - allowed_values = ["none", "phone_number", "totp", "mobile_push", "security_key", "fingerprint"] # noqa: E501 - if auth_second_factor_type not in allowed_values: - raise ValueError( - "Invalid value for `auth_second_factor_type` ({0}), must be one of {1}" # noqa: E501 - .format(auth_second_factor_type, allowed_values) - ) - - self._auth_second_factor_type = auth_second_factor_type - - @property - def auth_provider(self): - """Gets the auth_provider of this SubmissionDataRequest. # noqa: E501 - - - :return: The auth_provider of this SubmissionDataRequest. # noqa: E501 - :rtype: str - """ - return self._auth_provider - - @auth_provider.setter - def auth_provider(self, auth_provider): - """Sets the auth_provider of this SubmissionDataRequest. - - - :param auth_provider: The auth_provider of this SubmissionDataRequest. # noqa: E501 - :type: str - """ - - self._auth_provider = auth_provider - - @property - def auth_session_started_at(self): - """Gets the auth_session_started_at of this SubmissionDataRequest. # noqa: E501 - - - :return: The auth_session_started_at of this SubmissionDataRequest. # noqa: E501 - :rtype: str - """ - return self._auth_session_started_at - - @auth_session_started_at.setter - def auth_session_started_at(self, auth_session_started_at): - """Sets the auth_session_started_at of this SubmissionDataRequest. - - - :param auth_session_started_at: The auth_session_started_at of this SubmissionDataRequest. # noqa: E501 - :type: str - """ - - self._auth_session_started_at = auth_session_started_at - - @property - def auth_session_id_hash(self): - """Gets the auth_session_id_hash of this SubmissionDataRequest. # noqa: E501 - - - :return: The auth_session_id_hash of this SubmissionDataRequest. # noqa: E501 - :rtype: str - """ - return self._auth_session_id_hash - - @auth_session_id_hash.setter - def auth_session_id_hash(self, auth_session_id_hash): - """Sets the auth_session_id_hash of this SubmissionDataRequest. - - - :param auth_session_id_hash: The auth_session_id_hash of this SubmissionDataRequest. # noqa: E501 - :type: str - """ - - self._auth_session_id_hash = auth_session_id_hash - - @property - def auth_user_id_hash(self): - """Gets the auth_user_id_hash of this SubmissionDataRequest. # noqa: E501 - - - :return: The auth_user_id_hash of this SubmissionDataRequest. # noqa: E501 - :rtype: str - """ - return self._auth_user_id_hash - - @auth_user_id_hash.setter - def auth_user_id_hash(self, auth_user_id_hash): - """Sets the auth_user_id_hash of this SubmissionDataRequest. - - - :param auth_user_id_hash: The auth_user_id_hash of this SubmissionDataRequest. # noqa: E501 - :type: str - """ - - self._auth_user_id_hash = auth_user_id_hash - - @property - def auth_username_hash(self): - """Gets the auth_username_hash of this SubmissionDataRequest. # noqa: E501 - - - :return: The auth_username_hash of this SubmissionDataRequest. # noqa: E501 - :rtype: str - """ - return self._auth_username_hash - - @auth_username_hash.setter - def auth_username_hash(self, auth_username_hash): - """Sets the auth_username_hash of this SubmissionDataRequest. - - - :param auth_username_hash: The auth_username_hash of this SubmissionDataRequest. # noqa: E501 - :type: str - """ - - self._auth_username_hash = auth_username_hash - - @property - def auth_phone_number_hash(self): - """Gets the auth_phone_number_hash of this SubmissionDataRequest. # noqa: E501 - - - :return: The auth_phone_number_hash of this SubmissionDataRequest. # noqa: E501 - :rtype: str - """ - return self._auth_phone_number_hash - - @auth_phone_number_hash.setter - def auth_phone_number_hash(self, auth_phone_number_hash): - """Sets the auth_phone_number_hash of this SubmissionDataRequest. - - - :param auth_phone_number_hash: The auth_phone_number_hash of this SubmissionDataRequest. # noqa: E501 - :type: str - """ - - self._auth_phone_number_hash = auth_phone_number_hash - - @property - def ip_address(self): - """Gets the ip_address of this SubmissionDataRequest. # noqa: E501 - - - :return: The ip_address of this SubmissionDataRequest. # noqa: E501 - :rtype: str - """ - return self._ip_address - - @ip_address.setter - def ip_address(self, ip_address): - """Sets the ip_address of this SubmissionDataRequest. - - - :param ip_address: The ip_address of this SubmissionDataRequest. # noqa: E501 - :type: str - """ - - self._ip_address = ip_address - - @property - def user_agent(self): - """Gets the user_agent of this SubmissionDataRequest. # noqa: E501 - - - :return: The user_agent of this SubmissionDataRequest. # noqa: E501 - :rtype: str - """ - return self._user_agent - - @user_agent.setter - def user_agent(self, user_agent): - """Sets the user_agent of this SubmissionDataRequest. - - - :param user_agent: The user_agent of this SubmissionDataRequest. # noqa: E501 - :type: str - """ - - self._user_agent = user_agent - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, SubmissionDataRequest): - 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/docspring/models/submission_data_request_event.py b/docspring/models/submission_data_request_event.py new file mode 100644 index 0000000..19c1f98 --- /dev/null +++ b/docspring/models/submission_data_request_event.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SubmissionDataRequestEvent(BaseModel): + """ + SubmissionDataRequestEvent + """ # noqa: E501 + id: Optional[StrictStr] + submission_id: Optional[StrictStr] + submission_data_request_id: Optional[StrictStr] + event_type: StrictStr + message_type: StrictStr + message_recipient: Optional[StrictStr] + occurred_at: Optional[StrictStr] + __properties: ClassVar[List[str]] = ["id", "submission_id", "submission_data_request_id", "event_type", "message_type", "message_recipient", "occurred_at"] + + @field_validator('event_type') + def event_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['send_request', 'view_request', 'accepted_terms', 'decline_request', 'sign_request', 'all_completed']): + raise ValueError("must be one of enum values ('send_request', 'view_request', 'accepted_terms', 'decline_request', 'sign_request', 'all_completed')") + return value + + @field_validator('message_type') + def message_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['email', 'sms', 'fax', 'mail', 'slack', 'msteams', 'discord', 'telegram', 'whatsapp']): + raise ValueError("must be one of enum values ('email', 'sms', 'fax', 'mail', 'slack', 'msteams', 'discord', 'telegram', 'whatsapp')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubmissionDataRequestEvent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if submission_id (nullable) is None + # and model_fields_set contains the field + if self.submission_id is None and "submission_id" in self.model_fields_set: + _dict['submission_id'] = None + + # set to None if submission_data_request_id (nullable) is None + # and model_fields_set contains the field + if self.submission_data_request_id is None and "submission_data_request_id" in self.model_fields_set: + _dict['submission_data_request_id'] = None + + # set to None if message_recipient (nullable) is None + # and model_fields_set contains the field + if self.message_recipient is None and "message_recipient" in self.model_fields_set: + _dict['message_recipient'] = None + + # set to None if occurred_at (nullable) is None + # and model_fields_set contains the field + if self.occurred_at is None and "occurred_at" in self.model_fields_set: + _dict['occurred_at'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubmissionDataRequestEvent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "submission_id": obj.get("submission_id"), + "submission_data_request_id": obj.get("submission_data_request_id"), + "event_type": obj.get("event_type"), + "message_type": obj.get("message_type"), + "message_recipient": obj.get("message_recipient"), + "occurred_at": obj.get("occurred_at") + }) + return _obj + + diff --git a/docspring/models/submission_data_request_show.py b/docspring/models/submission_data_request_show.py new file mode 100644 index 0000000..5d1bbe8 --- /dev/null +++ b/docspring/models/submission_data_request_show.py @@ -0,0 +1,240 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SubmissionDataRequestShow(BaseModel): + """ + SubmissionDataRequestShow + """ # noqa: E501 + id: Optional[StrictStr] + email: Optional[StrictStr] + name: Optional[StrictStr] + order: Optional[StrictInt] + sort_order: StrictInt + fields: Optional[List[StrictStr]] + metadata: Optional[Dict[str, Any]] + state: StrictStr + viewed_at: Optional[StrictStr] + completed_at: Optional[StrictStr] + data: Optional[Dict[str, Any]] + auth_type: StrictStr + auth_second_factor_type: StrictStr + auth_provider: Optional[StrictStr] + auth_session_started_at: Optional[StrictStr] + auth_session_id_hash: Optional[StrictStr] + auth_user_id_hash: Optional[StrictStr] + auth_username_hash: Optional[StrictStr] + auth_phone_number_hash: Optional[StrictStr] + ip_address: Optional[StrictStr] + user_agent: Optional[StrictStr] + submission_id: Optional[StrictStr] + __properties: ClassVar[List[str]] = ["id", "email", "name", "order", "sort_order", "fields", "metadata", "state", "viewed_at", "completed_at", "data", "auth_type", "auth_second_factor_type", "auth_provider", "auth_session_started_at", "auth_session_id_hash", "auth_user_id_hash", "auth_username_hash", "auth_phone_number_hash", "ip_address", "user_agent", "submission_id"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending', 'completed']): + raise ValueError("must be one of enum values ('pending', 'completed')") + return value + + @field_validator('auth_type') + def auth_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['none', 'password', 'oauth', 'email_link', 'phone_number', 'ldap', 'saml']): + raise ValueError("must be one of enum values ('none', 'password', 'oauth', 'email_link', 'phone_number', 'ldap', 'saml')") + return value + + @field_validator('auth_second_factor_type') + def auth_second_factor_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['none', 'phone_number', 'totp', 'mobile_push', 'security_key', 'fingerprint']): + raise ValueError("must be one of enum values ('none', 'phone_number', 'totp', 'mobile_push', 'security_key', 'fingerprint')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubmissionDataRequestShow from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if email (nullable) is None + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: + _dict['email'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if order (nullable) is None + # and model_fields_set contains the field + if self.order is None and "order" in self.model_fields_set: + _dict['order'] = None + + # set to None if fields (nullable) is None + # and model_fields_set contains the field + if self.fields is None and "fields" in self.model_fields_set: + _dict['fields'] = None + + # set to None if metadata (nullable) is None + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: + _dict['metadata'] = None + + # set to None if viewed_at (nullable) is None + # and model_fields_set contains the field + if self.viewed_at is None and "viewed_at" in self.model_fields_set: + _dict['viewed_at'] = None + + # set to None if completed_at (nullable) is None + # and model_fields_set contains the field + if self.completed_at is None and "completed_at" in self.model_fields_set: + _dict['completed_at'] = None + + # set to None if data (nullable) is None + # and model_fields_set contains the field + if self.data is None and "data" in self.model_fields_set: + _dict['data'] = None + + # set to None if auth_provider (nullable) is None + # and model_fields_set contains the field + if self.auth_provider is None and "auth_provider" in self.model_fields_set: + _dict['auth_provider'] = None + + # set to None if auth_session_started_at (nullable) is None + # and model_fields_set contains the field + if self.auth_session_started_at is None and "auth_session_started_at" in self.model_fields_set: + _dict['auth_session_started_at'] = None + + # set to None if auth_session_id_hash (nullable) is None + # and model_fields_set contains the field + if self.auth_session_id_hash is None and "auth_session_id_hash" in self.model_fields_set: + _dict['auth_session_id_hash'] = None + + # set to None if auth_user_id_hash (nullable) is None + # and model_fields_set contains the field + if self.auth_user_id_hash is None and "auth_user_id_hash" in self.model_fields_set: + _dict['auth_user_id_hash'] = None + + # set to None if auth_username_hash (nullable) is None + # and model_fields_set contains the field + if self.auth_username_hash is None and "auth_username_hash" in self.model_fields_set: + _dict['auth_username_hash'] = None + + # set to None if auth_phone_number_hash (nullable) is None + # and model_fields_set contains the field + if self.auth_phone_number_hash is None and "auth_phone_number_hash" in self.model_fields_set: + _dict['auth_phone_number_hash'] = None + + # set to None if ip_address (nullable) is None + # and model_fields_set contains the field + if self.ip_address is None and "ip_address" in self.model_fields_set: + _dict['ip_address'] = None + + # set to None if user_agent (nullable) is None + # and model_fields_set contains the field + if self.user_agent is None and "user_agent" in self.model_fields_set: + _dict['user_agent'] = None + + # set to None if submission_id (nullable) is None + # and model_fields_set contains the field + if self.submission_id is None and "submission_id" in self.model_fields_set: + _dict['submission_id'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubmissionDataRequestShow from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "email": obj.get("email"), + "name": obj.get("name"), + "order": obj.get("order"), + "sort_order": obj.get("sort_order"), + "fields": obj.get("fields"), + "metadata": obj.get("metadata"), + "state": obj.get("state"), + "viewed_at": obj.get("viewed_at"), + "completed_at": obj.get("completed_at"), + "data": obj.get("data"), + "auth_type": obj.get("auth_type"), + "auth_second_factor_type": obj.get("auth_second_factor_type"), + "auth_provider": obj.get("auth_provider"), + "auth_session_started_at": obj.get("auth_session_started_at"), + "auth_session_id_hash": obj.get("auth_session_id_hash"), + "auth_user_id_hash": obj.get("auth_user_id_hash"), + "auth_username_hash": obj.get("auth_username_hash"), + "auth_phone_number_hash": obj.get("auth_phone_number_hash"), + "ip_address": obj.get("ip_address"), + "user_agent": obj.get("user_agent"), + "submission_id": obj.get("submission_id") + }) + return _obj + + diff --git a/docspring/models/submission_data_request_token.py b/docspring/models/submission_data_request_token.py new file mode 100644 index 0000000..b687a18 --- /dev/null +++ b/docspring/models/submission_data_request_token.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SubmissionDataRequestToken(BaseModel): + """ + SubmissionDataRequestToken + """ # noqa: E501 + id: Optional[StrictStr] + secret: StrictStr + expires_at: Optional[StrictStr] + data_request_url: Optional[StrictStr] + __properties: ClassVar[List[str]] = ["id", "secret", "expires_at", "data_request_url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubmissionDataRequestToken from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if expires_at (nullable) is None + # and model_fields_set contains the field + if self.expires_at is None and "expires_at" in self.model_fields_set: + _dict['expires_at'] = None + + # set to None if data_request_url (nullable) is None + # and model_fields_set contains the field + if self.data_request_url is None and "data_request_url" in self.model_fields_set: + _dict['data_request_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubmissionDataRequestToken from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "secret": obj.get("secret"), + "expires_at": obj.get("expires_at"), + "data_request_url": obj.get("data_request_url") + }) + return _obj + + diff --git a/docspring/models/submission_preview.py b/docspring/models/submission_preview.py new file mode 100644 index 0000000..818a29e --- /dev/null +++ b/docspring/models/submission_preview.py @@ -0,0 +1,225 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from docspring.models.submission_action import SubmissionAction +from docspring.models.submission_data_request import SubmissionDataRequest +from typing import Optional, Set +from typing_extensions import Self + +class SubmissionPreview(BaseModel): + """ + SubmissionPreview + """ # noqa: E501 + batch_id: Optional[StrictStr] + data_requests: List[SubmissionDataRequest] + editable: Optional[StrictBool] + expired: StrictBool + expires_at: Optional[StrictStr] + id: Optional[StrictStr] + json_schema_errors: Optional[List[StrictStr]] + metadata: Dict[str, Any] + password: Optional[StrictStr] + processed_at: Optional[StrictStr] + state: StrictStr + template_id: Optional[StrictStr] + test: StrictBool + truncated_text: Optional[Dict[str, Any]] + pdf_hash: Optional[StrictStr] + download_url: Optional[StrictStr] + permanent_download_url: Optional[StrictStr] + preview_download_url: Optional[StrictStr] + preview_generated_at: Optional[StrictStr] + audit_trail_download_url: Optional[StrictStr] + actions: List[SubmissionAction] + __properties: ClassVar[List[str]] = ["batch_id", "data_requests", "editable", "expired", "expires_at", "id", "json_schema_errors", "metadata", "password", "processed_at", "state", "template_id", "test", "truncated_text", "pdf_hash", "download_url", "permanent_download_url", "preview_download_url", "preview_generated_at", "audit_trail_download_url", "actions"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending', 'processed', 'invalid_data', 'error', 'image_download_failed', 'image_processing_failed', 'waiting_for_data_requests', 'syntax_error', 'account_suspended', 'license_revoked', 'accidental']): + raise ValueError("must be one of enum values ('pending', 'processed', 'invalid_data', 'error', 'image_download_failed', 'image_processing_failed', 'waiting_for_data_requests', 'syntax_error', 'account_suspended', 'license_revoked', 'accidental')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SubmissionPreview from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data_requests (list) + _items = [] + if self.data_requests: + for _item_data_requests in self.data_requests: + if _item_data_requests: + _items.append(_item_data_requests.to_dict()) + _dict['data_requests'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in actions (list) + _items = [] + if self.actions: + for _item_actions in self.actions: + if _item_actions: + _items.append(_item_actions.to_dict()) + _dict['actions'] = _items + # set to None if batch_id (nullable) is None + # and model_fields_set contains the field + if self.batch_id is None and "batch_id" in self.model_fields_set: + _dict['batch_id'] = None + + # set to None if editable (nullable) is None + # and model_fields_set contains the field + if self.editable is None and "editable" in self.model_fields_set: + _dict['editable'] = None + + # set to None if expires_at (nullable) is None + # and model_fields_set contains the field + if self.expires_at is None and "expires_at" in self.model_fields_set: + _dict['expires_at'] = None + + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if json_schema_errors (nullable) is None + # and model_fields_set contains the field + if self.json_schema_errors is None and "json_schema_errors" in self.model_fields_set: + _dict['json_schema_errors'] = None + + # set to None if password (nullable) is None + # and model_fields_set contains the field + if self.password is None and "password" in self.model_fields_set: + _dict['password'] = None + + # set to None if processed_at (nullable) is None + # and model_fields_set contains the field + if self.processed_at is None and "processed_at" in self.model_fields_set: + _dict['processed_at'] = None + + # set to None if template_id (nullable) is None + # and model_fields_set contains the field + if self.template_id is None and "template_id" in self.model_fields_set: + _dict['template_id'] = None + + # set to None if truncated_text (nullable) is None + # and model_fields_set contains the field + if self.truncated_text is None and "truncated_text" in self.model_fields_set: + _dict['truncated_text'] = None + + # set to None if pdf_hash (nullable) is None + # and model_fields_set contains the field + if self.pdf_hash is None and "pdf_hash" in self.model_fields_set: + _dict['pdf_hash'] = None + + # set to None if download_url (nullable) is None + # and model_fields_set contains the field + if self.download_url is None and "download_url" in self.model_fields_set: + _dict['download_url'] = None + + # set to None if permanent_download_url (nullable) is None + # and model_fields_set contains the field + if self.permanent_download_url is None and "permanent_download_url" in self.model_fields_set: + _dict['permanent_download_url'] = None + + # set to None if preview_download_url (nullable) is None + # and model_fields_set contains the field + if self.preview_download_url is None and "preview_download_url" in self.model_fields_set: + _dict['preview_download_url'] = None + + # set to None if preview_generated_at (nullable) is None + # and model_fields_set contains the field + if self.preview_generated_at is None and "preview_generated_at" in self.model_fields_set: + _dict['preview_generated_at'] = None + + # set to None if audit_trail_download_url (nullable) is None + # and model_fields_set contains the field + if self.audit_trail_download_url is None and "audit_trail_download_url" in self.model_fields_set: + _dict['audit_trail_download_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SubmissionPreview from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "batch_id": obj.get("batch_id"), + "data_requests": [SubmissionDataRequest.from_dict(_item) for _item in obj["data_requests"]] if obj.get("data_requests") is not None else None, + "editable": obj.get("editable"), + "expired": obj.get("expired"), + "expires_at": obj.get("expires_at"), + "id": obj.get("id"), + "json_schema_errors": obj.get("json_schema_errors"), + "metadata": obj.get("metadata"), + "password": obj.get("password"), + "processed_at": obj.get("processed_at"), + "state": obj.get("state"), + "template_id": obj.get("template_id"), + "test": obj.get("test"), + "truncated_text": obj.get("truncated_text"), + "pdf_hash": obj.get("pdf_hash"), + "download_url": obj.get("download_url"), + "permanent_download_url": obj.get("permanent_download_url"), + "preview_download_url": obj.get("preview_download_url"), + "preview_generated_at": obj.get("preview_generated_at"), + "audit_trail_download_url": obj.get("audit_trail_download_url"), + "actions": [SubmissionAction.from_dict(_item) for _item in obj["actions"]] if obj.get("actions") is not None else None + }) + return _obj + + diff --git a/docspring/models/success_error_response.py b/docspring/models/success_error_response.py new file mode 100644 index 0000000..4fe7948 --- /dev/null +++ b/docspring/models/success_error_response.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SuccessErrorResponse(BaseModel): + """ + SuccessErrorResponse + """ # noqa: E501 + status: StrictStr + error: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["status", "error"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'error']): + raise ValueError("must be one of enum values ('success', 'error')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SuccessErrorResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SuccessErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "error": obj.get("error") + }) + return _obj + + diff --git a/docspring/models/success_multiple_errors_response.py b/docspring/models/success_multiple_errors_response.py new file mode 100644 index 0000000..4335139 --- /dev/null +++ b/docspring/models/success_multiple_errors_response.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class SuccessMultipleErrorsResponse(BaseModel): + """ + SuccessMultipleErrorsResponse + """ # noqa: E501 + status: StrictStr + errors: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["status", "errors"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'error']): + raise ValueError("must be one of enum values ('success', 'error')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SuccessMultipleErrorsResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SuccessMultipleErrorsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "errors": obj.get("errors") + }) + return _obj + + diff --git a/docspring/models/template.py b/docspring/models/template.py index 275166d..9c350ae 100644 --- a/docspring/models/template.py +++ b/docspring/models/template.py @@ -1,603 +1,302 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - - -class Template(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +class Template(BaseModel): """ - Attributes: - openapi_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. - """ - openapi_types = { - 'expiration_interval': 'str', - 'webhook_url': 'str', - 'parent_folder_id': 'str', - 'expire_after': 'float', - 'allow_additional_properties': 'bool', - 'description': 'str', - 'public_submissions': 'bool', - 'slack_webhook_url': 'str', - 'path': 'str', - 'public_web_form': 'bool', - 'editable_submissions': 'bool', - 'expire_submissions': 'bool', - 'name': 'str', - 'permanent_document_url': 'str', - 'template_type': 'str', - 'id': 'str', - 'page_dimensions': 'list[list[float]]', - 'locked': 'bool', - 'redirect_url': 'str', - 'document_url': 'str' - } - - attribute_map = { - 'expiration_interval': 'expiration_interval', - 'webhook_url': 'webhook_url', - 'parent_folder_id': 'parent_folder_id', - 'expire_after': 'expire_after', - 'allow_additional_properties': 'allow_additional_properties', - 'description': 'description', - 'public_submissions': 'public_submissions', - 'slack_webhook_url': 'slack_webhook_url', - 'path': 'path', - 'public_web_form': 'public_web_form', - 'editable_submissions': 'editable_submissions', - 'expire_submissions': 'expire_submissions', - 'name': 'name', - 'permanent_document_url': 'permanent_document_url', - 'template_type': 'template_type', - 'id': 'id', - 'page_dimensions': 'page_dimensions', - 'locked': 'locked', - 'redirect_url': 'redirect_url', - 'document_url': 'document_url' - } - - def __init__(self, expiration_interval=None, webhook_url=None, parent_folder_id=None, expire_after=None, allow_additional_properties=None, description=None, public_submissions=None, slack_webhook_url=None, path=None, public_web_form=None, editable_submissions=None, expire_submissions=None, name=None, permanent_document_url=None, template_type=None, id=None, page_dimensions=None, locked=None, redirect_url=None, document_url=None): # noqa: E501 - """Template - a model defined in OpenAPI""" # noqa: E501 - - self._expiration_interval = None - self._webhook_url = None - self._parent_folder_id = None - self._expire_after = None - self._allow_additional_properties = None - self._description = None - self._public_submissions = None - self._slack_webhook_url = None - self._path = None - self._public_web_form = None - self._editable_submissions = None - self._expire_submissions = None - self._name = None - self._permanent_document_url = None - self._template_type = None - self._id = None - self._page_dimensions = None - self._locked = None - self._redirect_url = None - self._document_url = None - self.discriminator = None - - if expiration_interval is not None: - self.expiration_interval = expiration_interval - self.webhook_url = webhook_url - self.parent_folder_id = parent_folder_id - if expire_after is not None: - self.expire_after = expire_after - if allow_additional_properties is not None: - self.allow_additional_properties = allow_additional_properties - self.description = description - if public_submissions is not None: - self.public_submissions = public_submissions - self.slack_webhook_url = slack_webhook_url - if path is not None: - self.path = path - if public_web_form is not None: - self.public_web_form = public_web_form - if editable_submissions is not None: - self.editable_submissions = editable_submissions - if expire_submissions is not None: - self.expire_submissions = expire_submissions - self.name = name - self.permanent_document_url = permanent_document_url - if template_type is not None: - self.template_type = template_type - if id is not None: - self.id = id - self.page_dimensions = page_dimensions - if locked is not None: - self.locked = locked - self.redirect_url = redirect_url - self.document_url = document_url - - @property - def expiration_interval(self): - """Gets the expiration_interval of this Template. # noqa: E501 - - - :return: The expiration_interval of this Template. # noqa: E501 - :rtype: str - """ - return self._expiration_interval - - @expiration_interval.setter - def expiration_interval(self, expiration_interval): - """Sets the expiration_interval of this Template. - - - :param expiration_interval: The expiration_interval of this Template. # noqa: E501 - :type: str - """ - allowed_values = ["minutes", "hours", "days"] # noqa: E501 - if expiration_interval not in allowed_values: - raise ValueError( - "Invalid value for `expiration_interval` ({0}), must be one of {1}" # noqa: E501 - .format(expiration_interval, allowed_values) - ) - - self._expiration_interval = expiration_interval - - @property - def webhook_url(self): - """Gets the webhook_url of this Template. # noqa: E501 - - - :return: The webhook_url of this Template. # noqa: E501 - :rtype: str - """ - return self._webhook_url - - @webhook_url.setter - def webhook_url(self, webhook_url): - """Sets the webhook_url of this Template. - - - :param webhook_url: The webhook_url of this Template. # noqa: E501 - :type: str - """ - - self._webhook_url = webhook_url - - @property - def parent_folder_id(self): - """Gets the parent_folder_id of this Template. # noqa: E501 - - - :return: The parent_folder_id of this Template. # noqa: E501 - :rtype: str - """ - return self._parent_folder_id - - @parent_folder_id.setter - def parent_folder_id(self, parent_folder_id): - """Sets the parent_folder_id of this Template. - - - :param parent_folder_id: The parent_folder_id of this Template. # noqa: E501 - :type: str - """ - - self._parent_folder_id = parent_folder_id - - @property - def expire_after(self): - """Gets the expire_after of this Template. # noqa: E501 - - - :return: The expire_after of this Template. # noqa: E501 - :rtype: float - """ - return self._expire_after - - @expire_after.setter - def expire_after(self, expire_after): - """Sets the expire_after of this Template. - - - :param expire_after: The expire_after of this Template. # noqa: E501 - :type: float - """ - - self._expire_after = expire_after - - @property - def allow_additional_properties(self): - """Gets the allow_additional_properties of this Template. # noqa: E501 - - - :return: The allow_additional_properties of this Template. # noqa: E501 - :rtype: bool - """ - return self._allow_additional_properties - - @allow_additional_properties.setter - def allow_additional_properties(self, allow_additional_properties): - """Sets the allow_additional_properties of this Template. - - - :param allow_additional_properties: The allow_additional_properties of this Template. # noqa: E501 - :type: bool - """ - - self._allow_additional_properties = allow_additional_properties - - @property - def description(self): - """Gets the description of this Template. # noqa: E501 - - - :return: The description of this Template. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this Template. - - - :param description: The description of this Template. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def public_submissions(self): - """Gets the public_submissions of this Template. # noqa: E501 - - - :return: The public_submissions of this Template. # noqa: E501 - :rtype: bool - """ - return self._public_submissions - - @public_submissions.setter - def public_submissions(self, public_submissions): - """Sets the public_submissions of this Template. - - - :param public_submissions: The public_submissions of this Template. # noqa: E501 - :type: bool - """ - - self._public_submissions = public_submissions - - @property - def slack_webhook_url(self): - """Gets the slack_webhook_url of this Template. # noqa: E501 - - - :return: The slack_webhook_url of this Template. # noqa: E501 - :rtype: str - """ - return self._slack_webhook_url - - @slack_webhook_url.setter - def slack_webhook_url(self, slack_webhook_url): - """Sets the slack_webhook_url of this Template. - - - :param slack_webhook_url: The slack_webhook_url of this Template. # noqa: E501 - :type: str - """ - - self._slack_webhook_url = slack_webhook_url - - @property - def path(self): - """Gets the path of this Template. # noqa: E501 - - - :return: The path of this Template. # noqa: E501 - :rtype: str - """ - return self._path - - @path.setter - def path(self, path): - """Sets the path of this Template. - - - :param path: The path of this Template. # noqa: E501 - :type: str - """ - - self._path = path - - @property - def public_web_form(self): - """Gets the public_web_form of this Template. # noqa: E501 - - - :return: The public_web_form of this Template. # noqa: E501 - :rtype: bool - """ - return self._public_web_form - - @public_web_form.setter - def public_web_form(self, public_web_form): - """Sets the public_web_form of this Template. + Template + """ # noqa: E501 + add_data_request_submission_id_footers: StrictBool + allow_additional_properties: StrictBool + description: Optional[StrictStr] + document_filename: Optional[StrictStr] + document_md5: Optional[StrictStr] + document_parse_error: StrictBool + document_processed: StrictBool + document_state: StrictStr + document_url: Optional[StrictStr] + editable_submissions: StrictBool + embed_domains: Optional[StrictStr] + encrypt_pdfs_password: Optional[StrictStr] + encrypt_pdfs: StrictBool + expiration_interval: StrictStr + expire_after: StrictInt + expire_submissions: StrictBool + external_predefined_fields_template_id: Optional[StrictStr] + external_predefined_fields_template_name: Optional[StrictStr] + first_template: StrictBool + id: Optional[StrictStr] + locked: StrictBool + merge_audit_trail_pdf: StrictBool + name: Optional[StrictStr] + page_count: StrictInt + page_dimensions: Optional[List[Annotated[List[Union[StrictFloat, StrictInt]], Field(min_length=2, max_length=2)]]] + parent_folder_id: Optional[StrictStr] + path: Optional[StrictStr] + permanent_document_url: Optional[StrictStr] + public_submissions: StrictBool + public_web_form: StrictBool + redirect_url: Optional[StrictStr] + slack_webhook_url: Optional[StrictStr] + template_type: StrictStr + updated_at: Optional[StrictStr] + webhook_url: Optional[StrictStr] + demo: StrictBool + defaults: Dict[str, Any] + field_order: List[List[Union[StrictFloat, StrictInt]]] + fields: Dict[str, Any] + footer_html: Optional[StrictStr] + header_html: Optional[StrictStr] + html_engine_options: Dict[str, Any] + html: Optional[StrictStr] + predefined_fields: List[Dict[str, Any]] + scss: Optional[StrictStr] + shared_field_data: Dict[str, Any] + __properties: ClassVar[List[str]] = ["add_data_request_submission_id_footers", "allow_additional_properties", "description", "document_filename", "document_md5", "document_parse_error", "document_processed", "document_state", "document_url", "editable_submissions", "embed_domains", "encrypt_pdfs_password", "encrypt_pdfs", "expiration_interval", "expire_after", "expire_submissions", "external_predefined_fields_template_id", "external_predefined_fields_template_name", "first_template", "id", "locked", "merge_audit_trail_pdf", "name", "page_count", "page_dimensions", "parent_folder_id", "path", "permanent_document_url", "public_submissions", "public_web_form", "redirect_url", "slack_webhook_url", "template_type", "updated_at", "webhook_url", "demo", "defaults", "field_order", "fields", "footer_html", "header_html", "html_engine_options", "html", "predefined_fields", "scss", "shared_field_data"] + + @field_validator('document_state') + def document_state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending', 'processed', 'password_required', 'malformed_pdf', 'unknown_error']): + raise ValueError("must be one of enum values ('pending', 'processed', 'password_required', 'malformed_pdf', 'unknown_error')") + return value + + @field_validator('template_type') + def template_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pdf', 'html']): + raise ValueError("must be one of enum values ('pdf', 'html')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Template from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if document_filename (nullable) is None + # and model_fields_set contains the field + if self.document_filename is None and "document_filename" in self.model_fields_set: + _dict['document_filename'] = None + + # set to None if document_md5 (nullable) is None + # and model_fields_set contains the field + if self.document_md5 is None and "document_md5" in self.model_fields_set: + _dict['document_md5'] = None + + # set to None if document_url (nullable) is None + # and model_fields_set contains the field + if self.document_url is None and "document_url" in self.model_fields_set: + _dict['document_url'] = None + + # set to None if embed_domains (nullable) is None + # and model_fields_set contains the field + if self.embed_domains is None and "embed_domains" in self.model_fields_set: + _dict['embed_domains'] = None + + # set to None if encrypt_pdfs_password (nullable) is None + # and model_fields_set contains the field + if self.encrypt_pdfs_password is None and "encrypt_pdfs_password" in self.model_fields_set: + _dict['encrypt_pdfs_password'] = None + + # set to None if external_predefined_fields_template_id (nullable) is None + # and model_fields_set contains the field + if self.external_predefined_fields_template_id is None and "external_predefined_fields_template_id" in self.model_fields_set: + _dict['external_predefined_fields_template_id'] = None + + # set to None if external_predefined_fields_template_name (nullable) is None + # and model_fields_set contains the field + if self.external_predefined_fields_template_name is None and "external_predefined_fields_template_name" in self.model_fields_set: + _dict['external_predefined_fields_template_name'] = None + + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if page_dimensions (nullable) is None + # and model_fields_set contains the field + if self.page_dimensions is None and "page_dimensions" in self.model_fields_set: + _dict['page_dimensions'] = None + + # set to None if parent_folder_id (nullable) is None + # and model_fields_set contains the field + if self.parent_folder_id is None and "parent_folder_id" in self.model_fields_set: + _dict['parent_folder_id'] = None + + # set to None if path (nullable) is None + # and model_fields_set contains the field + if self.path is None and "path" in self.model_fields_set: + _dict['path'] = None + + # set to None if permanent_document_url (nullable) is None + # and model_fields_set contains the field + if self.permanent_document_url is None and "permanent_document_url" in self.model_fields_set: + _dict['permanent_document_url'] = None + + # set to None if redirect_url (nullable) is None + # and model_fields_set contains the field + if self.redirect_url is None and "redirect_url" in self.model_fields_set: + _dict['redirect_url'] = None + + # set to None if slack_webhook_url (nullable) is None + # and model_fields_set contains the field + if self.slack_webhook_url is None and "slack_webhook_url" in self.model_fields_set: + _dict['slack_webhook_url'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + # set to None if webhook_url (nullable) is None + # and model_fields_set contains the field + if self.webhook_url is None and "webhook_url" in self.model_fields_set: + _dict['webhook_url'] = None + + # set to None if footer_html (nullable) is None + # and model_fields_set contains the field + if self.footer_html is None and "footer_html" in self.model_fields_set: + _dict['footer_html'] = None + + # set to None if header_html (nullable) is None + # and model_fields_set contains the field + if self.header_html is None and "header_html" in self.model_fields_set: + _dict['header_html'] = None + + # set to None if html (nullable) is None + # and model_fields_set contains the field + if self.html is None and "html" in self.model_fields_set: + _dict['html'] = None + + # set to None if scss (nullable) is None + # and model_fields_set contains the field + if self.scss is None and "scss" in self.model_fields_set: + _dict['scss'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Template from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "add_data_request_submission_id_footers": obj.get("add_data_request_submission_id_footers"), + "allow_additional_properties": obj.get("allow_additional_properties"), + "description": obj.get("description"), + "document_filename": obj.get("document_filename"), + "document_md5": obj.get("document_md5"), + "document_parse_error": obj.get("document_parse_error"), + "document_processed": obj.get("document_processed"), + "document_state": obj.get("document_state"), + "document_url": obj.get("document_url"), + "editable_submissions": obj.get("editable_submissions"), + "embed_domains": obj.get("embed_domains"), + "encrypt_pdfs_password": obj.get("encrypt_pdfs_password"), + "encrypt_pdfs": obj.get("encrypt_pdfs"), + "expiration_interval": obj.get("expiration_interval"), + "expire_after": obj.get("expire_after"), + "expire_submissions": obj.get("expire_submissions"), + "external_predefined_fields_template_id": obj.get("external_predefined_fields_template_id"), + "external_predefined_fields_template_name": obj.get("external_predefined_fields_template_name"), + "first_template": obj.get("first_template"), + "id": obj.get("id"), + "locked": obj.get("locked"), + "merge_audit_trail_pdf": obj.get("merge_audit_trail_pdf"), + "name": obj.get("name"), + "page_count": obj.get("page_count"), + "page_dimensions": obj.get("page_dimensions"), + "parent_folder_id": obj.get("parent_folder_id"), + "path": obj.get("path"), + "permanent_document_url": obj.get("permanent_document_url"), + "public_submissions": obj.get("public_submissions"), + "public_web_form": obj.get("public_web_form"), + "redirect_url": obj.get("redirect_url"), + "slack_webhook_url": obj.get("slack_webhook_url"), + "template_type": obj.get("template_type"), + "updated_at": obj.get("updated_at"), + "webhook_url": obj.get("webhook_url"), + "demo": obj.get("demo"), + "defaults": obj.get("defaults"), + "field_order": obj.get("field_order"), + "fields": obj.get("fields"), + "footer_html": obj.get("footer_html"), + "header_html": obj.get("header_html"), + "html_engine_options": obj.get("html_engine_options"), + "html": obj.get("html"), + "predefined_fields": obj.get("predefined_fields"), + "scss": obj.get("scss"), + "shared_field_data": obj.get("shared_field_data") + }) + return _obj - :param public_web_form: The public_web_form of this Template. # noqa: E501 - :type: bool - """ - - self._public_web_form = public_web_form - - @property - def editable_submissions(self): - """Gets the editable_submissions of this Template. # noqa: E501 - - - :return: The editable_submissions of this Template. # noqa: E501 - :rtype: bool - """ - return self._editable_submissions - - @editable_submissions.setter - def editable_submissions(self, editable_submissions): - """Sets the editable_submissions of this Template. - - - :param editable_submissions: The editable_submissions of this Template. # noqa: E501 - :type: bool - """ - - self._editable_submissions = editable_submissions - - @property - def expire_submissions(self): - """Gets the expire_submissions of this Template. # noqa: E501 - - - :return: The expire_submissions of this Template. # noqa: E501 - :rtype: bool - """ - return self._expire_submissions - - @expire_submissions.setter - def expire_submissions(self, expire_submissions): - """Sets the expire_submissions of this Template. - - - :param expire_submissions: The expire_submissions of this Template. # noqa: E501 - :type: bool - """ - - self._expire_submissions = expire_submissions - - @property - def name(self): - """Gets the name of this Template. # noqa: E501 - - - :return: The name of this Template. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Template. - - - :param name: The name of this Template. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def permanent_document_url(self): - """Gets the permanent_document_url of this Template. # noqa: E501 - - - :return: The permanent_document_url of this Template. # noqa: E501 - :rtype: str - """ - return self._permanent_document_url - - @permanent_document_url.setter - def permanent_document_url(self, permanent_document_url): - """Sets the permanent_document_url of this Template. - - - :param permanent_document_url: The permanent_document_url of this Template. # noqa: E501 - :type: str - """ - - self._permanent_document_url = permanent_document_url - - @property - def template_type(self): - """Gets the template_type of this Template. # noqa: E501 - - - :return: The template_type of this Template. # noqa: E501 - :rtype: str - """ - return self._template_type - - @template_type.setter - def template_type(self, template_type): - """Sets the template_type of this Template. - - - :param template_type: The template_type of this Template. # noqa: E501 - :type: str - """ - - self._template_type = template_type - - @property - def id(self): - """Gets the id of this Template. # noqa: E501 - - - :return: The id of this Template. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Template. - - - :param id: The id of this Template. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def page_dimensions(self): - """Gets the page_dimensions of this Template. # noqa: E501 - - - :return: The page_dimensions of this Template. # noqa: E501 - :rtype: list[list[float]] - """ - return self._page_dimensions - - @page_dimensions.setter - def page_dimensions(self, page_dimensions): - """Sets the page_dimensions of this Template. - - - :param page_dimensions: The page_dimensions of this Template. # noqa: E501 - :type: list[list[float]] - """ - - self._page_dimensions = page_dimensions - - @property - def locked(self): - """Gets the locked of this Template. # noqa: E501 - - - :return: The locked of this Template. # noqa: E501 - :rtype: bool - """ - return self._locked - - @locked.setter - def locked(self, locked): - """Sets the locked of this Template. - - - :param locked: The locked of this Template. # noqa: E501 - :type: bool - """ - - self._locked = locked - - @property - def redirect_url(self): - """Gets the redirect_url of this Template. # noqa: E501 - - - :return: The redirect_url of this Template. # noqa: E501 - :rtype: str - """ - return self._redirect_url - - @redirect_url.setter - def redirect_url(self, redirect_url): - """Sets the redirect_url of this Template. - - - :param redirect_url: The redirect_url of this Template. # noqa: E501 - :type: str - """ - - self._redirect_url = redirect_url - - @property - def document_url(self): - """Gets the document_url of this Template. # noqa: E501 - - - :return: The document_url of this Template. # noqa: E501 - :rtype: str - """ - return self._document_url - - @document_url.setter - def document_url(self, document_url): - """Sets the document_url of this Template. - - - :param document_url: The document_url of this Template. # noqa: E501 - :type: str - """ - - self._document_url = document_url - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, Template): - 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/docspring/models/template1.py b/docspring/models/template1.py deleted file mode 100644 index aa2fb65..0000000 --- a/docspring/models/template1.py +++ /dev/null @@ -1,1089 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Template1(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'document_processed': 'bool', - 'expiration_interval': 'str', - 'scss': 'str', - 'document_state': 'str', - 'expire_after': 'float', - 'description': 'str', - 'slack_webhook_url': 'str', - 'demo': 'bool', - 'path': 'str', - 'header_html': 'str', - 'public_web_form': 'bool', - 'field_order': 'list[list[float]]', - 'permanent_document_url': 'str', - 'html': 'str', - 'template_type': 'str', - 'id': 'str', - 'page_dimensions': 'list[list[float]]', - 'locked': 'bool', - 'page_count': 'float', - 'encrypt_pdfs': 'bool', - 'webhook_url': 'str', - 'embed_domains': 'list[str]', - 'parent_folder_id': 'str', - 'allow_additional_properties': 'bool', - 'encrypt_pdfs_password': 'str', - 'public_submissions': 'bool', - 'shared_field_data': 'object', - 'document_md5': 'str', - 'first_template': 'bool', - 'defaults': 'Template1Defaults', - 'editable_submissions': 'bool', - 'expire_submissions': 'bool', - 'name': 'str', - 'footer_html': 'str', - 'document_parse_error': 'bool', - 'fields': 'object', - 'document_filename': 'str', - 'redirect_url': 'str', - 'document_url': 'str' - } - - attribute_map = { - 'document_processed': 'document_processed', - 'expiration_interval': 'expiration_interval', - 'scss': 'scss', - 'document_state': 'document_state', - 'expire_after': 'expire_after', - 'description': 'description', - 'slack_webhook_url': 'slack_webhook_url', - 'demo': 'demo', - 'path': 'path', - 'header_html': 'header_html', - 'public_web_form': 'public_web_form', - 'field_order': 'field_order', - 'permanent_document_url': 'permanent_document_url', - 'html': 'html', - 'template_type': 'template_type', - 'id': 'id', - 'page_dimensions': 'page_dimensions', - 'locked': 'locked', - 'page_count': 'page_count', - 'encrypt_pdfs': 'encrypt_pdfs', - 'webhook_url': 'webhook_url', - 'embed_domains': 'embed_domains', - 'parent_folder_id': 'parent_folder_id', - 'allow_additional_properties': 'allow_additional_properties', - 'encrypt_pdfs_password': 'encrypt_pdfs_password', - 'public_submissions': 'public_submissions', - 'shared_field_data': 'shared_field_data', - 'document_md5': 'document_md5', - 'first_template': 'first_template', - 'defaults': 'defaults', - 'editable_submissions': 'editable_submissions', - 'expire_submissions': 'expire_submissions', - 'name': 'name', - 'footer_html': 'footer_html', - 'document_parse_error': 'document_parse_error', - 'fields': 'fields', - 'document_filename': 'document_filename', - 'redirect_url': 'redirect_url', - 'document_url': 'document_url' - } - - def __init__(self, document_processed=None, expiration_interval=None, scss=None, document_state=None, expire_after=None, description=None, slack_webhook_url=None, demo=None, path=None, header_html=None, public_web_form=None, field_order=None, permanent_document_url=None, html=None, template_type=None, id=None, page_dimensions=None, locked=None, page_count=None, encrypt_pdfs=None, webhook_url=None, embed_domains=None, parent_folder_id=None, allow_additional_properties=None, encrypt_pdfs_password=None, public_submissions=None, shared_field_data=None, document_md5=None, first_template=None, defaults=None, editable_submissions=None, expire_submissions=None, name=None, footer_html=None, document_parse_error=None, fields=None, document_filename=None, redirect_url=None, document_url=None): # noqa: E501 - """Template1 - a model defined in OpenAPI""" # noqa: E501 - - self._document_processed = None - self._expiration_interval = None - self._scss = None - self._document_state = None - self._expire_after = None - self._description = None - self._slack_webhook_url = None - self._demo = None - self._path = None - self._header_html = None - self._public_web_form = None - self._field_order = None - self._permanent_document_url = None - self._html = None - self._template_type = None - self._id = None - self._page_dimensions = None - self._locked = None - self._page_count = None - self._encrypt_pdfs = None - self._webhook_url = None - self._embed_domains = None - self._parent_folder_id = None - self._allow_additional_properties = None - self._encrypt_pdfs_password = None - self._public_submissions = None - self._shared_field_data = None - self._document_md5 = None - self._first_template = None - self._defaults = None - self._editable_submissions = None - self._expire_submissions = None - self._name = None - self._footer_html = None - self._document_parse_error = None - self._fields = None - self._document_filename = None - self._redirect_url = None - self._document_url = None - self.discriminator = None - - if document_processed is not None: - self.document_processed = document_processed - if expiration_interval is not None: - self.expiration_interval = expiration_interval - self.scss = scss - if document_state is not None: - self.document_state = document_state - if expire_after is not None: - self.expire_after = expire_after - self.description = description - self.slack_webhook_url = slack_webhook_url - if demo is not None: - self.demo = demo - if path is not None: - self.path = path - self.header_html = header_html - if public_web_form is not None: - self.public_web_form = public_web_form - if field_order is not None: - self.field_order = field_order - self.permanent_document_url = permanent_document_url - self.html = html - if template_type is not None: - self.template_type = template_type - if id is not None: - self.id = id - self.page_dimensions = page_dimensions - if locked is not None: - self.locked = locked - if page_count is not None: - self.page_count = page_count - if encrypt_pdfs is not None: - self.encrypt_pdfs = encrypt_pdfs - self.webhook_url = webhook_url - self.embed_domains = embed_domains - self.parent_folder_id = parent_folder_id - if allow_additional_properties is not None: - self.allow_additional_properties = allow_additional_properties - self.encrypt_pdfs_password = encrypt_pdfs_password - if public_submissions is not None: - self.public_submissions = public_submissions - if shared_field_data is not None: - self.shared_field_data = shared_field_data - self.document_md5 = document_md5 - if first_template is not None: - self.first_template = first_template - if defaults is not None: - self.defaults = defaults - if editable_submissions is not None: - self.editable_submissions = editable_submissions - if expire_submissions is not None: - self.expire_submissions = expire_submissions - self.name = name - self.footer_html = footer_html - if document_parse_error is not None: - self.document_parse_error = document_parse_error - if fields is not None: - self.fields = fields - self.document_filename = document_filename - self.redirect_url = redirect_url - self.document_url = document_url - - @property - def document_processed(self): - """Gets the document_processed of this Template1. # noqa: E501 - - - :return: The document_processed of this Template1. # noqa: E501 - :rtype: bool - """ - return self._document_processed - - @document_processed.setter - def document_processed(self, document_processed): - """Sets the document_processed of this Template1. - - - :param document_processed: The document_processed of this Template1. # noqa: E501 - :type: bool - """ - - self._document_processed = document_processed - - @property - def expiration_interval(self): - """Gets the expiration_interval of this Template1. # noqa: E501 - - - :return: The expiration_interval of this Template1. # noqa: E501 - :rtype: str - """ - return self._expiration_interval - - @expiration_interval.setter - def expiration_interval(self, expiration_interval): - """Sets the expiration_interval of this Template1. - - - :param expiration_interval: The expiration_interval of this Template1. # noqa: E501 - :type: str - """ - allowed_values = ["minutes", "hours", "days"] # noqa: E501 - if expiration_interval not in allowed_values: - raise ValueError( - "Invalid value for `expiration_interval` ({0}), must be one of {1}" # noqa: E501 - .format(expiration_interval, allowed_values) - ) - - self._expiration_interval = expiration_interval - - @property - def scss(self): - """Gets the scss of this Template1. # noqa: E501 - - - :return: The scss of this Template1. # noqa: E501 - :rtype: str - """ - return self._scss - - @scss.setter - def scss(self, scss): - """Sets the scss of this Template1. - - - :param scss: The scss of this Template1. # noqa: E501 - :type: str - """ - - self._scss = scss - - @property - def document_state(self): - """Gets the document_state of this Template1. # noqa: E501 - - - :return: The document_state of this Template1. # noqa: E501 - :rtype: str - """ - return self._document_state - - @document_state.setter - def document_state(self, document_state): - """Sets the document_state of this Template1. - - - :param document_state: The document_state of this Template1. # noqa: E501 - :type: str - """ - - self._document_state = document_state - - @property - def expire_after(self): - """Gets the expire_after of this Template1. # noqa: E501 - - - :return: The expire_after of this Template1. # noqa: E501 - :rtype: float - """ - return self._expire_after - - @expire_after.setter - def expire_after(self, expire_after): - """Sets the expire_after of this Template1. - - - :param expire_after: The expire_after of this Template1. # noqa: E501 - :type: float - """ - - self._expire_after = expire_after - - @property - def description(self): - """Gets the description of this Template1. # noqa: E501 - - - :return: The description of this Template1. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this Template1. - - - :param description: The description of this Template1. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def slack_webhook_url(self): - """Gets the slack_webhook_url of this Template1. # noqa: E501 - - - :return: The slack_webhook_url of this Template1. # noqa: E501 - :rtype: str - """ - return self._slack_webhook_url - - @slack_webhook_url.setter - def slack_webhook_url(self, slack_webhook_url): - """Sets the slack_webhook_url of this Template1. - - - :param slack_webhook_url: The slack_webhook_url of this Template1. # noqa: E501 - :type: str - """ - - self._slack_webhook_url = slack_webhook_url - - @property - def demo(self): - """Gets the demo of this Template1. # noqa: E501 - - - :return: The demo of this Template1. # noqa: E501 - :rtype: bool - """ - return self._demo - - @demo.setter - def demo(self, demo): - """Sets the demo of this Template1. - - - :param demo: The demo of this Template1. # noqa: E501 - :type: bool - """ - - self._demo = demo - - @property - def path(self): - """Gets the path of this Template1. # noqa: E501 - - - :return: The path of this Template1. # noqa: E501 - :rtype: str - """ - return self._path - - @path.setter - def path(self, path): - """Sets the path of this Template1. - - - :param path: The path of this Template1. # noqa: E501 - :type: str - """ - - self._path = path - - @property - def header_html(self): - """Gets the header_html of this Template1. # noqa: E501 - - - :return: The header_html of this Template1. # noqa: E501 - :rtype: str - """ - return self._header_html - - @header_html.setter - def header_html(self, header_html): - """Sets the header_html of this Template1. - - - :param header_html: The header_html of this Template1. # noqa: E501 - :type: str - """ - - self._header_html = header_html - - @property - def public_web_form(self): - """Gets the public_web_form of this Template1. # noqa: E501 - - - :return: The public_web_form of this Template1. # noqa: E501 - :rtype: bool - """ - return self._public_web_form - - @public_web_form.setter - def public_web_form(self, public_web_form): - """Sets the public_web_form of this Template1. - - - :param public_web_form: The public_web_form of this Template1. # noqa: E501 - :type: bool - """ - - self._public_web_form = public_web_form - - @property - def field_order(self): - """Gets the field_order of this Template1. # noqa: E501 - - - :return: The field_order of this Template1. # noqa: E501 - :rtype: list[list[float]] - """ - return self._field_order - - @field_order.setter - def field_order(self, field_order): - """Sets the field_order of this Template1. - - - :param field_order: The field_order of this Template1. # noqa: E501 - :type: list[list[float]] - """ - - self._field_order = field_order - - @property - def permanent_document_url(self): - """Gets the permanent_document_url of this Template1. # noqa: E501 - - - :return: The permanent_document_url of this Template1. # noqa: E501 - :rtype: str - """ - return self._permanent_document_url - - @permanent_document_url.setter - def permanent_document_url(self, permanent_document_url): - """Sets the permanent_document_url of this Template1. - - - :param permanent_document_url: The permanent_document_url of this Template1. # noqa: E501 - :type: str - """ - - self._permanent_document_url = permanent_document_url - - @property - def html(self): - """Gets the html of this Template1. # noqa: E501 - - - :return: The html of this Template1. # noqa: E501 - :rtype: str - """ - return self._html - - @html.setter - def html(self, html): - """Sets the html of this Template1. - - - :param html: The html of this Template1. # noqa: E501 - :type: str - """ - - self._html = html - - @property - def template_type(self): - """Gets the template_type of this Template1. # noqa: E501 - - - :return: The template_type of this Template1. # noqa: E501 - :rtype: str - """ - return self._template_type - - @template_type.setter - def template_type(self, template_type): - """Sets the template_type of this Template1. - - - :param template_type: The template_type of this Template1. # noqa: E501 - :type: str - """ - - self._template_type = template_type - - @property - def id(self): - """Gets the id of this Template1. # noqa: E501 - - - :return: The id of this Template1. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Template1. - - - :param id: The id of this Template1. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def page_dimensions(self): - """Gets the page_dimensions of this Template1. # noqa: E501 - - - :return: The page_dimensions of this Template1. # noqa: E501 - :rtype: list[list[float]] - """ - return self._page_dimensions - - @page_dimensions.setter - def page_dimensions(self, page_dimensions): - """Sets the page_dimensions of this Template1. - - - :param page_dimensions: The page_dimensions of this Template1. # noqa: E501 - :type: list[list[float]] - """ - - self._page_dimensions = page_dimensions - - @property - def locked(self): - """Gets the locked of this Template1. # noqa: E501 - - - :return: The locked of this Template1. # noqa: E501 - :rtype: bool - """ - return self._locked - - @locked.setter - def locked(self, locked): - """Sets the locked of this Template1. - - - :param locked: The locked of this Template1. # noqa: E501 - :type: bool - """ - - self._locked = locked - - @property - def page_count(self): - """Gets the page_count of this Template1. # noqa: E501 - - - :return: The page_count of this Template1. # noqa: E501 - :rtype: float - """ - return self._page_count - - @page_count.setter - def page_count(self, page_count): - """Sets the page_count of this Template1. - - - :param page_count: The page_count of this Template1. # noqa: E501 - :type: float - """ - - self._page_count = page_count - - @property - def encrypt_pdfs(self): - """Gets the encrypt_pdfs of this Template1. # noqa: E501 - - - :return: The encrypt_pdfs of this Template1. # noqa: E501 - :rtype: bool - """ - return self._encrypt_pdfs - - @encrypt_pdfs.setter - def encrypt_pdfs(self, encrypt_pdfs): - """Sets the encrypt_pdfs of this Template1. - - - :param encrypt_pdfs: The encrypt_pdfs of this Template1. # noqa: E501 - :type: bool - """ - - self._encrypt_pdfs = encrypt_pdfs - - @property - def webhook_url(self): - """Gets the webhook_url of this Template1. # noqa: E501 - - - :return: The webhook_url of this Template1. # noqa: E501 - :rtype: str - """ - return self._webhook_url - - @webhook_url.setter - def webhook_url(self, webhook_url): - """Sets the webhook_url of this Template1. - - - :param webhook_url: The webhook_url of this Template1. # noqa: E501 - :type: str - """ - - self._webhook_url = webhook_url - - @property - def embed_domains(self): - """Gets the embed_domains of this Template1. # noqa: E501 - - - :return: The embed_domains of this Template1. # noqa: E501 - :rtype: list[str] - """ - return self._embed_domains - - @embed_domains.setter - def embed_domains(self, embed_domains): - """Sets the embed_domains of this Template1. - - - :param embed_domains: The embed_domains of this Template1. # noqa: E501 - :type: list[str] - """ - - self._embed_domains = embed_domains - - @property - def parent_folder_id(self): - """Gets the parent_folder_id of this Template1. # noqa: E501 - - - :return: The parent_folder_id of this Template1. # noqa: E501 - :rtype: str - """ - return self._parent_folder_id - - @parent_folder_id.setter - def parent_folder_id(self, parent_folder_id): - """Sets the parent_folder_id of this Template1. - - - :param parent_folder_id: The parent_folder_id of this Template1. # noqa: E501 - :type: str - """ - - self._parent_folder_id = parent_folder_id - - @property - def allow_additional_properties(self): - """Gets the allow_additional_properties of this Template1. # noqa: E501 - - - :return: The allow_additional_properties of this Template1. # noqa: E501 - :rtype: bool - """ - return self._allow_additional_properties - - @allow_additional_properties.setter - def allow_additional_properties(self, allow_additional_properties): - """Sets the allow_additional_properties of this Template1. - - - :param allow_additional_properties: The allow_additional_properties of this Template1. # noqa: E501 - :type: bool - """ - - self._allow_additional_properties = allow_additional_properties - - @property - def encrypt_pdfs_password(self): - """Gets the encrypt_pdfs_password of this Template1. # noqa: E501 - - - :return: The encrypt_pdfs_password of this Template1. # noqa: E501 - :rtype: str - """ - return self._encrypt_pdfs_password - - @encrypt_pdfs_password.setter - def encrypt_pdfs_password(self, encrypt_pdfs_password): - """Sets the encrypt_pdfs_password of this Template1. - - - :param encrypt_pdfs_password: The encrypt_pdfs_password of this Template1. # noqa: E501 - :type: str - """ - - self._encrypt_pdfs_password = encrypt_pdfs_password - - @property - def public_submissions(self): - """Gets the public_submissions of this Template1. # noqa: E501 - - - :return: The public_submissions of this Template1. # noqa: E501 - :rtype: bool - """ - return self._public_submissions - - @public_submissions.setter - def public_submissions(self, public_submissions): - """Sets the public_submissions of this Template1. - - - :param public_submissions: The public_submissions of this Template1. # noqa: E501 - :type: bool - """ - - self._public_submissions = public_submissions - - @property - def shared_field_data(self): - """Gets the shared_field_data of this Template1. # noqa: E501 - - - :return: The shared_field_data of this Template1. # noqa: E501 - :rtype: object - """ - return self._shared_field_data - - @shared_field_data.setter - def shared_field_data(self, shared_field_data): - """Sets the shared_field_data of this Template1. - - - :param shared_field_data: The shared_field_data of this Template1. # noqa: E501 - :type: object - """ - - self._shared_field_data = shared_field_data - - @property - def document_md5(self): - """Gets the document_md5 of this Template1. # noqa: E501 - - - :return: The document_md5 of this Template1. # noqa: E501 - :rtype: str - """ - return self._document_md5 - - @document_md5.setter - def document_md5(self, document_md5): - """Sets the document_md5 of this Template1. - - - :param document_md5: The document_md5 of this Template1. # noqa: E501 - :type: str - """ - - self._document_md5 = document_md5 - - @property - def first_template(self): - """Gets the first_template of this Template1. # noqa: E501 - - - :return: The first_template of this Template1. # noqa: E501 - :rtype: bool - """ - return self._first_template - - @first_template.setter - def first_template(self, first_template): - """Sets the first_template of this Template1. - - - :param first_template: The first_template of this Template1. # noqa: E501 - :type: bool - """ - - self._first_template = first_template - - @property - def defaults(self): - """Gets the defaults of this Template1. # noqa: E501 - - - :return: The defaults of this Template1. # noqa: E501 - :rtype: Template1Defaults - """ - return self._defaults - - @defaults.setter - def defaults(self, defaults): - """Sets the defaults of this Template1. - - - :param defaults: The defaults of this Template1. # noqa: E501 - :type: Template1Defaults - """ - - self._defaults = defaults - - @property - def editable_submissions(self): - """Gets the editable_submissions of this Template1. # noqa: E501 - - - :return: The editable_submissions of this Template1. # noqa: E501 - :rtype: bool - """ - return self._editable_submissions - - @editable_submissions.setter - def editable_submissions(self, editable_submissions): - """Sets the editable_submissions of this Template1. - - - :param editable_submissions: The editable_submissions of this Template1. # noqa: E501 - :type: bool - """ - - self._editable_submissions = editable_submissions - - @property - def expire_submissions(self): - """Gets the expire_submissions of this Template1. # noqa: E501 - - - :return: The expire_submissions of this Template1. # noqa: E501 - :rtype: bool - """ - return self._expire_submissions - - @expire_submissions.setter - def expire_submissions(self, expire_submissions): - """Sets the expire_submissions of this Template1. - - - :param expire_submissions: The expire_submissions of this Template1. # noqa: E501 - :type: bool - """ - - self._expire_submissions = expire_submissions - - @property - def name(self): - """Gets the name of this Template1. # noqa: E501 - - - :return: The name of this Template1. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Template1. - - - :param name: The name of this Template1. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def footer_html(self): - """Gets the footer_html of this Template1. # noqa: E501 - - - :return: The footer_html of this Template1. # noqa: E501 - :rtype: str - """ - return self._footer_html - - @footer_html.setter - def footer_html(self, footer_html): - """Sets the footer_html of this Template1. - - - :param footer_html: The footer_html of this Template1. # noqa: E501 - :type: str - """ - - self._footer_html = footer_html - - @property - def document_parse_error(self): - """Gets the document_parse_error of this Template1. # noqa: E501 - - - :return: The document_parse_error of this Template1. # noqa: E501 - :rtype: bool - """ - return self._document_parse_error - - @document_parse_error.setter - def document_parse_error(self, document_parse_error): - """Sets the document_parse_error of this Template1. - - - :param document_parse_error: The document_parse_error of this Template1. # noqa: E501 - :type: bool - """ - - self._document_parse_error = document_parse_error - - @property - def fields(self): - """Gets the fields of this Template1. # noqa: E501 - - - :return: The fields of this Template1. # noqa: E501 - :rtype: object - """ - return self._fields - - @fields.setter - def fields(self, fields): - """Sets the fields of this Template1. - - - :param fields: The fields of this Template1. # noqa: E501 - :type: object - """ - - self._fields = fields - - @property - def document_filename(self): - """Gets the document_filename of this Template1. # noqa: E501 - - - :return: The document_filename of this Template1. # noqa: E501 - :rtype: str - """ - return self._document_filename - - @document_filename.setter - def document_filename(self, document_filename): - """Sets the document_filename of this Template1. - - - :param document_filename: The document_filename of this Template1. # noqa: E501 - :type: str - """ - - self._document_filename = document_filename - - @property - def redirect_url(self): - """Gets the redirect_url of this Template1. # noqa: E501 - - - :return: The redirect_url of this Template1. # noqa: E501 - :rtype: str - """ - return self._redirect_url - - @redirect_url.setter - def redirect_url(self, redirect_url): - """Sets the redirect_url of this Template1. - - - :param redirect_url: The redirect_url of this Template1. # noqa: E501 - :type: str - """ - - self._redirect_url = redirect_url - - @property - def document_url(self): - """Gets the document_url of this Template1. # noqa: E501 - - - :return: The document_url of this Template1. # noqa: E501 - :rtype: str - """ - return self._document_url - - @document_url.setter - def document_url(self, document_url): - """Sets the document_url of this Template1. - - - :param document_url: The document_url of this Template1. # noqa: E501 - :type: str - """ - - self._document_url = document_url - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, Template1): - 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/docspring/models/template1_defaults.py b/docspring/models/template1_defaults.py deleted file mode 100644 index 4ed8f41..0000000 --- a/docspring/models/template1_defaults.py +++ /dev/null @@ -1,163 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Template1Defaults(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'color': 'str', - 'font_size': 'float', - 'typeface': 'str' - } - - attribute_map = { - 'color': 'color', - 'font_size': 'fontSize', - 'typeface': 'typeface' - } - - def __init__(self, color=None, font_size=None, typeface=None): # noqa: E501 - """Template1Defaults - a model defined in OpenAPI""" # noqa: E501 - - self._color = None - self._font_size = None - self._typeface = None - self.discriminator = None - - self.color = color - if font_size is not None: - self.font_size = font_size - if typeface is not None: - self.typeface = typeface - - @property - def color(self): - """Gets the color of this Template1Defaults. # noqa: E501 - - - :return: The color of this Template1Defaults. # noqa: E501 - :rtype: str - """ - return self._color - - @color.setter - def color(self, color): - """Sets the color of this Template1Defaults. - - - :param color: The color of this Template1Defaults. # noqa: E501 - :type: str - """ - - self._color = color - - @property - def font_size(self): - """Gets the font_size of this Template1Defaults. # noqa: E501 - - - :return: The font_size of this Template1Defaults. # noqa: E501 - :rtype: float - """ - return self._font_size - - @font_size.setter - def font_size(self, font_size): - """Sets the font_size of this Template1Defaults. - - - :param font_size: The font_size of this Template1Defaults. # noqa: E501 - :type: float - """ - - self._font_size = font_size - - @property - def typeface(self): - """Gets the typeface of this Template1Defaults. # noqa: E501 - - - :return: The typeface of this Template1Defaults. # noqa: E501 - :rtype: str - """ - return self._typeface - - @typeface.setter - def typeface(self, typeface): - """Sets the typeface of this Template1Defaults. - - - :param typeface: The typeface of this Template1Defaults. # noqa: E501 - :type: str - """ - - self._typeface = typeface - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, Template1Defaults): - 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/docspring/models/template_add_fields_response.py b/docspring/models/template_add_fields_response.py new file mode 100644 index 0000000..bb3d1ea --- /dev/null +++ b/docspring/models/template_add_fields_response.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TemplateAddFieldsResponse(BaseModel): + """ + TemplateAddFieldsResponse + """ # noqa: E501 + status: StrictStr + errors: Optional[List[StrictStr]] = None + new_field_ids: Optional[List[StrictInt]] = None + __properties: ClassVar[List[str]] = ["status", "errors", "new_field_ids"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['success', 'error']): + raise ValueError("must be one of enum values ('success', 'error')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplateAddFieldsResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplateAddFieldsResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "errors": obj.get("errors"), + "new_field_ids": obj.get("new_field_ids") + }) + return _obj + + diff --git a/docspring/models/template_data.py b/docspring/models/template_data.py deleted file mode 100644 index 7dff6f8..0000000 --- a/docspring/models/template_data.py +++ /dev/null @@ -1,499 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class TemplateData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'expiration_interval': 'str', - 'webhook_url': 'str', - 'scss': 'str', - 'allow_additional_properties': 'bool', - 'expire_after': 'float', - 'description': 'str', - 'public_submissions': 'bool', - 'slack_webhook_url': 'str', - 'header_html': 'str', - 'public_web_form': 'bool', - 'editable_submissions': 'bool', - 'expire_submissions': 'bool', - 'name': 'str', - 'footer_html': 'str', - 'html': 'str', - 'redirect_url': 'str' - } - - attribute_map = { - 'expiration_interval': 'expiration_interval', - 'webhook_url': 'webhook_url', - 'scss': 'scss', - 'allow_additional_properties': 'allow_additional_properties', - 'expire_after': 'expire_after', - 'description': 'description', - 'public_submissions': 'public_submissions', - 'slack_webhook_url': 'slack_webhook_url', - 'header_html': 'header_html', - 'public_web_form': 'public_web_form', - 'editable_submissions': 'editable_submissions', - 'expire_submissions': 'expire_submissions', - 'name': 'name', - 'footer_html': 'footer_html', - 'html': 'html', - 'redirect_url': 'redirect_url' - } - - def __init__(self, expiration_interval=None, webhook_url=None, scss=None, allow_additional_properties=None, expire_after=None, description=None, public_submissions=None, slack_webhook_url=None, header_html=None, public_web_form=None, editable_submissions=None, expire_submissions=None, name=None, footer_html=None, html=None, redirect_url=None): # noqa: E501 - """TemplateData - a model defined in OpenAPI""" # noqa: E501 - - self._expiration_interval = None - self._webhook_url = None - self._scss = None - self._allow_additional_properties = None - self._expire_after = None - self._description = None - self._public_submissions = None - self._slack_webhook_url = None - self._header_html = None - self._public_web_form = None - self._editable_submissions = None - self._expire_submissions = None - self._name = None - self._footer_html = None - self._html = None - self._redirect_url = None - self.discriminator = None - - if expiration_interval is not None: - self.expiration_interval = expiration_interval - self.webhook_url = webhook_url - self.scss = scss - if allow_additional_properties is not None: - self.allow_additional_properties = allow_additional_properties - if expire_after is not None: - self.expire_after = expire_after - self.description = description - if public_submissions is not None: - self.public_submissions = public_submissions - self.slack_webhook_url = slack_webhook_url - self.header_html = header_html - if public_web_form is not None: - self.public_web_form = public_web_form - if editable_submissions is not None: - self.editable_submissions = editable_submissions - if expire_submissions is not None: - self.expire_submissions = expire_submissions - self.name = name - self.footer_html = footer_html - self.html = html - self.redirect_url = redirect_url - - @property - def expiration_interval(self): - """Gets the expiration_interval of this TemplateData. # noqa: E501 - - - :return: The expiration_interval of this TemplateData. # noqa: E501 - :rtype: str - """ - return self._expiration_interval - - @expiration_interval.setter - def expiration_interval(self, expiration_interval): - """Sets the expiration_interval of this TemplateData. - - - :param expiration_interval: The expiration_interval of this TemplateData. # noqa: E501 - :type: str - """ - allowed_values = ["minutes", "hours", "days"] # noqa: E501 - if expiration_interval not in allowed_values: - raise ValueError( - "Invalid value for `expiration_interval` ({0}), must be one of {1}" # noqa: E501 - .format(expiration_interval, allowed_values) - ) - - self._expiration_interval = expiration_interval - - @property - def webhook_url(self): - """Gets the webhook_url of this TemplateData. # noqa: E501 - - - :return: The webhook_url of this TemplateData. # noqa: E501 - :rtype: str - """ - return self._webhook_url - - @webhook_url.setter - def webhook_url(self, webhook_url): - """Sets the webhook_url of this TemplateData. - - - :param webhook_url: The webhook_url of this TemplateData. # noqa: E501 - :type: str - """ - - self._webhook_url = webhook_url - - @property - def scss(self): - """Gets the scss of this TemplateData. # noqa: E501 - - - :return: The scss of this TemplateData. # noqa: E501 - :rtype: str - """ - return self._scss - - @scss.setter - def scss(self, scss): - """Sets the scss of this TemplateData. - - - :param scss: The scss of this TemplateData. # noqa: E501 - :type: str - """ - - self._scss = scss - - @property - def allow_additional_properties(self): - """Gets the allow_additional_properties of this TemplateData. # noqa: E501 - - - :return: The allow_additional_properties of this TemplateData. # noqa: E501 - :rtype: bool - """ - return self._allow_additional_properties - - @allow_additional_properties.setter - def allow_additional_properties(self, allow_additional_properties): - """Sets the allow_additional_properties of this TemplateData. - - - :param allow_additional_properties: The allow_additional_properties of this TemplateData. # noqa: E501 - :type: bool - """ - - self._allow_additional_properties = allow_additional_properties - - @property - def expire_after(self): - """Gets the expire_after of this TemplateData. # noqa: E501 - - - :return: The expire_after of this TemplateData. # noqa: E501 - :rtype: float - """ - return self._expire_after - - @expire_after.setter - def expire_after(self, expire_after): - """Sets the expire_after of this TemplateData. - - - :param expire_after: The expire_after of this TemplateData. # noqa: E501 - :type: float - """ - - self._expire_after = expire_after - - @property - def description(self): - """Gets the description of this TemplateData. # noqa: E501 - - - :return: The description of this TemplateData. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this TemplateData. - - - :param description: The description of this TemplateData. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def public_submissions(self): - """Gets the public_submissions of this TemplateData. # noqa: E501 - - - :return: The public_submissions of this TemplateData. # noqa: E501 - :rtype: bool - """ - return self._public_submissions - - @public_submissions.setter - def public_submissions(self, public_submissions): - """Sets the public_submissions of this TemplateData. - - - :param public_submissions: The public_submissions of this TemplateData. # noqa: E501 - :type: bool - """ - - self._public_submissions = public_submissions - - @property - def slack_webhook_url(self): - """Gets the slack_webhook_url of this TemplateData. # noqa: E501 - - - :return: The slack_webhook_url of this TemplateData. # noqa: E501 - :rtype: str - """ - return self._slack_webhook_url - - @slack_webhook_url.setter - def slack_webhook_url(self, slack_webhook_url): - """Sets the slack_webhook_url of this TemplateData. - - - :param slack_webhook_url: The slack_webhook_url of this TemplateData. # noqa: E501 - :type: str - """ - - self._slack_webhook_url = slack_webhook_url - - @property - def header_html(self): - """Gets the header_html of this TemplateData. # noqa: E501 - - - :return: The header_html of this TemplateData. # noqa: E501 - :rtype: str - """ - return self._header_html - - @header_html.setter - def header_html(self, header_html): - """Sets the header_html of this TemplateData. - - - :param header_html: The header_html of this TemplateData. # noqa: E501 - :type: str - """ - - self._header_html = header_html - - @property - def public_web_form(self): - """Gets the public_web_form of this TemplateData. # noqa: E501 - - - :return: The public_web_form of this TemplateData. # noqa: E501 - :rtype: bool - """ - return self._public_web_form - - @public_web_form.setter - def public_web_form(self, public_web_form): - """Sets the public_web_form of this TemplateData. - - - :param public_web_form: The public_web_form of this TemplateData. # noqa: E501 - :type: bool - """ - - self._public_web_form = public_web_form - - @property - def editable_submissions(self): - """Gets the editable_submissions of this TemplateData. # noqa: E501 - - - :return: The editable_submissions of this TemplateData. # noqa: E501 - :rtype: bool - """ - return self._editable_submissions - - @editable_submissions.setter - def editable_submissions(self, editable_submissions): - """Sets the editable_submissions of this TemplateData. - - - :param editable_submissions: The editable_submissions of this TemplateData. # noqa: E501 - :type: bool - """ - - self._editable_submissions = editable_submissions - - @property - def expire_submissions(self): - """Gets the expire_submissions of this TemplateData. # noqa: E501 - - - :return: The expire_submissions of this TemplateData. # noqa: E501 - :rtype: bool - """ - return self._expire_submissions - - @expire_submissions.setter - def expire_submissions(self, expire_submissions): - """Sets the expire_submissions of this TemplateData. - - - :param expire_submissions: The expire_submissions of this TemplateData. # noqa: E501 - :type: bool - """ - - self._expire_submissions = expire_submissions - - @property - def name(self): - """Gets the name of this TemplateData. # noqa: E501 - - - :return: The name of this TemplateData. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this TemplateData. - - - :param name: The name of this TemplateData. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def footer_html(self): - """Gets the footer_html of this TemplateData. # noqa: E501 - - - :return: The footer_html of this TemplateData. # noqa: E501 - :rtype: str - """ - return self._footer_html - - @footer_html.setter - def footer_html(self, footer_html): - """Sets the footer_html of this TemplateData. - - - :param footer_html: The footer_html of this TemplateData. # noqa: E501 - :type: str - """ - - self._footer_html = footer_html - - @property - def html(self): - """Gets the html of this TemplateData. # noqa: E501 - - - :return: The html of this TemplateData. # noqa: E501 - :rtype: str - """ - return self._html - - @html.setter - def html(self, html): - """Sets the html of this TemplateData. - - - :param html: The html of this TemplateData. # noqa: E501 - :type: str - """ - - self._html = html - - @property - def redirect_url(self): - """Gets the redirect_url of this TemplateData. # noqa: E501 - - - :return: The redirect_url of this TemplateData. # noqa: E501 - :rtype: str - """ - return self._redirect_url - - @redirect_url.setter - def redirect_url(self, redirect_url): - """Sets the redirect_url of this TemplateData. - - - :param redirect_url: The redirect_url of this TemplateData. # noqa: E501 - :type: str - """ - - self._redirect_url = redirect_url - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, TemplateData): - 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/docspring/models/template_preview.py b/docspring/models/template_preview.py new file mode 100644 index 0000000..0defc8f --- /dev/null +++ b/docspring/models/template_preview.py @@ -0,0 +1,262 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class TemplatePreview(BaseModel): + """ + TemplatePreview + """ # noqa: E501 + add_data_request_submission_id_footers: StrictBool + allow_additional_properties: StrictBool + description: Optional[StrictStr] + document_filename: Optional[StrictStr] + document_md5: Optional[StrictStr] + document_parse_error: StrictBool + document_processed: StrictBool + document_state: StrictStr + document_url: Optional[StrictStr] + editable_submissions: StrictBool + embed_domains: Optional[StrictStr] + encrypt_pdfs_password: Optional[StrictStr] + encrypt_pdfs: StrictBool + expiration_interval: StrictStr + expire_after: StrictInt + expire_submissions: StrictBool + external_predefined_fields_template_id: Optional[StrictStr] + external_predefined_fields_template_name: Optional[StrictStr] + first_template: StrictBool + id: Optional[StrictStr] + locked: StrictBool + merge_audit_trail_pdf: StrictBool + name: Optional[StrictStr] + page_count: StrictInt + page_dimensions: Optional[List[Annotated[List[Union[StrictFloat, StrictInt]], Field(min_length=2, max_length=2)]]] + parent_folder_id: Optional[StrictStr] + path: Optional[StrictStr] + permanent_document_url: Optional[StrictStr] + public_submissions: StrictBool + public_web_form: StrictBool + redirect_url: Optional[StrictStr] + slack_webhook_url: Optional[StrictStr] + template_type: StrictStr + updated_at: Optional[StrictStr] + webhook_url: Optional[StrictStr] + demo: StrictBool + __properties: ClassVar[List[str]] = ["add_data_request_submission_id_footers", "allow_additional_properties", "description", "document_filename", "document_md5", "document_parse_error", "document_processed", "document_state", "document_url", "editable_submissions", "embed_domains", "encrypt_pdfs_password", "encrypt_pdfs", "expiration_interval", "expire_after", "expire_submissions", "external_predefined_fields_template_id", "external_predefined_fields_template_name", "first_template", "id", "locked", "merge_audit_trail_pdf", "name", "page_count", "page_dimensions", "parent_folder_id", "path", "permanent_document_url", "public_submissions", "public_web_form", "redirect_url", "slack_webhook_url", "template_type", "updated_at", "webhook_url", "demo"] + + @field_validator('document_state') + def document_state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pending', 'processed', 'password_required', 'malformed_pdf', 'unknown_error']): + raise ValueError("must be one of enum values ('pending', 'processed', 'password_required', 'malformed_pdf', 'unknown_error')") + return value + + @field_validator('template_type') + def template_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['pdf', 'html']): + raise ValueError("must be one of enum values ('pdf', 'html')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TemplatePreview from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if document_filename (nullable) is None + # and model_fields_set contains the field + if self.document_filename is None and "document_filename" in self.model_fields_set: + _dict['document_filename'] = None + + # set to None if document_md5 (nullable) is None + # and model_fields_set contains the field + if self.document_md5 is None and "document_md5" in self.model_fields_set: + _dict['document_md5'] = None + + # set to None if document_url (nullable) is None + # and model_fields_set contains the field + if self.document_url is None and "document_url" in self.model_fields_set: + _dict['document_url'] = None + + # set to None if embed_domains (nullable) is None + # and model_fields_set contains the field + if self.embed_domains is None and "embed_domains" in self.model_fields_set: + _dict['embed_domains'] = None + + # set to None if encrypt_pdfs_password (nullable) is None + # and model_fields_set contains the field + if self.encrypt_pdfs_password is None and "encrypt_pdfs_password" in self.model_fields_set: + _dict['encrypt_pdfs_password'] = None + + # set to None if external_predefined_fields_template_id (nullable) is None + # and model_fields_set contains the field + if self.external_predefined_fields_template_id is None and "external_predefined_fields_template_id" in self.model_fields_set: + _dict['external_predefined_fields_template_id'] = None + + # set to None if external_predefined_fields_template_name (nullable) is None + # and model_fields_set contains the field + if self.external_predefined_fields_template_name is None and "external_predefined_fields_template_name" in self.model_fields_set: + _dict['external_predefined_fields_template_name'] = None + + # set to None if id (nullable) is None + # and model_fields_set contains the field + if self.id is None and "id" in self.model_fields_set: + _dict['id'] = None + + # set to None if name (nullable) is None + # and model_fields_set contains the field + if self.name is None and "name" in self.model_fields_set: + _dict['name'] = None + + # set to None if page_dimensions (nullable) is None + # and model_fields_set contains the field + if self.page_dimensions is None and "page_dimensions" in self.model_fields_set: + _dict['page_dimensions'] = None + + # set to None if parent_folder_id (nullable) is None + # and model_fields_set contains the field + if self.parent_folder_id is None and "parent_folder_id" in self.model_fields_set: + _dict['parent_folder_id'] = None + + # set to None if path (nullable) is None + # and model_fields_set contains the field + if self.path is None and "path" in self.model_fields_set: + _dict['path'] = None + + # set to None if permanent_document_url (nullable) is None + # and model_fields_set contains the field + if self.permanent_document_url is None and "permanent_document_url" in self.model_fields_set: + _dict['permanent_document_url'] = None + + # set to None if redirect_url (nullable) is None + # and model_fields_set contains the field + if self.redirect_url is None and "redirect_url" in self.model_fields_set: + _dict['redirect_url'] = None + + # set to None if slack_webhook_url (nullable) is None + # and model_fields_set contains the field + if self.slack_webhook_url is None and "slack_webhook_url" in self.model_fields_set: + _dict['slack_webhook_url'] = None + + # set to None if updated_at (nullable) is None + # and model_fields_set contains the field + if self.updated_at is None and "updated_at" in self.model_fields_set: + _dict['updated_at'] = None + + # set to None if webhook_url (nullable) is None + # and model_fields_set contains the field + if self.webhook_url is None and "webhook_url" in self.model_fields_set: + _dict['webhook_url'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TemplatePreview from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "add_data_request_submission_id_footers": obj.get("add_data_request_submission_id_footers"), + "allow_additional_properties": obj.get("allow_additional_properties"), + "description": obj.get("description"), + "document_filename": obj.get("document_filename"), + "document_md5": obj.get("document_md5"), + "document_parse_error": obj.get("document_parse_error"), + "document_processed": obj.get("document_processed"), + "document_state": obj.get("document_state"), + "document_url": obj.get("document_url"), + "editable_submissions": obj.get("editable_submissions"), + "embed_domains": obj.get("embed_domains"), + "encrypt_pdfs_password": obj.get("encrypt_pdfs_password"), + "encrypt_pdfs": obj.get("encrypt_pdfs"), + "expiration_interval": obj.get("expiration_interval"), + "expire_after": obj.get("expire_after"), + "expire_submissions": obj.get("expire_submissions"), + "external_predefined_fields_template_id": obj.get("external_predefined_fields_template_id"), + "external_predefined_fields_template_name": obj.get("external_predefined_fields_template_name"), + "first_template": obj.get("first_template"), + "id": obj.get("id"), + "locked": obj.get("locked"), + "merge_audit_trail_pdf": obj.get("merge_audit_trail_pdf"), + "name": obj.get("name"), + "page_count": obj.get("page_count"), + "page_dimensions": obj.get("page_dimensions"), + "parent_folder_id": obj.get("parent_folder_id"), + "path": obj.get("path"), + "permanent_document_url": obj.get("permanent_document_url"), + "public_submissions": obj.get("public_submissions"), + "public_web_form": obj.get("public_web_form"), + "redirect_url": obj.get("redirect_url"), + "slack_webhook_url": obj.get("slack_webhook_url"), + "template_type": obj.get("template_type"), + "updated_at": obj.get("updated_at"), + "webhook_url": obj.get("webhook_url"), + "demo": obj.get("demo") + }) + return _obj + + diff --git a/docspring/models/templatestemplate_idadd_fields_fields.py b/docspring/models/templatestemplate_idadd_fields_fields.py deleted file mode 100644 index 91c4be7..0000000 --- a/docspring/models/templatestemplate_idadd_fields_fields.py +++ /dev/null @@ -1,2392 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class TemplatestemplateIdaddFieldsFields(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'background_color_field_name': 'str', - 'uppercase': 'bool', - 'metadata': 'str', - 'barcode_symbology': 'str', - 'min_length': 'float', - 'integer': 'bool', - 'type': 'str', - 'required': 'bool', - 'comb_value_offset': 'float', - 'image_gravity': 'str', - 'overflow': 'str', - 'qrcode_color': 'str', - 'color_field_required': 'bool', - 'background_color_field_required': 'bool', - 'id': 'float', - 'image_scale_type': 'str', - 'exclusive_minimum': 'bool', - 'height': 'float', - 'number_condition_range_exclusive_max': 'bool', - 'invert_boolean_condition': 'bool', - 'shape_fill_color_field_name': 'str', - 'static': 'bool', - 'shape_border_color_field_name': 'str', - 'v_alignment': 'str', - 'bold': 'bool', - 'shape_border_width': 'float', - 'comb_number_of_cells': 'float', - 'shape_border_color': 'str', - 'comb': 'bool', - 'typeface': 'str', - 'shape_type': 'str', - 'condition': 'str', - 'display_type': 'str', - 'check_color': 'str', - 'multiline_lines': 'float', - 'multiline': 'bool', - 'true_text': 'str', - 'name': 'str', - 'font_size': 'float', - 'page': 'float', - 'alignment': 'str', - 'max_length': 'float', - 'auto_calculate_max_length': 'bool', - 'color_field_name': 'str', - 'qrcode_color_field_name': 'str', - 'number_condition_range_min': 'float', - 'color': 'str', - 'hidden': 'bool', - 'check_color_field_required': 'bool', - 'combined_field_format': 'str', - 'description': 'str', - 'shape_border_color_field_required': 'bool', - 'combined_field_names': 'str', - 'title': 'str', - 'number_condition_range_exclusive_min': 'bool', - 'combined_field_separator': 'str', - 'exclusive_maximum': 'bool', - 'default': 'str', - 'combined_field_type': 'str', - 'date_time_format': 'str', - 'qrcode_color_field_required': 'bool', - 'currency': 'bool', - 'false_text': 'str', - 'strikethrough': 'bool', - 'character_spacing': 'float', - 'number_condition_range_max': 'float', - 'background_color': 'str', - 'check_color_field_name': 'str', - 'check_character': 'str', - 'rotation': 'float', - 'option_list': 'str', - 'shape_fill_color': 'str', - 'string_condition_type': 'str', - 'shape_fill_color_field_required': 'bool', - 'decimal_places': 'float', - 'include_time': 'bool', - 'width': 'float', - 'x': 'float', - 'maximum': 'float', - 'y': 'float', - 'signature_allow_draw': 'bool', - 'number_condition_type': 'str', - 'opacity': 'float', - 'minimum': 'float', - 'signature_allow_type': 'bool' - } - - attribute_map = { - 'background_color_field_name': 'backgroundColorFieldName', - 'uppercase': 'uppercase', - 'metadata': 'metadata', - 'barcode_symbology': 'barcodeSymbology', - 'min_length': 'minLength', - 'integer': 'integer', - 'type': 'type', - 'required': 'required', - 'comb_value_offset': 'combValueOffset', - 'image_gravity': 'imageGravity', - 'overflow': 'overflow', - 'qrcode_color': 'qrcodeColor', - 'color_field_required': 'colorFieldRequired', - 'background_color_field_required': 'backgroundColorFieldRequired', - 'id': 'id', - 'image_scale_type': 'imageScaleType', - 'exclusive_minimum': 'exclusiveMinimum', - 'height': 'height', - 'number_condition_range_exclusive_max': 'numberConditionRangeExclusiveMax', - 'invert_boolean_condition': 'invertBooleanCondition', - 'shape_fill_color_field_name': 'shapeFillColorFieldName', - 'static': 'static', - 'shape_border_color_field_name': 'shapeBorderColorFieldName', - 'v_alignment': 'vAlignment', - 'bold': 'bold', - 'shape_border_width': 'shapeBorderWidth', - 'comb_number_of_cells': 'combNumberOfCells', - 'shape_border_color': 'shapeBorderColor', - 'comb': 'comb', - 'typeface': 'typeface', - 'shape_type': 'shapeType', - 'condition': 'condition', - 'display_type': 'displayType', - 'check_color': 'checkColor', - 'multiline_lines': 'multilineLines', - 'multiline': 'multiline', - 'true_text': 'trueText', - 'name': 'name', - 'font_size': 'fontSize', - 'page': 'page', - 'alignment': 'alignment', - 'max_length': 'maxLength', - 'auto_calculate_max_length': 'autoCalculateMaxLength', - 'color_field_name': 'colorFieldName', - 'qrcode_color_field_name': 'qrcodeColorFieldName', - 'number_condition_range_min': 'numberConditionRangeMin', - 'color': 'color', - 'hidden': 'hidden', - 'check_color_field_required': 'checkColorFieldRequired', - 'combined_field_format': 'combinedFieldFormat', - 'description': 'description', - 'shape_border_color_field_required': 'shapeBorderColorFieldRequired', - 'combined_field_names': 'combinedFieldNames', - 'title': 'title', - 'number_condition_range_exclusive_min': 'numberConditionRangeExclusiveMin', - 'combined_field_separator': 'combinedFieldSeparator', - 'exclusive_maximum': 'exclusiveMaximum', - 'default': 'default', - 'combined_field_type': 'combinedFieldType', - 'date_time_format': 'dateTimeFormat', - 'qrcode_color_field_required': 'qrcodeColorFieldRequired', - 'currency': 'currency', - 'false_text': 'falseText', - 'strikethrough': 'strikethrough', - 'character_spacing': 'characterSpacing', - 'number_condition_range_max': 'numberConditionRangeMax', - 'background_color': 'backgroundColor', - 'check_color_field_name': 'checkColorFieldName', - 'check_character': 'checkCharacter', - 'rotation': 'rotation', - 'option_list': 'optionList', - 'shape_fill_color': 'shapeFillColor', - 'string_condition_type': 'stringConditionType', - 'shape_fill_color_field_required': 'shapeFillColorFieldRequired', - 'decimal_places': 'decimalPlaces', - 'include_time': 'includeTime', - 'width': 'width', - 'x': 'x', - 'maximum': 'maximum', - 'y': 'y', - 'signature_allow_draw': 'signatureAllowDraw', - 'number_condition_type': 'numberConditionType', - 'opacity': 'opacity', - 'minimum': 'minimum', - 'signature_allow_type': 'signatureAllowType' - } - - def __init__(self, background_color_field_name=None, uppercase=None, metadata=None, barcode_symbology=None, min_length=None, integer=None, type=None, required=None, comb_value_offset=None, image_gravity=None, overflow=None, qrcode_color=None, color_field_required=None, background_color_field_required=None, id=None, image_scale_type=None, exclusive_minimum=None, height=None, number_condition_range_exclusive_max=None, invert_boolean_condition=None, shape_fill_color_field_name=None, static=None, shape_border_color_field_name=None, v_alignment=None, bold=None, shape_border_width=None, comb_number_of_cells=None, shape_border_color=None, comb=None, typeface=None, shape_type=None, condition=None, display_type=None, check_color=None, multiline_lines=None, multiline=None, true_text=None, name=None, font_size=None, page=None, alignment=None, max_length=None, auto_calculate_max_length=None, color_field_name=None, qrcode_color_field_name=None, number_condition_range_min=None, color=None, hidden=None, check_color_field_required=None, combined_field_format=None, description=None, shape_border_color_field_required=None, combined_field_names=None, title=None, number_condition_range_exclusive_min=None, combined_field_separator=None, exclusive_maximum=None, default=None, combined_field_type=None, date_time_format=None, qrcode_color_field_required=None, currency=None, false_text=None, strikethrough=None, character_spacing=None, number_condition_range_max=None, background_color=None, check_color_field_name=None, check_character=None, rotation=None, option_list=None, shape_fill_color=None, string_condition_type=None, shape_fill_color_field_required=None, decimal_places=None, include_time=None, width=None, x=None, maximum=None, y=None, signature_allow_draw=None, number_condition_type=None, opacity=None, minimum=None, signature_allow_type=None): # noqa: E501 - """TemplatestemplateIdaddFieldsFields - a model defined in OpenAPI""" # noqa: E501 - - self._background_color_field_name = None - self._uppercase = None - self._metadata = None - self._barcode_symbology = None - self._min_length = None - self._integer = None - self._type = None - self._required = None - self._comb_value_offset = None - self._image_gravity = None - self._overflow = None - self._qrcode_color = None - self._color_field_required = None - self._background_color_field_required = None - self._id = None - self._image_scale_type = None - self._exclusive_minimum = None - self._height = None - self._number_condition_range_exclusive_max = None - self._invert_boolean_condition = None - self._shape_fill_color_field_name = None - self._static = None - self._shape_border_color_field_name = None - self._v_alignment = None - self._bold = None - self._shape_border_width = None - self._comb_number_of_cells = None - self._shape_border_color = None - self._comb = None - self._typeface = None - self._shape_type = None - self._condition = None - self._display_type = None - self._check_color = None - self._multiline_lines = None - self._multiline = None - self._true_text = None - self._name = None - self._font_size = None - self._page = None - self._alignment = None - self._max_length = None - self._auto_calculate_max_length = None - self._color_field_name = None - self._qrcode_color_field_name = None - self._number_condition_range_min = None - self._color = None - self._hidden = None - self._check_color_field_required = None - self._combined_field_format = None - self._description = None - self._shape_border_color_field_required = None - self._combined_field_names = None - self._title = None - self._number_condition_range_exclusive_min = None - self._combined_field_separator = None - self._exclusive_maximum = None - self._default = None - self._combined_field_type = None - self._date_time_format = None - self._qrcode_color_field_required = None - self._currency = None - self._false_text = None - self._strikethrough = None - self._character_spacing = None - self._number_condition_range_max = None - self._background_color = None - self._check_color_field_name = None - self._check_character = None - self._rotation = None - self._option_list = None - self._shape_fill_color = None - self._string_condition_type = None - self._shape_fill_color_field_required = None - self._decimal_places = None - self._include_time = None - self._width = None - self._x = None - self._maximum = None - self._y = None - self._signature_allow_draw = None - self._number_condition_type = None - self._opacity = None - self._minimum = None - self._signature_allow_type = None - self.discriminator = None - - if background_color_field_name is not None: - self.background_color_field_name = background_color_field_name - if uppercase is not None: - self.uppercase = uppercase - if metadata is not None: - self.metadata = metadata - if barcode_symbology is not None: - self.barcode_symbology = barcode_symbology - if min_length is not None: - self.min_length = min_length - if integer is not None: - self.integer = integer - if type is not None: - self.type = type - if required is not None: - self.required = required - if comb_value_offset is not None: - self.comb_value_offset = comb_value_offset - if image_gravity is not None: - self.image_gravity = image_gravity - if overflow is not None: - self.overflow = overflow - if qrcode_color is not None: - self.qrcode_color = qrcode_color - if color_field_required is not None: - self.color_field_required = color_field_required - if background_color_field_required is not None: - self.background_color_field_required = background_color_field_required - if id is not None: - self.id = id - if image_scale_type is not None: - self.image_scale_type = image_scale_type - if exclusive_minimum is not None: - self.exclusive_minimum = exclusive_minimum - if height is not None: - self.height = height - if number_condition_range_exclusive_max is not None: - self.number_condition_range_exclusive_max = number_condition_range_exclusive_max - if invert_boolean_condition is not None: - self.invert_boolean_condition = invert_boolean_condition - if shape_fill_color_field_name is not None: - self.shape_fill_color_field_name = shape_fill_color_field_name - if static is not None: - self.static = static - if shape_border_color_field_name is not None: - self.shape_border_color_field_name = shape_border_color_field_name - if v_alignment is not None: - self.v_alignment = v_alignment - if bold is not None: - self.bold = bold - if shape_border_width is not None: - self.shape_border_width = shape_border_width - if comb_number_of_cells is not None: - self.comb_number_of_cells = comb_number_of_cells - if shape_border_color is not None: - self.shape_border_color = shape_border_color - if comb is not None: - self.comb = comb - if typeface is not None: - self.typeface = typeface - if shape_type is not None: - self.shape_type = shape_type - if condition is not None: - self.condition = condition - if display_type is not None: - self.display_type = display_type - if check_color is not None: - self.check_color = check_color - if multiline_lines is not None: - self.multiline_lines = multiline_lines - if multiline is not None: - self.multiline = multiline - if true_text is not None: - self.true_text = true_text - if name is not None: - self.name = name - if font_size is not None: - self.font_size = font_size - if page is not None: - self.page = page - if alignment is not None: - self.alignment = alignment - if max_length is not None: - self.max_length = max_length - if auto_calculate_max_length is not None: - self.auto_calculate_max_length = auto_calculate_max_length - if color_field_name is not None: - self.color_field_name = color_field_name - if qrcode_color_field_name is not None: - self.qrcode_color_field_name = qrcode_color_field_name - if number_condition_range_min is not None: - self.number_condition_range_min = number_condition_range_min - if color is not None: - self.color = color - if hidden is not None: - self.hidden = hidden - if check_color_field_required is not None: - self.check_color_field_required = check_color_field_required - if combined_field_format is not None: - self.combined_field_format = combined_field_format - if description is not None: - self.description = description - if shape_border_color_field_required is not None: - self.shape_border_color_field_required = shape_border_color_field_required - if combined_field_names is not None: - self.combined_field_names = combined_field_names - if title is not None: - self.title = title - if number_condition_range_exclusive_min is not None: - self.number_condition_range_exclusive_min = number_condition_range_exclusive_min - if combined_field_separator is not None: - self.combined_field_separator = combined_field_separator - if exclusive_maximum is not None: - self.exclusive_maximum = exclusive_maximum - if default is not None: - self.default = default - if combined_field_type is not None: - self.combined_field_type = combined_field_type - if date_time_format is not None: - self.date_time_format = date_time_format - if qrcode_color_field_required is not None: - self.qrcode_color_field_required = qrcode_color_field_required - if currency is not None: - self.currency = currency - if false_text is not None: - self.false_text = false_text - if strikethrough is not None: - self.strikethrough = strikethrough - if character_spacing is not None: - self.character_spacing = character_spacing - if number_condition_range_max is not None: - self.number_condition_range_max = number_condition_range_max - if background_color is not None: - self.background_color = background_color - if check_color_field_name is not None: - self.check_color_field_name = check_color_field_name - if check_character is not None: - self.check_character = check_character - if rotation is not None: - self.rotation = rotation - if option_list is not None: - self.option_list = option_list - if shape_fill_color is not None: - self.shape_fill_color = shape_fill_color - if string_condition_type is not None: - self.string_condition_type = string_condition_type - if shape_fill_color_field_required is not None: - self.shape_fill_color_field_required = shape_fill_color_field_required - if decimal_places is not None: - self.decimal_places = decimal_places - if include_time is not None: - self.include_time = include_time - if width is not None: - self.width = width - if x is not None: - self.x = x - if maximum is not None: - self.maximum = maximum - if y is not None: - self.y = y - if signature_allow_draw is not None: - self.signature_allow_draw = signature_allow_draw - if number_condition_type is not None: - self.number_condition_type = number_condition_type - if opacity is not None: - self.opacity = opacity - if minimum is not None: - self.minimum = minimum - if signature_allow_type is not None: - self.signature_allow_type = signature_allow_type - - @property - def background_color_field_name(self): - """Gets the background_color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The background_color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._background_color_field_name - - @background_color_field_name.setter - def background_color_field_name(self, background_color_field_name): - """Sets the background_color_field_name of this TemplatestemplateIdaddFieldsFields. - - - :param background_color_field_name: The background_color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._background_color_field_name = background_color_field_name - - @property - def uppercase(self): - """Gets the uppercase of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The uppercase of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._uppercase - - @uppercase.setter - def uppercase(self, uppercase): - """Sets the uppercase of this TemplatestemplateIdaddFieldsFields. - - - :param uppercase: The uppercase of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._uppercase = uppercase - - @property - def metadata(self): - """Gets the metadata of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The metadata of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this TemplatestemplateIdaddFieldsFields. - - - :param metadata: The metadata of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._metadata = metadata - - @property - def barcode_symbology(self): - """Gets the barcode_symbology of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The barcode_symbology of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._barcode_symbology - - @barcode_symbology.setter - def barcode_symbology(self, barcode_symbology): - """Sets the barcode_symbology of this TemplatestemplateIdaddFieldsFields. - - - :param barcode_symbology: The barcode_symbology of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._barcode_symbology = barcode_symbology - - @property - def min_length(self): - """Gets the min_length of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The min_length of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._min_length - - @min_length.setter - def min_length(self, min_length): - """Sets the min_length of this TemplatestemplateIdaddFieldsFields. - - - :param min_length: The min_length of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - - self._min_length = min_length - - @property - def integer(self): - """Gets the integer of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The integer of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._integer - - @integer.setter - def integer(self, integer): - """Sets the integer of this TemplatestemplateIdaddFieldsFields. - - - :param integer: The integer of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._integer = integer - - @property - def type(self): - """Gets the type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this TemplatestemplateIdaddFieldsFields. - - - :param type: The type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - allowed_values = ["string", "number", "boolean", "date", "address", "country", "email", "url", "image", "signature", "barcode", "combined"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) - - self._type = type - - @property - def required(self): - """Gets the required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._required - - @required.setter - def required(self, required): - """Sets the required of this TemplatestemplateIdaddFieldsFields. - - - :param required: The required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._required = required - - @property - def comb_value_offset(self): - """Gets the comb_value_offset of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The comb_value_offset of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._comb_value_offset - - @comb_value_offset.setter - def comb_value_offset(self, comb_value_offset): - """Sets the comb_value_offset of this TemplatestemplateIdaddFieldsFields. - - - :param comb_value_offset: The comb_value_offset of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - - self._comb_value_offset = comb_value_offset - - @property - def image_gravity(self): - """Gets the image_gravity of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The image_gravity of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._image_gravity - - @image_gravity.setter - def image_gravity(self, image_gravity): - """Sets the image_gravity of this TemplatestemplateIdaddFieldsFields. - - - :param image_gravity: The image_gravity of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - allowed_values = ["NorthWest", "North", "NorthEast", "West", "Center", "East", "SouthWest", "South", "SouthEast"] # noqa: E501 - if image_gravity not in allowed_values: - raise ValueError( - "Invalid value for `image_gravity` ({0}), must be one of {1}" # noqa: E501 - .format(image_gravity, allowed_values) - ) - - self._image_gravity = image_gravity - - @property - def overflow(self): - """Gets the overflow of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The overflow of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._overflow - - @overflow.setter - def overflow(self, overflow): - """Sets the overflow of this TemplatestemplateIdaddFieldsFields. - - - :param overflow: The overflow of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - allowed_values = ["shrink_to_fit", "truncate"] # noqa: E501 - if overflow not in allowed_values: - raise ValueError( - "Invalid value for `overflow` ({0}), must be one of {1}" # noqa: E501 - .format(overflow, allowed_values) - ) - - self._overflow = overflow - - @property - def qrcode_color(self): - """Gets the qrcode_color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The qrcode_color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._qrcode_color - - @qrcode_color.setter - def qrcode_color(self, qrcode_color): - """Sets the qrcode_color of this TemplatestemplateIdaddFieldsFields. - - - :param qrcode_color: The qrcode_color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._qrcode_color = qrcode_color - - @property - def color_field_required(self): - """Gets the color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._color_field_required - - @color_field_required.setter - def color_field_required(self, color_field_required): - """Sets the color_field_required of this TemplatestemplateIdaddFieldsFields. - - - :param color_field_required: The color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._color_field_required = color_field_required - - @property - def background_color_field_required(self): - """Gets the background_color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The background_color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._background_color_field_required - - @background_color_field_required.setter - def background_color_field_required(self, background_color_field_required): - """Sets the background_color_field_required of this TemplatestemplateIdaddFieldsFields. - - - :param background_color_field_required: The background_color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._background_color_field_required = background_color_field_required - - @property - def id(self): - """Gets the id of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The id of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this TemplatestemplateIdaddFieldsFields. - - - :param id: The id of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - if id is not None and id < 0: # noqa: E501 - raise ValueError("Invalid value for `id`, must be a value greater than or equal to `0`") # noqa: E501 - - self._id = id - - @property - def image_scale_type(self): - """Gets the image_scale_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The image_scale_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._image_scale_type - - @image_scale_type.setter - def image_scale_type(self, image_scale_type): - """Sets the image_scale_type of this TemplatestemplateIdaddFieldsFields. - - - :param image_scale_type: The image_scale_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - allowed_values = ["fit", "fill", "stretch"] # noqa: E501 - if image_scale_type not in allowed_values: - raise ValueError( - "Invalid value for `image_scale_type` ({0}), must be one of {1}" # noqa: E501 - .format(image_scale_type, allowed_values) - ) - - self._image_scale_type = image_scale_type - - @property - def exclusive_minimum(self): - """Gets the exclusive_minimum of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The exclusive_minimum of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._exclusive_minimum - - @exclusive_minimum.setter - def exclusive_minimum(self, exclusive_minimum): - """Sets the exclusive_minimum of this TemplatestemplateIdaddFieldsFields. - - - :param exclusive_minimum: The exclusive_minimum of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._exclusive_minimum = exclusive_minimum - - @property - def height(self): - """Gets the height of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The height of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._height - - @height.setter - def height(self, height): - """Sets the height of this TemplatestemplateIdaddFieldsFields. - - - :param height: The height of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - if height is not None and height < 0: # noqa: E501 - raise ValueError("Invalid value for `height`, must be a value greater than or equal to `0`") # noqa: E501 - - self._height = height - - @property - def number_condition_range_exclusive_max(self): - """Gets the number_condition_range_exclusive_max of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The number_condition_range_exclusive_max of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._number_condition_range_exclusive_max - - @number_condition_range_exclusive_max.setter - def number_condition_range_exclusive_max(self, number_condition_range_exclusive_max): - """Sets the number_condition_range_exclusive_max of this TemplatestemplateIdaddFieldsFields. - - - :param number_condition_range_exclusive_max: The number_condition_range_exclusive_max of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._number_condition_range_exclusive_max = number_condition_range_exclusive_max - - @property - def invert_boolean_condition(self): - """Gets the invert_boolean_condition of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The invert_boolean_condition of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._invert_boolean_condition - - @invert_boolean_condition.setter - def invert_boolean_condition(self, invert_boolean_condition): - """Sets the invert_boolean_condition of this TemplatestemplateIdaddFieldsFields. - - - :param invert_boolean_condition: The invert_boolean_condition of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._invert_boolean_condition = invert_boolean_condition - - @property - def shape_fill_color_field_name(self): - """Gets the shape_fill_color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The shape_fill_color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._shape_fill_color_field_name - - @shape_fill_color_field_name.setter - def shape_fill_color_field_name(self, shape_fill_color_field_name): - """Sets the shape_fill_color_field_name of this TemplatestemplateIdaddFieldsFields. - - - :param shape_fill_color_field_name: The shape_fill_color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._shape_fill_color_field_name = shape_fill_color_field_name - - @property - def static(self): - """Gets the static of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The static of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._static - - @static.setter - def static(self, static): - """Sets the static of this TemplatestemplateIdaddFieldsFields. - - - :param static: The static of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._static = static - - @property - def shape_border_color_field_name(self): - """Gets the shape_border_color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The shape_border_color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._shape_border_color_field_name - - @shape_border_color_field_name.setter - def shape_border_color_field_name(self, shape_border_color_field_name): - """Sets the shape_border_color_field_name of this TemplatestemplateIdaddFieldsFields. - - - :param shape_border_color_field_name: The shape_border_color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._shape_border_color_field_name = shape_border_color_field_name - - @property - def v_alignment(self): - """Gets the v_alignment of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The v_alignment of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._v_alignment - - @v_alignment.setter - def v_alignment(self, v_alignment): - """Sets the v_alignment of this TemplatestemplateIdaddFieldsFields. - - - :param v_alignment: The v_alignment of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - allowed_values = ["bottom", "center", "top"] # noqa: E501 - if v_alignment not in allowed_values: - raise ValueError( - "Invalid value for `v_alignment` ({0}), must be one of {1}" # noqa: E501 - .format(v_alignment, allowed_values) - ) - - self._v_alignment = v_alignment - - @property - def bold(self): - """Gets the bold of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The bold of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._bold - - @bold.setter - def bold(self, bold): - """Sets the bold of this TemplatestemplateIdaddFieldsFields. - - - :param bold: The bold of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._bold = bold - - @property - def shape_border_width(self): - """Gets the shape_border_width of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The shape_border_width of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._shape_border_width - - @shape_border_width.setter - def shape_border_width(self, shape_border_width): - """Sets the shape_border_width of this TemplatestemplateIdaddFieldsFields. - - - :param shape_border_width: The shape_border_width of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - if shape_border_width is not None and shape_border_width < 0: # noqa: E501 - raise ValueError("Invalid value for `shape_border_width`, must be a value greater than or equal to `0`") # noqa: E501 - - self._shape_border_width = shape_border_width - - @property - def comb_number_of_cells(self): - """Gets the comb_number_of_cells of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The comb_number_of_cells of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._comb_number_of_cells - - @comb_number_of_cells.setter - def comb_number_of_cells(self, comb_number_of_cells): - """Sets the comb_number_of_cells of this TemplatestemplateIdaddFieldsFields. - - - :param comb_number_of_cells: The comb_number_of_cells of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - if comb_number_of_cells is not None and comb_number_of_cells < 0: # noqa: E501 - raise ValueError("Invalid value for `comb_number_of_cells`, must be a value greater than or equal to `0`") # noqa: E501 - - self._comb_number_of_cells = comb_number_of_cells - - @property - def shape_border_color(self): - """Gets the shape_border_color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The shape_border_color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._shape_border_color - - @shape_border_color.setter - def shape_border_color(self, shape_border_color): - """Sets the shape_border_color of this TemplatestemplateIdaddFieldsFields. - - - :param shape_border_color: The shape_border_color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._shape_border_color = shape_border_color - - @property - def comb(self): - """Gets the comb of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The comb of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._comb - - @comb.setter - def comb(self, comb): - """Sets the comb of this TemplatestemplateIdaddFieldsFields. - - - :param comb: The comb of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._comb = comb - - @property - def typeface(self): - """Gets the typeface of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The typeface of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._typeface - - @typeface.setter - def typeface(self, typeface): - """Sets the typeface of this TemplatestemplateIdaddFieldsFields. - - - :param typeface: The typeface of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._typeface = typeface - - @property - def shape_type(self): - """Gets the shape_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The shape_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._shape_type - - @shape_type.setter - def shape_type(self, shape_type): - """Sets the shape_type of this TemplatestemplateIdaddFieldsFields. - - - :param shape_type: The shape_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - allowed_values = ["square", "rectangle", "circle", "ellipse"] # noqa: E501 - if shape_type not in allowed_values: - raise ValueError( - "Invalid value for `shape_type` ({0}), must be one of {1}" # noqa: E501 - .format(shape_type, allowed_values) - ) - - self._shape_type = shape_type - - @property - def condition(self): - """Gets the condition of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The condition of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._condition - - @condition.setter - def condition(self, condition): - """Sets the condition of this TemplatestemplateIdaddFieldsFields. - - - :param condition: The condition of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._condition = condition - - @property - def display_type(self): - """Gets the display_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The display_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._display_type - - @display_type.setter - def display_type(self, display_type): - """Sets the display_type of this TemplatestemplateIdaddFieldsFields. - - - :param display_type: The display_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - allowed_values = ["text", "check", "qrcode", "barcode", "image", "shape"] # noqa: E501 - if display_type not in allowed_values: - raise ValueError( - "Invalid value for `display_type` ({0}), must be one of {1}" # noqa: E501 - .format(display_type, allowed_values) - ) - - self._display_type = display_type - - @property - def check_color(self): - """Gets the check_color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The check_color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._check_color - - @check_color.setter - def check_color(self, check_color): - """Sets the check_color of this TemplatestemplateIdaddFieldsFields. - - - :param check_color: The check_color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._check_color = check_color - - @property - def multiline_lines(self): - """Gets the multiline_lines of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The multiline_lines of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._multiline_lines - - @multiline_lines.setter - def multiline_lines(self, multiline_lines): - """Sets the multiline_lines of this TemplatestemplateIdaddFieldsFields. - - - :param multiline_lines: The multiline_lines of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - if multiline_lines is not None and multiline_lines < 0: # noqa: E501 - raise ValueError("Invalid value for `multiline_lines`, must be a value greater than or equal to `0`") # noqa: E501 - - self._multiline_lines = multiline_lines - - @property - def multiline(self): - """Gets the multiline of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The multiline of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._multiline - - @multiline.setter - def multiline(self, multiline): - """Sets the multiline of this TemplatestemplateIdaddFieldsFields. - - - :param multiline: The multiline of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._multiline = multiline - - @property - def true_text(self): - """Gets the true_text of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The true_text of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._true_text - - @true_text.setter - def true_text(self, true_text): - """Sets the true_text of this TemplatestemplateIdaddFieldsFields. - - - :param true_text: The true_text of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._true_text = true_text - - @property - def name(self): - """Gets the name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this TemplatestemplateIdaddFieldsFields. - - - :param name: The name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def font_size(self): - """Gets the font_size of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The font_size of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._font_size - - @font_size.setter - def font_size(self, font_size): - """Sets the font_size of this TemplatestemplateIdaddFieldsFields. - - - :param font_size: The font_size of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - if font_size is not None and font_size < 0: # noqa: E501 - raise ValueError("Invalid value for `font_size`, must be a value greater than or equal to `0`") # noqa: E501 - - self._font_size = font_size - - @property - def page(self): - """Gets the page of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The page of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._page - - @page.setter - def page(self, page): - """Sets the page of this TemplatestemplateIdaddFieldsFields. - - - :param page: The page of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - if page is not None and page < 1: # noqa: E501 - raise ValueError("Invalid value for `page`, must be a value greater than or equal to `1`") # noqa: E501 - - self._page = page - - @property - def alignment(self): - """Gets the alignment of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The alignment of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._alignment - - @alignment.setter - def alignment(self, alignment): - """Sets the alignment of this TemplatestemplateIdaddFieldsFields. - - - :param alignment: The alignment of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - allowed_values = ["left", "center", "right"] # noqa: E501 - if alignment not in allowed_values: - raise ValueError( - "Invalid value for `alignment` ({0}), must be one of {1}" # noqa: E501 - .format(alignment, allowed_values) - ) - - self._alignment = alignment - - @property - def max_length(self): - """Gets the max_length of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The max_length of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._max_length - - @max_length.setter - def max_length(self, max_length): - """Sets the max_length of this TemplatestemplateIdaddFieldsFields. - - - :param max_length: The max_length of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - - self._max_length = max_length - - @property - def auto_calculate_max_length(self): - """Gets the auto_calculate_max_length of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The auto_calculate_max_length of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._auto_calculate_max_length - - @auto_calculate_max_length.setter - def auto_calculate_max_length(self, auto_calculate_max_length): - """Sets the auto_calculate_max_length of this TemplatestemplateIdaddFieldsFields. - - - :param auto_calculate_max_length: The auto_calculate_max_length of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._auto_calculate_max_length = auto_calculate_max_length - - @property - def color_field_name(self): - """Gets the color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._color_field_name - - @color_field_name.setter - def color_field_name(self, color_field_name): - """Sets the color_field_name of this TemplatestemplateIdaddFieldsFields. - - - :param color_field_name: The color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._color_field_name = color_field_name - - @property - def qrcode_color_field_name(self): - """Gets the qrcode_color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The qrcode_color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._qrcode_color_field_name - - @qrcode_color_field_name.setter - def qrcode_color_field_name(self, qrcode_color_field_name): - """Sets the qrcode_color_field_name of this TemplatestemplateIdaddFieldsFields. - - - :param qrcode_color_field_name: The qrcode_color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._qrcode_color_field_name = qrcode_color_field_name - - @property - def number_condition_range_min(self): - """Gets the number_condition_range_min of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The number_condition_range_min of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._number_condition_range_min - - @number_condition_range_min.setter - def number_condition_range_min(self, number_condition_range_min): - """Sets the number_condition_range_min of this TemplatestemplateIdaddFieldsFields. - - - :param number_condition_range_min: The number_condition_range_min of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - - self._number_condition_range_min = number_condition_range_min - - @property - def color(self): - """Gets the color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._color - - @color.setter - def color(self, color): - """Sets the color of this TemplatestemplateIdaddFieldsFields. - - - :param color: The color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._color = color - - @property - def hidden(self): - """Gets the hidden of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The hidden of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._hidden - - @hidden.setter - def hidden(self, hidden): - """Sets the hidden of this TemplatestemplateIdaddFieldsFields. - - - :param hidden: The hidden of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._hidden = hidden - - @property - def check_color_field_required(self): - """Gets the check_color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The check_color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._check_color_field_required - - @check_color_field_required.setter - def check_color_field_required(self, check_color_field_required): - """Sets the check_color_field_required of this TemplatestemplateIdaddFieldsFields. - - - :param check_color_field_required: The check_color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._check_color_field_required = check_color_field_required - - @property - def combined_field_format(self): - """Gets the combined_field_format of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The combined_field_format of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._combined_field_format - - @combined_field_format.setter - def combined_field_format(self, combined_field_format): - """Sets the combined_field_format of this TemplatestemplateIdaddFieldsFields. - - - :param combined_field_format: The combined_field_format of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._combined_field_format = combined_field_format - - @property - def description(self): - """Gets the description of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The description of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this TemplatestemplateIdaddFieldsFields. - - - :param description: The description of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def shape_border_color_field_required(self): - """Gets the shape_border_color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The shape_border_color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._shape_border_color_field_required - - @shape_border_color_field_required.setter - def shape_border_color_field_required(self, shape_border_color_field_required): - """Sets the shape_border_color_field_required of this TemplatestemplateIdaddFieldsFields. - - - :param shape_border_color_field_required: The shape_border_color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._shape_border_color_field_required = shape_border_color_field_required - - @property - def combined_field_names(self): - """Gets the combined_field_names of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The combined_field_names of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._combined_field_names - - @combined_field_names.setter - def combined_field_names(self, combined_field_names): - """Sets the combined_field_names of this TemplatestemplateIdaddFieldsFields. - - - :param combined_field_names: The combined_field_names of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._combined_field_names = combined_field_names - - @property - def title(self): - """Gets the title of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The title of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._title - - @title.setter - def title(self, title): - """Sets the title of this TemplatestemplateIdaddFieldsFields. - - - :param title: The title of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._title = title - - @property - def number_condition_range_exclusive_min(self): - """Gets the number_condition_range_exclusive_min of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The number_condition_range_exclusive_min of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._number_condition_range_exclusive_min - - @number_condition_range_exclusive_min.setter - def number_condition_range_exclusive_min(self, number_condition_range_exclusive_min): - """Sets the number_condition_range_exclusive_min of this TemplatestemplateIdaddFieldsFields. - - - :param number_condition_range_exclusive_min: The number_condition_range_exclusive_min of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._number_condition_range_exclusive_min = number_condition_range_exclusive_min - - @property - def combined_field_separator(self): - """Gets the combined_field_separator of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The combined_field_separator of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._combined_field_separator - - @combined_field_separator.setter - def combined_field_separator(self, combined_field_separator): - """Sets the combined_field_separator of this TemplatestemplateIdaddFieldsFields. - - - :param combined_field_separator: The combined_field_separator of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._combined_field_separator = combined_field_separator - - @property - def exclusive_maximum(self): - """Gets the exclusive_maximum of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The exclusive_maximum of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._exclusive_maximum - - @exclusive_maximum.setter - def exclusive_maximum(self, exclusive_maximum): - """Sets the exclusive_maximum of this TemplatestemplateIdaddFieldsFields. - - - :param exclusive_maximum: The exclusive_maximum of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._exclusive_maximum = exclusive_maximum - - @property - def default(self): - """Gets the default of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The default of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._default - - @default.setter - def default(self, default): - """Sets the default of this TemplatestemplateIdaddFieldsFields. - - - :param default: The default of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._default = default - - @property - def combined_field_type(self): - """Gets the combined_field_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The combined_field_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._combined_field_type - - @combined_field_type.setter - def combined_field_type(self, combined_field_type): - """Sets the combined_field_type of this TemplatestemplateIdaddFieldsFields. - - - :param combined_field_type: The combined_field_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._combined_field_type = combined_field_type - - @property - def date_time_format(self): - """Gets the date_time_format of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The date_time_format of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._date_time_format - - @date_time_format.setter - def date_time_format(self, date_time_format): - """Sets the date_time_format of this TemplatestemplateIdaddFieldsFields. - - - :param date_time_format: The date_time_format of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._date_time_format = date_time_format - - @property - def qrcode_color_field_required(self): - """Gets the qrcode_color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The qrcode_color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._qrcode_color_field_required - - @qrcode_color_field_required.setter - def qrcode_color_field_required(self, qrcode_color_field_required): - """Sets the qrcode_color_field_required of this TemplatestemplateIdaddFieldsFields. - - - :param qrcode_color_field_required: The qrcode_color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._qrcode_color_field_required = qrcode_color_field_required - - @property - def currency(self): - """Gets the currency of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The currency of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._currency - - @currency.setter - def currency(self, currency): - """Sets the currency of this TemplatestemplateIdaddFieldsFields. - - - :param currency: The currency of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._currency = currency - - @property - def false_text(self): - """Gets the false_text of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The false_text of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._false_text - - @false_text.setter - def false_text(self, false_text): - """Sets the false_text of this TemplatestemplateIdaddFieldsFields. - - - :param false_text: The false_text of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._false_text = false_text - - @property - def strikethrough(self): - """Gets the strikethrough of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The strikethrough of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._strikethrough - - @strikethrough.setter - def strikethrough(self, strikethrough): - """Sets the strikethrough of this TemplatestemplateIdaddFieldsFields. - - - :param strikethrough: The strikethrough of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._strikethrough = strikethrough - - @property - def character_spacing(self): - """Gets the character_spacing of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The character_spacing of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._character_spacing - - @character_spacing.setter - def character_spacing(self, character_spacing): - """Sets the character_spacing of this TemplatestemplateIdaddFieldsFields. - - - :param character_spacing: The character_spacing of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - - self._character_spacing = character_spacing - - @property - def number_condition_range_max(self): - """Gets the number_condition_range_max of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The number_condition_range_max of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._number_condition_range_max - - @number_condition_range_max.setter - def number_condition_range_max(self, number_condition_range_max): - """Sets the number_condition_range_max of this TemplatestemplateIdaddFieldsFields. - - - :param number_condition_range_max: The number_condition_range_max of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - - self._number_condition_range_max = number_condition_range_max - - @property - def background_color(self): - """Gets the background_color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The background_color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._background_color - - @background_color.setter - def background_color(self, background_color): - """Sets the background_color of this TemplatestemplateIdaddFieldsFields. - - - :param background_color: The background_color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._background_color = background_color - - @property - def check_color_field_name(self): - """Gets the check_color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The check_color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._check_color_field_name - - @check_color_field_name.setter - def check_color_field_name(self, check_color_field_name): - """Sets the check_color_field_name of this TemplatestemplateIdaddFieldsFields. - - - :param check_color_field_name: The check_color_field_name of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._check_color_field_name = check_color_field_name - - @property - def check_character(self): - """Gets the check_character of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The check_character of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._check_character - - @check_character.setter - def check_character(self, check_character): - """Sets the check_character of this TemplatestemplateIdaddFieldsFields. - - - :param check_character: The check_character of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - allowed_values = ["✓", "✔", "✖", "✗", "✘"] # noqa: E501 - if check_character not in allowed_values: - raise ValueError( - "Invalid value for `check_character` ({0}), must be one of {1}" # noqa: E501 - .format(check_character, allowed_values) - ) - - self._check_character = check_character - - @property - def rotation(self): - """Gets the rotation of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The rotation of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._rotation - - @rotation.setter - def rotation(self, rotation): - """Sets the rotation of this TemplatestemplateIdaddFieldsFields. - - - :param rotation: The rotation of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - if rotation is not None and rotation > 3.6E+2: # noqa: E501 - raise ValueError("Invalid value for `rotation`, must be a value less than or equal to `3.6E+2`") # noqa: E501 - if rotation is not None and rotation < 0: # noqa: E501 - raise ValueError("Invalid value for `rotation`, must be a value greater than or equal to `0`") # noqa: E501 - - self._rotation = rotation - - @property - def option_list(self): - """Gets the option_list of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The option_list of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._option_list - - @option_list.setter - def option_list(self, option_list): - """Sets the option_list of this TemplatestemplateIdaddFieldsFields. - - - :param option_list: The option_list of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._option_list = option_list - - @property - def shape_fill_color(self): - """Gets the shape_fill_color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The shape_fill_color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._shape_fill_color - - @shape_fill_color.setter - def shape_fill_color(self, shape_fill_color): - """Sets the shape_fill_color of this TemplatestemplateIdaddFieldsFields. - - - :param shape_fill_color: The shape_fill_color of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - - self._shape_fill_color = shape_fill_color - - @property - def string_condition_type(self): - """Gets the string_condition_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The string_condition_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._string_condition_type - - @string_condition_type.setter - def string_condition_type(self, string_condition_type): - """Sets the string_condition_type of this TemplatestemplateIdaddFieldsFields. - - - :param string_condition_type: The string_condition_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - allowed_values = ["equals", "contains", "starts_with", "ends_with", "regex"] # noqa: E501 - if string_condition_type not in allowed_values: - raise ValueError( - "Invalid value for `string_condition_type` ({0}), must be one of {1}" # noqa: E501 - .format(string_condition_type, allowed_values) - ) - - self._string_condition_type = string_condition_type - - @property - def shape_fill_color_field_required(self): - """Gets the shape_fill_color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The shape_fill_color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._shape_fill_color_field_required - - @shape_fill_color_field_required.setter - def shape_fill_color_field_required(self, shape_fill_color_field_required): - """Sets the shape_fill_color_field_required of this TemplatestemplateIdaddFieldsFields. - - - :param shape_fill_color_field_required: The shape_fill_color_field_required of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._shape_fill_color_field_required = shape_fill_color_field_required - - @property - def decimal_places(self): - """Gets the decimal_places of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The decimal_places of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._decimal_places - - @decimal_places.setter - def decimal_places(self, decimal_places): - """Sets the decimal_places of this TemplatestemplateIdaddFieldsFields. - - - :param decimal_places: The decimal_places of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - if decimal_places is not None and decimal_places < 0: # noqa: E501 - raise ValueError("Invalid value for `decimal_places`, must be a value greater than or equal to `0`") # noqa: E501 - - self._decimal_places = decimal_places - - @property - def include_time(self): - """Gets the include_time of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The include_time of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._include_time - - @include_time.setter - def include_time(self, include_time): - """Sets the include_time of this TemplatestemplateIdaddFieldsFields. - - - :param include_time: The include_time of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._include_time = include_time - - @property - def width(self): - """Gets the width of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The width of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._width - - @width.setter - def width(self, width): - """Sets the width of this TemplatestemplateIdaddFieldsFields. - - - :param width: The width of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - if width is not None and width < 0: # noqa: E501 - raise ValueError("Invalid value for `width`, must be a value greater than or equal to `0`") # noqa: E501 - - self._width = width - - @property - def x(self): - """Gets the x of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The x of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._x - - @x.setter - def x(self, x): - """Sets the x of this TemplatestemplateIdaddFieldsFields. - - - :param x: The x of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - if x is not None and x < 0: # noqa: E501 - raise ValueError("Invalid value for `x`, must be a value greater than or equal to `0`") # noqa: E501 - - self._x = x - - @property - def maximum(self): - """Gets the maximum of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The maximum of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._maximum - - @maximum.setter - def maximum(self, maximum): - """Sets the maximum of this TemplatestemplateIdaddFieldsFields. - - - :param maximum: The maximum of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - - self._maximum = maximum - - @property - def y(self): - """Gets the y of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The y of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._y - - @y.setter - def y(self, y): - """Sets the y of this TemplatestemplateIdaddFieldsFields. - - - :param y: The y of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - if y is not None and y < 0: # noqa: E501 - raise ValueError("Invalid value for `y`, must be a value greater than or equal to `0`") # noqa: E501 - - self._y = y - - @property - def signature_allow_draw(self): - """Gets the signature_allow_draw of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The signature_allow_draw of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._signature_allow_draw - - @signature_allow_draw.setter - def signature_allow_draw(self, signature_allow_draw): - """Sets the signature_allow_draw of this TemplatestemplateIdaddFieldsFields. - - - :param signature_allow_draw: The signature_allow_draw of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._signature_allow_draw = signature_allow_draw - - @property - def number_condition_type(self): - """Gets the number_condition_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The number_condition_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: str - """ - return self._number_condition_type - - @number_condition_type.setter - def number_condition_type(self, number_condition_type): - """Sets the number_condition_type of this TemplatestemplateIdaddFieldsFields. - - - :param number_condition_type: The number_condition_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: str - """ - allowed_values = ["equals", "range", "gte", "gt", "lte", "lt"] # noqa: E501 - if number_condition_type not in allowed_values: - raise ValueError( - "Invalid value for `number_condition_type` ({0}), must be one of {1}" # noqa: E501 - .format(number_condition_type, allowed_values) - ) - - self._number_condition_type = number_condition_type - - @property - def opacity(self): - """Gets the opacity of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The opacity of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._opacity - - @opacity.setter - def opacity(self, opacity): - """Sets the opacity of this TemplatestemplateIdaddFieldsFields. - - - :param opacity: The opacity of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - if opacity is not None and opacity > 1: # noqa: E501 - raise ValueError("Invalid value for `opacity`, must be a value less than or equal to `1`") # noqa: E501 - if opacity is not None and opacity < 0: # noqa: E501 - raise ValueError("Invalid value for `opacity`, must be a value greater than or equal to `0`") # noqa: E501 - - self._opacity = opacity - - @property - def minimum(self): - """Gets the minimum of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The minimum of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: float - """ - return self._minimum - - @minimum.setter - def minimum(self, minimum): - """Sets the minimum of this TemplatestemplateIdaddFieldsFields. - - - :param minimum: The minimum of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: float - """ - - self._minimum = minimum - - @property - def signature_allow_type(self): - """Gets the signature_allow_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - - - :return: The signature_allow_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :rtype: bool - """ - return self._signature_allow_type - - @signature_allow_type.setter - def signature_allow_type(self, signature_allow_type): - """Sets the signature_allow_type of this TemplatestemplateIdaddFieldsFields. - - - :param signature_allow_type: The signature_allow_type of this TemplatestemplateIdaddFieldsFields. # noqa: E501 - :type: bool - """ - - self._signature_allow_type = signature_allow_type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, TemplatestemplateIdaddFieldsFields): - 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/docspring/models/update_data_request_response.py b/docspring/models/update_data_request_response.py deleted file mode 100644 index 75b8b4f..0000000 --- a/docspring/models/update_data_request_response.py +++ /dev/null @@ -1,170 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class UpdateDataRequestResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'data_request': 'SubmissionDataRequest', - 'errors': 'list[str]', - 'status': 'str' - } - - attribute_map = { - 'data_request': 'data_request', - 'errors': 'errors', - 'status': 'status' - } - - def __init__(self, data_request=None, errors=None, status=None): # noqa: E501 - """UpdateDataRequestResponse - a model defined in OpenAPI""" # noqa: E501 - - self._data_request = None - self._errors = None - self._status = None - self.discriminator = None - - if data_request is not None: - self.data_request = data_request - if errors is not None: - self.errors = errors - if status is not None: - self.status = status - - @property - def data_request(self): - """Gets the data_request of this UpdateDataRequestResponse. # noqa: E501 - - - :return: The data_request of this UpdateDataRequestResponse. # noqa: E501 - :rtype: SubmissionDataRequest - """ - return self._data_request - - @data_request.setter - def data_request(self, data_request): - """Sets the data_request of this UpdateDataRequestResponse. - - - :param data_request: The data_request of this UpdateDataRequestResponse. # noqa: E501 - :type: SubmissionDataRequest - """ - - self._data_request = data_request - - @property - def errors(self): - """Gets the errors of this UpdateDataRequestResponse. # noqa: E501 - - - :return: The errors of this UpdateDataRequestResponse. # noqa: E501 - :rtype: list[str] - """ - return self._errors - - @errors.setter - def errors(self, errors): - """Sets the errors of this UpdateDataRequestResponse. - - - :param errors: The errors of this UpdateDataRequestResponse. # noqa: E501 - :type: list[str] - """ - - self._errors = errors - - @property - def status(self): - """Gets the status of this UpdateDataRequestResponse. # noqa: E501 - - - :return: The status of this UpdateDataRequestResponse. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this UpdateDataRequestResponse. - - - :param status: The status of this UpdateDataRequestResponse. # noqa: E501 - :type: str - """ - allowed_values = ["success", "error"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, UpdateDataRequestResponse): - 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/docspring/models/update_html_template.py b/docspring/models/update_html_template.py new file mode 100644 index 0000000..4609756 --- /dev/null +++ b/docspring/models/update_html_template.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class UpdateHtmlTemplate(BaseModel): + """ + UpdateHtmlTemplate + """ # noqa: E501 + template: Dict[str, Any] + __properties: ClassVar[List[str]] = ["template"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateHtmlTemplate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateHtmlTemplate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "template": obj.get("template") + }) + return _obj + + diff --git a/docspring/models/update_submission_data_request_data.py b/docspring/models/update_submission_data_request_data.py index cecc389..21cdfe5 100644 --- a/docspring/models/update_submission_data_request_data.py +++ b/docspring/models/update_submission_data_request_data.py @@ -1,428 +1,103 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 +from __future__ import annotations import pprint import re # noqa: F401 +import json -import six - - -class UpdateSubmissionDataRequestData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. +class UpdateSubmissionDataRequestData(BaseModel): """ - openapi_types = { - 'auth_phone_number_hash': 'str', - 'auth_provider': 'str', - 'auth_second_factor_type': 'str', - 'auth_session_id_hash': 'str', - 'auth_session_started_at': 'str', - 'auth_type': 'str', - 'auth_user_id_hash': 'str', - 'auth_username_hash': 'str', - 'email': 'str', - 'fields': 'list[str]', - 'metadata': 'object', - 'name': 'str', - 'order': 'int' - } - - attribute_map = { - 'auth_phone_number_hash': 'auth_phone_number_hash', - 'auth_provider': 'auth_provider', - 'auth_second_factor_type': 'auth_second_factor_type', - 'auth_session_id_hash': 'auth_session_id_hash', - 'auth_session_started_at': 'auth_session_started_at', - 'auth_type': 'auth_type', - 'auth_user_id_hash': 'auth_user_id_hash', - 'auth_username_hash': 'auth_username_hash', - 'email': 'email', - 'fields': 'fields', - 'metadata': 'metadata', - 'name': 'name', - 'order': 'order' - } - - def __init__(self, auth_phone_number_hash=None, auth_provider=None, auth_second_factor_type=None, auth_session_id_hash=None, auth_session_started_at=None, auth_type=None, auth_user_id_hash=None, auth_username_hash=None, email=None, fields=None, metadata=None, name=None, order=None): # noqa: E501 - """UpdateSubmissionDataRequestData - a model defined in OpenAPI""" # noqa: E501 - - self._auth_phone_number_hash = None - self._auth_provider = None - self._auth_second_factor_type = None - self._auth_session_id_hash = None - self._auth_session_started_at = None - self._auth_type = None - self._auth_user_id_hash = None - self._auth_username_hash = None - self._email = None - self._fields = None - self._metadata = None - self._name = None - self._order = None - self.discriminator = None - - self.auth_phone_number_hash = auth_phone_number_hash - self.auth_provider = auth_provider - if auth_second_factor_type is not None: - self.auth_second_factor_type = auth_second_factor_type - self.auth_session_id_hash = auth_session_id_hash - self.auth_session_started_at = auth_session_started_at - if auth_type is not None: - self.auth_type = auth_type - self.auth_user_id_hash = auth_user_id_hash - self.auth_username_hash = auth_username_hash - self.email = email - if fields is not None: - self.fields = fields - if metadata is not None: - self.metadata = metadata - self.name = name - if order is not None: - self.order = order - - @property - def auth_phone_number_hash(self): - """Gets the auth_phone_number_hash of this UpdateSubmissionDataRequestData. # noqa: E501 - - - :return: The auth_phone_number_hash of this UpdateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._auth_phone_number_hash - - @auth_phone_number_hash.setter - def auth_phone_number_hash(self, auth_phone_number_hash): - """Sets the auth_phone_number_hash of this UpdateSubmissionDataRequestData. - - - :param auth_phone_number_hash: The auth_phone_number_hash of this UpdateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - - self._auth_phone_number_hash = auth_phone_number_hash - - @property - def auth_provider(self): - """Gets the auth_provider of this UpdateSubmissionDataRequestData. # noqa: E501 - - - :return: The auth_provider of this UpdateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._auth_provider - - @auth_provider.setter - def auth_provider(self, auth_provider): - """Sets the auth_provider of this UpdateSubmissionDataRequestData. - - - :param auth_provider: The auth_provider of this UpdateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - - self._auth_provider = auth_provider - - @property - def auth_second_factor_type(self): - """Gets the auth_second_factor_type of this UpdateSubmissionDataRequestData. # noqa: E501 - - - :return: The auth_second_factor_type of this UpdateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._auth_second_factor_type - - @auth_second_factor_type.setter - def auth_second_factor_type(self, auth_second_factor_type): - """Sets the auth_second_factor_type of this UpdateSubmissionDataRequestData. - - - :param auth_second_factor_type: The auth_second_factor_type of this UpdateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - allowed_values = ["none", "phone_number", "totp", "mobile_push", "security_key", "fingerprint"] # noqa: E501 - if auth_second_factor_type not in allowed_values: - raise ValueError( - "Invalid value for `auth_second_factor_type` ({0}), must be one of {1}" # noqa: E501 - .format(auth_second_factor_type, allowed_values) - ) - - self._auth_second_factor_type = auth_second_factor_type - - @property - def auth_session_id_hash(self): - """Gets the auth_session_id_hash of this UpdateSubmissionDataRequestData. # noqa: E501 - - - :return: The auth_session_id_hash of this UpdateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._auth_session_id_hash - - @auth_session_id_hash.setter - def auth_session_id_hash(self, auth_session_id_hash): - """Sets the auth_session_id_hash of this UpdateSubmissionDataRequestData. - - - :param auth_session_id_hash: The auth_session_id_hash of this UpdateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - - self._auth_session_id_hash = auth_session_id_hash - - @property - def auth_session_started_at(self): - """Gets the auth_session_started_at of this UpdateSubmissionDataRequestData. # noqa: E501 - - - :return: The auth_session_started_at of this UpdateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._auth_session_started_at - - @auth_session_started_at.setter - def auth_session_started_at(self, auth_session_started_at): - """Sets the auth_session_started_at of this UpdateSubmissionDataRequestData. - - - :param auth_session_started_at: The auth_session_started_at of this UpdateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - - self._auth_session_started_at = auth_session_started_at - - @property - def auth_type(self): - """Gets the auth_type of this UpdateSubmissionDataRequestData. # noqa: E501 - - - :return: The auth_type of this UpdateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._auth_type - - @auth_type.setter - def auth_type(self, auth_type): - """Sets the auth_type of this UpdateSubmissionDataRequestData. - - - :param auth_type: The auth_type of this UpdateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - allowed_values = ["none", "password", "oauth", "email_link", "phone_number", "ldap", "saml"] # noqa: E501 - if auth_type not in allowed_values: - raise ValueError( - "Invalid value for `auth_type` ({0}), must be one of {1}" # noqa: E501 - .format(auth_type, allowed_values) - ) - - self._auth_type = auth_type - - @property - def auth_user_id_hash(self): - """Gets the auth_user_id_hash of this UpdateSubmissionDataRequestData. # noqa: E501 - - - :return: The auth_user_id_hash of this UpdateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._auth_user_id_hash - - @auth_user_id_hash.setter - def auth_user_id_hash(self, auth_user_id_hash): - """Sets the auth_user_id_hash of this UpdateSubmissionDataRequestData. - - - :param auth_user_id_hash: The auth_user_id_hash of this UpdateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - - self._auth_user_id_hash = auth_user_id_hash - - @property - def auth_username_hash(self): - """Gets the auth_username_hash of this UpdateSubmissionDataRequestData. # noqa: E501 - - - :return: The auth_username_hash of this UpdateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._auth_username_hash - - @auth_username_hash.setter - def auth_username_hash(self, auth_username_hash): - """Sets the auth_username_hash of this UpdateSubmissionDataRequestData. - - - :param auth_username_hash: The auth_username_hash of this UpdateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - - self._auth_username_hash = auth_username_hash - - @property - def email(self): - """Gets the email of this UpdateSubmissionDataRequestData. # noqa: E501 - - - :return: The email of this UpdateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._email - - @email.setter - def email(self, email): - """Sets the email of this UpdateSubmissionDataRequestData. - - - :param email: The email of this UpdateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - - self._email = email - - @property - def fields(self): - """Gets the fields of this UpdateSubmissionDataRequestData. # noqa: E501 - - - :return: The fields of this UpdateSubmissionDataRequestData. # noqa: E501 - :rtype: list[str] - """ - return self._fields - - @fields.setter - def fields(self, fields): - """Sets the fields of this UpdateSubmissionDataRequestData. - - - :param fields: The fields of this UpdateSubmissionDataRequestData. # noqa: E501 - :type: list[str] - """ - - self._fields = fields - - @property - def metadata(self): - """Gets the metadata of this UpdateSubmissionDataRequestData. # noqa: E501 - - - :return: The metadata of this UpdateSubmissionDataRequestData. # noqa: E501 - :rtype: object - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this UpdateSubmissionDataRequestData. - - - :param metadata: The metadata of this UpdateSubmissionDataRequestData. # noqa: E501 - :type: object - """ - - self._metadata = metadata - - @property - def name(self): - """Gets the name of this UpdateSubmissionDataRequestData. # noqa: E501 - - - :return: The name of this UpdateSubmissionDataRequestData. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this UpdateSubmissionDataRequestData. - - - :param name: The name of this UpdateSubmissionDataRequestData. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def order(self): - """Gets the order of this UpdateSubmissionDataRequestData. # noqa: E501 - - - :return: The order of this UpdateSubmissionDataRequestData. # noqa: E501 - :rtype: int - """ - return self._order - - @order.setter - def order(self, order): - """Sets the order of this UpdateSubmissionDataRequestData. - - - :param order: The order of this UpdateSubmissionDataRequestData. # noqa: E501 - :type: int - """ - - self._order = order - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, UpdateSubmissionDataRequestData): - return False + UpdateSubmissionDataRequestData + """ # noqa: E501 + auth_type: Optional[StrictStr] = None + fields: Optional[List[StrictStr]] = None + metadata: Optional[Dict[str, Any]] = None + order: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["auth_type", "fields", "metadata", "order"] + + @field_validator('auth_type') + def auth_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['none', 'password', 'oauth', 'email_link', 'phone_number', 'ldap', 'saml']): + raise ValueError("must be one of enum values ('none', 'password', 'oauth', 'email_link', 'phone_number', 'ldap', 'saml')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateSubmissionDataRequestData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateSubmissionDataRequestData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "auth_type": obj.get("auth_type"), + "fields": obj.get("fields"), + "metadata": obj.get("metadata"), + "order": obj.get("order") + }) + return _obj - return self.__dict__ == other.__dict__ - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/docspring/models/update_template_data.py b/docspring/models/update_template_data.py deleted file mode 100644 index 9525d32..0000000 --- a/docspring/models/update_template_data.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class UpdateTemplateData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'template': 'TemplateData' - } - - attribute_map = { - 'template': 'template' - } - - def __init__(self, template=None): # noqa: E501 - """UpdateTemplateData - a model defined in OpenAPI""" # noqa: E501 - - self._template = None - self.discriminator = None - - self.template = template - - @property - def template(self): - """Gets the template of this UpdateTemplateData. # noqa: E501 - - - :return: The template of this UpdateTemplateData. # noqa: E501 - :rtype: TemplateData - """ - return self._template - - @template.setter - def template(self, template): - """Sets the template of this UpdateTemplateData. - - - :param template: The template of this UpdateTemplateData. # noqa: E501 - :type: TemplateData - """ - if template is None: - raise ValueError("Invalid value for `template`, must not be `None`") # noqa: E501 - - self._template = template - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, UpdateTemplateData): - 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/docspring/models/update_template_response.py b/docspring/models/update_template_response.py deleted file mode 100644 index 6c248fd..0000000 --- a/docspring/models/update_template_response.py +++ /dev/null @@ -1,144 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class UpdateTemplateResponse(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'errors': 'list[str]', - 'status': 'str' - } - - attribute_map = { - 'errors': 'errors', - 'status': 'status' - } - - def __init__(self, errors=None, status=None): # noqa: E501 - """UpdateTemplateResponse - a model defined in OpenAPI""" # noqa: E501 - - self._errors = None - self._status = None - self.discriminator = None - - if errors is not None: - self.errors = errors - if status is not None: - self.status = status - - @property - def errors(self): - """Gets the errors of this UpdateTemplateResponse. # noqa: E501 - - - :return: The errors of this UpdateTemplateResponse. # noqa: E501 - :rtype: list[str] - """ - return self._errors - - @errors.setter - def errors(self, errors): - """Sets the errors of this UpdateTemplateResponse. - - - :param errors: The errors of this UpdateTemplateResponse. # noqa: E501 - :type: list[str] - """ - - self._errors = errors - - @property - def status(self): - """Gets the status of this UpdateTemplateResponse. # noqa: E501 - - - :return: The status of this UpdateTemplateResponse. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this UpdateTemplateResponse. - - - :param status: The status of this UpdateTemplateResponse. # noqa: E501 - :type: str - """ - allowed_values = ["success", "error"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 - .format(status, allowed_values) - ) - - self._status = status - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, UpdateTemplateResponse): - 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/docspring/models/upload_presign_response.py b/docspring/models/upload_presign_response.py new file mode 100644 index 0000000..374374e --- /dev/null +++ b/docspring/models/upload_presign_response.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UploadPresignResponse(BaseModel): + """ + UploadPresignResponse + """ # noqa: E501 + fields: Dict[str, Any] + headers: Dict[str, Any] + url: StrictStr + method: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["fields", "headers", "url", "method"] + + @field_validator('method') + def method_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['post']): + raise ValueError("must be one of enum values ('post')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UploadPresignResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UploadPresignResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fields": obj.get("fields"), + "headers": obj.get("headers"), + "url": obj.get("url"), + "method": obj.get("method") + }) + return _obj + + diff --git a/docspring/models/upload_template_data.py b/docspring/models/upload_template_data.py deleted file mode 100644 index 3155fc7..0000000 --- a/docspring/models/upload_template_data.py +++ /dev/null @@ -1,557 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class UploadTemplateData(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'expiration_interval': 'str', - 'webhook_url': 'str', - 'scss': 'str', - 'allow_additional_properties': 'bool', - 'document': 'UploadTemplateDataDocument', - 'expire_after': 'float', - 'description': 'str', - 'public_submissions': 'bool', - 'slack_webhook_url': 'str', - 'header_html': 'str', - 'public_web_form': 'bool', - 'editable_submissions': 'bool', - 'expire_submissions': 'bool', - 'name': 'str', - 'footer_html': 'str', - 'html': 'str', - 'template_type': 'str', - 'redirect_url': 'str' - } - - attribute_map = { - 'expiration_interval': 'expiration_interval', - 'webhook_url': 'webhook_url', - 'scss': 'scss', - 'allow_additional_properties': 'allow_additional_properties', - 'document': 'document', - 'expire_after': 'expire_after', - 'description': 'description', - 'public_submissions': 'public_submissions', - 'slack_webhook_url': 'slack_webhook_url', - 'header_html': 'header_html', - 'public_web_form': 'public_web_form', - 'editable_submissions': 'editable_submissions', - 'expire_submissions': 'expire_submissions', - 'name': 'name', - 'footer_html': 'footer_html', - 'html': 'html', - 'template_type': 'template_type', - 'redirect_url': 'redirect_url' - } - - def __init__(self, expiration_interval=None, webhook_url=None, scss=None, allow_additional_properties=None, document=None, expire_after=None, description=None, public_submissions=None, slack_webhook_url=None, header_html=None, public_web_form=None, editable_submissions=None, expire_submissions=None, name=None, footer_html=None, html=None, template_type=None, redirect_url=None): # noqa: E501 - """UploadTemplateData - a model defined in OpenAPI""" # noqa: E501 - - self._expiration_interval = None - self._webhook_url = None - self._scss = None - self._allow_additional_properties = None - self._document = None - self._expire_after = None - self._description = None - self._public_submissions = None - self._slack_webhook_url = None - self._header_html = None - self._public_web_form = None - self._editable_submissions = None - self._expire_submissions = None - self._name = None - self._footer_html = None - self._html = None - self._template_type = None - self._redirect_url = None - self.discriminator = None - - if expiration_interval is not None: - self.expiration_interval = expiration_interval - self.webhook_url = webhook_url - self.scss = scss - if allow_additional_properties is not None: - self.allow_additional_properties = allow_additional_properties - if document is not None: - self.document = document - if expire_after is not None: - self.expire_after = expire_after - self.description = description - if public_submissions is not None: - self.public_submissions = public_submissions - self.slack_webhook_url = slack_webhook_url - self.header_html = header_html - if public_web_form is not None: - self.public_web_form = public_web_form - if editable_submissions is not None: - self.editable_submissions = editable_submissions - if expire_submissions is not None: - self.expire_submissions = expire_submissions - self.name = name - self.footer_html = footer_html - self.html = html - if template_type is not None: - self.template_type = template_type - self.redirect_url = redirect_url - - @property - def expiration_interval(self): - """Gets the expiration_interval of this UploadTemplateData. # noqa: E501 - - - :return: The expiration_interval of this UploadTemplateData. # noqa: E501 - :rtype: str - """ - return self._expiration_interval - - @expiration_interval.setter - def expiration_interval(self, expiration_interval): - """Sets the expiration_interval of this UploadTemplateData. - - - :param expiration_interval: The expiration_interval of this UploadTemplateData. # noqa: E501 - :type: str - """ - allowed_values = ["minutes", "hours", "days"] # noqa: E501 - if expiration_interval not in allowed_values: - raise ValueError( - "Invalid value for `expiration_interval` ({0}), must be one of {1}" # noqa: E501 - .format(expiration_interval, allowed_values) - ) - - self._expiration_interval = expiration_interval - - @property - def webhook_url(self): - """Gets the webhook_url of this UploadTemplateData. # noqa: E501 - - - :return: The webhook_url of this UploadTemplateData. # noqa: E501 - :rtype: str - """ - return self._webhook_url - - @webhook_url.setter - def webhook_url(self, webhook_url): - """Sets the webhook_url of this UploadTemplateData. - - - :param webhook_url: The webhook_url of this UploadTemplateData. # noqa: E501 - :type: str - """ - - self._webhook_url = webhook_url - - @property - def scss(self): - """Gets the scss of this UploadTemplateData. # noqa: E501 - - - :return: The scss of this UploadTemplateData. # noqa: E501 - :rtype: str - """ - return self._scss - - @scss.setter - def scss(self, scss): - """Sets the scss of this UploadTemplateData. - - - :param scss: The scss of this UploadTemplateData. # noqa: E501 - :type: str - """ - - self._scss = scss - - @property - def allow_additional_properties(self): - """Gets the allow_additional_properties of this UploadTemplateData. # noqa: E501 - - - :return: The allow_additional_properties of this UploadTemplateData. # noqa: E501 - :rtype: bool - """ - return self._allow_additional_properties - - @allow_additional_properties.setter - def allow_additional_properties(self, allow_additional_properties): - """Sets the allow_additional_properties of this UploadTemplateData. - - - :param allow_additional_properties: The allow_additional_properties of this UploadTemplateData. # noqa: E501 - :type: bool - """ - - self._allow_additional_properties = allow_additional_properties - - @property - def document(self): - """Gets the document of this UploadTemplateData. # noqa: E501 - - - :return: The document of this UploadTemplateData. # noqa: E501 - :rtype: UploadTemplateDataDocument - """ - return self._document - - @document.setter - def document(self, document): - """Sets the document of this UploadTemplateData. - - - :param document: The document of this UploadTemplateData. # noqa: E501 - :type: UploadTemplateDataDocument - """ - - self._document = document - - @property - def expire_after(self): - """Gets the expire_after of this UploadTemplateData. # noqa: E501 - - - :return: The expire_after of this UploadTemplateData. # noqa: E501 - :rtype: float - """ - return self._expire_after - - @expire_after.setter - def expire_after(self, expire_after): - """Sets the expire_after of this UploadTemplateData. - - - :param expire_after: The expire_after of this UploadTemplateData. # noqa: E501 - :type: float - """ - - self._expire_after = expire_after - - @property - def description(self): - """Gets the description of this UploadTemplateData. # noqa: E501 - - - :return: The description of this UploadTemplateData. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this UploadTemplateData. - - - :param description: The description of this UploadTemplateData. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def public_submissions(self): - """Gets the public_submissions of this UploadTemplateData. # noqa: E501 - - - :return: The public_submissions of this UploadTemplateData. # noqa: E501 - :rtype: bool - """ - return self._public_submissions - - @public_submissions.setter - def public_submissions(self, public_submissions): - """Sets the public_submissions of this UploadTemplateData. - - - :param public_submissions: The public_submissions of this UploadTemplateData. # noqa: E501 - :type: bool - """ - - self._public_submissions = public_submissions - - @property - def slack_webhook_url(self): - """Gets the slack_webhook_url of this UploadTemplateData. # noqa: E501 - - - :return: The slack_webhook_url of this UploadTemplateData. # noqa: E501 - :rtype: str - """ - return self._slack_webhook_url - - @slack_webhook_url.setter - def slack_webhook_url(self, slack_webhook_url): - """Sets the slack_webhook_url of this UploadTemplateData. - - - :param slack_webhook_url: The slack_webhook_url of this UploadTemplateData. # noqa: E501 - :type: str - """ - - self._slack_webhook_url = slack_webhook_url - - @property - def header_html(self): - """Gets the header_html of this UploadTemplateData. # noqa: E501 - - - :return: The header_html of this UploadTemplateData. # noqa: E501 - :rtype: str - """ - return self._header_html - - @header_html.setter - def header_html(self, header_html): - """Sets the header_html of this UploadTemplateData. - - - :param header_html: The header_html of this UploadTemplateData. # noqa: E501 - :type: str - """ - - self._header_html = header_html - - @property - def public_web_form(self): - """Gets the public_web_form of this UploadTemplateData. # noqa: E501 - - - :return: The public_web_form of this UploadTemplateData. # noqa: E501 - :rtype: bool - """ - return self._public_web_form - - @public_web_form.setter - def public_web_form(self, public_web_form): - """Sets the public_web_form of this UploadTemplateData. - - - :param public_web_form: The public_web_form of this UploadTemplateData. # noqa: E501 - :type: bool - """ - - self._public_web_form = public_web_form - - @property - def editable_submissions(self): - """Gets the editable_submissions of this UploadTemplateData. # noqa: E501 - - - :return: The editable_submissions of this UploadTemplateData. # noqa: E501 - :rtype: bool - """ - return self._editable_submissions - - @editable_submissions.setter - def editable_submissions(self, editable_submissions): - """Sets the editable_submissions of this UploadTemplateData. - - - :param editable_submissions: The editable_submissions of this UploadTemplateData. # noqa: E501 - :type: bool - """ - - self._editable_submissions = editable_submissions - - @property - def expire_submissions(self): - """Gets the expire_submissions of this UploadTemplateData. # noqa: E501 - - - :return: The expire_submissions of this UploadTemplateData. # noqa: E501 - :rtype: bool - """ - return self._expire_submissions - - @expire_submissions.setter - def expire_submissions(self, expire_submissions): - """Sets the expire_submissions of this UploadTemplateData. - - - :param expire_submissions: The expire_submissions of this UploadTemplateData. # noqa: E501 - :type: bool - """ - - self._expire_submissions = expire_submissions - - @property - def name(self): - """Gets the name of this UploadTemplateData. # noqa: E501 - - - :return: The name of this UploadTemplateData. # noqa: E501 - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this UploadTemplateData. - - - :param name: The name of this UploadTemplateData. # noqa: E501 - :type: str - """ - - self._name = name - - @property - def footer_html(self): - """Gets the footer_html of this UploadTemplateData. # noqa: E501 - - - :return: The footer_html of this UploadTemplateData. # noqa: E501 - :rtype: str - """ - return self._footer_html - - @footer_html.setter - def footer_html(self, footer_html): - """Sets the footer_html of this UploadTemplateData. - - - :param footer_html: The footer_html of this UploadTemplateData. # noqa: E501 - :type: str - """ - - self._footer_html = footer_html - - @property - def html(self): - """Gets the html of this UploadTemplateData. # noqa: E501 - - - :return: The html of this UploadTemplateData. # noqa: E501 - :rtype: str - """ - return self._html - - @html.setter - def html(self, html): - """Sets the html of this UploadTemplateData. - - - :param html: The html of this UploadTemplateData. # noqa: E501 - :type: str - """ - - self._html = html - - @property - def template_type(self): - """Gets the template_type of this UploadTemplateData. # noqa: E501 - - - :return: The template_type of this UploadTemplateData. # noqa: E501 - :rtype: str - """ - return self._template_type - - @template_type.setter - def template_type(self, template_type): - """Sets the template_type of this UploadTemplateData. - - - :param template_type: The template_type of this UploadTemplateData. # noqa: E501 - :type: str - """ - allowed_values = ["pdf", "html"] # noqa: E501 - if template_type not in allowed_values: - raise ValueError( - "Invalid value for `template_type` ({0}), must be one of {1}" # noqa: E501 - .format(template_type, allowed_values) - ) - - self._template_type = template_type - - @property - def redirect_url(self): - """Gets the redirect_url of this UploadTemplateData. # noqa: E501 - - - :return: The redirect_url of this UploadTemplateData. # noqa: E501 - :rtype: str - """ - return self._redirect_url - - @redirect_url.setter - def redirect_url(self, redirect_url): - """Sets the redirect_url of this UploadTemplateData. - - - :param redirect_url: The redirect_url of this UploadTemplateData. # noqa: E501 - :type: str - """ - - self._redirect_url = redirect_url - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, UploadTemplateData): - 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/docspring/models/upload_template_data_document.py b/docspring/models/upload_template_data_document.py deleted file mode 100644 index 0770206..0000000 --- a/docspring/models/upload_template_data_document.py +++ /dev/null @@ -1,170 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class UploadTemplateDataDocument(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'metadata': 'UploadTemplateDataDocumentMetadata', - 'id': 'str', - 'storage': 'str' - } - - attribute_map = { - 'metadata': 'metadata', - 'id': 'id', - 'storage': 'storage' - } - - def __init__(self, metadata=None, id=None, storage=None): # noqa: E501 - """UploadTemplateDataDocument - a model defined in OpenAPI""" # noqa: E501 - - self._metadata = None - self._id = None - self._storage = None - self.discriminator = None - - if metadata is not None: - self.metadata = metadata - if id is not None: - self.id = id - if storage is not None: - self.storage = storage - - @property - def metadata(self): - """Gets the metadata of this UploadTemplateDataDocument. # noqa: E501 - - - :return: The metadata of this UploadTemplateDataDocument. # noqa: E501 - :rtype: UploadTemplateDataDocumentMetadata - """ - return self._metadata - - @metadata.setter - def metadata(self, metadata): - """Sets the metadata of this UploadTemplateDataDocument. - - - :param metadata: The metadata of this UploadTemplateDataDocument. # noqa: E501 - :type: UploadTemplateDataDocumentMetadata - """ - - self._metadata = metadata - - @property - def id(self): - """Gets the id of this UploadTemplateDataDocument. # noqa: E501 - - - :return: The id of this UploadTemplateDataDocument. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this UploadTemplateDataDocument. - - - :param id: The id of this UploadTemplateDataDocument. # noqa: E501 - :type: str - """ - - self._id = id - - @property - def storage(self): - """Gets the storage of this UploadTemplateDataDocument. # noqa: E501 - - - :return: The storage of this UploadTemplateDataDocument. # noqa: E501 - :rtype: str - """ - return self._storage - - @storage.setter - def storage(self, storage): - """Sets the storage of this UploadTemplateDataDocument. - - - :param storage: The storage of this UploadTemplateDataDocument. # noqa: E501 - :type: str - """ - allowed_values = ["cache"] # noqa: E501 - if storage not in allowed_values: - raise ValueError( - "Invalid value for `storage` ({0}), must be one of {1}" # noqa: E501 - .format(storage, allowed_values) - ) - - self._storage = storage - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, UploadTemplateDataDocument): - 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/docspring/models/upload_template_data_document_metadata.py b/docspring/models/upload_template_data_document_metadata.py deleted file mode 100644 index 2db0604..0000000 --- a/docspring/models/upload_template_data_document_metadata.py +++ /dev/null @@ -1,170 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -import pprint -import re # noqa: F401 - -import six - - -class UploadTemplateDataDocumentMetadata(object): - """NOTE: This class is auto generated by OpenAPI Generator. - Ref: https://openapi-generator.tech - - Do not edit the class manually. - """ - - """ - Attributes: - openapi_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. - """ - openapi_types = { - 'filename': 'str', - 'size': 'int', - 'mime_type': 'str' - } - - attribute_map = { - 'filename': 'filename', - 'size': 'size', - 'mime_type': 'mime_type' - } - - def __init__(self, filename=None, size=None, mime_type=None): # noqa: E501 - """UploadTemplateDataDocumentMetadata - a model defined in OpenAPI""" # noqa: E501 - - self._filename = None - self._size = None - self._mime_type = None - self.discriminator = None - - if filename is not None: - self.filename = filename - if size is not None: - self.size = size - if mime_type is not None: - self.mime_type = mime_type - - @property - def filename(self): - """Gets the filename of this UploadTemplateDataDocumentMetadata. # noqa: E501 - - - :return: The filename of this UploadTemplateDataDocumentMetadata. # noqa: E501 - :rtype: str - """ - return self._filename - - @filename.setter - def filename(self, filename): - """Sets the filename of this UploadTemplateDataDocumentMetadata. - - - :param filename: The filename of this UploadTemplateDataDocumentMetadata. # noqa: E501 - :type: str - """ - - self._filename = filename - - @property - def size(self): - """Gets the size of this UploadTemplateDataDocumentMetadata. # noqa: E501 - - - :return: The size of this UploadTemplateDataDocumentMetadata. # noqa: E501 - :rtype: int - """ - return self._size - - @size.setter - def size(self, size): - """Sets the size of this UploadTemplateDataDocumentMetadata. - - - :param size: The size of this UploadTemplateDataDocumentMetadata. # noqa: E501 - :type: int - """ - - self._size = size - - @property - def mime_type(self): - """Gets the mime_type of this UploadTemplateDataDocumentMetadata. # noqa: E501 - - - :return: The mime_type of this UploadTemplateDataDocumentMetadata. # noqa: E501 - :rtype: str - """ - return self._mime_type - - @mime_type.setter - def mime_type(self, mime_type): - """Sets the mime_type of this UploadTemplateDataDocumentMetadata. - - - :param mime_type: The mime_type of this UploadTemplateDataDocumentMetadata. # noqa: E501 - :type: str - """ - allowed_values = ["application/pdf"] # noqa: E501 - if mime_type not in allowed_values: - raise ValueError( - "Invalid value for `mime_type` ({0}), must be one of {1}" # noqa: E501 - .format(mime_type, allowed_values) - ) - - self._mime_type = mime_type - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.openapi_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 - - 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, UploadTemplateDataDocumentMetadata): - 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/docspring/py.typed b/docspring/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/docspring/rest.py b/docspring/rest.py index 47e7eb1..692b1a9 100644 --- a/docspring/rest.py +++ b/docspring/rest.py @@ -1,61 +1,68 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import io import json -import logging import re import ssl -import certifi -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import urlencode +import urllib3 + +from docspring.exceptions import ApiException, ApiValueError -try: - import urllib3 -except ImportError: - raise ImportError('OpenAPI Python client requires urllib3.') +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse -logger = logging.getLogger(__name__) +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES class RESTResponse(io.IOBase): - def __init__(self, resp): - self.urllib3_response = resp + def __init__(self, resp) -> None: + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = resp.data + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.getheaders() + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.getheader(name, default) + return self.response.headers.get(name, default) -class RESTClientObject(object): +class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs @@ -64,73 +71,82 @@ def __init__(self, configuration, pools_size=4, maxsize=None): else: cert_reqs = ssl.CERT_NONE - # ca_certs - if configuration.ssl_ca_cert: - ca_certs = configuration.ssl_ca_cert - else: - # if not set certificate file, use Mozilla's root certificates. - ca_certs = certifi.where() - - addition_pool_args = {} + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + } if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 + if configuration.retries is not None: + pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + pool_args['server_hostname'] = configuration.tls_server_name + + + if configuration.socket_options is not None: + pool_args['socket_options'] = configuration.socket_options + + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize # https pool manager + self.pool_manager: urllib3.PoolManager + if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - **addition_pool_args - ) + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): """Perform requests. :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: - raise ValueError( + raise ApiValueError( "body parameter cannot be used with post_params parameter." ) @@ -139,60 +155,83 @@ def request(self, method, url, query_params=None, headers=None, timeout = None if _request_timeout: - if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, float)): timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) - - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/json' + connect=_request_timeout[0], + read=_request_timeout[1] + ) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if query_params: - url += '?' + urlencode(query_params) - if re.search('json', headers['Content-Type'], re.IGNORECASE): + + # no content type provided or payload is json + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): request_body = None if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( - method, url, + method, + url, body=request_body, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=False, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=True, - preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + preload_content=False + ) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str): - request_body = body + # other content types than JSON when `body` argument is + # provided in serialized form. + elif isinstance(body, str) or isinstance(body, bytes): + r = self.pool_manager.request( + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'].startswith('text/') and isinstance(body, bool): + request_body = "true" if body else "false" r = self.pool_manager.request( - method, url, + method, + url, body=request_body, - preload_content=_preload_content, + preload_content=False, timeout=timeout, headers=headers) else: @@ -203,127 +242,16 @@ def request(self, method, url, query_params=None, headers=None, raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) + msg = "\n".join([type(e).__name__, str(e)]) raise ApiException(status=0, reason=msg) - if _preload_content: - r = RESTResponse(r) - - # In the python 3, the response.data is bytes. - # we need to decode it to string. - if six.PY3: - r.data = r.data.decode('utf8') - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - raise ApiException(http_resp=r) - - return r - - def GET(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def HEAD(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def OPTIONS(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def DELETE(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def POST(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PUT(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def PATCH(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - -class ApiException(Exception): - - def __init__(self, status=None, reason=None, http_resp=None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - try: - self.data = json.loads(self.body) - except ValueError: - logger.info("Could not parse JSON data from response body") - self.data = None - - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - self.data = None - - def __str__(self): - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message + return RESTResponse(r) diff --git a/git_push.sh b/git_push.sh index 8442b80..f53a75d 100644 --- a/git_push.sh +++ b/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -28,18 +34,18 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote -git_remote=`git remote` +git_remote=$(git remote) if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,5 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' - diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..9b397be --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,89 @@ +[tool.poetry] +name = "docspring" +version = "2.0.0" +description = "DocSpring API" +authors = ["OpenAPI Generator Community "] +license = "NoLicense" +readme = "README.md" +repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID" +keywords = ["OpenAPI", "OpenAPI-Generator", "DocSpring API"] +include = ["docspring/py.typed"] + +[tool.poetry.dependencies] +python = "^3.8" + +urllib3 = ">= 1.25.3, < 3.0.0" +python-dateutil = ">= 2.8.2" +pydantic = ">= 2" +typing-extensions = ">= 4.7.1" + +[tool.poetry.dev-dependencies] +pytest = ">= 7.2.1" +pytest-cov = ">= 2.8.1" +tox = ">= 3.9.0" +flake8 = ">= 4.0.0" +types-python-dateutil = ">= 2.8.19.14" +mypy = ">= 1.5" + + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "docspring", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +extra_checks = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true + +[[tool.mypy.overrides]] +module = [ + "docspring.configuration", +] +warn_unused_ignores = true +strict_equality = true +extra_checks = true +check_untyped_defs = true +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true +disallow_untyped_calls = true +disallow_incomplete_defs = true +disallow_untyped_defs = true +no_implicit_reexport = true +warn_return_any = true diff --git a/requirements.txt b/requirements.txt index bafdc07..67f7f68 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ -certifi >= 14.05.14 -six >= 1.10 -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.15.1 +urllib3 >= 1.25.3, < 3.0.0 +python_dateutil >= 2.8.2 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..11433ee --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/setup.py b/setup.py index bac8aea..122cbd5 100644 --- a/setup.py +++ b/setup.py @@ -1,39 +1,49 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 from setuptools import setup, find_packages # noqa: H301 -NAME = "docspring" -VERSION = "1.3.2" # To install the library, run the following # # python setup.py install # # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools - -REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] +NAME = "docspring" +VERSION = "2.0.0" +PYTHON_REQUIRES = ">= 3.8" +REQUIRES = [ + "urllib3 >= 1.25.3, < 3.0.0", + "python-dateutil >= 2.8.2", + "pydantic >= 2", + "typing-extensions >= 4.7.1", +] setup( name=NAME, version=VERSION, - description="API v1", - author_email="", + description="DocSpring API", + author="OpenAPI Generator community", + author_email="team@openapitools.org", url="", - keywords=["OpenAPI", "OpenAPI-Generator", "API v1"], + keywords=["OpenAPI", "OpenAPI-Generator", "DocSpring API"], install_requires=REQUIRES, - packages=find_packages(), + packages=find_packages(exclude=["test", "tests"]), include_package_data=True, + long_description_content_type='text/markdown', long_description="""\ - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - """ -) + DocSpring provides an API that helps you fill out and sign PDF templates. + """, # noqa: E501 + package_data={"docspring": ["py.typed"]}, +) \ No newline at end of file diff --git a/test-requirements.txt b/test-requirements.txt index 296b3d7..e98555c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,7 +1,6 @@ -coverage>=4.0.3 -nose>=1.3.7 -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 -mock>=2.0.0 -pytest>=4.6.6 +pytest >= 7.2.1 +pytest-cov >= 2.8.1 +tox >= 3.9.0 +flake8 >= 4.0.0 +types-python-dateutil >= 2.8.19.14 +mypy >= 1.5 diff --git a/test/test_add_fields_data.py b/test/test_add_fields_data.py index ce08441..3ebbb64 100644 --- a/test/test_add_fields_data.py +++ b/test/test_add_fields_data.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.add_fields_data import AddFieldsData # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.add_fields_data import AddFieldsData class TestAddFieldsData(unittest.TestCase): """AddFieldsData unit test stubs""" @@ -28,12 +25,32 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> AddFieldsData: + """Test AddFieldsData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `AddFieldsData` + """ + model = AddFieldsData() + if include_optional: + return AddFieldsData( + fields = [ + None + ] + ) + else: + return AddFieldsData( + fields = [ + None + ], + ) + """ + def testAddFieldsData(self): """Test AddFieldsData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.add_fields_data.AddFieldsData() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_add_fields_template_response.py b/test/test_add_fields_template_response.py deleted file mode 100644 index 0af3ad1..0000000 --- a/test/test_add_fields_template_response.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.add_fields_template_response import AddFieldsTemplateResponse # noqa: E501 -from docspring.rest import ApiException - - -class TestAddFieldsTemplateResponse(unittest.TestCase): - """AddFieldsTemplateResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAddFieldsTemplateResponse(self): - """Test AddFieldsTemplateResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.add_fields_template_response.AddFieldsTemplateResponse() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_authentication_error.py b/test/test_authentication_error.py deleted file mode 100644 index 0e2febe..0000000 --- a/test/test_authentication_error.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.authentication_error import AuthenticationError # noqa: E501 -from docspring.rest import ApiException - - -class TestAuthenticationError(unittest.TestCase): - """AuthenticationError unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAuthenticationError(self): - """Test AuthenticationError""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.authentication_error.AuthenticationError() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_authentication_success_response.py b/test/test_authentication_success_response.py deleted file mode 100644 index ebf4a67..0000000 --- a/test/test_authentication_success_response.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.authentication_success_response import AuthenticationSuccessResponse # noqa: E501 -from docspring.rest import ApiException - - -class TestAuthenticationSuccessResponse(unittest.TestCase): - """AuthenticationSuccessResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAuthenticationSuccessResponse(self): - """Test AuthenticationSuccessResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.authentication_success_response.AuthenticationSuccessResponse() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_batch_generate_pdfs201_response.py b/test/test_batch_generate_pdfs201_response.py new file mode 100644 index 0000000..68cd4e4 --- /dev/null +++ b/test/test_batch_generate_pdfs201_response.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.batch_generate_pdfs201_response import BatchGeneratePdfs201Response + +class TestBatchGeneratePdfs201Response(unittest.TestCase): + """BatchGeneratePdfs201Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BatchGeneratePdfs201Response: + """Test BatchGeneratePdfs201Response + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `BatchGeneratePdfs201Response` + """ + model = BatchGeneratePdfs201Response() + if include_optional: + return BatchGeneratePdfs201Response( + status = 'success', + error = '', + errors = [ + '' + ], + submission_batch = docspring.models.submission_batch.submission_batch( + id = '', + state = 'pending', + metadata = docspring.models.metadata.metadata(), + processed_at = '', + total_count = 56, + pending_count = 56, + error_count = 56, + completion_percentage = 1.337, ), + submissions = [ + None + ] + ) + else: + return BatchGeneratePdfs201Response( + status = 'success', + submission_batch = docspring.models.submission_batch.submission_batch( + id = '', + state = 'pending', + metadata = docspring.models.metadata.metadata(), + processed_at = '', + total_count = 56, + pending_count = 56, + error_count = 56, + completion_percentage = 1.337, ), + submissions = [ + None + ], + ) + """ + + def testBatchGeneratePdfs201Response(self): + """Test BatchGeneratePdfs201Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_client_integration.py b/test/test_client_integration.py deleted file mode 100644 index e1af56a..0000000 --- a/test/test_client_integration.py +++ /dev/null @@ -1,190 +0,0 @@ -# coding: utf-8 -# Note - this file is just used to generate a scaffold for the tests -# We overwrite it with test_pdf_api.py - -""" - API V1 - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest -import mock -import time - -import docspring -# from docspring.api.pdf_api import PDFApi # noqa: E501 -from docspring.rest import ApiException -from pprint import pprint - -class TestClient(unittest.TestCase): - """Client unit tests""" - - def setUp(self): - # Configure HTTP basic authorization: api_token_basic - configuration = docspring.Configuration() - configuration.api_token_id = 'api_token123' - configuration.api_token_secret = 'testsecret123' - configuration.host = 'api.docspring.local:31337/api/v1' - - # create an instance of the API class - self.client = docspring.Client(docspring.ApiClient(configuration)) - - def tearDown(self): - pass - - def test_generate_pdf(self): - """Test case for generate_pdf - - Generates PDFs - """ - with mock.patch.object(docspring.Client, 'wait') as wait_patched: - template_id = 'tpl_000000000000000001' # str | - - response = self.client.generate_pdf( - template_id, { - 'data': { - 'title': 'Test PDF', - 'description': 'This PDF is great!' - }, - 'field_overrides': { - 'title': { - 'required': False - } - } - }) - wait_patched.assert_called() - self.assertEquals(response.status, 'success') - submission = response.submission - self.assertRegexpMatches(submission.id, '^sub_') - self.assertEquals(submission.expired, False) - self.assertEquals(submission.state, 'processed') - - - def test_generate_pdf_with_error(self): - """Test case for generate_pdf with error - - Generates PDFs - """ - with mock.patch.object(docspring.Client, 'wait') as wait_patched: - with self.assertRaises(ApiException) as context: - template_id = 'tpl_000000000000000001' # str | - self.client.generate_pdf( - template_id, { - 'data': { - 'title': 'Test PDF', - } - }) - wait_patched.assert_not_called() - self.assertEquals(context.exception.data['status'], 'error') - self.assertEquals(context.exception.data['errors'], [ - "Your submission data did not contain a required property of 'description'" - ]) - - def test_batch_generate_pdfs(self): - """Test case for batch_generate_pdfs - - Batch Generates PDFs - """ - with mock.patch.object(docspring.Client, 'wait') as wait_patched: - template_id = 'tpl_000000000000000001' # str | - - response = self.client.batch_generate_pdfs({ - 'template_id': template_id, - 'metadata': { 'user_id': 123 }, - 'test': True, - 'submissions': [ - { - 'data': { - 'title': 'Test PDF', - 'description': 'This PDF is great!', - } - }, - { - 'data': { - 'title': 'Test PDF 2', - 'description': 'This PDF is also great!', - } - } - ]}, wait=True) - wait_patched.assert_called() - - self.assertEquals(response.status, 'success') - batch = response.submission_batch - self.assertRegexpMatches(batch.id, '^sbb_') - self.assertEquals(batch.state, 'processed') - self.assertEquals(batch.metadata['user_id'], 123) - self.assertEquals(batch.total_count, 2) - self.assertEquals(batch.pending_count, 0) - self.assertEquals(batch.error_count, 0) - self.assertEquals(batch.completion_percentage, 100) - - submissions = response.submissions - self.assertEquals(len(submissions), 2) - first_response = submissions[0] - self.assertEquals(first_response.status, 'success') - submission = first_response.submission - self.assertRegexpMatches(submission.id, '^sub_') - self.assertEquals(submission.expired, False) - self.assertEquals(submission.state, 'processed') - - - def test_combine_submissions(self): - """Test case for combine_submissions - - Merge generated PDFs together # noqa: E501 - """ - with mock.patch.object(time, "sleep") as wait_patched: - response = self.client.combine_submissions({ - 'submission_ids': ['sub_000000000000000001', 'sub_000000000000000002'] - }, wait=True) - wait_patched.assert_called() - self.assertEquals(response.status, 'success') - combined_submission = response.combined_submission - self.assertRegexpMatches(combined_submission.id, '^com_') - self.assertEquals(combined_submission.expired, False) - self.assertEquals(len(combined_submission.submission_ids), 2) - self.assertEquals(combined_submission.state, 'processed') - - def test_batch_generate_and_combine_pdfs(self): - """Test case for batch_generate_and_combine_pdfs - - Batch generate and merge PDFs together # noqa: E501 - """ - with mock.patch.object(time, "sleep") as wait_patched: - template_id = 'tpl_000000000000000001' # str | - response = self.client.batch_generate_and_combine_pdfs({ - 'template_id': template_id, - 'metadata': {'user_id': 123}, - 'test': True, - 'submissions': [ - { - 'data': { - 'title': 'Test PDF', - 'description': 'This PDF is great!', - } - }, - { - 'data': { - 'title': 'Test PDF 2', - 'description': 'This PDF is also great!', - } - } - ]}, wait=True) - - wait_patched.assert_called() - combined_submission = response.combined_submission - self.assertRegexpMatches(combined_submission.id, '^com_') - self.assertEquals(combined_submission.expired, False) - self.assertEquals(len(combined_submission.submission_ids), 2) - self.assertEquals(combined_submission.state, 'processed') - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_combine_pdfs_data.py b/test/test_combine_pdfs_data.py index 0cac857..d2cc17c 100644 --- a/test/test_combine_pdfs_data.py +++ b/test/test_combine_pdfs_data.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.combine_pdfs_data import CombinePdfsData # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.combine_pdfs_data import CombinePdfsData class TestCombinePdfsData(unittest.TestCase): """CombinePdfsData unit test stubs""" @@ -28,12 +25,37 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> CombinePdfsData: + """Test CombinePdfsData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CombinePdfsData` + """ + model = CombinePdfsData() + if include_optional: + return CombinePdfsData( + delete_custom_files = True, + expires_in = 56, + metadata = None, + password = '', + source_pdfs = [ + None + ], + test = True + ) + else: + return CombinePdfsData( + source_pdfs = [ + None + ], + ) + """ + def testCombinePdfsData(self): """Test CombinePdfsData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.combine_pdfs_data.CombinePdfsData() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_combined_submission.py b/test/test_combined_submission.py index ee3cd8b..85d2084 100644 --- a/test/test_combined_submission.py +++ b/test/test_combined_submission.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.combined_submission import CombinedSubmission # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.combined_submission import CombinedSubmission class TestCombinedSubmission(unittest.TestCase): """CombinedSubmission unit test stubs""" @@ -28,12 +25,78 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> CombinedSubmission: + """Test CombinedSubmission + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CombinedSubmission` + """ + model = CombinedSubmission() + if include_optional: + return CombinedSubmission( + id = '', + state = 'pending', + expired = True, + expires_in = 56, + expires_at = '', + processed_at = '', + error_message = '', + submission_ids = [ + '' + ], + source_pdfs = [ + None + ], + metadata = None, + password = '', + pdf_hash = '', + download_url = '', + actions = [ + docspring.models.combined_submission_action.combined_submission_action( + id = '', + integration_id = '', + state = 'pending', + action_type = 'webhook', + action_category = 'notification', + result_data = docspring.models.result_data.result_data(), ) + ] + ) + else: + return CombinedSubmission( + id = '', + state = 'pending', + expired = True, + expires_in = 56, + expires_at = '', + processed_at = '', + error_message = '', + submission_ids = [ + '' + ], + source_pdfs = [ + None + ], + metadata = None, + password = '', + pdf_hash = '', + download_url = '', + actions = [ + docspring.models.combined_submission_action.combined_submission_action( + id = '', + integration_id = '', + state = 'pending', + action_type = 'webhook', + action_category = 'notification', + result_data = docspring.models.result_data.result_data(), ) + ], + ) + """ + def testCombinedSubmission(self): """Test CombinedSubmission""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.combined_submission.CombinedSubmission() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_combined_submission_action.py b/test/test_combined_submission_action.py index caaa93f..0e4e916 100644 --- a/test/test_combined_submission_action.py +++ b/test/test_combined_submission_action.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.combined_submission_action import CombinedSubmissionAction # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.combined_submission_action import CombinedSubmissionAction class TestCombinedSubmissionAction(unittest.TestCase): """CombinedSubmissionAction unit test stubs""" @@ -28,12 +25,38 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> CombinedSubmissionAction: + """Test CombinedSubmissionAction + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CombinedSubmissionAction` + """ + model = CombinedSubmissionAction() + if include_optional: + return CombinedSubmissionAction( + id = '', + integration_id = '', + state = 'pending', + action_type = 'webhook', + action_category = 'notification', + result_data = None + ) + else: + return CombinedSubmissionAction( + id = '', + integration_id = '', + state = 'pending', + action_type = 'webhook', + action_category = 'notification', + result_data = None, + ) + """ + def testCombinedSubmissionAction(self): """Test CombinedSubmissionAction""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.combined_submission_action.CombinedSubmissionAction() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_combined_submission_data.py b/test/test_combined_submission_data.py index 95fe106..4dcd589 100644 --- a/test/test_combined_submission_data.py +++ b/test/test_combined_submission_data.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.combined_submission_data import CombinedSubmissionData # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.combined_submission_data import CombinedSubmissionData class TestCombinedSubmissionData(unittest.TestCase): """CombinedSubmissionData unit test stubs""" @@ -28,12 +25,36 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> CombinedSubmissionData: + """Test CombinedSubmissionData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CombinedSubmissionData` + """ + model = CombinedSubmissionData() + if include_optional: + return CombinedSubmissionData( + expires_in = 56, + metadata = None, + password = '', + submission_ids = [ + '' + ], + test = True + ) + else: + return CombinedSubmissionData( + submission_ids = [ + '' + ], + ) + """ + def testCombinedSubmissionData(self): """Test CombinedSubmissionData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.combined_submission_data.CombinedSubmissionData() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_copy_template_data.py b/test/test_copy_template_data.py deleted file mode 100644 index d38c51f..0000000 --- a/test/test_copy_template_data.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.copy_template_data import CopyTemplateData # noqa: E501 -from docspring.rest import ApiException - - -class TestCopyTemplateData(unittest.TestCase): - """CopyTemplateData unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCopyTemplateData(self): - """Test CopyTemplateData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.copy_template_data.CopyTemplateData() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_copy_template_options.py b/test/test_copy_template_options.py new file mode 100644 index 0000000..829b0a8 --- /dev/null +++ b/test/test_copy_template_options.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.copy_template_options import CopyTemplateOptions + +class TestCopyTemplateOptions(unittest.TestCase): + """CopyTemplateOptions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CopyTemplateOptions: + """Test CopyTemplateOptions + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CopyTemplateOptions` + """ + model = CopyTemplateOptions() + if include_optional: + return CopyTemplateOptions( + name = '', + parent_folder_id = '' + ) + else: + return CopyTemplateOptions( + parent_folder_id = '', + ) + """ + + def testCopyTemplateOptions(self): + """Test CopyTemplateOptions""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_combined_submission_response.py b/test/test_create_combined_submission_response.py index 41b33ee..410593e 100644 --- a/test/test_create_combined_submission_response.py +++ b/test/test_create_combined_submission_response.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.create_combined_submission_response import CreateCombinedSubmissionResponse # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.create_combined_submission_response import CreateCombinedSubmissionResponse class TestCreateCombinedSubmissionResponse(unittest.TestCase): """CreateCombinedSubmissionResponse unit test stubs""" @@ -28,12 +25,85 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> CreateCombinedSubmissionResponse: + """Test CreateCombinedSubmissionResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateCombinedSubmissionResponse` + """ + model = CreateCombinedSubmissionResponse() + if include_optional: + return CreateCombinedSubmissionResponse( + status = 'success', + combined_submission = docspring.models.combined_submission.combined_submission( + id = '', + state = 'pending', + expired = True, + expires_in = 56, + expires_at = '', + processed_at = '', + error_message = '', + submission_ids = [ + '' + ], + source_pdfs = [ + None + ], + metadata = docspring.models.metadata.metadata(), + password = '', + pdf_hash = '', + download_url = '', + actions = [ + docspring.models.combined_submission_action.combined_submission_action( + id = '', + integration_id = '', + state = 'pending', + action_type = 'webhook', + action_category = 'notification', + result_data = docspring.models.result_data.result_data(), ) + ], ), + errors = [ + '' + ] + ) + else: + return CreateCombinedSubmissionResponse( + status = 'success', + combined_submission = docspring.models.combined_submission.combined_submission( + id = '', + state = 'pending', + expired = True, + expires_in = 56, + expires_at = '', + processed_at = '', + error_message = '', + submission_ids = [ + '' + ], + source_pdfs = [ + None + ], + metadata = docspring.models.metadata.metadata(), + password = '', + pdf_hash = '', + download_url = '', + actions = [ + docspring.models.combined_submission_action.combined_submission_action( + id = '', + integration_id = '', + state = 'pending', + action_type = 'webhook', + action_category = 'notification', + result_data = docspring.models.result_data.result_data(), ) + ], ), + ) + """ + def testCreateCombinedSubmissionResponse(self): """Test CreateCombinedSubmissionResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.create_combined_submission_response.CreateCombinedSubmissionResponse() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_create_custom_file_data.py b/test/test_create_custom_file_data.py index c32c349..11036bc 100644 --- a/test/test_create_custom_file_data.py +++ b/test/test_create_custom_file_data.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.create_custom_file_data import CreateCustomFileData # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.create_custom_file_data import CreateCustomFileData class TestCreateCustomFileData(unittest.TestCase): """CreateCustomFileData unit test stubs""" @@ -28,12 +25,28 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> CreateCustomFileData: + """Test CreateCustomFileData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateCustomFileData` + """ + model = CreateCustomFileData() + if include_optional: + return CreateCustomFileData( + cache_id = '0' + ) + else: + return CreateCustomFileData( + cache_id = '0', + ) + """ + def testCreateCustomFileData(self): """Test CreateCustomFileData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.create_custom_file_data.CreateCustomFileData() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_create_custom_file_response.py b/test/test_create_custom_file_response.py index 8edc10a..523e75c 100644 --- a/test/test_create_custom_file_response.py +++ b/test/test_create_custom_file_response.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.create_custom_file_response import CreateCustomFileResponse # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.create_custom_file_response import CreateCustomFileResponse class TestCreateCustomFileResponse(unittest.TestCase): """CreateCustomFileResponse unit test stubs""" @@ -28,12 +25,37 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> CreateCustomFileResponse: + """Test CreateCustomFileResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateCustomFileResponse` + """ + model = CreateCustomFileResponse() + if include_optional: + return CreateCustomFileResponse( + status = 'success', + custom_file = docspring.models.custom_file.custom_file( + id = '', + url = '', ), + errors = [ + '' + ] + ) + else: + return CreateCustomFileResponse( + status = 'success', + custom_file = docspring.models.custom_file.custom_file( + id = '', + url = '', ), + ) + """ + def testCreateCustomFileResponse(self): """Test CreateCustomFileResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.create_custom_file_response.CreateCustomFileResponse() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_create_folder_data.py b/test/test_create_folder_data.py index e278192..12ca159 100644 --- a/test/test_create_folder_data.py +++ b/test/test_create_folder_data.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.create_folder_data import CreateFolderData # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.create_folder_data import CreateFolderData class TestCreateFolderData(unittest.TestCase): """CreateFolderData unit test stubs""" @@ -28,12 +25,28 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> CreateFolderData: + """Test CreateFolderData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateFolderData` + """ + model = CreateFolderData() + if include_optional: + return CreateFolderData( + folder = docspring.models.create_folder_attributes.create_folder_attributes() + ) + else: + return CreateFolderData( + folder = docspring.models.create_folder_attributes.create_folder_attributes(), + ) + """ + def testCreateFolderData(self): """Test CreateFolderData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.create_folder_data.CreateFolderData() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_create_html_submission_data.py b/test/test_create_html_submission_data.py new file mode 100644 index 0000000..ed83e2f --- /dev/null +++ b/test/test_create_html_submission_data.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.create_html_submission_data import CreateHtmlSubmissionData + +class TestCreateHtmlSubmissionData(unittest.TestCase): + """CreateHtmlSubmissionData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateHtmlSubmissionData: + """Test CreateHtmlSubmissionData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateHtmlSubmissionData` + """ + model = CreateHtmlSubmissionData() + if include_optional: + return CreateHtmlSubmissionData( + css = '', + data = docspring.models.submission_data.submission_data(), + editable = True, + expires_in = 56, + field_overrides = docspring.models.submission_field_overrides.submission_field_overrides(), + html = '', + metadata = docspring.models.submission_metadata.submission_metadata(), + password = '', + test = True + ) + else: + return CreateHtmlSubmissionData( + ) + """ + + def testCreateHtmlSubmissionData(self): + """Test CreateHtmlSubmissionData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_html_template.py b/test/test_create_html_template.py new file mode 100644 index 0000000..44f670f --- /dev/null +++ b/test/test_create_html_template.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.create_html_template import CreateHtmlTemplate + +class TestCreateHtmlTemplate(unittest.TestCase): + """CreateHtmlTemplate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateHtmlTemplate: + """Test CreateHtmlTemplate + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateHtmlTemplate` + """ + model = CreateHtmlTemplate() + if include_optional: + return CreateHtmlTemplate( + template = docspring.models.create_html_template_data.create_html_template_data() + ) + else: + return CreateHtmlTemplate( + template = docspring.models.create_html_template_data.create_html_template_data(), + ) + """ + + def testCreateHtmlTemplate(self): + """Test CreateHtmlTemplate""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_html_template_data.py b/test/test_create_html_template_data.py deleted file mode 100644 index 7d26647..0000000 --- a/test/test_create_html_template_data.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.create_html_template_data import CreateHtmlTemplateData # noqa: E501 -from docspring.rest import ApiException - - -class TestCreateHtmlTemplateData(unittest.TestCase): - """CreateHtmlTemplateData unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCreateHtmlTemplateData(self): - """Test CreateHtmlTemplateData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.create_html_template_data.CreateHtmlTemplateData() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_pdf_submission_data.py b/test/test_create_pdf_submission_data.py new file mode 100644 index 0000000..ce6124d --- /dev/null +++ b/test/test_create_pdf_submission_data.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.create_pdf_submission_data import CreatePdfSubmissionData + +class TestCreatePdfSubmissionData(unittest.TestCase): + """CreatePdfSubmissionData unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreatePdfSubmissionData: + """Test CreatePdfSubmissionData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreatePdfSubmissionData` + """ + model = CreatePdfSubmissionData() + if include_optional: + return CreatePdfSubmissionData( + data = docspring.models.submission_data.submission_data(), + data_requests = [ + docspring.models.create_submission_data_request_data.create_submission_data_request_data( + auth_second_factor_type = 'none', + auth_type = 'none', + fields = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + order = 56, ) + ], + editable = True, + expires_in = 56, + field_overrides = docspring.models.submission_field_overrides.submission_field_overrides(), + metadata = docspring.models.submission_metadata.submission_metadata(), + password = '', + test = True + ) + else: + return CreatePdfSubmissionData( + data = docspring.models.submission_data.submission_data(), + ) + """ + + def testCreatePdfSubmissionData(self): + """Test CreatePdfSubmissionData""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_pdf_template.py b/test/test_create_pdf_template.py new file mode 100644 index 0000000..f324f29 --- /dev/null +++ b/test/test_create_pdf_template.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.create_pdf_template import CreatePdfTemplate + +class TestCreatePdfTemplate(unittest.TestCase): + """CreatePdfTemplate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreatePdfTemplate: + """Test CreatePdfTemplate + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreatePdfTemplate` + """ + model = CreatePdfTemplate() + if include_optional: + return CreatePdfTemplate( + template = docspring.models.create_pdf_template_data.create_pdf_template_data() + ) + else: + return CreatePdfTemplate( + template = docspring.models.create_pdf_template_data.create_pdf_template_data(), + ) + """ + + def testCreatePdfTemplate(self): + """Test CreatePdfTemplate""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_submission_batch_response.py b/test/test_create_submission_batch_response.py deleted file mode 100644 index 56d0dbf..0000000 --- a/test/test_create_submission_batch_response.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.create_submission_batch_response import CreateSubmissionBatchResponse # noqa: E501 -from docspring.rest import ApiException - - -class TestCreateSubmissionBatchResponse(unittest.TestCase): - """CreateSubmissionBatchResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCreateSubmissionBatchResponse(self): - """Test CreateSubmissionBatchResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.create_submission_batch_response.CreateSubmissionBatchResponse() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_submission_batch_submissions_response.py b/test/test_create_submission_batch_submissions_response.py deleted file mode 100644 index 49854ca..0000000 --- a/test/test_create_submission_batch_submissions_response.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.create_submission_batch_submissions_response import CreateSubmissionBatchSubmissionsResponse # noqa: E501 -from docspring.rest import ApiException - - -class TestCreateSubmissionBatchSubmissionsResponse(unittest.TestCase): - """CreateSubmissionBatchSubmissionsResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCreateSubmissionBatchSubmissionsResponse(self): - """Test CreateSubmissionBatchSubmissionsResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.create_submission_batch_submissions_response.CreateSubmissionBatchSubmissionsResponse() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_submission_data_request_data.py b/test/test_create_submission_data_request_data.py index 96e9ee9..9280c87 100644 --- a/test/test_create_submission_data_request_data.py +++ b/test/test_create_submission_data_request_data.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.create_submission_data_request_data import CreateSubmissionDataRequestData # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.create_submission_data_request_data import CreateSubmissionDataRequestData class TestCreateSubmissionDataRequestData(unittest.TestCase): """CreateSubmissionDataRequestData unit test stubs""" @@ -28,12 +25,33 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> CreateSubmissionDataRequestData: + """Test CreateSubmissionDataRequestData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateSubmissionDataRequestData` + """ + model = CreateSubmissionDataRequestData() + if include_optional: + return CreateSubmissionDataRequestData( + auth_second_factor_type = 'none', + auth_type = 'none', + fields = [ + '' + ], + metadata = None, + order = 56 + ) + else: + return CreateSubmissionDataRequestData( + ) + """ + def testCreateSubmissionDataRequestData(self): """Test CreateSubmissionDataRequestData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.create_submission_data_request_data.CreateSubmissionDataRequestData() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_create_submission_data_request_event_request.py b/test/test_create_submission_data_request_event_request.py new file mode 100644 index 0000000..17aef6c --- /dev/null +++ b/test/test_create_submission_data_request_event_request.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.create_submission_data_request_event_request import CreateSubmissionDataRequestEventRequest + +class TestCreateSubmissionDataRequestEventRequest(unittest.TestCase): + """CreateSubmissionDataRequestEventRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateSubmissionDataRequestEventRequest: + """Test CreateSubmissionDataRequestEventRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateSubmissionDataRequestEventRequest` + """ + model = CreateSubmissionDataRequestEventRequest() + if include_optional: + return CreateSubmissionDataRequestEventRequest( + event_type = 'send_request', + message_type = 'email' + ) + else: + return CreateSubmissionDataRequestEventRequest( + event_type = 'send_request', + ) + """ + + def testCreateSubmissionDataRequestEventRequest(self): + """Test CreateSubmissionDataRequestEventRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_submission_data_request_event_response.py b/test/test_create_submission_data_request_event_response.py new file mode 100644 index 0000000..9e0af20 --- /dev/null +++ b/test/test_create_submission_data_request_event_response.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.create_submission_data_request_event_response import CreateSubmissionDataRequestEventResponse + +class TestCreateSubmissionDataRequestEventResponse(unittest.TestCase): + """CreateSubmissionDataRequestEventResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateSubmissionDataRequestEventResponse: + """Test CreateSubmissionDataRequestEventResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateSubmissionDataRequestEventResponse` + """ + model = CreateSubmissionDataRequestEventResponse() + if include_optional: + return CreateSubmissionDataRequestEventResponse( + status = 'success', + event = docspring.models.submission_data_request_event.submission_data_request_event( + id = '', + submission_id = '', + submission_data_request_id = '', + event_type = 'send_request', + message_type = 'email', + message_recipient = '', + occurred_at = '', ), + errors = [ + '' + ] + ) + else: + return CreateSubmissionDataRequestEventResponse( + status = 'success', + event = docspring.models.submission_data_request_event.submission_data_request_event( + id = '', + submission_id = '', + submission_data_request_id = '', + event_type = 'send_request', + message_type = 'email', + message_recipient = '', + occurred_at = '', ), + ) + """ + + def testCreateSubmissionDataRequestEventResponse(self): + """Test CreateSubmissionDataRequestEventResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_submission_data_request_response.py b/test/test_create_submission_data_request_response.py new file mode 100644 index 0000000..3858bf5 --- /dev/null +++ b/test/test_create_submission_data_request_response.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.create_submission_data_request_response import CreateSubmissionDataRequestResponse + +class TestCreateSubmissionDataRequestResponse(unittest.TestCase): + """CreateSubmissionDataRequestResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CreateSubmissionDataRequestResponse: + """Test CreateSubmissionDataRequestResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateSubmissionDataRequestResponse` + """ + model = CreateSubmissionDataRequestResponse() + if include_optional: + return CreateSubmissionDataRequestResponse( + status = 'success', + data_request = docspring.models.submission_data_request_show.submission_data_request_show( + id = '', + email = '', + name = '', + order = 56, + sort_order = 56, + fields = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + state = 'pending', + viewed_at = '', + completed_at = '', + data = docspring.models.data.data(), + auth_type = 'none', + auth_second_factor_type = 'none', + auth_provider = '', + auth_session_started_at = '', + auth_session_id_hash = '', + auth_user_id_hash = '', + auth_username_hash = '', + auth_phone_number_hash = '', + ip_address = '', + user_agent = '', + submission_id = '', ), + errors = [ + '' + ] + ) + else: + return CreateSubmissionDataRequestResponse( + status = 'success', + data_request = docspring.models.submission_data_request_show.submission_data_request_show( + id = '', + email = '', + name = '', + order = 56, + sort_order = 56, + fields = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + state = 'pending', + viewed_at = '', + completed_at = '', + data = docspring.models.data.data(), + auth_type = 'none', + auth_second_factor_type = 'none', + auth_provider = '', + auth_session_started_at = '', + auth_session_id_hash = '', + auth_user_id_hash = '', + auth_username_hash = '', + auth_phone_number_hash = '', + ip_address = '', + user_agent = '', + submission_id = '', ), + ) + """ + + def testCreateSubmissionDataRequestResponse(self): + """Test CreateSubmissionDataRequestResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_create_submission_data_request_token_response.py b/test/test_create_submission_data_request_token_response.py index b025290..1c814b3 100644 --- a/test/test_create_submission_data_request_token_response.py +++ b/test/test_create_submission_data_request_token_response.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.create_submission_data_request_token_response import CreateSubmissionDataRequestTokenResponse # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.create_submission_data_request_token_response import CreateSubmissionDataRequestTokenResponse class TestCreateSubmissionDataRequestTokenResponse(unittest.TestCase): """CreateSubmissionDataRequestTokenResponse unit test stubs""" @@ -28,12 +25,41 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> CreateSubmissionDataRequestTokenResponse: + """Test CreateSubmissionDataRequestTokenResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateSubmissionDataRequestTokenResponse` + """ + model = CreateSubmissionDataRequestTokenResponse() + if include_optional: + return CreateSubmissionDataRequestTokenResponse( + status = 'success', + token = docspring.models.submission_data_request_token.submission_data_request_token( + id = '', + secret = '', + expires_at = '', + data_request_url = '', ), + errors = [ + '' + ] + ) + else: + return CreateSubmissionDataRequestTokenResponse( + status = 'success', + token = docspring.models.submission_data_request_token.submission_data_request_token( + id = '', + secret = '', + expires_at = '', + data_request_url = '', ), + ) + """ + def testCreateSubmissionDataRequestTokenResponse(self): """Test CreateSubmissionDataRequestTokenResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.create_submission_data_request_token_response.CreateSubmissionDataRequestTokenResponse() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_create_submission_data_request_token_response_token.py b/test/test_create_submission_data_request_token_response_token.py deleted file mode 100644 index ae9125c..0000000 --- a/test/test_create_submission_data_request_token_response_token.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.create_submission_data_request_token_response_token import CreateSubmissionDataRequestTokenResponseToken # noqa: E501 -from docspring.rest import ApiException - - -class TestCreateSubmissionDataRequestTokenResponseToken(unittest.TestCase): - """CreateSubmissionDataRequestTokenResponseToken unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCreateSubmissionDataRequestTokenResponseToken(self): - """Test CreateSubmissionDataRequestTokenResponseToken""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.create_submission_data_request_token_response_token.CreateSubmissionDataRequestTokenResponseToken() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_create_submission_response.py b/test/test_create_submission_response.py index 5adf7bc..4c5c70e 100644 --- a/test/test_create_submission_response.py +++ b/test/test_create_submission_response.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.create_submission_response import CreateSubmissionResponse # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.create_submission_response import CreateSubmissionResponse class TestCreateSubmissionResponse(unittest.TestCase): """CreateSubmissionResponse unit test stubs""" @@ -28,12 +25,145 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> CreateSubmissionResponse: + """Test CreateSubmissionResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CreateSubmissionResponse` + """ + model = CreateSubmissionResponse() + if include_optional: + return CreateSubmissionResponse( + status = 'success', + submission = docspring.models.submission_preview.submission_preview( + batch_id = '', + data_requests = [ + docspring.models.submission_data_request.submission_data_request( + id = '', + email = '', + name = '', + order = 56, + sort_order = 56, + fields = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + state = 'pending', + viewed_at = '', + completed_at = '', + data = docspring.models.data.data(), + auth_type = 'none', + auth_second_factor_type = 'none', + auth_provider = '', + auth_session_started_at = '', + auth_session_id_hash = '', + auth_user_id_hash = '', + auth_username_hash = '', + auth_phone_number_hash = '', + ip_address = '', + user_agent = '', ) + ], + editable = True, + expired = True, + expires_at = '', + id = '', + json_schema_errors = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + password = '', + processed_at = '', + state = 'pending', + template_id = '', + test = True, + truncated_text = docspring.models.truncated_text.truncated_text(), + pdf_hash = '', + download_url = '', + permanent_download_url = '', + preview_download_url = '', + preview_generated_at = '', + audit_trail_download_url = '', + actions = [ + docspring.models.submission_action.submission_action( + id = '', + integration_id = '', + state = 'pending', + action_type = 'webhook', + action_category = 'notification', + result_data = docspring.models.result_data.result_data(), ) + ], ), + errors = [ + '' + ] + ) + else: + return CreateSubmissionResponse( + status = 'success', + submission = docspring.models.submission_preview.submission_preview( + batch_id = '', + data_requests = [ + docspring.models.submission_data_request.submission_data_request( + id = '', + email = '', + name = '', + order = 56, + sort_order = 56, + fields = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + state = 'pending', + viewed_at = '', + completed_at = '', + data = docspring.models.data.data(), + auth_type = 'none', + auth_second_factor_type = 'none', + auth_provider = '', + auth_session_started_at = '', + auth_session_id_hash = '', + auth_user_id_hash = '', + auth_username_hash = '', + auth_phone_number_hash = '', + ip_address = '', + user_agent = '', ) + ], + editable = True, + expired = True, + expires_at = '', + id = '', + json_schema_errors = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + password = '', + processed_at = '', + state = 'pending', + template_id = '', + test = True, + truncated_text = docspring.models.truncated_text.truncated_text(), + pdf_hash = '', + download_url = '', + permanent_download_url = '', + preview_download_url = '', + preview_generated_at = '', + audit_trail_download_url = '', + actions = [ + docspring.models.submission_action.submission_action( + id = '', + integration_id = '', + state = 'pending', + action_type = 'webhook', + action_category = 'notification', + result_data = docspring.models.result_data.result_data(), ) + ], ), + ) + """ + def testCreateSubmissionResponse(self): """Test CreateSubmissionResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.create_submission_response.CreateSubmissionResponse() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_create_template_from_upload_data.py b/test/test_create_template_from_upload_data.py deleted file mode 100644 index e576d22..0000000 --- a/test/test_create_template_from_upload_data.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.create_template_from_upload_data import CreateTemplateFromUploadData # noqa: E501 -from docspring.rest import ApiException - - -class TestCreateTemplateFromUploadData(unittest.TestCase): - """CreateTemplateFromUploadData unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCreateTemplateFromUploadData(self): - """Test CreateTemplateFromUploadData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.create_template_from_upload_data.CreateTemplateFromUploadData() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_custom_file.py b/test/test_custom_file.py index 1524704..59ce524 100644 --- a/test/test_custom_file.py +++ b/test/test_custom_file.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.custom_file import CustomFile # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.custom_file import CustomFile class TestCustomFile(unittest.TestCase): """CustomFile unit test stubs""" @@ -28,12 +25,30 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> CustomFile: + """Test CustomFile + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CustomFile` + """ + model = CustomFile() + if include_optional: + return CustomFile( + id = '', + url = '' + ) + else: + return CustomFile( + id = '', + url = '', + ) + """ + def testCustomFile(self): """Test CustomFile""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.custom_file.CustomFile() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_error.py b/test/test_error.py deleted file mode 100644 index 2526b5c..0000000 --- a/test/test_error.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.error import Error # noqa: E501 -from docspring.rest import ApiException - - -class TestError(unittest.TestCase): - """Error unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testError(self): - """Test Error""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.error.Error() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_error_response.py b/test/test_error_response.py new file mode 100644 index 0000000..692b298 --- /dev/null +++ b/test/test_error_response.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.error_response import ErrorResponse + +class TestErrorResponse(unittest.TestCase): + """ErrorResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ErrorResponse: + """Test ErrorResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ErrorResponse` + """ + model = ErrorResponse() + if include_optional: + return ErrorResponse( + status = 'error', + error = '' + ) + else: + return ErrorResponse( + status = 'error', + error = '', + ) + """ + + def testErrorResponse(self): + """Test ErrorResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_folder.py b/test/test_folder.py index faba960..0caa29e 100644 --- a/test/test_folder.py +++ b/test/test_folder.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.folder import Folder # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.folder import Folder class TestFolder(unittest.TestCase): """Folder unit test stubs""" @@ -28,12 +25,34 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> Folder: + """Test Folder + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Folder` + """ + model = Folder() + if include_optional: + return Folder( + id = '', + name = '', + path = '', + parent_folder_id = '' + ) + else: + return Folder( + id = '', + name = '', + path = '', + parent_folder_id = '', + ) + """ + def testFolder(self): """Test Folder""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.folder.Folder() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_folders_folder.py b/test/test_folders_folder.py deleted file mode 100644 index b100bd8..0000000 --- a/test/test_folders_folder.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.folders_folder import FoldersFolder # noqa: E501 -from docspring.rest import ApiException - - -class TestFoldersFolder(unittest.TestCase): - """FoldersFolder unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFoldersFolder(self): - """Test FoldersFolder""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.folders_folder.FoldersFolder() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_html_template_data.py b/test/test_html_template_data.py deleted file mode 100644 index 68edd45..0000000 --- a/test/test_html_template_data.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.html_template_data import HtmlTemplateData # noqa: E501 -from docspring.rest import ApiException - - -class TestHtmlTemplateData(unittest.TestCase): - """HtmlTemplateData unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testHtmlTemplateData(self): - """Test HtmlTemplateData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.html_template_data.HtmlTemplateData() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_invalid_request.py b/test/test_invalid_request.py deleted file mode 100644 index 5ce9d21..0000000 --- a/test/test_invalid_request.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.invalid_request import InvalidRequest # noqa: E501 -from docspring.rest import ApiException - - -class TestInvalidRequest(unittest.TestCase): - """InvalidRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInvalidRequest(self): - """Test InvalidRequest""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.invalid_request.InvalidRequest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_json_schema.py b/test/test_json_schema.py new file mode 100644 index 0000000..ac8ee41 --- /dev/null +++ b/test/test_json_schema.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.json_schema import JsonSchema + +class TestJsonSchema(unittest.TestCase): + """JsonSchema unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> JsonSchema: + """Test JsonSchema + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `JsonSchema` + """ + model = JsonSchema() + if include_optional: + return JsonSchema( + var_schema = '', + id = '', + title = '', + description = '', + definitions = None, + type = '', + properties = None, + additional_properties = True, + required = [ + '' + ] + ) + else: + return JsonSchema( + ) + """ + + def testJsonSchema(self): + """Test JsonSchema""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_list_submissions_response.py b/test/test_list_submissions_response.py index bb488a8..c41b0dc 100644 --- a/test/test_list_submissions_response.py +++ b/test/test_list_submissions_response.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.list_submissions_response import ListSubmissionsResponse # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.list_submissions_response import ListSubmissionsResponse class TestListSubmissionsResponse(unittest.TestCase): """ListSubmissionsResponse unit test stubs""" @@ -28,12 +25,154 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> ListSubmissionsResponse: + """Test ListSubmissionsResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ListSubmissionsResponse` + """ + model = ListSubmissionsResponse() + if include_optional: + return ListSubmissionsResponse( + submissions = [ + docspring.models.submission.submission( + batch_id = '', + data_requests = [ + docspring.models.submission_data_request.submission_data_request( + id = '', + email = '', + name = '', + order = 56, + sort_order = 56, + fields = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + state = 'pending', + viewed_at = '', + completed_at = '', + data = docspring.models.data.data(), + auth_type = 'none', + auth_second_factor_type = 'none', + auth_provider = '', + auth_session_started_at = '', + auth_session_id_hash = '', + auth_user_id_hash = '', + auth_username_hash = '', + auth_phone_number_hash = '', + ip_address = '', + user_agent = '', ) + ], + editable = True, + expired = True, + expires_at = '', + id = '', + json_schema_errors = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + password = '', + processed_at = '', + state = 'pending', + template_id = '', + test = True, + truncated_text = docspring.models.truncated_text.truncated_text(), + pdf_hash = '', + download_url = '', + permanent_download_url = '', + preview_download_url = '', + preview_generated_at = '', + audit_trail_download_url = '', + actions = [ + docspring.models.submission_action.submission_action( + id = '', + integration_id = '', + state = 'pending', + action_type = 'webhook', + action_category = 'notification', + result_data = docspring.models.result_data.result_data(), ) + ], + source = 'api', + referrer = '', + data = docspring.models.data.data(), ) + ], + limit = 1.337, + next_cursor = '' + ) + else: + return ListSubmissionsResponse( + submissions = [ + docspring.models.submission.submission( + batch_id = '', + data_requests = [ + docspring.models.submission_data_request.submission_data_request( + id = '', + email = '', + name = '', + order = 56, + sort_order = 56, + fields = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + state = 'pending', + viewed_at = '', + completed_at = '', + data = docspring.models.data.data(), + auth_type = 'none', + auth_second_factor_type = 'none', + auth_provider = '', + auth_session_started_at = '', + auth_session_id_hash = '', + auth_user_id_hash = '', + auth_username_hash = '', + auth_phone_number_hash = '', + ip_address = '', + user_agent = '', ) + ], + editable = True, + expired = True, + expires_at = '', + id = '', + json_schema_errors = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + password = '', + processed_at = '', + state = 'pending', + template_id = '', + test = True, + truncated_text = docspring.models.truncated_text.truncated_text(), + pdf_hash = '', + download_url = '', + permanent_download_url = '', + preview_download_url = '', + preview_generated_at = '', + audit_trail_download_url = '', + actions = [ + docspring.models.submission_action.submission_action( + id = '', + integration_id = '', + state = 'pending', + action_type = 'webhook', + action_category = 'notification', + result_data = docspring.models.result_data.result_data(), ) + ], + source = 'api', + referrer = '', + data = docspring.models.data.data(), ) + ], + limit = 1.337, + next_cursor = '', + ) + """ + def testListSubmissionsResponse(self): """Test ListSubmissionsResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.list_submissions_response.ListSubmissionsResponse() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_move_folder_data.py b/test/test_move_folder_data.py index aa85378..a66bf46 100644 --- a/test/test_move_folder_data.py +++ b/test/test_move_folder_data.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.move_folder_data import MoveFolderData # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.move_folder_data import MoveFolderData class TestMoveFolderData(unittest.TestCase): """MoveFolderData unit test stubs""" @@ -28,12 +25,27 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> MoveFolderData: + """Test MoveFolderData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MoveFolderData` + """ + model = MoveFolderData() + if include_optional: + return MoveFolderData( + parent_folder_id = '' + ) + else: + return MoveFolderData( + ) + """ + def testMoveFolderData(self): """Test MoveFolderData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.move_folder_data.MoveFolderData() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_move_template_data.py b/test/test_move_template_data.py index 0a96124..eef0c68 100644 --- a/test/test_move_template_data.py +++ b/test/test_move_template_data.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.move_template_data import MoveTemplateData # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.move_template_data import MoveTemplateData class TestMoveTemplateData(unittest.TestCase): """MoveTemplateData unit test stubs""" @@ -28,12 +25,28 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> MoveTemplateData: + """Test MoveTemplateData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MoveTemplateData` + """ + model = MoveTemplateData() + if include_optional: + return MoveTemplateData( + parent_folder_id = '' + ) + else: + return MoveTemplateData( + parent_folder_id = '', + ) + """ + def testMoveTemplateData(self): """Test MoveTemplateData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.move_template_data.MoveTemplateData() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_multiple_errors_response.py b/test/test_multiple_errors_response.py new file mode 100644 index 0000000..5801dcf --- /dev/null +++ b/test/test_multiple_errors_response.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.multiple_errors_response import MultipleErrorsResponse + +class TestMultipleErrorsResponse(unittest.TestCase): + """MultipleErrorsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MultipleErrorsResponse: + """Test MultipleErrorsResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `MultipleErrorsResponse` + """ + model = MultipleErrorsResponse() + if include_optional: + return MultipleErrorsResponse( + status = 'error', + errors = [ + '' + ] + ) + else: + return MultipleErrorsResponse( + status = 'error', + errors = [ + '' + ], + ) + """ + + def testMultipleErrorsResponse(self): + """Test MultipleErrorsResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_pdf_api.py.original b/test/test_pdf_api.py.original index 4595e94..27cabe0 100644 --- a/test/test_pdf_api.py.original +++ b/test/test_pdf_api.py.original @@ -1,306 +1,297 @@ # coding: utf-8 -# Note - this file is just used to generate a scaffold for the tests -# We overwrite it with test_pdf_api.py """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.api.pdf_api import PDFApi # noqa: E501 -from docspring.rest import ApiException -from pprint import pprint +from docspring.api.pdf_api import PDFApi class TestPDFApi(unittest.TestCase): """PDFApi unit test stubs""" - def setUp(self): - # Configure HTTP basic authorization: api_token_basic - configuration = docspring.Configuration() - configuration.username = 'api_token123' - configuration.password = 'testsecret123' - configuration.host = 'api.docspring.local:31337/api/v1' - configuration.scheme = 'http' - - # create an instance of the API class - self.api = docspring.PDFApi(docspring.ApiClient(configuration)) + def setUp(self) -> None: + self.api = PDFApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_add_fields_to_template(self): + def test_add_fields_to_template(self) -> None: """Test case for add_fields_to_template - Add new fields to a Template # noqa: E501 + Add new fields to a Template """ - template_id = 'tpl_000000000000000002' # str | - add_fields_data = docspring.AddFieldsData() # AddFieldsData | - api_response = self.api.add_fields_to_template(template_id, add_fields_data) - def test_batch_generate_pdf_v1(self): - """Test case for batch_generate_pdf_v1 + pass - Generates multiple PDFs # noqa: E501 - """ - template_id = 'tpl_000000000000000001' # str | - request_body = NULL # list[object] | - api_response = self.api.batch_generate_pdf_v1(template_id, request_body) - def test_batch_generate_pdfs(self): + def test_batch_generate_pdfs(self) -> None: """Test case for batch_generate_pdfs - Generates multiple PDFs # noqa: E501 + Generates multiple PDFs """ - submission_batch_data = docspring.SubmissionBatchData() # SubmissionBatchData | - api_response = self.api.batch_generate_pdfs(submission_batch_data) - def test_combine_pdfs(self): + pass + + def test_combine_pdfs(self) -> None: """Test case for combine_pdfs - Merge submission PDFs, template PDFs, or custom files # noqa: E501 + Merge submission PDFs, template PDFs, or custom files """ - combine_pdfs_data = docspring.CombinePdfsData() # CombinePdfsData | - api_response = self.api.combine_pdfs(combine_pdfs_data) - def test_combine_submissions(self): + pass + + def test_combine_submissions(self) -> None: """Test case for combine_submissions - Merge generated PDFs together # noqa: E501 + Merge generated PDFs together """ - combined_submission_data = docspring.CombinedSubmissionData() # CombinedSubmissionData | - api_response = self.api.combine_submissions(combined_submission_data) - def test_copy_template(self): + pass + + def test_copy_template(self) -> None: """Test case for copy_template - Copy a Template # noqa: E501 + Copy a Template """ - template_id = 'tpl_000000000000000001' # str | - copy_template_data = docspring.CopyTemplateData() # CopyTemplateData | - api_response = self.api.copy_template(template_id, copy_template_data) - def test_create_custom_file_from_upload(self): + pass + + def test_create_custom_file_from_upload(self) -> None: """Test case for create_custom_file_from_upload - Create a new custom file from a cached presign upload # noqa: E501 + Create a new custom file from a cached presign upload """ - create_custom_file_data = docspring.CreateCustomFileData() # CreateCustomFileData | - api_response = self.api.create_custom_file_from_upload(create_custom_file_data) - def test_create_data_request_token(self): + pass + + def test_create_data_request_event(self) -> None: + """Test case for create_data_request_event + + Creates a new event for emailing a signee a request for signature + """ + pass + + def test_create_data_request_token(self) -> None: """Test case for create_data_request_token - Creates a new data request token for form authentication # noqa: E501 + Creates a new data request token for form authentication """ - data_request_id = 'drq_000000000000000001' # str | - api_response = self.api.create_data_request_token(data_request_id) - def test_create_folder(self): + pass + + def test_create_folder(self) -> None: """Test case for create_folder - Create a folder # noqa: E501 + Create a folder """ - create_folder_data = docspring.CreateFolderData() # CreateFolderData | - api_response = self.api.create_folder(create_folder_data) - def test_create_html_template(self): + pass + + def test_create_html_template(self) -> None: """Test case for create_html_template - Create a new HTML template # noqa: E501 + Create a new HTML template """ - create_html_template_data = docspring.CreateHtmlTemplateData() # CreateHtmlTemplateData | - api_response = self.api.create_html_template(create_html_template_data) - def test_create_pdf_template(self): + pass + + def test_create_pdf_template(self) -> None: """Test case for create_pdf_template - Create a new PDF template with a form POST file upload # noqa: E501 + Create a new PDF template with a form POST file upload """ - template_document = '/path/to/file' # file | - template_name = 'template_name_example' # str | - template_parent_folder_id = 'template_parent_folder_id_example' # str | (optional) - api_response = self.api.create_pdf_template(template_document, template_name, template_parent_folder_id=template_parent_folder_id) - def test_create_pdf_template_from_upload(self): + pass + + def test_create_pdf_template_from_upload(self) -> None: """Test case for create_pdf_template_from_upload - Create a new PDF template from a cached presign upload # noqa: E501 + Create a new PDF template from a cached presign upload """ - create_template_from_upload_data = docspring.CreateTemplateFromUploadData() # CreateTemplateFromUploadData | - api_response = self.api.create_pdf_template_from_upload(create_template_from_upload_data) - def test_delete_folder(self): + pass + + def test_delete_folder(self) -> None: """Test case for delete_folder - Delete a folder # noqa: E501 + Delete a folder + """ + pass + + def test_delete_template(self) -> None: + """Test case for delete_template + + Delete a template """ - folder_id = 'fld_000000000000000001' # str | - api_response = self.api.delete_folder(folder_id) - def test_expire_combined_submission(self): + pass + + def test_expire_combined_submission(self) -> None: """Test case for expire_combined_submission - Expire a combined submission # noqa: E501 + Expire a combined submission """ - combined_submission_id = 'com_000000000000000001' # str | - api_response = self.api.expire_combined_submission(combined_submission_id) - def test_expire_submission(self): + pass + + def test_expire_submission(self) -> None: """Test case for expire_submission - Expire a PDF submission # noqa: E501 + Expire a PDF submission """ - submission_id = 'sub_000000000000000001' # str | - api_response = self.api.expire_submission(submission_id) - def test_generate_pdf(self): + pass + + def test_generate_pdf(self) -> None: """Test case for generate_pdf - Generates a new PDF # noqa: E501 + Generates a new PDF + """ + pass + + def test_generate_pdf_for_html_template(self) -> None: + """Test case for generate_pdf_for_html_template + + Generates a new PDF for an HTML template + """ + pass + + def test_generate_preview(self) -> None: + """Test case for generate_preview + + Generated a preview PDF for partially completed data requests """ - template_id = 'tpl_000000000000000001' # str | - submission_data = docspring.SubmissionData() # SubmissionData | - api_response = self.api.generate_pdf(template_id, submission_data) - def test_get_combined_submission(self): + pass + + def test_get_combined_submission(self) -> None: """Test case for get_combined_submission - Check the status of a combined submission (merged PDFs) # noqa: E501 + Check the status of a combined submission (merged PDFs) """ - combined_submission_id = 'com_000000000000000001' # str | - api_response = self.api.get_combined_submission(combined_submission_id) - def test_get_data_request(self): + pass + + def test_get_data_request(self) -> None: """Test case for get_data_request - Look up a submission data request # noqa: E501 + Look up a submission data request """ - data_request_id = 'drq_000000000000000001' # str | - api_response = self.api.get_data_request(data_request_id) - def test_get_full_template(self): + pass + + def test_get_full_template(self) -> None: """Test case for get_full_template - Fetch the full template attributes # noqa: E501 + Fetch the full template attributes """ - template_id = 'tpl_000000000000000001' # str | - api_response = self.api.get_full_template(template_id) - def test_get_presign_url(self): + pass + + def test_get_presign_url(self) -> None: """Test case for get_presign_url - Get a presigned URL so that you can upload a file to our AWS S3 bucket # noqa: E501 + Get a presigned URL so that you can upload a file to our AWS S3 bucket """ - api_response = self.api.get_presign_url() - def test_get_submission(self): + pass + + def test_get_submission(self) -> None: """Test case for get_submission - Check the status of a PDF # noqa: E501 + Check the status of a PDF """ - submission_id = 'sub_000000000000000001' # str | - include_data = true # bool | (optional) - api_response = self.api.get_submission(submission_id, include_data=include_data) - def test_get_submission_batch(self): + pass + + def test_get_submission_batch(self) -> None: """Test case for get_submission_batch - Check the status of a submission batch job # noqa: E501 + Check the status of a submission batch job """ - submission_batch_id = 'sbb_000000000000000001' # str | - include_submissions = true # bool | (optional) - api_response = self.api.get_submission_batch(submission_batch_id, include_submissions=include_submissions) - def test_get_template(self): + pass + + def test_get_template(self) -> None: """Test case for get_template - Check the status of an uploaded template # noqa: E501 + Check the status of an uploaded template """ - template_id = 'tpl_000000000000000001' # str | - api_response = self.api.get_template(template_id) - def test_get_template_schema(self): + pass + + def test_get_template_schema(self) -> None: """Test case for get_template_schema - Fetch the JSON schema for a template # noqa: E501 + Fetch the JSON schema for a template """ - template_id = 'tpl_000000000000000001' # str | - api_response = self.api.get_template_schema(template_id) - def test_list_folders(self): + pass + + def test_list_combined_submissions(self) -> None: + """Test case for list_combined_submissions + + Get a list of all combined submissions + """ + pass + + def test_list_folders(self) -> None: """Test case for list_folders - Get a list of all folders # noqa: E501 + Get a list of all folders """ - parent_folder_id = 'fld_000000000000000002' # str | Filter By Folder Id (optional) - api_response = self.api.list_folders(parent_folder_id=parent_folder_id) - def test_list_submissions(self): + pass + + def test_list_submissions(self) -> None: """Test case for list_submissions - List all submissions # noqa: E501 - """ - cursor = 'sub_list_000012' # str | (optional) - limit = 3 # float | (optional) - created_after = '2019-01-01T09:00:00-05:00' # str | (optional) - created_before = '2020-01-01T09:00:00-05:00' # str | (optional) - type = 'test' # str | (optional) - include_data = true # bool | (optional) - api_response = self.api.list_submissions(cursor=cursor, limit=limit, created_after=created_after, created_before=created_before, type=type, include_data=include_data) - def test_list_submissions_0(self): - """Test case for list_submissions_0 - - List all submissions for a given template # noqa: E501 - """ - template_id = 'tpl_000000000000000002' # str | - cursor = 'cursor_example' # str | (optional) - limit = 3.4 # float | (optional) - created_after = 'created_after_example' # str | (optional) - created_before = 'created_before_example' # str | (optional) - type = 'type_example' # str | (optional) - include_data = true # bool | (optional) - api_response = self.api.list_submissions_0(template_id, cursor=cursor, limit=limit, created_after=created_after, created_before=created_before, type=type, include_data=include_data) - def test_list_templates(self): + List all submissions + """ + pass + + def test_list_template_submissions(self) -> None: + """Test case for list_template_submissions + + List all submissions for a given template + """ + pass + + def test_list_templates(self) -> None: """Test case for list_templates - Get a list of all templates # noqa: E501 + Get a list of all templates """ - query = '2' # str | Search By Name (optional) - parent_folder_id = 'fld_000000000000000001' # str | Filter By Folder Id (optional) - page = 2 # int | Default: 1 (optional) - per_page = 1 # int | Default: 50 (optional) - api_response = self.api.list_templates(query=query, parent_folder_id=parent_folder_id, page=page, per_page=per_page) - def test_move_folder_to_folder(self): + pass + + def test_move_folder_to_folder(self) -> None: """Test case for move_folder_to_folder - Move a folder # noqa: E501 + Move a folder """ - folder_id = 'fld_000000000000000001' # str | - move_folder_data = docspring.MoveFolderData() # MoveFolderData | - api_response = self.api.move_folder_to_folder(folder_id, move_folder_data) - def test_move_template_to_folder(self): + pass + + def test_move_template_to_folder(self) -> None: """Test case for move_template_to_folder - Move Template to folder # noqa: E501 + Move Template to folder """ - template_id = 'tpl_000000000000000001' # str | - move_template_data = docspring.MoveTemplateData() # MoveTemplateData | - api_response = self.api.move_template_to_folder(template_id, move_template_data) - def test_rename_folder(self): + pass + + def test_rename_folder(self) -> None: """Test case for rename_folder - Rename a folder # noqa: E501 + Rename a folder """ - folder_id = 'fld_000000000000000001' # str | - rename_folder_data = docspring.RenameFolderData() # RenameFolderData | - self.api.rename_folder(folder_id, rename_folder_data) def test_test_authentication(self): + pass + + def test_test_authentication(self) -> None: """Test case for test_authentication - Test Authentication # noqa: E501 + Test Authentication """ - api_response = self.api.test_authentication() - def test_update_data_request(self): + pass + + def test_update_data_request(self) -> None: """Test case for update_data_request - Update a submission data request # noqa: E501 + Update a submission data request """ - data_request_id = 'drq_000000000000000001' # str | - update_submission_data_request_data = docspring.UpdateSubmissionDataRequestData() # UpdateSubmissionDataRequestData | - api_response = self.api.update_data_request(data_request_id, update_submission_data_request_data) - def test_update_template(self): + pass + + def test_update_template(self) -> None: """Test case for update_template - Update a Template # noqa: E501 + Update a Template """ - template_id = 'tpl_000000000000000003' # str | - update_template_data = docspring.UpdateTemplateData() # UpdateTemplateData | - api_response = self.api.update_template(template_id, update_template_data) + pass + if __name__ == '__main__': unittest.main() diff --git a/test/test_pdf_api_integration.py b/test/test_pdf_api_integration.py deleted file mode 100644 index 238de66..0000000 --- a/test/test_pdf_api_integration.py +++ /dev/null @@ -1,217 +0,0 @@ -# coding: utf-8 -# Note - this file is just used to generate a scaffold for the tests -# We overwrite it with test_pdf_api.py - -""" - API V1 - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.api.pdf_api import PDFApi # noqa: E501 -from docspring.rest import ApiException -from pprint import pprint - - -class TestPDFApi(unittest.TestCase): - """PDFApi unit test stubs""" - - def setUp(self): - # Configure HTTP basic authorization: api_token_basic - configuration = docspring.Configuration() - configuration.api_token_id = 'api_token123' - configuration.api_token_secret = 'testsecret123' - configuration.host = 'api.docspring.local:31337/api/v1' - - # create an instance of the API class - self.api = docspring.PDFApi(docspring.ApiClient(configuration)) - - def tearDown(self): - pass - - def test_batch_generate_pdfs(self): - """Test case for batch_generate_pdfs - - Generates multiple PDFs # noqa: E501 - """ - template_id = 'tpl_000000000000000001' # str | - api_response = self.api.batch_generate_pdfs({ - 'template_id': template_id, - 'metadata': { 'user_id' : 123 }, - 'test': True, - 'submissions': [ - { - 'data': { - 'title': 'Test PDF', - 'description': 'This PDF is great!', - } - }, - { - 'data': { - 'title': 'Test PDF 2', - 'description': 'This PDF is also great!', - } - } - ] - }) - - self.assertEquals(api_response.status, 'success') - batch = api_response.submission_batch - self.assertRegexpMatches(batch.id, '^sbb_') - self.assertEquals(batch.state, 'pending') - self.assertEquals(batch.metadata['user_id'], 123) - self.assertEquals(batch.total_count, 2) - self.assertEquals(batch.pending_count, 2) - self.assertEquals(batch.error_count, 0) - self.assertEquals(batch.completion_percentage, 0) - - submissions = api_response.submissions - self.assertEquals(len(submissions), 2) - first_response = submissions[0] - self.assertEquals(first_response.status, 'success') - submission = first_response.submission - self.assertRegexpMatches(submission.id, '^sub_') - self.assertEquals(submission.expired, False) - self.assertEquals(submission.state, 'pending') - - def test_combine_submissions(self): - """Test case for combine_submissions - - Merge generated PDFs together # noqa: E501 - """ - api_response = self.api.combine_submissions( - combined_submission_data={ - 'submission_ids': ['sub_000000000000000001', 'sub_000000000000000002'] - }) - self.assertEquals(api_response.status, 'success') - self.assertRegexpMatches(api_response.combined_submission.id, '^com_') - - def test_expire_combined_submission(self): - """Test case for expire_combined_submission - - Expire a combined submission # noqa: E501 - """ - combined_submission_id = 'com_000000000000000001' # str | - api_response = self.api.expire_combined_submission( - combined_submission_id) - self.assertEquals(api_response.expired, True) - - def test_expire_submission(self): - """Test case for expire_submission - - Expire a PDF submission # noqa: E501 - """ - submission_id = 'sub_000000000000000001' # str | - api_response = self.api.expire_submission(submission_id) - self.assertEquals(api_response.expired, True) - - def test_generate_pdf(self): - """Test case for generate_pdf - - Generates a new PDF # noqa: E501 - """ - template_id = 'tpl_000000000000000001' # str | - api_response = self.api.generate_pdf( - template_id, { - 'data': { - 'title': 'Test PDF', - 'description': 'This PDF is great!' - } - }) - self.assertEquals(api_response.status, 'success') - submission = api_response.submission - self.assertRegexpMatches(submission.id, '^sub_') - self.assertEquals(submission.expired, False) - self.assertEquals(submission.state, 'pending') - - def test_generate_pdf_with_data_requests(self): - """Test case for generate_pdf with data_requests - - Generates a new PDF with data_requests # noqa: E501 - """ - template_id = 'tpl_000000000000000001' # str | - api_response = self.api.generate_pdf( - template_id, { - 'data': { - 'title': 'Test PDF', - }, - "data_requests": [ - { - 'name': 'John Smith', - 'email': 'jsmith@example.com', - 'fields': ['description'], - 'order': 1, - 'metadata': { - 'user_id': 123 - }, - 'auth_type': 'email_link' - } - ] - }) - self.assertEquals(api_response.status, 'success') - submission = api_response.submission - self.assertRegexpMatches(submission.id, '^sub_') - self.assertEquals(submission.expired, False) - self.assertEquals(submission.state, 'waiting_for_data_requests') - - data_requests = submission.data_requests - self.assertEquals(len(data_requests), 1) - data_request = data_requests[0] - - self.assertRegexpMatches(data_request.id, '^drq_') - self.assertEquals(data_request.state, 'pending') - self.assertEquals(data_request.fields, ['description']) - self.assertEquals(data_request.order, 1) - self.assertEquals(data_request.name, 'John Smith') - self.assertEquals(data_request.email, 'jsmith@example.com') - - def test_get_combined_submission(self): - """Test case for get_combined_submission - - Check the status of a combined submission (merged PDFs) # noqa: E501 - """ - combined_submission_id = 'com_000000000000000001' # str | - api_response = self.api.get_combined_submission(combined_submission_id) - self.assertRegexpMatches(api_response.id, '^com_') - - def test_get_submission(self): - """Test case for get_submission - - Check the status of a PDF # noqa: E501 - """ - submission_id = 'sub_000000000000000001' # str | - api_response = self.api.get_submission(submission_id) - self.assertRegexpMatches(api_response.id, '^sub_') - - def test_list_templates(self): - """Test case for list_templates - - Get a list of all templates # noqa: E501 - """ - query = 'API Client Test Template 2' # String | Search By Name - page = 1 # int | Default: 1 (optional) - per_page = 10 # int | Default: 50 (optional) - api_response = self.api.list_templates(page=page, per_page=per_page, query=query) - self.assertEquals(len(api_response), 1) - self.assertEquals(api_response[0].id, 'tpl_000000000000000002') - - def test_test_authentication(self): - """Test case for test_authentication - - Test Authentication # noqa: E501 - """ - api_response = self.api.test_authentication() - self.assertEquals(api_response.status, 'success') - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_pending_template.py b/test/test_pending_template.py deleted file mode 100644 index 3bd07f6..0000000 --- a/test/test_pending_template.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.pending_template import PendingTemplate # noqa: E501 -from docspring.rest import ApiException - - -class TestPendingTemplate(unittest.TestCase): - """PendingTemplate unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testPendingTemplate(self): - """Test PendingTemplate""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.pending_template.PendingTemplate() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_rename_folder_data.py b/test/test_rename_folder_data.py index 049e2c3..dd5de24 100644 --- a/test/test_rename_folder_data.py +++ b/test/test_rename_folder_data.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.rename_folder_data import RenameFolderData # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.rename_folder_data import RenameFolderData class TestRenameFolderData(unittest.TestCase): """RenameFolderData unit test stubs""" @@ -28,12 +25,28 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> RenameFolderData: + """Test RenameFolderData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `RenameFolderData` + """ + model = RenameFolderData() + if include_optional: + return RenameFolderData( + name = '' + ) + else: + return RenameFolderData( + name = '', + ) + """ + def testRenameFolderData(self): """Test RenameFolderData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.rename_folder_data.RenameFolderData() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_submission.py b/test/test_submission.py index 01d4b60..2f6dde4 100644 --- a/test/test_submission.py +++ b/test/test_submission.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.submission import Submission # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.submission import Submission class TestSubmission(unittest.TestCase): """Submission unit test stubs""" @@ -28,12 +25,144 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> Submission: + """Test Submission + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Submission` + """ + model = Submission() + if include_optional: + return Submission( + batch_id = '', + data_requests = [ + docspring.models.submission_data_request.submission_data_request( + id = '', + email = '', + name = '', + order = 56, + sort_order = 56, + fields = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + state = 'pending', + viewed_at = '', + completed_at = '', + data = docspring.models.data.data(), + auth_type = 'none', + auth_second_factor_type = 'none', + auth_provider = '', + auth_session_started_at = '', + auth_session_id_hash = '', + auth_user_id_hash = '', + auth_username_hash = '', + auth_phone_number_hash = '', + ip_address = '', + user_agent = '', ) + ], + editable = True, + expired = True, + expires_at = '', + id = '', + json_schema_errors = [ + '' + ], + metadata = None, + password = '', + processed_at = '', + state = 'pending', + template_id = '', + test = True, + truncated_text = None, + pdf_hash = '', + download_url = '', + permanent_download_url = '', + preview_download_url = '', + preview_generated_at = '', + audit_trail_download_url = '', + actions = [ + docspring.models.submission_action.submission_action( + id = '', + integration_id = '', + state = 'pending', + action_type = 'webhook', + action_category = 'notification', + result_data = docspring.models.result_data.result_data(), ) + ], + source = 'api', + referrer = '', + data = None + ) + else: + return Submission( + batch_id = '', + data_requests = [ + docspring.models.submission_data_request.submission_data_request( + id = '', + email = '', + name = '', + order = 56, + sort_order = 56, + fields = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + state = 'pending', + viewed_at = '', + completed_at = '', + data = docspring.models.data.data(), + auth_type = 'none', + auth_second_factor_type = 'none', + auth_provider = '', + auth_session_started_at = '', + auth_session_id_hash = '', + auth_user_id_hash = '', + auth_username_hash = '', + auth_phone_number_hash = '', + ip_address = '', + user_agent = '', ) + ], + editable = True, + expired = True, + expires_at = '', + id = '', + json_schema_errors = [ + '' + ], + metadata = None, + password = '', + processed_at = '', + state = 'pending', + template_id = '', + test = True, + truncated_text = None, + pdf_hash = '', + download_url = '', + permanent_download_url = '', + preview_download_url = '', + preview_generated_at = '', + audit_trail_download_url = '', + actions = [ + docspring.models.submission_action.submission_action( + id = '', + integration_id = '', + state = 'pending', + action_type = 'webhook', + action_category = 'notification', + result_data = docspring.models.result_data.result_data(), ) + ], + source = 'api', + referrer = '', + data = None, + ) + """ + def testSubmission(self): """Test Submission""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.submission.Submission() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_submission_action.py b/test/test_submission_action.py index 4278919..fab0bf2 100644 --- a/test/test_submission_action.py +++ b/test/test_submission_action.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.submission_action import SubmissionAction # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.submission_action import SubmissionAction class TestSubmissionAction(unittest.TestCase): """SubmissionAction unit test stubs""" @@ -28,12 +25,38 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> SubmissionAction: + """Test SubmissionAction + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SubmissionAction` + """ + model = SubmissionAction() + if include_optional: + return SubmissionAction( + id = '', + integration_id = '', + state = 'pending', + action_type = 'webhook', + action_category = 'notification', + result_data = None + ) + else: + return SubmissionAction( + id = '', + integration_id = '', + state = 'pending', + action_type = 'webhook', + action_category = 'notification', + result_data = None, + ) + """ + def testSubmissionAction(self): """Test SubmissionAction""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.submission_action.SubmissionAction() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_submission_batch.py b/test/test_submission_batch.py index 0dbb31e..ccf1d9a 100644 --- a/test/test_submission_batch.py +++ b/test/test_submission_batch.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.submission_batch import SubmissionBatch # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.submission_batch import SubmissionBatch class TestSubmissionBatch(unittest.TestCase): """SubmissionBatch unit test stubs""" @@ -28,12 +25,42 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> SubmissionBatch: + """Test SubmissionBatch + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SubmissionBatch` + """ + model = SubmissionBatch() + if include_optional: + return SubmissionBatch( + id = '', + state = 'pending', + metadata = None, + processed_at = '', + total_count = 56, + pending_count = 56, + error_count = 56, + completion_percentage = 1.337 + ) + else: + return SubmissionBatch( + id = '', + state = 'pending', + metadata = None, + processed_at = '', + total_count = 56, + pending_count = 56, + error_count = 56, + completion_percentage = 1.337, + ) + """ + def testSubmissionBatch(self): """Test SubmissionBatch""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.submission_batch.SubmissionBatch() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_submission_batch_data.py b/test/test_submission_batch_data.py index f65be3a..0af8719 100644 --- a/test/test_submission_batch_data.py +++ b/test/test_submission_batch_data.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.submission_batch_data import SubmissionBatchData # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.submission_batch_data import SubmissionBatchData class TestSubmissionBatchData(unittest.TestCase): """SubmissionBatchData unit test stubs""" @@ -28,12 +25,34 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> SubmissionBatchData: + """Test SubmissionBatchData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SubmissionBatchData` + """ + model = SubmissionBatchData() + if include_optional: + return SubmissionBatchData( + metadata = None, + submissions = [ + docspring.models.submission_data_batch_request.submission_data_batch_request() + ], + test = True + ) + else: + return SubmissionBatchData( + submissions = [ + docspring.models.submission_data_batch_request.submission_data_batch_request() + ], + ) + """ + def testSubmissionBatchData(self): """Test SubmissionBatchData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.submission_batch_data.SubmissionBatchData() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_submission_batch_with_submissions.py b/test/test_submission_batch_with_submissions.py new file mode 100644 index 0000000..2171f47 --- /dev/null +++ b/test/test_submission_batch_with_submissions.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.submission_batch_with_submissions import SubmissionBatchWithSubmissions + +class TestSubmissionBatchWithSubmissions(unittest.TestCase): + """SubmissionBatchWithSubmissions unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SubmissionBatchWithSubmissions: + """Test SubmissionBatchWithSubmissions + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SubmissionBatchWithSubmissions` + """ + model = SubmissionBatchWithSubmissions() + if include_optional: + return SubmissionBatchWithSubmissions( + id = '', + state = 'pending', + metadata = None, + processed_at = '', + total_count = 56, + pending_count = 56, + error_count = 56, + completion_percentage = 1.337, + submissions = [ + docspring.models.submission_preview.submission_preview( + batch_id = '', + data_requests = [ + docspring.models.submission_data_request.submission_data_request( + id = '', + email = '', + name = '', + order = 56, + sort_order = 56, + fields = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + state = 'pending', + viewed_at = '', + completed_at = '', + data = docspring.models.data.data(), + auth_type = 'none', + auth_second_factor_type = 'none', + auth_provider = '', + auth_session_started_at = '', + auth_session_id_hash = '', + auth_user_id_hash = '', + auth_username_hash = '', + auth_phone_number_hash = '', + ip_address = '', + user_agent = '', ) + ], + editable = True, + expired = True, + expires_at = '', + id = '', + json_schema_errors = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + password = '', + processed_at = '', + state = 'pending', + template_id = '', + test = True, + truncated_text = docspring.models.truncated_text.truncated_text(), + pdf_hash = '', + download_url = '', + permanent_download_url = '', + preview_download_url = '', + preview_generated_at = '', + audit_trail_download_url = '', + actions = [ + docspring.models.submission_action.submission_action( + id = '', + integration_id = '', + state = 'pending', + action_type = 'webhook', + action_category = 'notification', + result_data = docspring.models.result_data.result_data(), ) + ], ) + ] + ) + else: + return SubmissionBatchWithSubmissions( + id = '', + state = 'pending', + metadata = None, + processed_at = '', + total_count = 56, + pending_count = 56, + error_count = 56, + completion_percentage = 1.337, + ) + """ + + def testSubmissionBatchWithSubmissions(self): + """Test SubmissionBatchWithSubmissions""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_submission_data.py b/test/test_submission_data.py deleted file mode 100644 index 62ac653..0000000 --- a/test/test_submission_data.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.submission_data import SubmissionData # noqa: E501 -from docspring.rest import ApiException - - -class TestSubmissionData(unittest.TestCase): - """SubmissionData unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSubmissionData(self): - """Test SubmissionData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.submission_data.SubmissionData() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_submission_data_batch_request.py b/test/test_submission_data_batch_request.py deleted file mode 100644 index 8743c5a..0000000 --- a/test/test_submission_data_batch_request.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.submission_data_batch_request import SubmissionDataBatchRequest # noqa: E501 -from docspring.rest import ApiException - - -class TestSubmissionDataBatchRequest(unittest.TestCase): - """SubmissionDataBatchRequest unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSubmissionDataBatchRequest(self): - """Test SubmissionDataBatchRequest""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.submission_data_batch_request.SubmissionDataBatchRequest() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_submission_data_request.py b/test/test_submission_data_request.py index 495fcea..3f84f3a 100644 --- a/test/test_submission_data_request.py +++ b/test/test_submission_data_request.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.submission_data_request import SubmissionDataRequest # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.submission_data_request import SubmissionDataRequest class TestSubmissionDataRequest(unittest.TestCase): """SubmissionDataRequest unit test stubs""" @@ -28,12 +25,72 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> SubmissionDataRequest: + """Test SubmissionDataRequest + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SubmissionDataRequest` + """ + model = SubmissionDataRequest() + if include_optional: + return SubmissionDataRequest( + id = '', + email = '', + name = '', + order = 56, + sort_order = 56, + fields = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + state = 'pending', + viewed_at = '', + completed_at = '', + data = docspring.models.data.data(), + auth_type = 'none', + auth_second_factor_type = 'none', + auth_provider = '', + auth_session_started_at = '', + auth_session_id_hash = '', + auth_user_id_hash = '', + auth_username_hash = '', + auth_phone_number_hash = '', + ip_address = '', + user_agent = '' + ) + else: + return SubmissionDataRequest( + id = '', + email = '', + name = '', + order = 56, + sort_order = 56, + fields = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + state = 'pending', + viewed_at = '', + completed_at = '', + data = docspring.models.data.data(), + auth_type = 'none', + auth_second_factor_type = 'none', + auth_provider = '', + auth_session_started_at = '', + auth_session_id_hash = '', + auth_user_id_hash = '', + auth_username_hash = '', + auth_phone_number_hash = '', + ip_address = '', + user_agent = '', + ) + """ + def testSubmissionDataRequest(self): """Test SubmissionDataRequest""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.submission_data_request.SubmissionDataRequest() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_submission_data_request_event.py b/test/test_submission_data_request_event.py new file mode 100644 index 0000000..4818d85 --- /dev/null +++ b/test/test_submission_data_request_event.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.submission_data_request_event import SubmissionDataRequestEvent + +class TestSubmissionDataRequestEvent(unittest.TestCase): + """SubmissionDataRequestEvent unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SubmissionDataRequestEvent: + """Test SubmissionDataRequestEvent + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SubmissionDataRequestEvent` + """ + model = SubmissionDataRequestEvent() + if include_optional: + return SubmissionDataRequestEvent( + id = '', + submission_id = '', + submission_data_request_id = '', + event_type = 'send_request', + message_type = 'email', + message_recipient = '', + occurred_at = '' + ) + else: + return SubmissionDataRequestEvent( + id = '', + submission_id = '', + submission_data_request_id = '', + event_type = 'send_request', + message_type = 'email', + message_recipient = '', + occurred_at = '', + ) + """ + + def testSubmissionDataRequestEvent(self): + """Test SubmissionDataRequestEvent""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_submission_data_request_show.py b/test/test_submission_data_request_show.py new file mode 100644 index 0000000..a9ee22a --- /dev/null +++ b/test/test_submission_data_request_show.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.submission_data_request_show import SubmissionDataRequestShow + +class TestSubmissionDataRequestShow(unittest.TestCase): + """SubmissionDataRequestShow unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SubmissionDataRequestShow: + """Test SubmissionDataRequestShow + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SubmissionDataRequestShow` + """ + model = SubmissionDataRequestShow() + if include_optional: + return SubmissionDataRequestShow( + id = '', + email = '', + name = '', + order = 56, + sort_order = 56, + fields = [ + '' + ], + metadata = None, + state = 'pending', + viewed_at = '', + completed_at = '', + data = None, + auth_type = 'none', + auth_second_factor_type = 'none', + auth_provider = '', + auth_session_started_at = '', + auth_session_id_hash = '', + auth_user_id_hash = '', + auth_username_hash = '', + auth_phone_number_hash = '', + ip_address = '', + user_agent = '', + submission_id = '' + ) + else: + return SubmissionDataRequestShow( + id = '', + email = '', + name = '', + order = 56, + sort_order = 56, + fields = [ + '' + ], + metadata = None, + state = 'pending', + viewed_at = '', + completed_at = '', + data = None, + auth_type = 'none', + auth_second_factor_type = 'none', + auth_provider = '', + auth_session_started_at = '', + auth_session_id_hash = '', + auth_user_id_hash = '', + auth_username_hash = '', + auth_phone_number_hash = '', + ip_address = '', + user_agent = '', + submission_id = '', + ) + """ + + def testSubmissionDataRequestShow(self): + """Test SubmissionDataRequestShow""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_submission_data_request_token.py b/test/test_submission_data_request_token.py new file mode 100644 index 0000000..6b539db --- /dev/null +++ b/test/test_submission_data_request_token.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.submission_data_request_token import SubmissionDataRequestToken + +class TestSubmissionDataRequestToken(unittest.TestCase): + """SubmissionDataRequestToken unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SubmissionDataRequestToken: + """Test SubmissionDataRequestToken + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SubmissionDataRequestToken` + """ + model = SubmissionDataRequestToken() + if include_optional: + return SubmissionDataRequestToken( + id = '', + secret = '', + expires_at = '', + data_request_url = '' + ) + else: + return SubmissionDataRequestToken( + id = '', + secret = '', + expires_at = '', + data_request_url = '', + ) + """ + + def testSubmissionDataRequestToken(self): + """Test SubmissionDataRequestToken""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_submission_preview.py b/test/test_submission_preview.py new file mode 100644 index 0000000..feade2b --- /dev/null +++ b/test/test_submission_preview.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.submission_preview import SubmissionPreview + +class TestSubmissionPreview(unittest.TestCase): + """SubmissionPreview unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SubmissionPreview: + """Test SubmissionPreview + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SubmissionPreview` + """ + model = SubmissionPreview() + if include_optional: + return SubmissionPreview( + batch_id = '', + data_requests = [ + docspring.models.submission_data_request.submission_data_request( + id = '', + email = '', + name = '', + order = 56, + sort_order = 56, + fields = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + state = 'pending', + viewed_at = '', + completed_at = '', + data = docspring.models.data.data(), + auth_type = 'none', + auth_second_factor_type = 'none', + auth_provider = '', + auth_session_started_at = '', + auth_session_id_hash = '', + auth_user_id_hash = '', + auth_username_hash = '', + auth_phone_number_hash = '', + ip_address = '', + user_agent = '', ) + ], + editable = True, + expired = True, + expires_at = '', + id = '', + json_schema_errors = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + password = '', + processed_at = '', + state = 'pending', + template_id = '', + test = True, + truncated_text = docspring.models.truncated_text.truncated_text(), + pdf_hash = '', + download_url = '', + permanent_download_url = '', + preview_download_url = '', + preview_generated_at = '', + audit_trail_download_url = '', + actions = [ + docspring.models.submission_action.submission_action( + id = '', + integration_id = '', + state = 'pending', + action_type = 'webhook', + action_category = 'notification', + result_data = docspring.models.result_data.result_data(), ) + ] + ) + else: + return SubmissionPreview( + batch_id = '', + data_requests = [ + docspring.models.submission_data_request.submission_data_request( + id = '', + email = '', + name = '', + order = 56, + sort_order = 56, + fields = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + state = 'pending', + viewed_at = '', + completed_at = '', + data = docspring.models.data.data(), + auth_type = 'none', + auth_second_factor_type = 'none', + auth_provider = '', + auth_session_started_at = '', + auth_session_id_hash = '', + auth_user_id_hash = '', + auth_username_hash = '', + auth_phone_number_hash = '', + ip_address = '', + user_agent = '', ) + ], + editable = True, + expired = True, + expires_at = '', + id = '', + json_schema_errors = [ + '' + ], + metadata = docspring.models.metadata.metadata(), + password = '', + processed_at = '', + state = 'pending', + template_id = '', + test = True, + truncated_text = docspring.models.truncated_text.truncated_text(), + pdf_hash = '', + download_url = '', + permanent_download_url = '', + preview_download_url = '', + preview_generated_at = '', + audit_trail_download_url = '', + actions = [ + docspring.models.submission_action.submission_action( + id = '', + integration_id = '', + state = 'pending', + action_type = 'webhook', + action_category = 'notification', + result_data = docspring.models.result_data.result_data(), ) + ], + ) + """ + + def testSubmissionPreview(self): + """Test SubmissionPreview""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_success_error_response.py b/test/test_success_error_response.py new file mode 100644 index 0000000..ab19083 --- /dev/null +++ b/test/test_success_error_response.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.success_error_response import SuccessErrorResponse + +class TestSuccessErrorResponse(unittest.TestCase): + """SuccessErrorResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SuccessErrorResponse: + """Test SuccessErrorResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SuccessErrorResponse` + """ + model = SuccessErrorResponse() + if include_optional: + return SuccessErrorResponse( + status = 'success', + error = '' + ) + else: + return SuccessErrorResponse( + status = 'success', + ) + """ + + def testSuccessErrorResponse(self): + """Test SuccessErrorResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_success_multiple_errors_response.py b/test/test_success_multiple_errors_response.py new file mode 100644 index 0000000..2e5e31f --- /dev/null +++ b/test/test_success_multiple_errors_response.py @@ -0,0 +1,55 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.success_multiple_errors_response import SuccessMultipleErrorsResponse + +class TestSuccessMultipleErrorsResponse(unittest.TestCase): + """SuccessMultipleErrorsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SuccessMultipleErrorsResponse: + """Test SuccessMultipleErrorsResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SuccessMultipleErrorsResponse` + """ + model = SuccessMultipleErrorsResponse() + if include_optional: + return SuccessMultipleErrorsResponse( + status = 'success', + errors = [ + '' + ] + ) + else: + return SuccessMultipleErrorsResponse( + status = 'success', + ) + """ + + def testSuccessMultipleErrorsResponse(self): + """Test SuccessMultipleErrorsResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_template.py b/test/test_template.py index 3f1978a..4914172 100644 --- a/test/test_template.py +++ b/test/test_template.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.template import Template # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.template import Template class TestTemplate(unittest.TestCase): """Template unit test stubs""" @@ -28,12 +25,138 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> Template: + """Test Template + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `Template` + """ + model = Template() + if include_optional: + return Template( + add_data_request_submission_id_footers = True, + allow_additional_properties = True, + description = '', + document_filename = '', + document_md5 = '', + document_parse_error = True, + document_processed = True, + document_state = 'pending', + document_url = '', + editable_submissions = True, + embed_domains = '', + encrypt_pdfs_password = '', + encrypt_pdfs = True, + expiration_interval = '', + expire_after = 56, + expire_submissions = True, + external_predefined_fields_template_id = '', + external_predefined_fields_template_name = '', + first_template = True, + id = '', + locked = True, + merge_audit_trail_pdf = True, + name = '', + page_count = 56, + page_dimensions = [ + [ + 1.337 + ] + ], + parent_folder_id = '', + path = '', + permanent_document_url = '', + public_submissions = True, + public_web_form = True, + redirect_url = '', + slack_webhook_url = '', + template_type = 'pdf', + updated_at = '', + webhook_url = '', + demo = True, + defaults = docspring.models.template_defaults.template_defaults(), + field_order = [ + [ + 1.337 + ] + ], + fields = docspring.models.template_fields.template_fields(), + footer_html = '', + header_html = '', + html_engine_options = docspring.models.html_engine_options.html_engine_options(), + html = '', + predefined_fields = [ + docspring.models.predefined_field.predefined_field() + ], + scss = '', + shared_field_data = docspring.models.template_shared_field_data.template_shared_field_data() + ) + else: + return Template( + add_data_request_submission_id_footers = True, + allow_additional_properties = True, + description = '', + document_filename = '', + document_md5 = '', + document_parse_error = True, + document_processed = True, + document_state = 'pending', + document_url = '', + editable_submissions = True, + embed_domains = '', + encrypt_pdfs_password = '', + encrypt_pdfs = True, + expiration_interval = '', + expire_after = 56, + expire_submissions = True, + external_predefined_fields_template_id = '', + external_predefined_fields_template_name = '', + first_template = True, + id = '', + locked = True, + merge_audit_trail_pdf = True, + name = '', + page_count = 56, + page_dimensions = [ + [ + 1.337 + ] + ], + parent_folder_id = '', + path = '', + permanent_document_url = '', + public_submissions = True, + public_web_form = True, + redirect_url = '', + slack_webhook_url = '', + template_type = 'pdf', + updated_at = '', + webhook_url = '', + demo = True, + defaults = docspring.models.template_defaults.template_defaults(), + field_order = [ + [ + 1.337 + ] + ], + fields = docspring.models.template_fields.template_fields(), + footer_html = '', + header_html = '', + html_engine_options = docspring.models.html_engine_options.html_engine_options(), + html = '', + predefined_fields = [ + docspring.models.predefined_field.predefined_field() + ], + scss = '', + shared_field_data = docspring.models.template_shared_field_data.template_shared_field_data(), + ) + """ + def testTemplate(self): """Test Template""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.template.Template() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_template1.py b/test/test_template1.py deleted file mode 100644 index c3a2434..0000000 --- a/test/test_template1.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.template1 import Template1 # noqa: E501 -from docspring.rest import ApiException - - -class TestTemplate1(unittest.TestCase): - """Template1 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTemplate1(self): - """Test Template1""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.template1.Template1() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_template1_defaults.py b/test/test_template1_defaults.py deleted file mode 100644 index 3d82031..0000000 --- a/test/test_template1_defaults.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.template1_defaults import Template1Defaults # noqa: E501 -from docspring.rest import ApiException - - -class TestTemplate1Defaults(unittest.TestCase): - """Template1Defaults unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTemplate1Defaults(self): - """Test Template1Defaults""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.template1_defaults.Template1Defaults() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_template_add_fields_response.py b/test/test_template_add_fields_response.py new file mode 100644 index 0000000..b6235cd --- /dev/null +++ b/test/test_template_add_fields_response.py @@ -0,0 +1,58 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.template_add_fields_response import TemplateAddFieldsResponse + +class TestTemplateAddFieldsResponse(unittest.TestCase): + """TemplateAddFieldsResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TemplateAddFieldsResponse: + """Test TemplateAddFieldsResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TemplateAddFieldsResponse` + """ + model = TemplateAddFieldsResponse() + if include_optional: + return TemplateAddFieldsResponse( + status = 'success', + errors = [ + '' + ], + new_field_ids = [ + 56 + ] + ) + else: + return TemplateAddFieldsResponse( + status = 'success', + ) + """ + + def testTemplateAddFieldsResponse(self): + """Test TemplateAddFieldsResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_template_data.py b/test/test_template_data.py deleted file mode 100644 index 779ffac..0000000 --- a/test/test_template_data.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.template_data import TemplateData # noqa: E501 -from docspring.rest import ApiException - - -class TestTemplateData(unittest.TestCase): - """TemplateData unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTemplateData(self): - """Test TemplateData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.template_data.TemplateData() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_template_preview.py b/test/test_template_preview.py new file mode 100644 index 0000000..c9674b4 --- /dev/null +++ b/test/test_template_preview.py @@ -0,0 +1,130 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.template_preview import TemplatePreview + +class TestTemplatePreview(unittest.TestCase): + """TemplatePreview unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> TemplatePreview: + """Test TemplatePreview + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `TemplatePreview` + """ + model = TemplatePreview() + if include_optional: + return TemplatePreview( + add_data_request_submission_id_footers = True, + allow_additional_properties = True, + description = '', + document_filename = '', + document_md5 = '', + document_parse_error = True, + document_processed = True, + document_state = 'pending', + document_url = '', + editable_submissions = True, + embed_domains = '', + encrypt_pdfs_password = '', + encrypt_pdfs = True, + expiration_interval = '', + expire_after = 56, + expire_submissions = True, + external_predefined_fields_template_id = '', + external_predefined_fields_template_name = '', + first_template = True, + id = '', + locked = True, + merge_audit_trail_pdf = True, + name = '', + page_count = 56, + page_dimensions = [ + [ + 1.337 + ] + ], + parent_folder_id = '', + path = '', + permanent_document_url = '', + public_submissions = True, + public_web_form = True, + redirect_url = '', + slack_webhook_url = '', + template_type = 'pdf', + updated_at = '', + webhook_url = '', + demo = True + ) + else: + return TemplatePreview( + add_data_request_submission_id_footers = True, + allow_additional_properties = True, + description = '', + document_filename = '', + document_md5 = '', + document_parse_error = True, + document_processed = True, + document_state = 'pending', + document_url = '', + editable_submissions = True, + embed_domains = '', + encrypt_pdfs_password = '', + encrypt_pdfs = True, + expiration_interval = '', + expire_after = 56, + expire_submissions = True, + external_predefined_fields_template_id = '', + external_predefined_fields_template_name = '', + first_template = True, + id = '', + locked = True, + merge_audit_trail_pdf = True, + name = '', + page_count = 56, + page_dimensions = [ + [ + 1.337 + ] + ], + parent_folder_id = '', + path = '', + permanent_document_url = '', + public_submissions = True, + public_web_form = True, + redirect_url = '', + slack_webhook_url = '', + template_type = 'pdf', + updated_at = '', + webhook_url = '', + demo = True, + ) + """ + + def testTemplatePreview(self): + """Test TemplatePreview""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_templatestemplate_idadd_fields_fields.py b/test/test_templatestemplate_idadd_fields_fields.py deleted file mode 100644 index 0bbe1dd..0000000 --- a/test/test_templatestemplate_idadd_fields_fields.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.templatestemplate_idadd_fields_fields import TemplatestemplateIdaddFieldsFields # noqa: E501 -from docspring.rest import ApiException - - -class TestTemplatestemplateIdaddFieldsFields(unittest.TestCase): - """TemplatestemplateIdaddFieldsFields unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTemplatestemplateIdaddFieldsFields(self): - """Test TemplatestemplateIdaddFieldsFields""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.templatestemplate_idadd_fields_fields.TemplatestemplateIdaddFieldsFields() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_update_data_request_response.py b/test/test_update_data_request_response.py deleted file mode 100644 index 9e481e5..0000000 --- a/test/test_update_data_request_response.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.update_data_request_response import UpdateDataRequestResponse # noqa: E501 -from docspring.rest import ApiException - - -class TestUpdateDataRequestResponse(unittest.TestCase): - """UpdateDataRequestResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUpdateDataRequestResponse(self): - """Test UpdateDataRequestResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.update_data_request_response.UpdateDataRequestResponse() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_update_html_template.py b/test/test_update_html_template.py new file mode 100644 index 0000000..4ae1947 --- /dev/null +++ b/test/test_update_html_template.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.update_html_template import UpdateHtmlTemplate + +class TestUpdateHtmlTemplate(unittest.TestCase): + """UpdateHtmlTemplate unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateHtmlTemplate: + """Test UpdateHtmlTemplate + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateHtmlTemplate` + """ + model = UpdateHtmlTemplate() + if include_optional: + return UpdateHtmlTemplate( + template = docspring.models.update_html_template_data.update_html_template_data() + ) + else: + return UpdateHtmlTemplate( + template = docspring.models.update_html_template_data.update_html_template_data(), + ) + """ + + def testUpdateHtmlTemplate(self): + """Test UpdateHtmlTemplate""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_submission_data_request_data.py b/test/test_update_submission_data_request_data.py index aeef9de..e77c010 100644 --- a/test/test_update_submission_data_request_data.py +++ b/test/test_update_submission_data_request_data.py @@ -1,23 +1,20 @@ # coding: utf-8 """ - API v1 + DocSpring API - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 + DocSpring provides an API that helps you fill out and sign PDF templates. - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + Do not edit the class manually. +""" # noqa: E501 -from __future__ import absolute_import import unittest -import docspring -from docspring.models.update_submission_data_request_data import UpdateSubmissionDataRequestData # noqa: E501 -from docspring.rest import ApiException - +from docspring.models.update_submission_data_request_data import UpdateSubmissionDataRequestData class TestUpdateSubmissionDataRequestData(unittest.TestCase): """UpdateSubmissionDataRequestData unit test stubs""" @@ -28,12 +25,32 @@ def setUp(self): def tearDown(self): pass + def make_instance(self, include_optional) -> UpdateSubmissionDataRequestData: + """Test UpdateSubmissionDataRequestData + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateSubmissionDataRequestData` + """ + model = UpdateSubmissionDataRequestData() + if include_optional: + return UpdateSubmissionDataRequestData( + auth_type = 'none', + fields = [ + '' + ], + metadata = None, + order = 56 + ) + else: + return UpdateSubmissionDataRequestData( + ) + """ + def testUpdateSubmissionDataRequestData(self): """Test UpdateSubmissionDataRequestData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.update_submission_data_request_data.UpdateSubmissionDataRequestData() # noqa: E501 - pass - + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) if __name__ == '__main__': unittest.main() diff --git a/test/test_update_template_data.py b/test/test_update_template_data.py deleted file mode 100644 index bf2a802..0000000 --- a/test/test_update_template_data.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.update_template_data import UpdateTemplateData # noqa: E501 -from docspring.rest import ApiException - - -class TestUpdateTemplateData(unittest.TestCase): - """UpdateTemplateData unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUpdateTemplateData(self): - """Test UpdateTemplateData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.update_template_data.UpdateTemplateData() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_update_template_response.py b/test/test_update_template_response.py deleted file mode 100644 index d34f463..0000000 --- a/test/test_update_template_response.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.update_template_response import UpdateTemplateResponse # noqa: E501 -from docspring.rest import ApiException - - -class TestUpdateTemplateResponse(unittest.TestCase): - """UpdateTemplateResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUpdateTemplateResponse(self): - """Test UpdateTemplateResponse""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.update_template_response.UpdateTemplateResponse() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_upload_presign_response.py b/test/test_upload_presign_response.py new file mode 100644 index 0000000..69e0661 --- /dev/null +++ b/test/test_upload_presign_response.py @@ -0,0 +1,57 @@ +# coding: utf-8 + +""" + DocSpring API + + DocSpring provides an API that helps you fill out and sign PDF templates. + + The version of the OpenAPI document: v1 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from docspring.models.upload_presign_response import UploadPresignResponse + +class TestUploadPresignResponse(unittest.TestCase): + """UploadPresignResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UploadPresignResponse: + """Test UploadPresignResponse + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UploadPresignResponse` + """ + model = UploadPresignResponse() + if include_optional: + return UploadPresignResponse( + fields = None, + headers = None, + url = '', + method = 'post' + ) + else: + return UploadPresignResponse( + fields = None, + headers = None, + url = '', + ) + """ + + def testUploadPresignResponse(self): + """Test UploadPresignResponse""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_upload_template_data.py b/test/test_upload_template_data.py deleted file mode 100644 index 73d1bd5..0000000 --- a/test/test_upload_template_data.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.upload_template_data import UploadTemplateData # noqa: E501 -from docspring.rest import ApiException - - -class TestUploadTemplateData(unittest.TestCase): - """UploadTemplateData unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUploadTemplateData(self): - """Test UploadTemplateData""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.upload_template_data.UploadTemplateData() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_upload_template_data_document.py b/test/test_upload_template_data_document.py deleted file mode 100644 index eddd7fd..0000000 --- a/test/test_upload_template_data_document.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.upload_template_data_document import UploadTemplateDataDocument # noqa: E501 -from docspring.rest import ApiException - - -class TestUploadTemplateDataDocument(unittest.TestCase): - """UploadTemplateDataDocument unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUploadTemplateDataDocument(self): - """Test UploadTemplateDataDocument""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.upload_template_data_document.UploadTemplateDataDocument() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_upload_template_data_document_metadata.py b/test/test_upload_template_data_document_metadata.py deleted file mode 100644 index 42b48a5..0000000 --- a/test/test_upload_template_data_document_metadata.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - API v1 - - DocSpring is a service that helps you fill out and sign PDF templates. # noqa: E501 - - OpenAPI spec version: v1 - Generated by: https://openapi-generator.tech -""" - - -from __future__ import absolute_import - -import unittest - -import docspring -from docspring.models.upload_template_data_document_metadata import UploadTemplateDataDocumentMetadata # noqa: E501 -from docspring.rest import ApiException - - -class TestUploadTemplateDataDocumentMetadata(unittest.TestCase): - """UploadTemplateDataDocumentMetadata unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testUploadTemplateDataDocumentMetadata(self): - """Test UploadTemplateDataDocumentMetadata""" - # FIXME: construct object with mandatory attributes with example values - # model = docspring.models.upload_template_data_document_metadata.UploadTemplateDataDocumentMetadata() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/tox.ini b/tox.ini index 3d0be61..067317f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,9 @@ [tox] -envlist = py27, py3 +envlist = py3 [testenv] deps=-r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands= - nosetests \ - [] + pytest --cov=docspring