docspring 3.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. docspring/__init__.py +250 -0
  2. docspring/api/__init__.py +20 -0
  3. docspring/api/client.py +13430 -0
  4. docspring/api_client.py +805 -0
  5. docspring/api_response.py +21 -0
  6. docspring/configuration.py +598 -0
  7. docspring/exceptions.py +217 -0
  8. docspring/models/__init__.py +146 -0
  9. docspring/models/add_fields_data.py +88 -0
  10. docspring/models/batch_generate_pdfs201_response.py +111 -0
  11. docspring/models/combine_pdfs_data.py +98 -0
  12. docspring/models/combined_submission.py +173 -0
  13. docspring/models/combined_submission_action.py +156 -0
  14. docspring/models/copy_template_options.py +92 -0
  15. docspring/models/create_combined_submission_response.py +107 -0
  16. docspring/models/create_custom_file_data.py +89 -0
  17. docspring/models/create_custom_file_response.py +107 -0
  18. docspring/models/create_folder_data.py +88 -0
  19. docspring/models/create_html_template.py +88 -0
  20. docspring/models/create_pdf_submission_data.py +112 -0
  21. docspring/models/create_pdf_template.py +88 -0
  22. docspring/models/create_submission_data_request_data.py +187 -0
  23. docspring/models/create_submission_data_request_event_request.py +134 -0
  24. docspring/models/create_submission_data_request_event_response.py +107 -0
  25. docspring/models/create_submission_data_request_response.py +107 -0
  26. docspring/models/create_submission_data_request_token_response.py +107 -0
  27. docspring/models/create_submission_response.py +107 -0
  28. docspring/models/create_webhook_data.py +88 -0
  29. docspring/models/custom_file.py +100 -0
  30. docspring/models/error_or_multiple_errors_response.py +103 -0
  31. docspring/models/error_response.py +101 -0
  32. docspring/models/folder.py +114 -0
  33. docspring/models/json_schema.py +110 -0
  34. docspring/models/list_submissions_response.py +105 -0
  35. docspring/models/move_folder_data.py +93 -0
  36. docspring/models/move_template_data.py +95 -0
  37. docspring/models/multiple_errors_response.py +101 -0
  38. docspring/models/publish_version_data.py +90 -0
  39. docspring/models/rename_folder_data.py +88 -0
  40. docspring/models/restore_version_data.py +88 -0
  41. docspring/models/submission.py +287 -0
  42. docspring/models/submission422_response.py +109 -0
  43. docspring/models/submission_action.py +148 -0
  44. docspring/models/submission_batch.py +123 -0
  45. docspring/models/submission_batch_data.py +106 -0
  46. docspring/models/submission_batch_with_submissions.py +133 -0
  47. docspring/models/submission_data_request.py +253 -0
  48. docspring/models/submission_data_request_event.py +155 -0
  49. docspring/models/submission_data_request_show.py +260 -0
  50. docspring/models/submission_data_request_token.py +109 -0
  51. docspring/models/submission_preview.py +257 -0
  52. docspring/models/success_error_response.py +101 -0
  53. docspring/models/success_multiple_errors_response.py +101 -0
  54. docspring/models/template.py +402 -0
  55. docspring/models/template_add_fields_response.py +103 -0
  56. docspring/models/template_delete_response.py +110 -0
  57. docspring/models/template_model_code_response.py +103 -0
  58. docspring/models/template_preview.py +356 -0
  59. docspring/models/template_publish_version_response.py +103 -0
  60. docspring/models/update_html_template.py +88 -0
  61. docspring/models/update_pdf_template.py +88 -0
  62. docspring/models/update_submission_data_request_data.py +185 -0
  63. docspring/models/update_webhook_data.py +88 -0
  64. docspring/models/upload_presign_response.py +108 -0
  65. docspring/models/webhook.py +185 -0
  66. docspring/py.typed +0 -0
  67. docspring/rest.py +259 -0
  68. docspring-3.1.0.dist-info/METADATA +245 -0
  69. docspring-3.1.0.dist-info/RECORD +72 -0
  70. docspring-3.1.0.dist-info/WHEEL +5 -0
  71. docspring-3.1.0.dist-info/licenses/LICENSE +7 -0
  72. docspring-3.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,93 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ DocSpring API
5
+
6
+ Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
7
+
8
+ The version of the OpenAPI document: v1
9
+ Contact: support@docspring.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class MoveFolderData(BaseModel):
27
+ """
28
+ MoveFolderData
29
+ """ # noqa: E501
30
+ parent_folder_id: Optional[StrictStr] = None
31
+ __properties: ClassVar[List[str]] = ["parent_folder_id"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of MoveFolderData from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # set to None if parent_folder_id (nullable) is None
73
+ # and model_fields_set contains the field
74
+ if self.parent_folder_id is None and "parent_folder_id" in self.model_fields_set:
75
+ _dict['parent_folder_id'] = None
76
+
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of MoveFolderData from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj, context={"skip_enum_validation": True})
87
+
88
+ _obj = cls.model_validate({
89
+ "parent_folder_id": obj.get("parent_folder_id")
90
+ }, context={"skip_enum_validation": True})
91
+ return _obj
92
+
93
+
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ DocSpring API
5
+
6
+ Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
7
+
8
+ The version of the OpenAPI document: v1
9
+ Contact: support@docspring.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class MoveTemplateData(BaseModel):
27
+ """
28
+ MoveTemplateData
29
+ """ # noqa: E501
30
+ parent_folder_id: Optional[StrictStr]
31
+ version: Optional[StrictStr] = None
32
+ __properties: ClassVar[List[str]] = ["parent_folder_id", "version"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of MoveTemplateData from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ # set to None if parent_folder_id (nullable) is None
74
+ # and model_fields_set contains the field
75
+ if self.parent_folder_id is None and "parent_folder_id" in self.model_fields_set:
76
+ _dict['parent_folder_id'] = None
77
+
78
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
+ """Create an instance of MoveTemplateData from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return cls.model_validate(obj, context={"skip_enum_validation": True})
88
+
89
+ _obj = cls.model_validate({
90
+ "parent_folder_id": obj.get("parent_folder_id"),
91
+ "version": obj.get("version")
92
+ }, context={"skip_enum_validation": True})
93
+ return _obj
94
+
95
+
@@ -0,0 +1,101 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ DocSpring API
5
+
6
+ Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
7
+
8
+ The version of the OpenAPI document: v1
9
+ Contact: support@docspring.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, StrictStr, ValidationInfo, field_validator
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class MultipleErrorsResponse(BaseModel):
27
+ """
28
+ MultipleErrorsResponse
29
+ """ # noqa: E501
30
+ status: StrictStr
31
+ errors: List[StrictStr]
32
+ __properties: ClassVar[List[str]] = ["status", "errors"]
33
+
34
+ @field_validator('status')
35
+ def status_validate_enum(cls, value, info: ValidationInfo):
36
+ """Validates the enum"""
37
+ # from_dict accepts enum values this client doesn't know about yet
38
+ if info.context and info.context.get("skip_enum_validation"):
39
+ return value
40
+
41
+ if value not in set(['error']):
42
+ raise ValueError("must be one of enum values ('error')")
43
+ return value
44
+
45
+ model_config = ConfigDict(
46
+ populate_by_name=True,
47
+ validate_assignment=True,
48
+ protected_namespaces=(),
49
+ )
50
+
51
+
52
+ def to_str(self) -> str:
53
+ """Returns the string representation of the model using alias"""
54
+ return pprint.pformat(self.model_dump(by_alias=True))
55
+
56
+ def to_json(self) -> str:
57
+ """Returns the JSON representation of the model using alias"""
58
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
59
+ return json.dumps(self.to_dict())
60
+
61
+ @classmethod
62
+ def from_json(cls, json_str: str) -> Optional[Self]:
63
+ """Create an instance of MultipleErrorsResponse from a JSON string"""
64
+ return cls.from_dict(json.loads(json_str))
65
+
66
+ def to_dict(self) -> Dict[str, Any]:
67
+ """Return the dictionary representation of the model using alias.
68
+
69
+ This has the following differences from calling pydantic's
70
+ `self.model_dump(by_alias=True)`:
71
+
72
+ * `None` is only added to the output dict for nullable fields that
73
+ were set at model initialization. Other fields with value `None`
74
+ are ignored.
75
+ """
76
+ excluded_fields: Set[str] = set([
77
+ ])
78
+
79
+ _dict = self.model_dump(
80
+ by_alias=True,
81
+ exclude=excluded_fields,
82
+ exclude_none=True,
83
+ )
84
+ return _dict
85
+
86
+ @classmethod
87
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88
+ """Create an instance of MultipleErrorsResponse from a dict"""
89
+ if obj is None:
90
+ return None
91
+
92
+ if not isinstance(obj, dict):
93
+ return cls.model_validate(obj, context={"skip_enum_validation": True})
94
+
95
+ _obj = cls.model_validate({
96
+ "status": obj.get("status"),
97
+ "errors": obj.get("errors")
98
+ }, context={"skip_enum_validation": True})
99
+ return _obj
100
+
101
+
@@ -0,0 +1,90 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ DocSpring API
5
+
6
+ Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
7
+
8
+ The version of the OpenAPI document: v1
9
+ Contact: support@docspring.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class PublishVersionData(BaseModel):
27
+ """
28
+ PublishVersionData
29
+ """ # noqa: E501
30
+ description: Optional[StrictStr] = None
31
+ version_type: StrictStr
32
+ __properties: ClassVar[List[str]] = ["description", "version_type"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of PublishVersionData from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of PublishVersionData from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj, context={"skip_enum_validation": True})
83
+
84
+ _obj = cls.model_validate({
85
+ "description": obj.get("description"),
86
+ "version_type": obj.get("version_type")
87
+ }, context={"skip_enum_validation": True})
88
+ return _obj
89
+
90
+
@@ -0,0 +1,88 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ DocSpring API
5
+
6
+ Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
7
+
8
+ The version of the OpenAPI document: v1
9
+ Contact: support@docspring.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class RenameFolderData(BaseModel):
27
+ """
28
+ RenameFolderData
29
+ """ # noqa: E501
30
+ name: StrictStr
31
+ __properties: ClassVar[List[str]] = ["name"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of RenameFolderData from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of RenameFolderData from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj, context={"skip_enum_validation": True})
82
+
83
+ _obj = cls.model_validate({
84
+ "name": obj.get("name")
85
+ }, context={"skip_enum_validation": True})
86
+ return _obj
87
+
88
+
@@ -0,0 +1,88 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ DocSpring API
5
+
6
+ Use DocSpring's API to programmatically fill out PDF forms, convert HTML to PDFs, merge PDFs, or request legally binding e-signatures.
7
+
8
+ The version of the OpenAPI document: v1
9
+ Contact: support@docspring.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class RestoreVersionData(BaseModel):
27
+ """
28
+ RestoreVersionData
29
+ """ # noqa: E501
30
+ version: StrictStr
31
+ __properties: ClassVar[List[str]] = ["version"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of RestoreVersionData from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of RestoreVersionData from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj, context={"skip_enum_validation": True})
82
+
83
+ _obj = cls.model_validate({
84
+ "version": obj.get("version")
85
+ }, context={"skip_enum_validation": True})
86
+ return _obj
87
+
88
+