signedly 0.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 (74) hide show
  1. signedly/__init__.py +92 -0
  2. signedly/api/__init__.py +14 -0
  3. signedly/api/api_request_logs_api.py +686 -0
  4. signedly/api/authentication_api.py +603 -0
  5. signedly/api/bulk_sending_api.py +858 -0
  6. signedly/api/documents_api.py +2465 -0
  7. signedly/api/downloads_api.py +840 -0
  8. signedly/api/fields_api.py +2308 -0
  9. signedly/api/sending_api.py +890 -0
  10. signedly/api/signatories_api.py +1165 -0
  11. signedly/api/templates_api.py +1452 -0
  12. signedly/api/webhooks_api.py +2582 -0
  13. signedly/api_client.py +798 -0
  14. signedly/api_response.py +21 -0
  15. signedly/configuration.py +596 -0
  16. signedly/exceptions.py +200 -0
  17. signedly/helpers.py +89 -0
  18. signedly/models/__init__.py +66 -0
  19. signedly/models/create_bulk_send202_response.py +105 -0
  20. signedly/models/create_bulk_send_request.py +101 -0
  21. signedly/models/create_document_fields_request_inner.py +156 -0
  22. signedly/models/create_document_from_template200_response.py +101 -0
  23. signedly/models/create_document_from_template_request.py +115 -0
  24. signedly/models/create_document_from_template_request_recipients_inner.py +92 -0
  25. signedly/models/create_signatories_request.py +100 -0
  26. signedly/models/create_signatories_request_signatories_inner.py +92 -0
  27. signedly/models/create_signatory_request.py +94 -0
  28. signedly/models/create_template_fields_request_inner.py +156 -0
  29. signedly/models/create_webhook_endpoint_request.py +103 -0
  30. signedly/models/delete_field_request.py +88 -0
  31. signedly/models/document.py +159 -0
  32. signedly/models/document_page.py +113 -0
  33. signedly/models/document_status_page.py +113 -0
  34. signedly/models/document_status_row.py +90 -0
  35. signedly/models/fill_and_send_document_request.py +116 -0
  36. signedly/models/fill_and_send_document_request_elements_inner.py +96 -0
  37. signedly/models/get_access_token_request.py +90 -0
  38. signedly/models/get_audit_trail_link200_response.py +88 -0
  39. signedly/models/get_download_status200_response.py +90 -0
  40. signedly/models/list_bulk_send_columns200_response_inner.py +92 -0
  41. signedly/models/model_field.py +202 -0
  42. signedly/models/page.py +102 -0
  43. signedly/models/refresh_access_token200_response.py +99 -0
  44. signedly/models/refresh_access_token_request.py +88 -0
  45. signedly/models/request_count_page.py +113 -0
  46. signedly/models/request_hit.py +93 -0
  47. signedly/models/request_log.py +108 -0
  48. signedly/models/request_log_page.py +113 -0
  49. signedly/models/send_document200_response.py +88 -0
  50. signedly/models/send_document_by_link200_response.py +90 -0
  51. signedly/models/send_document_by_link_request.py +91 -0
  52. signedly/models/send_document_request.py +102 -0
  53. signedly/models/signatory.py +119 -0
  54. signedly/models/template.py +124 -0
  55. signedly/models/template_field.py +202 -0
  56. signedly/models/template_page.py +113 -0
  57. signedly/models/update_document_field_by_body_request.py +158 -0
  58. signedly/models/update_document_field_by_body_request_items_inner.py +92 -0
  59. signedly/models/update_webhook_endpoint_request.py +105 -0
  60. signedly/models/upload.py +110 -0
  61. signedly/models/upload_document_for_one_signer200_response.py +90 -0
  62. signedly/models/upload_document_for_one_signer_request.py +96 -0
  63. signedly/models/upload_document_request.py +101 -0
  64. signedly/models/webhook_delivery.py +140 -0
  65. signedly/models/webhook_delivery_page.py +113 -0
  66. signedly/models/webhook_endpoint.py +116 -0
  67. signedly/models/webhook_endpoint_with_secret.py +120 -0
  68. signedly/py.typed +0 -0
  69. signedly/rest.py +258 -0
  70. signedly-0.1.0.dist-info/LICENSE +21 -0
  71. signedly-0.1.0.dist-info/METADATA +18 -0
  72. signedly-0.1.0.dist-info/RECORD +74 -0
  73. signedly-0.1.0.dist-info/WHEEL +5 -0
  74. signedly-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2308 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Signedly API
5
+
6
+ The Signedly REST API lets your system upload documents, add signatories and fields, send them for signing and download the signed result. Every path starts with `/ap1/`, and every request and response body is JSON unless an endpoint says otherwise (the uploads are `multipart/form-data`). ## Authentication 1. In the Signedly web app, open **Account & Settings → API** and generate a **client ID** and **client secret** for your organisation. 2. `POST /ap1/token/` with them. You get an `access_token` (valid **2 hours**) and a `refresh_token` (valid **7 days**). While both are still valid, calling `/ap1/token/` again returns the same pair. 3. Send the access token on every other call: `Authorization: Bearer <access_token>`. 4. When the access token expires, `POST /ap1/refreshtoken/` with the refresh token for a new access token. When the refresh token has expired too, call `/ap1/token/` again. `/ap1/token/` and `/ap1/refreshtoken/` allow 60 calls a minute per IP address; more answer 429. A missing, unknown or expired access token answers 403 (`\"Client not found\"` or `\"Access token expired\"`). The API acts for your **organisation's admin account**: documents you upload belong to it and appear in its Signedly web app, and you can reach only that account's documents, templates, signatories and fields. Another organisation's IDs answer 404, as if they didn't exist. ## Plans What the API allows depends on the Signedly plan of your **organisation's admin account** (Account & Settings → Account & Plan). The same rules apply to live and test keys. | What | Free | Personal Pro | Business Pro | Teams | |---|---|---|---|---| | Generate live and test keys (Account & Settings → API) | – | ✓ | ✓ | ✓ | | Every endpoint, `/ap1/token/` and `/ap1/refreshtoken/` included | – | ✓ | ✓ | ✓ | | `require_email_otp` on `POST /ap1/signatories/` and `POST /ap1/signatories/bulk/` | – | ✓ | ✓ | ✓ | | Bulk send: `GET /ap1/bulk-sends/columns/` and `POST /ap1/bulk-sends/` | – | – | – | ✓ | The API is part of the paid plans. On Free (or with no plan) every call answers 403 `\"... Your plan doesn't include API access.\"`, with live or test keys, also with a token or keys made earlier; they work again once the plan is paid. On a paid plan, a feature it doesn't include answers 400 with `\"Your plan doesn't include ...\"` and changes nothing, and `GET /ap1/bulk-sends/{id}/` still reports bulk sends already made. Live documents also need an API contract with Signedly. Without one, or with an unpaid API invoice, `POST /ap1/upload/` (except templates), `/ap1/upload_app/`, `/ap1/documents/fromtemplate/` and `/ap1/bulk-sends/` answer 402 with live keys. Test keys work without a contract (see Sandbox). ## Sending a document for signing 1. `POST /ap1/upload/` a PDF or DOCX (`type` 2). The document is prepared in the background: find it in `GET /ap1/documents/?name=<name>` (its `upload.id` is the upload's `id`), and wait until `GET /ap1/documents/{id}/pages/` lists its pages. 2. `POST /ap1/signatories/` (one) or `POST /ap1/signatories/bulk/` (several) to add the people who sign. 3. `POST /ap1/documents/fields/` to place the fields each signatory fills in. 4. Send it: - `POST /ap1/document/send/` emails every signatory a signing link (with ordered signing, only the first; each next one is emailed in turn), or - `POST /ap1/document/send_url/` sends no email and returns the first signatory's signing link, for you to show or send yourself. 5. Poll `GET /ap1/documents-status-list/` (or `GET /ap1/documents/`) until the status is 6 (Completed), then `GET /ap1/document/download-link/` for the signed PDF and `GET /ap1/document/download-audit-link/` for its audit trail. **From a template:** upload with `type` 4 and a `template_name` (or make the template in the web app), place its fields with `POST /ap1/templates/fields/`, then for each signing make a document with `POST /ap1/documents/fromtemplate/`, add its signatory, and send it. **One signer, one call:** `POST /ap1/upload_app/` uploads a PDF or DOCX for one signer and returns their signing link in `redirect_url`; the signer places their own signature. After signing they go to the `redirect_url` you sent, and the signed PDF and its audit trail are emailed to `final_email` (otherwise to your organisation's admin). ## Quick start with curl Each step uses an ID from the step before. `$API` is this server, e.g. `https://l0ads.signedly.com`. ```bash # 1. Token curl -X POST $API/ap1/token/ -H 'Content-Type: application/json' \\ -d '{\"client_id\": \"<client id>\", \"client_secret\": \"<client secret>\"}' TOKEN=<access_token from the answer> # 2. Upload a PDF (answers with the upload's id) curl -X POST $API/ap1/upload/ -H \"Authorization: Bearer $TOKEN\" \\ -F file=@nda.pdf -F name=nda-ann-lee -F type=2 # 3. Find the document, then wait until it has pages curl \"$API/ap1/documents/?name=nda-ann-lee\" -H \"Authorization: Bearer $TOKEN\" DOC=<results[0].id> curl $API/ap1/documents/$DOC/pages/ -H \"Authorization: Bearer $TOKEN\" PAGE=<[0].id> # 4. Add the signatory curl -X POST $API/ap1/signatories/ -H \"Authorization: Bearer $TOKEN\" \\ -H 'Content-Type: application/json' \\ -d '{\"document_id\": \"'$DOC'\", \"name\": \"Ann Lee\", \"email\": \"ann@example.com\"}' SIGNER=<id from the answer> # 5. Place her signature: 150 × 40 points, 72 points from the left, 640 from the top curl -X POST $API/ap1/documents/fields/ -H \"Authorization: Bearer $TOKEN\" \\ -H 'Content-Type: application/json' \\ -d '[{\"document_id\": \"'$DOC'\", \"signatory_id\": \"'$SIGNER'\", \"kind\": 2, \"label\": \"Signature\", \"placeholder\": \"Sign here\", \"page\": \"'$PAGE'\", \"page_number\": 0, \"x\": 72, \"y\": 640, \"width\": 150, \"height\": 40}]' # 6. Send it (Ann gets the signing email) curl -X POST $API/ap1/document/send/ -H \"Authorization: Bearer $TOKEN\" \\ -H 'Content-Type: application/json' \\ -d '{\"document_id\": \"'$DOC'\", \"subject\": \"Please sign the NDA\", \"message\": \"Hi Ann, please sign by Friday.\", \"expiry_date\": \"2026-12-31\"}' # 7. Poll until status is 6 (Completed), then get the signed PDF curl \"$API/ap1/documents-status-list/?document_ids=$DOC\" -H \"Authorization: Bearer $TOKEN\" curl \"$API/ap1/document/download-link/?id=$DOC\" -H \"Authorization: Bearer $TOKEN\" ``` ## Postman Import the whole API into Postman with **Import → Link** and `<this server>/swaggerap1/postman.json`. Set `client_id` and `client_secret` in the collection's **Variables**, run **Get an access token** (it saves the token for every other request), and set `document_id` when a request needs one. ## Webhooks Instead of polling, add an endpoint with `POST /ap1/webhooks/` (or in **Account & Settings → API**) and Signedly posts your organisation's document events to it: `document.sent`, `document.viewed`, `document.signed`, `document.approved`, `document.completed`, `document.rejected` and `document.expired` (all of them, or the `events` you choose). Each is a JSON `POST`: ```json {\"id\": \"5b7f…\", \"type\": \"document.signed\", \"created_at\": \"2026-10-27T09:12:00+00:00\", \"test\": false, \"data\": {\"document\": {\"id\": \"6f0c…\", \"name\": \"nda.pdf\", \"status\": 5}, \"recipient\": {\"id\": \"0b6e…\", \"email\": \"ann@example.com\", \"name\": \"Ann Lee\", \"role\": \"signer\"}}} ``` `recipient` is null for events no recipient caused (sent, completed, expired); `test` is true for documents made with your test keys. Fetch anything else, such as download links, with your access token: events never carry links. **Check every event is from Signedly.** The `Signedly-Signature` header is `t=<unix seconds>,v1=<signature>`, where the signature is the hex HMAC-SHA256 of `<t>.<raw body>` with the endpoint's secret. Refuse an event whose signature doesn't match or whose `t` is more than 5 minutes off: ```python import hashlib, hmac, time def is_from_signedly(secret, header, raw_body): parts = dict(item.split(\"=\", 1) for item in header.split(\",\")) signed = f\"{parts['t']}.{raw_body.decode()}\".encode() expected = hmac.new(secret.encode(), signed, hashlib.sha256).hexdigest() fresh = abs(time.time() - int(parts[\"t\"])) <= 300 return fresh and hmac.compare_digest(parts[\"v1\"], expected) ``` **Answer 2xx within 10 seconds**, then do the work. Anything else is retried after 1 and 5 minutes, then 30 minutes and 2, 5 and 10 hours (7 tries in about 18 hours). `Signedly-Event-Id` is the same on every try of an event: use it to ignore repeats. After 20 events in a row fail for good, Signedly switches the endpoint off and emails your organisation's admin; switch it on again with `PUT /ap1/webhooks/{id}/` and `\"is_active\": true`. Each endpoint's deliveries and their last answers are at `GET /ap1/webhooks/{id}/deliveries/`, and any can be sent again. ## Sandbox Build and test against the API without paying for documents: in **Account & Settings → API**, generate your **test keys**, and get a token with them at `/ap1/token/` as usual. Everything works the same, except that what you upload or make from a template with a test token is a **test document** (`is_test` on its upload): - every page of its PDF and of its audit trail says **TEST – NOT LEGALLY BINDING**; - its emails are real, with `[TEST]` at the start of the subject; - it isn't billed or counted toward your plan; - your organisation can make 50 a calendar month (templates don't count); the next upload answers 429. ## Fields Positions and sizes are in **PDF points** (1/72 inch), measured from the **top-left corner** of the page as it is displayed (rotation applied). `page_number` counts pages from 0. A field must sit wholly on its page (1 point of tolerance); otherwise it is refused with 400. A field's page and signatory can't be changed later: delete the field and add it again. ## Status values **Document `status`:** 1 Draft · 2 Signees Added · 3 Prepared · 4 Sent · 5 In Progress · 6 Completed · 7 Rejected · 8 Archived · 9 Expired. Signatories, fields and sends are only accepted while a document is 1–3 (not yet sent). **Signatory `status`:** 1 Waiting · 2 Invited · 3 Signed · 4 Viewed · 5 Rejected. ## Lists `GET /ap1/documents/`, `/ap1/documents-status-list/`, `/ap1/templates/`, `/ap1/logs/` and `/ap1/logs/hits/` are paged: pass `limit` (default 10) and `offset`, and read `count`, `next`, `previous` and `results` from the response. ## Errors | Status | Meaning | |---|---| | 400 | The request was refused, also when your plan doesn't include it (see Plans); the body says why (`{\"error\": \"...\"}`, or the name of each bad field with its messages). Nothing was changed. | | 403 | The access token is missing, unknown or expired; the client ID and secret or the refresh token were refused; the organisation's plan has no API access (Free, see Plans); or an `expiry_date` isn't in the future (`\"Invalid Date Entered\"`). | | 402 | No API contract, or an unpaid API invoice: live documents are refused (test keys keep working). | | 404 | The document, template, signatory or field doesn't exist or isn't yours. | | 429 | Too many token requests (wait a minute), or this month's 50 test documents are used. | | 5xx | Our side failed; retry later. | A send that times out may still have worked: check the document's status before sending again (a second send of a sent document answers 400). Download, view and audit links are valid for about 7 days; ask for a new one whenever you need it.
7
+
8
+ The version of the OpenAPI document: v1
9
+ Contact: info@signedly.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+ import warnings
16
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
17
+ from typing import Any, Dict, List, Optional, Tuple, Union
18
+ from typing_extensions import Annotated
19
+
20
+ from pydantic import Field, StrictStr
21
+ from typing import List
22
+ from typing_extensions import Annotated
23
+ from signedly.models.create_document_fields_request_inner import CreateDocumentFieldsRequestInner
24
+ from signedly.models.create_template_fields_request_inner import CreateTemplateFieldsRequestInner
25
+ from signedly.models.delete_field_request import DeleteFieldRequest
26
+ from signedly.models.model_field import ModelField
27
+ from signedly.models.send_document200_response import SendDocument200Response
28
+ from signedly.models.template_field import TemplateField
29
+ from signedly.models.update_document_field_by_body_request import UpdateDocumentFieldByBodyRequest
30
+
31
+ from signedly.api_client import ApiClient, RequestSerialized
32
+ from signedly.api_response import ApiResponse
33
+ from signedly.rest import RESTResponseType
34
+
35
+
36
+ class FieldsApi:
37
+ """NOTE: This class is auto generated by OpenAPI Generator
38
+ Ref: https://openapi-generator.tech
39
+
40
+ Do not edit the class manually.
41
+ """
42
+
43
+ def __init__(self, api_client=None) -> None:
44
+ if api_client is None:
45
+ api_client = ApiClient.get_default()
46
+ self.api_client = api_client
47
+
48
+
49
+ @validate_call
50
+ def create_document_fields(
51
+ self,
52
+ data: List[CreateDocumentFieldsRequestInner],
53
+ _request_timeout: Union[
54
+ None,
55
+ Annotated[StrictFloat, Field(gt=0)],
56
+ Tuple[
57
+ Annotated[StrictFloat, Field(gt=0)],
58
+ Annotated[StrictFloat, Field(gt=0)]
59
+ ]
60
+ ] = None,
61
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
62
+ _content_type: Optional[StrictStr] = None,
63
+ _headers: Optional[Dict[StrictStr, Any]] = None,
64
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
65
+ ) -> List[ModelField]:
66
+ """Add fields to a document
67
+
68
+ Places fields on a document, each assigned to a signatory. Only while the document isn't sent yet (status 1 Draft, 2 Signees Added or 3 Prepared). A field must sit wholly on its page (1 point of tolerance). For a template, use POST /ap1/templates/fields/.
69
+
70
+ :param data: (required)
71
+ :type data: List[CreateDocumentFieldsRequestInner]
72
+ :param _request_timeout: timeout setting for this request. If one
73
+ number provided, it will be total request
74
+ timeout. It can also be a pair (tuple) of
75
+ (connection, read) timeouts.
76
+ :type _request_timeout: int, tuple(int, int), optional
77
+ :param _request_auth: set to override the auth_settings for an a single
78
+ request; this effectively ignores the
79
+ authentication in the spec for a single request.
80
+ :type _request_auth: dict, optional
81
+ :param _content_type: force content-type for the request.
82
+ :type _content_type: str, Optional
83
+ :param _headers: set to override the headers for a single
84
+ request; this effectively ignores the headers
85
+ in the spec for a single request.
86
+ :type _headers: dict, optional
87
+ :param _host_index: set to override the host_index for a single
88
+ request; this effectively ignores the host_index
89
+ in the spec for a single request.
90
+ :type _host_index: int, optional
91
+ :return: Returns the result object.
92
+ """ # noqa: E501
93
+
94
+ _param = self._create_document_fields_serialize(
95
+ data=data,
96
+ _request_auth=_request_auth,
97
+ _content_type=_content_type,
98
+ _headers=_headers,
99
+ _host_index=_host_index
100
+ )
101
+
102
+ _response_types_map: Dict[str, Optional[str]] = {
103
+ '201': "List[ModelField]",
104
+ '400': "Dict[str, object]",
105
+ '404': "Dict[str, object]",
106
+ }
107
+ response_data = self.api_client.call_api(
108
+ *_param,
109
+ _request_timeout=_request_timeout
110
+ )
111
+ response_data.read()
112
+ return self.api_client.response_deserialize(
113
+ response_data=response_data,
114
+ response_types_map=_response_types_map,
115
+ ).data
116
+
117
+
118
+ @validate_call
119
+ def create_document_fields_with_http_info(
120
+ self,
121
+ data: List[CreateDocumentFieldsRequestInner],
122
+ _request_timeout: Union[
123
+ None,
124
+ Annotated[StrictFloat, Field(gt=0)],
125
+ Tuple[
126
+ Annotated[StrictFloat, Field(gt=0)],
127
+ Annotated[StrictFloat, Field(gt=0)]
128
+ ]
129
+ ] = None,
130
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
131
+ _content_type: Optional[StrictStr] = None,
132
+ _headers: Optional[Dict[StrictStr, Any]] = None,
133
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
134
+ ) -> ApiResponse[List[ModelField]]:
135
+ """Add fields to a document
136
+
137
+ Places fields on a document, each assigned to a signatory. Only while the document isn't sent yet (status 1 Draft, 2 Signees Added or 3 Prepared). A field must sit wholly on its page (1 point of tolerance). For a template, use POST /ap1/templates/fields/.
138
+
139
+ :param data: (required)
140
+ :type data: List[CreateDocumentFieldsRequestInner]
141
+ :param _request_timeout: timeout setting for this request. If one
142
+ number provided, it will be total request
143
+ timeout. It can also be a pair (tuple) of
144
+ (connection, read) timeouts.
145
+ :type _request_timeout: int, tuple(int, int), optional
146
+ :param _request_auth: set to override the auth_settings for an a single
147
+ request; this effectively ignores the
148
+ authentication in the spec for a single request.
149
+ :type _request_auth: dict, optional
150
+ :param _content_type: force content-type for the request.
151
+ :type _content_type: str, Optional
152
+ :param _headers: set to override the headers for a single
153
+ request; this effectively ignores the headers
154
+ in the spec for a single request.
155
+ :type _headers: dict, optional
156
+ :param _host_index: set to override the host_index for a single
157
+ request; this effectively ignores the host_index
158
+ in the spec for a single request.
159
+ :type _host_index: int, optional
160
+ :return: Returns the result object.
161
+ """ # noqa: E501
162
+
163
+ _param = self._create_document_fields_serialize(
164
+ data=data,
165
+ _request_auth=_request_auth,
166
+ _content_type=_content_type,
167
+ _headers=_headers,
168
+ _host_index=_host_index
169
+ )
170
+
171
+ _response_types_map: Dict[str, Optional[str]] = {
172
+ '201': "List[ModelField]",
173
+ '400': "Dict[str, object]",
174
+ '404': "Dict[str, object]",
175
+ }
176
+ response_data = self.api_client.call_api(
177
+ *_param,
178
+ _request_timeout=_request_timeout
179
+ )
180
+ response_data.read()
181
+ return self.api_client.response_deserialize(
182
+ response_data=response_data,
183
+ response_types_map=_response_types_map,
184
+ )
185
+
186
+
187
+ @validate_call
188
+ def create_document_fields_without_preload_content(
189
+ self,
190
+ data: List[CreateDocumentFieldsRequestInner],
191
+ _request_timeout: Union[
192
+ None,
193
+ Annotated[StrictFloat, Field(gt=0)],
194
+ Tuple[
195
+ Annotated[StrictFloat, Field(gt=0)],
196
+ Annotated[StrictFloat, Field(gt=0)]
197
+ ]
198
+ ] = None,
199
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
200
+ _content_type: Optional[StrictStr] = None,
201
+ _headers: Optional[Dict[StrictStr, Any]] = None,
202
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
203
+ ) -> RESTResponseType:
204
+ """Add fields to a document
205
+
206
+ Places fields on a document, each assigned to a signatory. Only while the document isn't sent yet (status 1 Draft, 2 Signees Added or 3 Prepared). A field must sit wholly on its page (1 point of tolerance). For a template, use POST /ap1/templates/fields/.
207
+
208
+ :param data: (required)
209
+ :type data: List[CreateDocumentFieldsRequestInner]
210
+ :param _request_timeout: timeout setting for this request. If one
211
+ number provided, it will be total request
212
+ timeout. It can also be a pair (tuple) of
213
+ (connection, read) timeouts.
214
+ :type _request_timeout: int, tuple(int, int), optional
215
+ :param _request_auth: set to override the auth_settings for an a single
216
+ request; this effectively ignores the
217
+ authentication in the spec for a single request.
218
+ :type _request_auth: dict, optional
219
+ :param _content_type: force content-type for the request.
220
+ :type _content_type: str, Optional
221
+ :param _headers: set to override the headers for a single
222
+ request; this effectively ignores the headers
223
+ in the spec for a single request.
224
+ :type _headers: dict, optional
225
+ :param _host_index: set to override the host_index for a single
226
+ request; this effectively ignores the host_index
227
+ in the spec for a single request.
228
+ :type _host_index: int, optional
229
+ :return: Returns the result object.
230
+ """ # noqa: E501
231
+
232
+ _param = self._create_document_fields_serialize(
233
+ data=data,
234
+ _request_auth=_request_auth,
235
+ _content_type=_content_type,
236
+ _headers=_headers,
237
+ _host_index=_host_index
238
+ )
239
+
240
+ _response_types_map: Dict[str, Optional[str]] = {
241
+ '201': "List[ModelField]",
242
+ '400': "Dict[str, object]",
243
+ '404': "Dict[str, object]",
244
+ }
245
+ response_data = self.api_client.call_api(
246
+ *_param,
247
+ _request_timeout=_request_timeout
248
+ )
249
+ return response_data.response
250
+
251
+
252
+ def _create_document_fields_serialize(
253
+ self,
254
+ data,
255
+ _request_auth,
256
+ _content_type,
257
+ _headers,
258
+ _host_index,
259
+ ) -> RequestSerialized:
260
+
261
+ _host = None
262
+
263
+ _collection_formats: Dict[str, str] = {
264
+ 'data': '',
265
+ }
266
+
267
+ _path_params: Dict[str, str] = {}
268
+ _query_params: List[Tuple[str, str]] = []
269
+ _header_params: Dict[str, Optional[str]] = _headers or {}
270
+ _form_params: List[Tuple[str, str]] = []
271
+ _files: Dict[
272
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
273
+ ] = {}
274
+ _body_params: Optional[bytes] = None
275
+
276
+ # process the path parameters
277
+ # process the query parameters
278
+ # process the header parameters
279
+ # process the form parameters
280
+ # process the body parameter
281
+ if data is not None:
282
+ _body_params = data
283
+
284
+
285
+ # set the HTTP header `Accept`
286
+ if 'Accept' not in _header_params:
287
+ _header_params['Accept'] = self.api_client.select_header_accept(
288
+ [
289
+ 'application/json'
290
+ ]
291
+ )
292
+
293
+ # set the HTTP header `Content-Type`
294
+ if _content_type:
295
+ _header_params['Content-Type'] = _content_type
296
+ else:
297
+ _default_content_type = (
298
+ self.api_client.select_header_content_type(
299
+ [
300
+ 'application/json'
301
+ ]
302
+ )
303
+ )
304
+ if _default_content_type is not None:
305
+ _header_params['Content-Type'] = _default_content_type
306
+
307
+ # authentication setting
308
+ _auth_settings: List[str] = [
309
+ 'Bearer'
310
+ ]
311
+
312
+ return self.api_client.param_serialize(
313
+ method='POST',
314
+ resource_path='/ap1/documents/fields/',
315
+ path_params=_path_params,
316
+ query_params=_query_params,
317
+ header_params=_header_params,
318
+ body=_body_params,
319
+ post_params=_form_params,
320
+ files=_files,
321
+ auth_settings=_auth_settings,
322
+ collection_formats=_collection_formats,
323
+ _host=_host,
324
+ _request_auth=_request_auth
325
+ )
326
+
327
+
328
+
329
+
330
+ @validate_call
331
+ def create_template_fields(
332
+ self,
333
+ data: List[CreateTemplateFieldsRequestInner],
334
+ _request_timeout: Union[
335
+ None,
336
+ Annotated[StrictFloat, Field(gt=0)],
337
+ Tuple[
338
+ Annotated[StrictFloat, Field(gt=0)],
339
+ Annotated[StrictFloat, Field(gt=0)]
340
+ ]
341
+ ] = None,
342
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
343
+ _content_type: Optional[StrictStr] = None,
344
+ _headers: Optional[Dict[StrictStr, Any]] = None,
345
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
346
+ ) -> List[TemplateField]:
347
+ """Add fields to a template
348
+
349
+ Places fields on a template. They have no signatory yet: on a document made from the template, they go to its first signatory. A field must sit wholly on its page (1 point of tolerance).
350
+
351
+ :param data: (required)
352
+ :type data: List[CreateTemplateFieldsRequestInner]
353
+ :param _request_timeout: timeout setting for this request. If one
354
+ number provided, it will be total request
355
+ timeout. It can also be a pair (tuple) of
356
+ (connection, read) timeouts.
357
+ :type _request_timeout: int, tuple(int, int), optional
358
+ :param _request_auth: set to override the auth_settings for an a single
359
+ request; this effectively ignores the
360
+ authentication in the spec for a single request.
361
+ :type _request_auth: dict, optional
362
+ :param _content_type: force content-type for the request.
363
+ :type _content_type: str, Optional
364
+ :param _headers: set to override the headers for a single
365
+ request; this effectively ignores the headers
366
+ in the spec for a single request.
367
+ :type _headers: dict, optional
368
+ :param _host_index: set to override the host_index for a single
369
+ request; this effectively ignores the host_index
370
+ in the spec for a single request.
371
+ :type _host_index: int, optional
372
+ :return: Returns the result object.
373
+ """ # noqa: E501
374
+
375
+ _param = self._create_template_fields_serialize(
376
+ data=data,
377
+ _request_auth=_request_auth,
378
+ _content_type=_content_type,
379
+ _headers=_headers,
380
+ _host_index=_host_index
381
+ )
382
+
383
+ _response_types_map: Dict[str, Optional[str]] = {
384
+ '201': "List[TemplateField]",
385
+ '400': "Dict[str, object]",
386
+ '404': "Dict[str, object]",
387
+ }
388
+ response_data = self.api_client.call_api(
389
+ *_param,
390
+ _request_timeout=_request_timeout
391
+ )
392
+ response_data.read()
393
+ return self.api_client.response_deserialize(
394
+ response_data=response_data,
395
+ response_types_map=_response_types_map,
396
+ ).data
397
+
398
+
399
+ @validate_call
400
+ def create_template_fields_with_http_info(
401
+ self,
402
+ data: List[CreateTemplateFieldsRequestInner],
403
+ _request_timeout: Union[
404
+ None,
405
+ Annotated[StrictFloat, Field(gt=0)],
406
+ Tuple[
407
+ Annotated[StrictFloat, Field(gt=0)],
408
+ Annotated[StrictFloat, Field(gt=0)]
409
+ ]
410
+ ] = None,
411
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
412
+ _content_type: Optional[StrictStr] = None,
413
+ _headers: Optional[Dict[StrictStr, Any]] = None,
414
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
415
+ ) -> ApiResponse[List[TemplateField]]:
416
+ """Add fields to a template
417
+
418
+ Places fields on a template. They have no signatory yet: on a document made from the template, they go to its first signatory. A field must sit wholly on its page (1 point of tolerance).
419
+
420
+ :param data: (required)
421
+ :type data: List[CreateTemplateFieldsRequestInner]
422
+ :param _request_timeout: timeout setting for this request. If one
423
+ number provided, it will be total request
424
+ timeout. It can also be a pair (tuple) of
425
+ (connection, read) timeouts.
426
+ :type _request_timeout: int, tuple(int, int), optional
427
+ :param _request_auth: set to override the auth_settings for an a single
428
+ request; this effectively ignores the
429
+ authentication in the spec for a single request.
430
+ :type _request_auth: dict, optional
431
+ :param _content_type: force content-type for the request.
432
+ :type _content_type: str, Optional
433
+ :param _headers: set to override the headers for a single
434
+ request; this effectively ignores the headers
435
+ in the spec for a single request.
436
+ :type _headers: dict, optional
437
+ :param _host_index: set to override the host_index for a single
438
+ request; this effectively ignores the host_index
439
+ in the spec for a single request.
440
+ :type _host_index: int, optional
441
+ :return: Returns the result object.
442
+ """ # noqa: E501
443
+
444
+ _param = self._create_template_fields_serialize(
445
+ data=data,
446
+ _request_auth=_request_auth,
447
+ _content_type=_content_type,
448
+ _headers=_headers,
449
+ _host_index=_host_index
450
+ )
451
+
452
+ _response_types_map: Dict[str, Optional[str]] = {
453
+ '201': "List[TemplateField]",
454
+ '400': "Dict[str, object]",
455
+ '404': "Dict[str, object]",
456
+ }
457
+ response_data = self.api_client.call_api(
458
+ *_param,
459
+ _request_timeout=_request_timeout
460
+ )
461
+ response_data.read()
462
+ return self.api_client.response_deserialize(
463
+ response_data=response_data,
464
+ response_types_map=_response_types_map,
465
+ )
466
+
467
+
468
+ @validate_call
469
+ def create_template_fields_without_preload_content(
470
+ self,
471
+ data: List[CreateTemplateFieldsRequestInner],
472
+ _request_timeout: Union[
473
+ None,
474
+ Annotated[StrictFloat, Field(gt=0)],
475
+ Tuple[
476
+ Annotated[StrictFloat, Field(gt=0)],
477
+ Annotated[StrictFloat, Field(gt=0)]
478
+ ]
479
+ ] = None,
480
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
481
+ _content_type: Optional[StrictStr] = None,
482
+ _headers: Optional[Dict[StrictStr, Any]] = None,
483
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
484
+ ) -> RESTResponseType:
485
+ """Add fields to a template
486
+
487
+ Places fields on a template. They have no signatory yet: on a document made from the template, they go to its first signatory. A field must sit wholly on its page (1 point of tolerance).
488
+
489
+ :param data: (required)
490
+ :type data: List[CreateTemplateFieldsRequestInner]
491
+ :param _request_timeout: timeout setting for this request. If one
492
+ number provided, it will be total request
493
+ timeout. It can also be a pair (tuple) of
494
+ (connection, read) timeouts.
495
+ :type _request_timeout: int, tuple(int, int), optional
496
+ :param _request_auth: set to override the auth_settings for an a single
497
+ request; this effectively ignores the
498
+ authentication in the spec for a single request.
499
+ :type _request_auth: dict, optional
500
+ :param _content_type: force content-type for the request.
501
+ :type _content_type: str, Optional
502
+ :param _headers: set to override the headers for a single
503
+ request; this effectively ignores the headers
504
+ in the spec for a single request.
505
+ :type _headers: dict, optional
506
+ :param _host_index: set to override the host_index for a single
507
+ request; this effectively ignores the host_index
508
+ in the spec for a single request.
509
+ :type _host_index: int, optional
510
+ :return: Returns the result object.
511
+ """ # noqa: E501
512
+
513
+ _param = self._create_template_fields_serialize(
514
+ data=data,
515
+ _request_auth=_request_auth,
516
+ _content_type=_content_type,
517
+ _headers=_headers,
518
+ _host_index=_host_index
519
+ )
520
+
521
+ _response_types_map: Dict[str, Optional[str]] = {
522
+ '201': "List[TemplateField]",
523
+ '400': "Dict[str, object]",
524
+ '404': "Dict[str, object]",
525
+ }
526
+ response_data = self.api_client.call_api(
527
+ *_param,
528
+ _request_timeout=_request_timeout
529
+ )
530
+ return response_data.response
531
+
532
+
533
+ def _create_template_fields_serialize(
534
+ self,
535
+ data,
536
+ _request_auth,
537
+ _content_type,
538
+ _headers,
539
+ _host_index,
540
+ ) -> RequestSerialized:
541
+
542
+ _host = None
543
+
544
+ _collection_formats: Dict[str, str] = {
545
+ 'data': '',
546
+ }
547
+
548
+ _path_params: Dict[str, str] = {}
549
+ _query_params: List[Tuple[str, str]] = []
550
+ _header_params: Dict[str, Optional[str]] = _headers or {}
551
+ _form_params: List[Tuple[str, str]] = []
552
+ _files: Dict[
553
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
554
+ ] = {}
555
+ _body_params: Optional[bytes] = None
556
+
557
+ # process the path parameters
558
+ # process the query parameters
559
+ # process the header parameters
560
+ # process the form parameters
561
+ # process the body parameter
562
+ if data is not None:
563
+ _body_params = data
564
+
565
+
566
+ # set the HTTP header `Accept`
567
+ if 'Accept' not in _header_params:
568
+ _header_params['Accept'] = self.api_client.select_header_accept(
569
+ [
570
+ 'application/json'
571
+ ]
572
+ )
573
+
574
+ # set the HTTP header `Content-Type`
575
+ if _content_type:
576
+ _header_params['Content-Type'] = _content_type
577
+ else:
578
+ _default_content_type = (
579
+ self.api_client.select_header_content_type(
580
+ [
581
+ 'application/json'
582
+ ]
583
+ )
584
+ )
585
+ if _default_content_type is not None:
586
+ _header_params['Content-Type'] = _default_content_type
587
+
588
+ # authentication setting
589
+ _auth_settings: List[str] = [
590
+ 'Bearer'
591
+ ]
592
+
593
+ return self.api_client.param_serialize(
594
+ method='POST',
595
+ resource_path='/ap1/templates/fields/',
596
+ path_params=_path_params,
597
+ query_params=_query_params,
598
+ header_params=_header_params,
599
+ body=_body_params,
600
+ post_params=_form_params,
601
+ files=_files,
602
+ auth_settings=_auth_settings,
603
+ collection_formats=_collection_formats,
604
+ _host=_host,
605
+ _request_auth=_request_auth
606
+ )
607
+
608
+
609
+
610
+
611
+ @validate_call
612
+ def delete_field(
613
+ self,
614
+ id: Annotated[StrictStr, Field(description="The field's ID.")],
615
+ data: DeleteFieldRequest,
616
+ _request_timeout: Union[
617
+ None,
618
+ Annotated[StrictFloat, Field(gt=0)],
619
+ Tuple[
620
+ Annotated[StrictFloat, Field(gt=0)],
621
+ Annotated[StrictFloat, Field(gt=0)]
622
+ ]
623
+ ] = None,
624
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
625
+ _content_type: Optional[StrictStr] = None,
626
+ _headers: Optional[Dict[StrictStr, Any]] = None,
627
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
628
+ ) -> SendDocument200Response:
629
+ """Delete a field
630
+
631
+ Deletes a field of a template, or of a document that isn't sent yet. The document's or template's ID goes in the JSON body.
632
+
633
+ :param id: The field's ID. (required)
634
+ :type id: str
635
+ :param data: (required)
636
+ :type data: DeleteFieldRequest
637
+ :param _request_timeout: timeout setting for this request. If one
638
+ number provided, it will be total request
639
+ timeout. It can also be a pair (tuple) of
640
+ (connection, read) timeouts.
641
+ :type _request_timeout: int, tuple(int, int), optional
642
+ :param _request_auth: set to override the auth_settings for an a single
643
+ request; this effectively ignores the
644
+ authentication in the spec for a single request.
645
+ :type _request_auth: dict, optional
646
+ :param _content_type: force content-type for the request.
647
+ :type _content_type: str, Optional
648
+ :param _headers: set to override the headers for a single
649
+ request; this effectively ignores the headers
650
+ in the spec for a single request.
651
+ :type _headers: dict, optional
652
+ :param _host_index: set to override the host_index for a single
653
+ request; this effectively ignores the host_index
654
+ in the spec for a single request.
655
+ :type _host_index: int, optional
656
+ :return: Returns the result object.
657
+ """ # noqa: E501
658
+
659
+ _param = self._delete_field_serialize(
660
+ id=id,
661
+ data=data,
662
+ _request_auth=_request_auth,
663
+ _content_type=_content_type,
664
+ _headers=_headers,
665
+ _host_index=_host_index
666
+ )
667
+
668
+ _response_types_map: Dict[str, Optional[str]] = {
669
+ '204': "SendDocument200Response",
670
+ '400': "Dict[str, object]",
671
+ '404': "Dict[str, object]",
672
+ }
673
+ response_data = self.api_client.call_api(
674
+ *_param,
675
+ _request_timeout=_request_timeout
676
+ )
677
+ response_data.read()
678
+ return self.api_client.response_deserialize(
679
+ response_data=response_data,
680
+ response_types_map=_response_types_map,
681
+ ).data
682
+
683
+
684
+ @validate_call
685
+ def delete_field_with_http_info(
686
+ self,
687
+ id: Annotated[StrictStr, Field(description="The field's ID.")],
688
+ data: DeleteFieldRequest,
689
+ _request_timeout: Union[
690
+ None,
691
+ Annotated[StrictFloat, Field(gt=0)],
692
+ Tuple[
693
+ Annotated[StrictFloat, Field(gt=0)],
694
+ Annotated[StrictFloat, Field(gt=0)]
695
+ ]
696
+ ] = None,
697
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
698
+ _content_type: Optional[StrictStr] = None,
699
+ _headers: Optional[Dict[StrictStr, Any]] = None,
700
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
701
+ ) -> ApiResponse[SendDocument200Response]:
702
+ """Delete a field
703
+
704
+ Deletes a field of a template, or of a document that isn't sent yet. The document's or template's ID goes in the JSON body.
705
+
706
+ :param id: The field's ID. (required)
707
+ :type id: str
708
+ :param data: (required)
709
+ :type data: DeleteFieldRequest
710
+ :param _request_timeout: timeout setting for this request. If one
711
+ number provided, it will be total request
712
+ timeout. It can also be a pair (tuple) of
713
+ (connection, read) timeouts.
714
+ :type _request_timeout: int, tuple(int, int), optional
715
+ :param _request_auth: set to override the auth_settings for an a single
716
+ request; this effectively ignores the
717
+ authentication in the spec for a single request.
718
+ :type _request_auth: dict, optional
719
+ :param _content_type: force content-type for the request.
720
+ :type _content_type: str, Optional
721
+ :param _headers: set to override the headers for a single
722
+ request; this effectively ignores the headers
723
+ in the spec for a single request.
724
+ :type _headers: dict, optional
725
+ :param _host_index: set to override the host_index for a single
726
+ request; this effectively ignores the host_index
727
+ in the spec for a single request.
728
+ :type _host_index: int, optional
729
+ :return: Returns the result object.
730
+ """ # noqa: E501
731
+
732
+ _param = self._delete_field_serialize(
733
+ id=id,
734
+ data=data,
735
+ _request_auth=_request_auth,
736
+ _content_type=_content_type,
737
+ _headers=_headers,
738
+ _host_index=_host_index
739
+ )
740
+
741
+ _response_types_map: Dict[str, Optional[str]] = {
742
+ '204': "SendDocument200Response",
743
+ '400': "Dict[str, object]",
744
+ '404': "Dict[str, object]",
745
+ }
746
+ response_data = self.api_client.call_api(
747
+ *_param,
748
+ _request_timeout=_request_timeout
749
+ )
750
+ response_data.read()
751
+ return self.api_client.response_deserialize(
752
+ response_data=response_data,
753
+ response_types_map=_response_types_map,
754
+ )
755
+
756
+
757
+ @validate_call
758
+ def delete_field_without_preload_content(
759
+ self,
760
+ id: Annotated[StrictStr, Field(description="The field's ID.")],
761
+ data: DeleteFieldRequest,
762
+ _request_timeout: Union[
763
+ None,
764
+ Annotated[StrictFloat, Field(gt=0)],
765
+ Tuple[
766
+ Annotated[StrictFloat, Field(gt=0)],
767
+ Annotated[StrictFloat, Field(gt=0)]
768
+ ]
769
+ ] = None,
770
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
771
+ _content_type: Optional[StrictStr] = None,
772
+ _headers: Optional[Dict[StrictStr, Any]] = None,
773
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
774
+ ) -> RESTResponseType:
775
+ """Delete a field
776
+
777
+ Deletes a field of a template, or of a document that isn't sent yet. The document's or template's ID goes in the JSON body.
778
+
779
+ :param id: The field's ID. (required)
780
+ :type id: str
781
+ :param data: (required)
782
+ :type data: DeleteFieldRequest
783
+ :param _request_timeout: timeout setting for this request. If one
784
+ number provided, it will be total request
785
+ timeout. It can also be a pair (tuple) of
786
+ (connection, read) timeouts.
787
+ :type _request_timeout: int, tuple(int, int), optional
788
+ :param _request_auth: set to override the auth_settings for an a single
789
+ request; this effectively ignores the
790
+ authentication in the spec for a single request.
791
+ :type _request_auth: dict, optional
792
+ :param _content_type: force content-type for the request.
793
+ :type _content_type: str, Optional
794
+ :param _headers: set to override the headers for a single
795
+ request; this effectively ignores the headers
796
+ in the spec for a single request.
797
+ :type _headers: dict, optional
798
+ :param _host_index: set to override the host_index for a single
799
+ request; this effectively ignores the host_index
800
+ in the spec for a single request.
801
+ :type _host_index: int, optional
802
+ :return: Returns the result object.
803
+ """ # noqa: E501
804
+
805
+ _param = self._delete_field_serialize(
806
+ id=id,
807
+ data=data,
808
+ _request_auth=_request_auth,
809
+ _content_type=_content_type,
810
+ _headers=_headers,
811
+ _host_index=_host_index
812
+ )
813
+
814
+ _response_types_map: Dict[str, Optional[str]] = {
815
+ '204': "SendDocument200Response",
816
+ '400': "Dict[str, object]",
817
+ '404': "Dict[str, object]",
818
+ }
819
+ response_data = self.api_client.call_api(
820
+ *_param,
821
+ _request_timeout=_request_timeout
822
+ )
823
+ return response_data.response
824
+
825
+
826
+ def _delete_field_serialize(
827
+ self,
828
+ id,
829
+ data,
830
+ _request_auth,
831
+ _content_type,
832
+ _headers,
833
+ _host_index,
834
+ ) -> RequestSerialized:
835
+
836
+ _host = None
837
+
838
+ _collection_formats: Dict[str, str] = {
839
+ }
840
+
841
+ _path_params: Dict[str, str] = {}
842
+ _query_params: List[Tuple[str, str]] = []
843
+ _header_params: Dict[str, Optional[str]] = _headers or {}
844
+ _form_params: List[Tuple[str, str]] = []
845
+ _files: Dict[
846
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
847
+ ] = {}
848
+ _body_params: Optional[bytes] = None
849
+
850
+ # process the path parameters
851
+ if id is not None:
852
+ _path_params['id'] = id
853
+ # process the query parameters
854
+ # process the header parameters
855
+ # process the form parameters
856
+ # process the body parameter
857
+ if data is not None:
858
+ _body_params = data
859
+
860
+
861
+ # set the HTTP header `Accept`
862
+ if 'Accept' not in _header_params:
863
+ _header_params['Accept'] = self.api_client.select_header_accept(
864
+ [
865
+ 'application/json'
866
+ ]
867
+ )
868
+
869
+ # set the HTTP header `Content-Type`
870
+ if _content_type:
871
+ _header_params['Content-Type'] = _content_type
872
+ else:
873
+ _default_content_type = (
874
+ self.api_client.select_header_content_type(
875
+ [
876
+ 'application/json'
877
+ ]
878
+ )
879
+ )
880
+ if _default_content_type is not None:
881
+ _header_params['Content-Type'] = _default_content_type
882
+
883
+ # authentication setting
884
+ _auth_settings: List[str] = [
885
+ 'Bearer'
886
+ ]
887
+
888
+ return self.api_client.param_serialize(
889
+ method='DELETE',
890
+ resource_path='/ap1/documents/fields/{id}/',
891
+ path_params=_path_params,
892
+ query_params=_query_params,
893
+ header_params=_header_params,
894
+ body=_body_params,
895
+ post_params=_form_params,
896
+ files=_files,
897
+ auth_settings=_auth_settings,
898
+ collection_formats=_collection_formats,
899
+ _host=_host,
900
+ _request_auth=_request_auth
901
+ )
902
+
903
+
904
+
905
+
906
+ @validate_call
907
+ def list_document_fields(
908
+ self,
909
+ document_id: Annotated[StrictStr, Field(description="The document's ID.")],
910
+ _request_timeout: Union[
911
+ None,
912
+ Annotated[StrictFloat, Field(gt=0)],
913
+ Tuple[
914
+ Annotated[StrictFloat, Field(gt=0)],
915
+ Annotated[StrictFloat, Field(gt=0)]
916
+ ]
917
+ ] = None,
918
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
919
+ _content_type: Optional[StrictStr] = None,
920
+ _headers: Optional[Dict[StrictStr, Any]] = None,
921
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
922
+ ) -> List[ModelField]:
923
+ """List a document's fields
924
+
925
+ The fields of a document. Only while the document isn't sent yet (status 1 Draft, 2 Signees Added or 3 Prepared).
926
+
927
+ :param document_id: The document's ID. (required)
928
+ :type document_id: str
929
+ :param _request_timeout: timeout setting for this request. If one
930
+ number provided, it will be total request
931
+ timeout. It can also be a pair (tuple) of
932
+ (connection, read) timeouts.
933
+ :type _request_timeout: int, tuple(int, int), optional
934
+ :param _request_auth: set to override the auth_settings for an a single
935
+ request; this effectively ignores the
936
+ authentication in the spec for a single request.
937
+ :type _request_auth: dict, optional
938
+ :param _content_type: force content-type for the request.
939
+ :type _content_type: str, Optional
940
+ :param _headers: set to override the headers for a single
941
+ request; this effectively ignores the headers
942
+ in the spec for a single request.
943
+ :type _headers: dict, optional
944
+ :param _host_index: set to override the host_index for a single
945
+ request; this effectively ignores the host_index
946
+ in the spec for a single request.
947
+ :type _host_index: int, optional
948
+ :return: Returns the result object.
949
+ """ # noqa: E501
950
+
951
+ _param = self._list_document_fields_serialize(
952
+ document_id=document_id,
953
+ _request_auth=_request_auth,
954
+ _content_type=_content_type,
955
+ _headers=_headers,
956
+ _host_index=_host_index
957
+ )
958
+
959
+ _response_types_map: Dict[str, Optional[str]] = {
960
+ '200': "List[ModelField]",
961
+ '400': "Dict[str, object]",
962
+ '404': "Dict[str, object]",
963
+ }
964
+ response_data = self.api_client.call_api(
965
+ *_param,
966
+ _request_timeout=_request_timeout
967
+ )
968
+ response_data.read()
969
+ return self.api_client.response_deserialize(
970
+ response_data=response_data,
971
+ response_types_map=_response_types_map,
972
+ ).data
973
+
974
+
975
+ @validate_call
976
+ def list_document_fields_with_http_info(
977
+ self,
978
+ document_id: Annotated[StrictStr, Field(description="The document's ID.")],
979
+ _request_timeout: Union[
980
+ None,
981
+ Annotated[StrictFloat, Field(gt=0)],
982
+ Tuple[
983
+ Annotated[StrictFloat, Field(gt=0)],
984
+ Annotated[StrictFloat, Field(gt=0)]
985
+ ]
986
+ ] = None,
987
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
988
+ _content_type: Optional[StrictStr] = None,
989
+ _headers: Optional[Dict[StrictStr, Any]] = None,
990
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
991
+ ) -> ApiResponse[List[ModelField]]:
992
+ """List a document's fields
993
+
994
+ The fields of a document. Only while the document isn't sent yet (status 1 Draft, 2 Signees Added or 3 Prepared).
995
+
996
+ :param document_id: The document's ID. (required)
997
+ :type document_id: str
998
+ :param _request_timeout: timeout setting for this request. If one
999
+ number provided, it will be total request
1000
+ timeout. It can also be a pair (tuple) of
1001
+ (connection, read) timeouts.
1002
+ :type _request_timeout: int, tuple(int, int), optional
1003
+ :param _request_auth: set to override the auth_settings for an a single
1004
+ request; this effectively ignores the
1005
+ authentication in the spec for a single request.
1006
+ :type _request_auth: dict, optional
1007
+ :param _content_type: force content-type for the request.
1008
+ :type _content_type: str, Optional
1009
+ :param _headers: set to override the headers for a single
1010
+ request; this effectively ignores the headers
1011
+ in the spec for a single request.
1012
+ :type _headers: dict, optional
1013
+ :param _host_index: set to override the host_index for a single
1014
+ request; this effectively ignores the host_index
1015
+ in the spec for a single request.
1016
+ :type _host_index: int, optional
1017
+ :return: Returns the result object.
1018
+ """ # noqa: E501
1019
+
1020
+ _param = self._list_document_fields_serialize(
1021
+ document_id=document_id,
1022
+ _request_auth=_request_auth,
1023
+ _content_type=_content_type,
1024
+ _headers=_headers,
1025
+ _host_index=_host_index
1026
+ )
1027
+
1028
+ _response_types_map: Dict[str, Optional[str]] = {
1029
+ '200': "List[ModelField]",
1030
+ '400': "Dict[str, object]",
1031
+ '404': "Dict[str, object]",
1032
+ }
1033
+ response_data = self.api_client.call_api(
1034
+ *_param,
1035
+ _request_timeout=_request_timeout
1036
+ )
1037
+ response_data.read()
1038
+ return self.api_client.response_deserialize(
1039
+ response_data=response_data,
1040
+ response_types_map=_response_types_map,
1041
+ )
1042
+
1043
+
1044
+ @validate_call
1045
+ def list_document_fields_without_preload_content(
1046
+ self,
1047
+ document_id: Annotated[StrictStr, Field(description="The document's ID.")],
1048
+ _request_timeout: Union[
1049
+ None,
1050
+ Annotated[StrictFloat, Field(gt=0)],
1051
+ Tuple[
1052
+ Annotated[StrictFloat, Field(gt=0)],
1053
+ Annotated[StrictFloat, Field(gt=0)]
1054
+ ]
1055
+ ] = None,
1056
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1057
+ _content_type: Optional[StrictStr] = None,
1058
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1059
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1060
+ ) -> RESTResponseType:
1061
+ """List a document's fields
1062
+
1063
+ The fields of a document. Only while the document isn't sent yet (status 1 Draft, 2 Signees Added or 3 Prepared).
1064
+
1065
+ :param document_id: The document's ID. (required)
1066
+ :type document_id: str
1067
+ :param _request_timeout: timeout setting for this request. If one
1068
+ number provided, it will be total request
1069
+ timeout. It can also be a pair (tuple) of
1070
+ (connection, read) timeouts.
1071
+ :type _request_timeout: int, tuple(int, int), optional
1072
+ :param _request_auth: set to override the auth_settings for an a single
1073
+ request; this effectively ignores the
1074
+ authentication in the spec for a single request.
1075
+ :type _request_auth: dict, optional
1076
+ :param _content_type: force content-type for the request.
1077
+ :type _content_type: str, Optional
1078
+ :param _headers: set to override the headers for a single
1079
+ request; this effectively ignores the headers
1080
+ in the spec for a single request.
1081
+ :type _headers: dict, optional
1082
+ :param _host_index: set to override the host_index for a single
1083
+ request; this effectively ignores the host_index
1084
+ in the spec for a single request.
1085
+ :type _host_index: int, optional
1086
+ :return: Returns the result object.
1087
+ """ # noqa: E501
1088
+
1089
+ _param = self._list_document_fields_serialize(
1090
+ document_id=document_id,
1091
+ _request_auth=_request_auth,
1092
+ _content_type=_content_type,
1093
+ _headers=_headers,
1094
+ _host_index=_host_index
1095
+ )
1096
+
1097
+ _response_types_map: Dict[str, Optional[str]] = {
1098
+ '200': "List[ModelField]",
1099
+ '400': "Dict[str, object]",
1100
+ '404': "Dict[str, object]",
1101
+ }
1102
+ response_data = self.api_client.call_api(
1103
+ *_param,
1104
+ _request_timeout=_request_timeout
1105
+ )
1106
+ return response_data.response
1107
+
1108
+
1109
+ def _list_document_fields_serialize(
1110
+ self,
1111
+ document_id,
1112
+ _request_auth,
1113
+ _content_type,
1114
+ _headers,
1115
+ _host_index,
1116
+ ) -> RequestSerialized:
1117
+
1118
+ _host = None
1119
+
1120
+ _collection_formats: Dict[str, str] = {
1121
+ }
1122
+
1123
+ _path_params: Dict[str, str] = {}
1124
+ _query_params: List[Tuple[str, str]] = []
1125
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1126
+ _form_params: List[Tuple[str, str]] = []
1127
+ _files: Dict[
1128
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1129
+ ] = {}
1130
+ _body_params: Optional[bytes] = None
1131
+
1132
+ # process the path parameters
1133
+ # process the query parameters
1134
+ if document_id is not None:
1135
+
1136
+ _query_params.append(('document_id', document_id))
1137
+
1138
+ # process the header parameters
1139
+ # process the form parameters
1140
+ # process the body parameter
1141
+
1142
+
1143
+ # set the HTTP header `Accept`
1144
+ if 'Accept' not in _header_params:
1145
+ _header_params['Accept'] = self.api_client.select_header_accept(
1146
+ [
1147
+ 'application/json'
1148
+ ]
1149
+ )
1150
+
1151
+
1152
+ # authentication setting
1153
+ _auth_settings: List[str] = [
1154
+ 'Bearer'
1155
+ ]
1156
+
1157
+ return self.api_client.param_serialize(
1158
+ method='GET',
1159
+ resource_path='/ap1/documents/fields/',
1160
+ path_params=_path_params,
1161
+ query_params=_query_params,
1162
+ header_params=_header_params,
1163
+ body=_body_params,
1164
+ post_params=_form_params,
1165
+ files=_files,
1166
+ auth_settings=_auth_settings,
1167
+ collection_formats=_collection_formats,
1168
+ _host=_host,
1169
+ _request_auth=_request_auth
1170
+ )
1171
+
1172
+
1173
+
1174
+
1175
+ @validate_call
1176
+ def list_template_fields(
1177
+ self,
1178
+ document_id: Annotated[StrictStr, Field(description="The template's ID.")],
1179
+ _request_timeout: Union[
1180
+ None,
1181
+ Annotated[StrictFloat, Field(gt=0)],
1182
+ Tuple[
1183
+ Annotated[StrictFloat, Field(gt=0)],
1184
+ Annotated[StrictFloat, Field(gt=0)]
1185
+ ]
1186
+ ] = None,
1187
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1188
+ _content_type: Optional[StrictStr] = None,
1189
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1190
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1191
+ ) -> List[TemplateField]:
1192
+ """List a template's fields
1193
+
1194
+ The fields of a template (or of any of your documents).
1195
+
1196
+ :param document_id: The template's ID. (required)
1197
+ :type document_id: str
1198
+ :param _request_timeout: timeout setting for this request. If one
1199
+ number provided, it will be total request
1200
+ timeout. It can also be a pair (tuple) of
1201
+ (connection, read) timeouts.
1202
+ :type _request_timeout: int, tuple(int, int), optional
1203
+ :param _request_auth: set to override the auth_settings for an a single
1204
+ request; this effectively ignores the
1205
+ authentication in the spec for a single request.
1206
+ :type _request_auth: dict, optional
1207
+ :param _content_type: force content-type for the request.
1208
+ :type _content_type: str, Optional
1209
+ :param _headers: set to override the headers for a single
1210
+ request; this effectively ignores the headers
1211
+ in the spec for a single request.
1212
+ :type _headers: dict, optional
1213
+ :param _host_index: set to override the host_index for a single
1214
+ request; this effectively ignores the host_index
1215
+ in the spec for a single request.
1216
+ :type _host_index: int, optional
1217
+ :return: Returns the result object.
1218
+ """ # noqa: E501
1219
+
1220
+ _param = self._list_template_fields_serialize(
1221
+ document_id=document_id,
1222
+ _request_auth=_request_auth,
1223
+ _content_type=_content_type,
1224
+ _headers=_headers,
1225
+ _host_index=_host_index
1226
+ )
1227
+
1228
+ _response_types_map: Dict[str, Optional[str]] = {
1229
+ '200': "List[TemplateField]",
1230
+ '404': "Dict[str, object]",
1231
+ }
1232
+ response_data = self.api_client.call_api(
1233
+ *_param,
1234
+ _request_timeout=_request_timeout
1235
+ )
1236
+ response_data.read()
1237
+ return self.api_client.response_deserialize(
1238
+ response_data=response_data,
1239
+ response_types_map=_response_types_map,
1240
+ ).data
1241
+
1242
+
1243
+ @validate_call
1244
+ def list_template_fields_with_http_info(
1245
+ self,
1246
+ document_id: Annotated[StrictStr, Field(description="The template's ID.")],
1247
+ _request_timeout: Union[
1248
+ None,
1249
+ Annotated[StrictFloat, Field(gt=0)],
1250
+ Tuple[
1251
+ Annotated[StrictFloat, Field(gt=0)],
1252
+ Annotated[StrictFloat, Field(gt=0)]
1253
+ ]
1254
+ ] = None,
1255
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1256
+ _content_type: Optional[StrictStr] = None,
1257
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1258
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1259
+ ) -> ApiResponse[List[TemplateField]]:
1260
+ """List a template's fields
1261
+
1262
+ The fields of a template (or of any of your documents).
1263
+
1264
+ :param document_id: The template's ID. (required)
1265
+ :type document_id: str
1266
+ :param _request_timeout: timeout setting for this request. If one
1267
+ number provided, it will be total request
1268
+ timeout. It can also be a pair (tuple) of
1269
+ (connection, read) timeouts.
1270
+ :type _request_timeout: int, tuple(int, int), optional
1271
+ :param _request_auth: set to override the auth_settings for an a single
1272
+ request; this effectively ignores the
1273
+ authentication in the spec for a single request.
1274
+ :type _request_auth: dict, optional
1275
+ :param _content_type: force content-type for the request.
1276
+ :type _content_type: str, Optional
1277
+ :param _headers: set to override the headers for a single
1278
+ request; this effectively ignores the headers
1279
+ in the spec for a single request.
1280
+ :type _headers: dict, optional
1281
+ :param _host_index: set to override the host_index for a single
1282
+ request; this effectively ignores the host_index
1283
+ in the spec for a single request.
1284
+ :type _host_index: int, optional
1285
+ :return: Returns the result object.
1286
+ """ # noqa: E501
1287
+
1288
+ _param = self._list_template_fields_serialize(
1289
+ document_id=document_id,
1290
+ _request_auth=_request_auth,
1291
+ _content_type=_content_type,
1292
+ _headers=_headers,
1293
+ _host_index=_host_index
1294
+ )
1295
+
1296
+ _response_types_map: Dict[str, Optional[str]] = {
1297
+ '200': "List[TemplateField]",
1298
+ '404': "Dict[str, object]",
1299
+ }
1300
+ response_data = self.api_client.call_api(
1301
+ *_param,
1302
+ _request_timeout=_request_timeout
1303
+ )
1304
+ response_data.read()
1305
+ return self.api_client.response_deserialize(
1306
+ response_data=response_data,
1307
+ response_types_map=_response_types_map,
1308
+ )
1309
+
1310
+
1311
+ @validate_call
1312
+ def list_template_fields_without_preload_content(
1313
+ self,
1314
+ document_id: Annotated[StrictStr, Field(description="The template's ID.")],
1315
+ _request_timeout: Union[
1316
+ None,
1317
+ Annotated[StrictFloat, Field(gt=0)],
1318
+ Tuple[
1319
+ Annotated[StrictFloat, Field(gt=0)],
1320
+ Annotated[StrictFloat, Field(gt=0)]
1321
+ ]
1322
+ ] = None,
1323
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1324
+ _content_type: Optional[StrictStr] = None,
1325
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1326
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1327
+ ) -> RESTResponseType:
1328
+ """List a template's fields
1329
+
1330
+ The fields of a template (or of any of your documents).
1331
+
1332
+ :param document_id: The template's ID. (required)
1333
+ :type document_id: str
1334
+ :param _request_timeout: timeout setting for this request. If one
1335
+ number provided, it will be total request
1336
+ timeout. It can also be a pair (tuple) of
1337
+ (connection, read) timeouts.
1338
+ :type _request_timeout: int, tuple(int, int), optional
1339
+ :param _request_auth: set to override the auth_settings for an a single
1340
+ request; this effectively ignores the
1341
+ authentication in the spec for a single request.
1342
+ :type _request_auth: dict, optional
1343
+ :param _content_type: force content-type for the request.
1344
+ :type _content_type: str, Optional
1345
+ :param _headers: set to override the headers for a single
1346
+ request; this effectively ignores the headers
1347
+ in the spec for a single request.
1348
+ :type _headers: dict, optional
1349
+ :param _host_index: set to override the host_index for a single
1350
+ request; this effectively ignores the host_index
1351
+ in the spec for a single request.
1352
+ :type _host_index: int, optional
1353
+ :return: Returns the result object.
1354
+ """ # noqa: E501
1355
+
1356
+ _param = self._list_template_fields_serialize(
1357
+ document_id=document_id,
1358
+ _request_auth=_request_auth,
1359
+ _content_type=_content_type,
1360
+ _headers=_headers,
1361
+ _host_index=_host_index
1362
+ )
1363
+
1364
+ _response_types_map: Dict[str, Optional[str]] = {
1365
+ '200': "List[TemplateField]",
1366
+ '404': "Dict[str, object]",
1367
+ }
1368
+ response_data = self.api_client.call_api(
1369
+ *_param,
1370
+ _request_timeout=_request_timeout
1371
+ )
1372
+ return response_data.response
1373
+
1374
+
1375
+ def _list_template_fields_serialize(
1376
+ self,
1377
+ document_id,
1378
+ _request_auth,
1379
+ _content_type,
1380
+ _headers,
1381
+ _host_index,
1382
+ ) -> RequestSerialized:
1383
+
1384
+ _host = None
1385
+
1386
+ _collection_formats: Dict[str, str] = {
1387
+ }
1388
+
1389
+ _path_params: Dict[str, str] = {}
1390
+ _query_params: List[Tuple[str, str]] = []
1391
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1392
+ _form_params: List[Tuple[str, str]] = []
1393
+ _files: Dict[
1394
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1395
+ ] = {}
1396
+ _body_params: Optional[bytes] = None
1397
+
1398
+ # process the path parameters
1399
+ # process the query parameters
1400
+ if document_id is not None:
1401
+
1402
+ _query_params.append(('document_id', document_id))
1403
+
1404
+ # process the header parameters
1405
+ # process the form parameters
1406
+ # process the body parameter
1407
+
1408
+
1409
+ # set the HTTP header `Accept`
1410
+ if 'Accept' not in _header_params:
1411
+ _header_params['Accept'] = self.api_client.select_header_accept(
1412
+ [
1413
+ 'application/json'
1414
+ ]
1415
+ )
1416
+
1417
+
1418
+ # authentication setting
1419
+ _auth_settings: List[str] = [
1420
+ 'Bearer'
1421
+ ]
1422
+
1423
+ return self.api_client.param_serialize(
1424
+ method='GET',
1425
+ resource_path='/ap1/templates/fields/',
1426
+ path_params=_path_params,
1427
+ query_params=_query_params,
1428
+ header_params=_header_params,
1429
+ body=_body_params,
1430
+ post_params=_form_params,
1431
+ files=_files,
1432
+ auth_settings=_auth_settings,
1433
+ collection_formats=_collection_formats,
1434
+ _host=_host,
1435
+ _request_auth=_request_auth
1436
+ )
1437
+
1438
+
1439
+
1440
+
1441
+ @validate_call
1442
+ def update_document_field(
1443
+ self,
1444
+ id: Annotated[StrictStr, Field(description="The field's ID.")],
1445
+ data: CreateDocumentFieldsRequestInner,
1446
+ _request_timeout: Union[
1447
+ None,
1448
+ Annotated[StrictFloat, Field(gt=0)],
1449
+ Tuple[
1450
+ Annotated[StrictFloat, Field(gt=0)],
1451
+ Annotated[StrictFloat, Field(gt=0)]
1452
+ ]
1453
+ ] = None,
1454
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1455
+ _content_type: Optional[StrictStr] = None,
1456
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1457
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1458
+ ) -> ModelField:
1459
+ """Change a document's field
1460
+
1461
+ Changes a document's field; send all of its values, as when adding it. Only while the document isn't sent yet (status 1 Draft, 2 Signees Added or 3 Prepared). Its page and signatory can't change: delete the field and add it again. For a template's field, use PUT /ap1/templates/fields/{id}/.
1462
+
1463
+ :param id: The field's ID. (required)
1464
+ :type id: str
1465
+ :param data: (required)
1466
+ :type data: CreateDocumentFieldsRequestInner
1467
+ :param _request_timeout: timeout setting for this request. If one
1468
+ number provided, it will be total request
1469
+ timeout. It can also be a pair (tuple) of
1470
+ (connection, read) timeouts.
1471
+ :type _request_timeout: int, tuple(int, int), optional
1472
+ :param _request_auth: set to override the auth_settings for an a single
1473
+ request; this effectively ignores the
1474
+ authentication in the spec for a single request.
1475
+ :type _request_auth: dict, optional
1476
+ :param _content_type: force content-type for the request.
1477
+ :type _content_type: str, Optional
1478
+ :param _headers: set to override the headers for a single
1479
+ request; this effectively ignores the headers
1480
+ in the spec for a single request.
1481
+ :type _headers: dict, optional
1482
+ :param _host_index: set to override the host_index for a single
1483
+ request; this effectively ignores the host_index
1484
+ in the spec for a single request.
1485
+ :type _host_index: int, optional
1486
+ :return: Returns the result object.
1487
+ """ # noqa: E501
1488
+
1489
+ _param = self._update_document_field_serialize(
1490
+ id=id,
1491
+ data=data,
1492
+ _request_auth=_request_auth,
1493
+ _content_type=_content_type,
1494
+ _headers=_headers,
1495
+ _host_index=_host_index
1496
+ )
1497
+
1498
+ _response_types_map: Dict[str, Optional[str]] = {
1499
+ '200': "ModelField",
1500
+ '400': "Dict[str, object]",
1501
+ '404': "Dict[str, object]",
1502
+ }
1503
+ response_data = self.api_client.call_api(
1504
+ *_param,
1505
+ _request_timeout=_request_timeout
1506
+ )
1507
+ response_data.read()
1508
+ return self.api_client.response_deserialize(
1509
+ response_data=response_data,
1510
+ response_types_map=_response_types_map,
1511
+ ).data
1512
+
1513
+
1514
+ @validate_call
1515
+ def update_document_field_with_http_info(
1516
+ self,
1517
+ id: Annotated[StrictStr, Field(description="The field's ID.")],
1518
+ data: CreateDocumentFieldsRequestInner,
1519
+ _request_timeout: Union[
1520
+ None,
1521
+ Annotated[StrictFloat, Field(gt=0)],
1522
+ Tuple[
1523
+ Annotated[StrictFloat, Field(gt=0)],
1524
+ Annotated[StrictFloat, Field(gt=0)]
1525
+ ]
1526
+ ] = None,
1527
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1528
+ _content_type: Optional[StrictStr] = None,
1529
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1530
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1531
+ ) -> ApiResponse[ModelField]:
1532
+ """Change a document's field
1533
+
1534
+ Changes a document's field; send all of its values, as when adding it. Only while the document isn't sent yet (status 1 Draft, 2 Signees Added or 3 Prepared). Its page and signatory can't change: delete the field and add it again. For a template's field, use PUT /ap1/templates/fields/{id}/.
1535
+
1536
+ :param id: The field's ID. (required)
1537
+ :type id: str
1538
+ :param data: (required)
1539
+ :type data: CreateDocumentFieldsRequestInner
1540
+ :param _request_timeout: timeout setting for this request. If one
1541
+ number provided, it will be total request
1542
+ timeout. It can also be a pair (tuple) of
1543
+ (connection, read) timeouts.
1544
+ :type _request_timeout: int, tuple(int, int), optional
1545
+ :param _request_auth: set to override the auth_settings for an a single
1546
+ request; this effectively ignores the
1547
+ authentication in the spec for a single request.
1548
+ :type _request_auth: dict, optional
1549
+ :param _content_type: force content-type for the request.
1550
+ :type _content_type: str, Optional
1551
+ :param _headers: set to override the headers for a single
1552
+ request; this effectively ignores the headers
1553
+ in the spec for a single request.
1554
+ :type _headers: dict, optional
1555
+ :param _host_index: set to override the host_index for a single
1556
+ request; this effectively ignores the host_index
1557
+ in the spec for a single request.
1558
+ :type _host_index: int, optional
1559
+ :return: Returns the result object.
1560
+ """ # noqa: E501
1561
+
1562
+ _param = self._update_document_field_serialize(
1563
+ id=id,
1564
+ data=data,
1565
+ _request_auth=_request_auth,
1566
+ _content_type=_content_type,
1567
+ _headers=_headers,
1568
+ _host_index=_host_index
1569
+ )
1570
+
1571
+ _response_types_map: Dict[str, Optional[str]] = {
1572
+ '200': "ModelField",
1573
+ '400': "Dict[str, object]",
1574
+ '404': "Dict[str, object]",
1575
+ }
1576
+ response_data = self.api_client.call_api(
1577
+ *_param,
1578
+ _request_timeout=_request_timeout
1579
+ )
1580
+ response_data.read()
1581
+ return self.api_client.response_deserialize(
1582
+ response_data=response_data,
1583
+ response_types_map=_response_types_map,
1584
+ )
1585
+
1586
+
1587
+ @validate_call
1588
+ def update_document_field_without_preload_content(
1589
+ self,
1590
+ id: Annotated[StrictStr, Field(description="The field's ID.")],
1591
+ data: CreateDocumentFieldsRequestInner,
1592
+ _request_timeout: Union[
1593
+ None,
1594
+ Annotated[StrictFloat, Field(gt=0)],
1595
+ Tuple[
1596
+ Annotated[StrictFloat, Field(gt=0)],
1597
+ Annotated[StrictFloat, Field(gt=0)]
1598
+ ]
1599
+ ] = None,
1600
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1601
+ _content_type: Optional[StrictStr] = None,
1602
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1603
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1604
+ ) -> RESTResponseType:
1605
+ """Change a document's field
1606
+
1607
+ Changes a document's field; send all of its values, as when adding it. Only while the document isn't sent yet (status 1 Draft, 2 Signees Added or 3 Prepared). Its page and signatory can't change: delete the field and add it again. For a template's field, use PUT /ap1/templates/fields/{id}/.
1608
+
1609
+ :param id: The field's ID. (required)
1610
+ :type id: str
1611
+ :param data: (required)
1612
+ :type data: CreateDocumentFieldsRequestInner
1613
+ :param _request_timeout: timeout setting for this request. If one
1614
+ number provided, it will be total request
1615
+ timeout. It can also be a pair (tuple) of
1616
+ (connection, read) timeouts.
1617
+ :type _request_timeout: int, tuple(int, int), optional
1618
+ :param _request_auth: set to override the auth_settings for an a single
1619
+ request; this effectively ignores the
1620
+ authentication in the spec for a single request.
1621
+ :type _request_auth: dict, optional
1622
+ :param _content_type: force content-type for the request.
1623
+ :type _content_type: str, Optional
1624
+ :param _headers: set to override the headers for a single
1625
+ request; this effectively ignores the headers
1626
+ in the spec for a single request.
1627
+ :type _headers: dict, optional
1628
+ :param _host_index: set to override the host_index for a single
1629
+ request; this effectively ignores the host_index
1630
+ in the spec for a single request.
1631
+ :type _host_index: int, optional
1632
+ :return: Returns the result object.
1633
+ """ # noqa: E501
1634
+
1635
+ _param = self._update_document_field_serialize(
1636
+ id=id,
1637
+ data=data,
1638
+ _request_auth=_request_auth,
1639
+ _content_type=_content_type,
1640
+ _headers=_headers,
1641
+ _host_index=_host_index
1642
+ )
1643
+
1644
+ _response_types_map: Dict[str, Optional[str]] = {
1645
+ '200': "ModelField",
1646
+ '400': "Dict[str, object]",
1647
+ '404': "Dict[str, object]",
1648
+ }
1649
+ response_data = self.api_client.call_api(
1650
+ *_param,
1651
+ _request_timeout=_request_timeout
1652
+ )
1653
+ return response_data.response
1654
+
1655
+
1656
+ def _update_document_field_serialize(
1657
+ self,
1658
+ id,
1659
+ data,
1660
+ _request_auth,
1661
+ _content_type,
1662
+ _headers,
1663
+ _host_index,
1664
+ ) -> RequestSerialized:
1665
+
1666
+ _host = None
1667
+
1668
+ _collection_formats: Dict[str, str] = {
1669
+ }
1670
+
1671
+ _path_params: Dict[str, str] = {}
1672
+ _query_params: List[Tuple[str, str]] = []
1673
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1674
+ _form_params: List[Tuple[str, str]] = []
1675
+ _files: Dict[
1676
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1677
+ ] = {}
1678
+ _body_params: Optional[bytes] = None
1679
+
1680
+ # process the path parameters
1681
+ if id is not None:
1682
+ _path_params['id'] = id
1683
+ # process the query parameters
1684
+ # process the header parameters
1685
+ # process the form parameters
1686
+ # process the body parameter
1687
+ if data is not None:
1688
+ _body_params = data
1689
+
1690
+
1691
+ # set the HTTP header `Accept`
1692
+ if 'Accept' not in _header_params:
1693
+ _header_params['Accept'] = self.api_client.select_header_accept(
1694
+ [
1695
+ 'application/json'
1696
+ ]
1697
+ )
1698
+
1699
+ # set the HTTP header `Content-Type`
1700
+ if _content_type:
1701
+ _header_params['Content-Type'] = _content_type
1702
+ else:
1703
+ _default_content_type = (
1704
+ self.api_client.select_header_content_type(
1705
+ [
1706
+ 'application/json'
1707
+ ]
1708
+ )
1709
+ )
1710
+ if _default_content_type is not None:
1711
+ _header_params['Content-Type'] = _default_content_type
1712
+
1713
+ # authentication setting
1714
+ _auth_settings: List[str] = [
1715
+ 'Bearer'
1716
+ ]
1717
+
1718
+ return self.api_client.param_serialize(
1719
+ method='PUT',
1720
+ resource_path='/ap1/documents/fields/{id}/',
1721
+ path_params=_path_params,
1722
+ query_params=_query_params,
1723
+ header_params=_header_params,
1724
+ body=_body_params,
1725
+ post_params=_form_params,
1726
+ files=_files,
1727
+ auth_settings=_auth_settings,
1728
+ collection_formats=_collection_formats,
1729
+ _host=_host,
1730
+ _request_auth=_request_auth
1731
+ )
1732
+
1733
+
1734
+
1735
+
1736
+ @validate_call
1737
+ def update_document_field_by_body(
1738
+ self,
1739
+ data: UpdateDocumentFieldByBodyRequest,
1740
+ _request_timeout: Union[
1741
+ None,
1742
+ Annotated[StrictFloat, Field(gt=0)],
1743
+ Tuple[
1744
+ Annotated[StrictFloat, Field(gt=0)],
1745
+ Annotated[StrictFloat, Field(gt=0)]
1746
+ ]
1747
+ ] = None,
1748
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1749
+ _content_type: Optional[StrictStr] = None,
1750
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1751
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1752
+ ) -> ModelField:
1753
+ """Change a document's field (ID in the body)
1754
+
1755
+ Changes a document's field, named by `element_id` in the body; the same as PUT /ap1/documents/fields/{id}/. Only while the document isn't sent yet (status 1 Draft, 2 Signees Added or 3 Prepared). Its page and signatory can't change: delete the field and add it again.
1756
+
1757
+ :param data: (required)
1758
+ :type data: UpdateDocumentFieldByBodyRequest
1759
+ :param _request_timeout: timeout setting for this request. If one
1760
+ number provided, it will be total request
1761
+ timeout. It can also be a pair (tuple) of
1762
+ (connection, read) timeouts.
1763
+ :type _request_timeout: int, tuple(int, int), optional
1764
+ :param _request_auth: set to override the auth_settings for an a single
1765
+ request; this effectively ignores the
1766
+ authentication in the spec for a single request.
1767
+ :type _request_auth: dict, optional
1768
+ :param _content_type: force content-type for the request.
1769
+ :type _content_type: str, Optional
1770
+ :param _headers: set to override the headers for a single
1771
+ request; this effectively ignores the headers
1772
+ in the spec for a single request.
1773
+ :type _headers: dict, optional
1774
+ :param _host_index: set to override the host_index for a single
1775
+ request; this effectively ignores the host_index
1776
+ in the spec for a single request.
1777
+ :type _host_index: int, optional
1778
+ :return: Returns the result object.
1779
+ """ # noqa: E501
1780
+
1781
+ _param = self._update_document_field_by_body_serialize(
1782
+ data=data,
1783
+ _request_auth=_request_auth,
1784
+ _content_type=_content_type,
1785
+ _headers=_headers,
1786
+ _host_index=_host_index
1787
+ )
1788
+
1789
+ _response_types_map: Dict[str, Optional[str]] = {
1790
+ '200': "ModelField",
1791
+ '400': "Dict[str, object]",
1792
+ '404': "Dict[str, object]",
1793
+ }
1794
+ response_data = self.api_client.call_api(
1795
+ *_param,
1796
+ _request_timeout=_request_timeout
1797
+ )
1798
+ response_data.read()
1799
+ return self.api_client.response_deserialize(
1800
+ response_data=response_data,
1801
+ response_types_map=_response_types_map,
1802
+ ).data
1803
+
1804
+
1805
+ @validate_call
1806
+ def update_document_field_by_body_with_http_info(
1807
+ self,
1808
+ data: UpdateDocumentFieldByBodyRequest,
1809
+ _request_timeout: Union[
1810
+ None,
1811
+ Annotated[StrictFloat, Field(gt=0)],
1812
+ Tuple[
1813
+ Annotated[StrictFloat, Field(gt=0)],
1814
+ Annotated[StrictFloat, Field(gt=0)]
1815
+ ]
1816
+ ] = None,
1817
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1818
+ _content_type: Optional[StrictStr] = None,
1819
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1820
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1821
+ ) -> ApiResponse[ModelField]:
1822
+ """Change a document's field (ID in the body)
1823
+
1824
+ Changes a document's field, named by `element_id` in the body; the same as PUT /ap1/documents/fields/{id}/. Only while the document isn't sent yet (status 1 Draft, 2 Signees Added or 3 Prepared). Its page and signatory can't change: delete the field and add it again.
1825
+
1826
+ :param data: (required)
1827
+ :type data: UpdateDocumentFieldByBodyRequest
1828
+ :param _request_timeout: timeout setting for this request. If one
1829
+ number provided, it will be total request
1830
+ timeout. It can also be a pair (tuple) of
1831
+ (connection, read) timeouts.
1832
+ :type _request_timeout: int, tuple(int, int), optional
1833
+ :param _request_auth: set to override the auth_settings for an a single
1834
+ request; this effectively ignores the
1835
+ authentication in the spec for a single request.
1836
+ :type _request_auth: dict, optional
1837
+ :param _content_type: force content-type for the request.
1838
+ :type _content_type: str, Optional
1839
+ :param _headers: set to override the headers for a single
1840
+ request; this effectively ignores the headers
1841
+ in the spec for a single request.
1842
+ :type _headers: dict, optional
1843
+ :param _host_index: set to override the host_index for a single
1844
+ request; this effectively ignores the host_index
1845
+ in the spec for a single request.
1846
+ :type _host_index: int, optional
1847
+ :return: Returns the result object.
1848
+ """ # noqa: E501
1849
+
1850
+ _param = self._update_document_field_by_body_serialize(
1851
+ data=data,
1852
+ _request_auth=_request_auth,
1853
+ _content_type=_content_type,
1854
+ _headers=_headers,
1855
+ _host_index=_host_index
1856
+ )
1857
+
1858
+ _response_types_map: Dict[str, Optional[str]] = {
1859
+ '200': "ModelField",
1860
+ '400': "Dict[str, object]",
1861
+ '404': "Dict[str, object]",
1862
+ }
1863
+ response_data = self.api_client.call_api(
1864
+ *_param,
1865
+ _request_timeout=_request_timeout
1866
+ )
1867
+ response_data.read()
1868
+ return self.api_client.response_deserialize(
1869
+ response_data=response_data,
1870
+ response_types_map=_response_types_map,
1871
+ )
1872
+
1873
+
1874
+ @validate_call
1875
+ def update_document_field_by_body_without_preload_content(
1876
+ self,
1877
+ data: UpdateDocumentFieldByBodyRequest,
1878
+ _request_timeout: Union[
1879
+ None,
1880
+ Annotated[StrictFloat, Field(gt=0)],
1881
+ Tuple[
1882
+ Annotated[StrictFloat, Field(gt=0)],
1883
+ Annotated[StrictFloat, Field(gt=0)]
1884
+ ]
1885
+ ] = None,
1886
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1887
+ _content_type: Optional[StrictStr] = None,
1888
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1889
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1890
+ ) -> RESTResponseType:
1891
+ """Change a document's field (ID in the body)
1892
+
1893
+ Changes a document's field, named by `element_id` in the body; the same as PUT /ap1/documents/fields/{id}/. Only while the document isn't sent yet (status 1 Draft, 2 Signees Added or 3 Prepared). Its page and signatory can't change: delete the field and add it again.
1894
+
1895
+ :param data: (required)
1896
+ :type data: UpdateDocumentFieldByBodyRequest
1897
+ :param _request_timeout: timeout setting for this request. If one
1898
+ number provided, it will be total request
1899
+ timeout. It can also be a pair (tuple) of
1900
+ (connection, read) timeouts.
1901
+ :type _request_timeout: int, tuple(int, int), optional
1902
+ :param _request_auth: set to override the auth_settings for an a single
1903
+ request; this effectively ignores the
1904
+ authentication in the spec for a single request.
1905
+ :type _request_auth: dict, optional
1906
+ :param _content_type: force content-type for the request.
1907
+ :type _content_type: str, Optional
1908
+ :param _headers: set to override the headers for a single
1909
+ request; this effectively ignores the headers
1910
+ in the spec for a single request.
1911
+ :type _headers: dict, optional
1912
+ :param _host_index: set to override the host_index for a single
1913
+ request; this effectively ignores the host_index
1914
+ in the spec for a single request.
1915
+ :type _host_index: int, optional
1916
+ :return: Returns the result object.
1917
+ """ # noqa: E501
1918
+
1919
+ _param = self._update_document_field_by_body_serialize(
1920
+ data=data,
1921
+ _request_auth=_request_auth,
1922
+ _content_type=_content_type,
1923
+ _headers=_headers,
1924
+ _host_index=_host_index
1925
+ )
1926
+
1927
+ _response_types_map: Dict[str, Optional[str]] = {
1928
+ '200': "ModelField",
1929
+ '400': "Dict[str, object]",
1930
+ '404': "Dict[str, object]",
1931
+ }
1932
+ response_data = self.api_client.call_api(
1933
+ *_param,
1934
+ _request_timeout=_request_timeout
1935
+ )
1936
+ return response_data.response
1937
+
1938
+
1939
+ def _update_document_field_by_body_serialize(
1940
+ self,
1941
+ data,
1942
+ _request_auth,
1943
+ _content_type,
1944
+ _headers,
1945
+ _host_index,
1946
+ ) -> RequestSerialized:
1947
+
1948
+ _host = None
1949
+
1950
+ _collection_formats: Dict[str, str] = {
1951
+ }
1952
+
1953
+ _path_params: Dict[str, str] = {}
1954
+ _query_params: List[Tuple[str, str]] = []
1955
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1956
+ _form_params: List[Tuple[str, str]] = []
1957
+ _files: Dict[
1958
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1959
+ ] = {}
1960
+ _body_params: Optional[bytes] = None
1961
+
1962
+ # process the path parameters
1963
+ # process the query parameters
1964
+ # process the header parameters
1965
+ # process the form parameters
1966
+ # process the body parameter
1967
+ if data is not None:
1968
+ _body_params = data
1969
+
1970
+
1971
+ # set the HTTP header `Accept`
1972
+ if 'Accept' not in _header_params:
1973
+ _header_params['Accept'] = self.api_client.select_header_accept(
1974
+ [
1975
+ 'application/json'
1976
+ ]
1977
+ )
1978
+
1979
+ # set the HTTP header `Content-Type`
1980
+ if _content_type:
1981
+ _header_params['Content-Type'] = _content_type
1982
+ else:
1983
+ _default_content_type = (
1984
+ self.api_client.select_header_content_type(
1985
+ [
1986
+ 'application/json'
1987
+ ]
1988
+ )
1989
+ )
1990
+ if _default_content_type is not None:
1991
+ _header_params['Content-Type'] = _default_content_type
1992
+
1993
+ # authentication setting
1994
+ _auth_settings: List[str] = [
1995
+ 'Bearer'
1996
+ ]
1997
+
1998
+ return self.api_client.param_serialize(
1999
+ method='PUT',
2000
+ resource_path='/ap1/documents/fields/',
2001
+ path_params=_path_params,
2002
+ query_params=_query_params,
2003
+ header_params=_header_params,
2004
+ body=_body_params,
2005
+ post_params=_form_params,
2006
+ files=_files,
2007
+ auth_settings=_auth_settings,
2008
+ collection_formats=_collection_formats,
2009
+ _host=_host,
2010
+ _request_auth=_request_auth
2011
+ )
2012
+
2013
+
2014
+
2015
+
2016
+ @validate_call
2017
+ def update_template_field(
2018
+ self,
2019
+ id: Annotated[StrictStr, Field(description="The field's ID.")],
2020
+ data: CreateTemplateFieldsRequestInner,
2021
+ _request_timeout: Union[
2022
+ None,
2023
+ Annotated[StrictFloat, Field(gt=0)],
2024
+ Tuple[
2025
+ Annotated[StrictFloat, Field(gt=0)],
2026
+ Annotated[StrictFloat, Field(gt=0)]
2027
+ ]
2028
+ ] = None,
2029
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2030
+ _content_type: Optional[StrictStr] = None,
2031
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2032
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2033
+ ) -> TemplateField:
2034
+ """Change a template's field
2035
+
2036
+ Changes a template's field; send all of its values, as when adding it. Its page can't change: delete the field and add it again.
2037
+
2038
+ :param id: The field's ID. (required)
2039
+ :type id: str
2040
+ :param data: (required)
2041
+ :type data: CreateTemplateFieldsRequestInner
2042
+ :param _request_timeout: timeout setting for this request. If one
2043
+ number provided, it will be total request
2044
+ timeout. It can also be a pair (tuple) of
2045
+ (connection, read) timeouts.
2046
+ :type _request_timeout: int, tuple(int, int), optional
2047
+ :param _request_auth: set to override the auth_settings for an a single
2048
+ request; this effectively ignores the
2049
+ authentication in the spec for a single request.
2050
+ :type _request_auth: dict, optional
2051
+ :param _content_type: force content-type for the request.
2052
+ :type _content_type: str, Optional
2053
+ :param _headers: set to override the headers for a single
2054
+ request; this effectively ignores the headers
2055
+ in the spec for a single request.
2056
+ :type _headers: dict, optional
2057
+ :param _host_index: set to override the host_index for a single
2058
+ request; this effectively ignores the host_index
2059
+ in the spec for a single request.
2060
+ :type _host_index: int, optional
2061
+ :return: Returns the result object.
2062
+ """ # noqa: E501
2063
+
2064
+ _param = self._update_template_field_serialize(
2065
+ id=id,
2066
+ data=data,
2067
+ _request_auth=_request_auth,
2068
+ _content_type=_content_type,
2069
+ _headers=_headers,
2070
+ _host_index=_host_index
2071
+ )
2072
+
2073
+ _response_types_map: Dict[str, Optional[str]] = {
2074
+ '200': "TemplateField",
2075
+ '400': "Dict[str, object]",
2076
+ '404': "Dict[str, object]",
2077
+ }
2078
+ response_data = self.api_client.call_api(
2079
+ *_param,
2080
+ _request_timeout=_request_timeout
2081
+ )
2082
+ response_data.read()
2083
+ return self.api_client.response_deserialize(
2084
+ response_data=response_data,
2085
+ response_types_map=_response_types_map,
2086
+ ).data
2087
+
2088
+
2089
+ @validate_call
2090
+ def update_template_field_with_http_info(
2091
+ self,
2092
+ id: Annotated[StrictStr, Field(description="The field's ID.")],
2093
+ data: CreateTemplateFieldsRequestInner,
2094
+ _request_timeout: Union[
2095
+ None,
2096
+ Annotated[StrictFloat, Field(gt=0)],
2097
+ Tuple[
2098
+ Annotated[StrictFloat, Field(gt=0)],
2099
+ Annotated[StrictFloat, Field(gt=0)]
2100
+ ]
2101
+ ] = None,
2102
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2103
+ _content_type: Optional[StrictStr] = None,
2104
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2105
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2106
+ ) -> ApiResponse[TemplateField]:
2107
+ """Change a template's field
2108
+
2109
+ Changes a template's field; send all of its values, as when adding it. Its page can't change: delete the field and add it again.
2110
+
2111
+ :param id: The field's ID. (required)
2112
+ :type id: str
2113
+ :param data: (required)
2114
+ :type data: CreateTemplateFieldsRequestInner
2115
+ :param _request_timeout: timeout setting for this request. If one
2116
+ number provided, it will be total request
2117
+ timeout. It can also be a pair (tuple) of
2118
+ (connection, read) timeouts.
2119
+ :type _request_timeout: int, tuple(int, int), optional
2120
+ :param _request_auth: set to override the auth_settings for an a single
2121
+ request; this effectively ignores the
2122
+ authentication in the spec for a single request.
2123
+ :type _request_auth: dict, optional
2124
+ :param _content_type: force content-type for the request.
2125
+ :type _content_type: str, Optional
2126
+ :param _headers: set to override the headers for a single
2127
+ request; this effectively ignores the headers
2128
+ in the spec for a single request.
2129
+ :type _headers: dict, optional
2130
+ :param _host_index: set to override the host_index for a single
2131
+ request; this effectively ignores the host_index
2132
+ in the spec for a single request.
2133
+ :type _host_index: int, optional
2134
+ :return: Returns the result object.
2135
+ """ # noqa: E501
2136
+
2137
+ _param = self._update_template_field_serialize(
2138
+ id=id,
2139
+ data=data,
2140
+ _request_auth=_request_auth,
2141
+ _content_type=_content_type,
2142
+ _headers=_headers,
2143
+ _host_index=_host_index
2144
+ )
2145
+
2146
+ _response_types_map: Dict[str, Optional[str]] = {
2147
+ '200': "TemplateField",
2148
+ '400': "Dict[str, object]",
2149
+ '404': "Dict[str, object]",
2150
+ }
2151
+ response_data = self.api_client.call_api(
2152
+ *_param,
2153
+ _request_timeout=_request_timeout
2154
+ )
2155
+ response_data.read()
2156
+ return self.api_client.response_deserialize(
2157
+ response_data=response_data,
2158
+ response_types_map=_response_types_map,
2159
+ )
2160
+
2161
+
2162
+ @validate_call
2163
+ def update_template_field_without_preload_content(
2164
+ self,
2165
+ id: Annotated[StrictStr, Field(description="The field's ID.")],
2166
+ data: CreateTemplateFieldsRequestInner,
2167
+ _request_timeout: Union[
2168
+ None,
2169
+ Annotated[StrictFloat, Field(gt=0)],
2170
+ Tuple[
2171
+ Annotated[StrictFloat, Field(gt=0)],
2172
+ Annotated[StrictFloat, Field(gt=0)]
2173
+ ]
2174
+ ] = None,
2175
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2176
+ _content_type: Optional[StrictStr] = None,
2177
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2178
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2179
+ ) -> RESTResponseType:
2180
+ """Change a template's field
2181
+
2182
+ Changes a template's field; send all of its values, as when adding it. Its page can't change: delete the field and add it again.
2183
+
2184
+ :param id: The field's ID. (required)
2185
+ :type id: str
2186
+ :param data: (required)
2187
+ :type data: CreateTemplateFieldsRequestInner
2188
+ :param _request_timeout: timeout setting for this request. If one
2189
+ number provided, it will be total request
2190
+ timeout. It can also be a pair (tuple) of
2191
+ (connection, read) timeouts.
2192
+ :type _request_timeout: int, tuple(int, int), optional
2193
+ :param _request_auth: set to override the auth_settings for an a single
2194
+ request; this effectively ignores the
2195
+ authentication in the spec for a single request.
2196
+ :type _request_auth: dict, optional
2197
+ :param _content_type: force content-type for the request.
2198
+ :type _content_type: str, Optional
2199
+ :param _headers: set to override the headers for a single
2200
+ request; this effectively ignores the headers
2201
+ in the spec for a single request.
2202
+ :type _headers: dict, optional
2203
+ :param _host_index: set to override the host_index for a single
2204
+ request; this effectively ignores the host_index
2205
+ in the spec for a single request.
2206
+ :type _host_index: int, optional
2207
+ :return: Returns the result object.
2208
+ """ # noqa: E501
2209
+
2210
+ _param = self._update_template_field_serialize(
2211
+ id=id,
2212
+ data=data,
2213
+ _request_auth=_request_auth,
2214
+ _content_type=_content_type,
2215
+ _headers=_headers,
2216
+ _host_index=_host_index
2217
+ )
2218
+
2219
+ _response_types_map: Dict[str, Optional[str]] = {
2220
+ '200': "TemplateField",
2221
+ '400': "Dict[str, object]",
2222
+ '404': "Dict[str, object]",
2223
+ }
2224
+ response_data = self.api_client.call_api(
2225
+ *_param,
2226
+ _request_timeout=_request_timeout
2227
+ )
2228
+ return response_data.response
2229
+
2230
+
2231
+ def _update_template_field_serialize(
2232
+ self,
2233
+ id,
2234
+ data,
2235
+ _request_auth,
2236
+ _content_type,
2237
+ _headers,
2238
+ _host_index,
2239
+ ) -> RequestSerialized:
2240
+
2241
+ _host = None
2242
+
2243
+ _collection_formats: Dict[str, str] = {
2244
+ }
2245
+
2246
+ _path_params: Dict[str, str] = {}
2247
+ _query_params: List[Tuple[str, str]] = []
2248
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2249
+ _form_params: List[Tuple[str, str]] = []
2250
+ _files: Dict[
2251
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2252
+ ] = {}
2253
+ _body_params: Optional[bytes] = None
2254
+
2255
+ # process the path parameters
2256
+ if id is not None:
2257
+ _path_params['id'] = id
2258
+ # process the query parameters
2259
+ # process the header parameters
2260
+ # process the form parameters
2261
+ # process the body parameter
2262
+ if data is not None:
2263
+ _body_params = data
2264
+
2265
+
2266
+ # set the HTTP header `Accept`
2267
+ if 'Accept' not in _header_params:
2268
+ _header_params['Accept'] = self.api_client.select_header_accept(
2269
+ [
2270
+ 'application/json'
2271
+ ]
2272
+ )
2273
+
2274
+ # set the HTTP header `Content-Type`
2275
+ if _content_type:
2276
+ _header_params['Content-Type'] = _content_type
2277
+ else:
2278
+ _default_content_type = (
2279
+ self.api_client.select_header_content_type(
2280
+ [
2281
+ 'application/json'
2282
+ ]
2283
+ )
2284
+ )
2285
+ if _default_content_type is not None:
2286
+ _header_params['Content-Type'] = _default_content_type
2287
+
2288
+ # authentication setting
2289
+ _auth_settings: List[str] = [
2290
+ 'Bearer'
2291
+ ]
2292
+
2293
+ return self.api_client.param_serialize(
2294
+ method='PUT',
2295
+ resource_path='/ap1/templates/fields/{id}/',
2296
+ path_params=_path_params,
2297
+ query_params=_query_params,
2298
+ header_params=_header_params,
2299
+ body=_body_params,
2300
+ post_params=_form_params,
2301
+ files=_files,
2302
+ auth_settings=_auth_settings,
2303
+ collection_formats=_collection_formats,
2304
+ _host=_host,
2305
+ _request_auth=_request_auth
2306
+ )
2307
+
2308
+