templatefox 1.0.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.
@@ -0,0 +1,1085 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ TemplateFox API
5
+
6
+ Generate PDFs from HTML templates via API. Design once, generate thousands.
7
+
8
+ The version of the OpenAPI document: 1.0.0
9
+ Contact: support@pdftemplateapi.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 templatefox.models.s3_config_request import S3ConfigRequest
21
+ from templatefox.models.s3_config_response import S3ConfigResponse
22
+ from templatefox.models.s3_success_response import S3SuccessResponse
23
+ from templatefox.models.s3_test_response import S3TestResponse
24
+
25
+ from templatefox.api_client import ApiClient, RequestSerialized
26
+ from templatefox.api_response import ApiResponse
27
+ from templatefox.rest import RESTResponseType
28
+
29
+
30
+ class IntegrationsApi:
31
+ """NOTE: This class is auto generated by OpenAPI Generator
32
+ Ref: https://openapi-generator.tech
33
+
34
+ Do not edit the class manually.
35
+ """
36
+
37
+ def __init__(self, api_client=None) -> None:
38
+ if api_client is None:
39
+ api_client = ApiClient.get_default()
40
+ self.api_client = api_client
41
+
42
+
43
+ @validate_call
44
+ def delete_s3_config(
45
+ self,
46
+ _request_timeout: Union[
47
+ None,
48
+ Annotated[StrictFloat, Field(gt=0)],
49
+ Tuple[
50
+ Annotated[StrictFloat, Field(gt=0)],
51
+ Annotated[StrictFloat, Field(gt=0)]
52
+ ]
53
+ ] = None,
54
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
55
+ _content_type: Optional[StrictStr] = None,
56
+ _headers: Optional[Dict[StrictStr, Any]] = None,
57
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
58
+ ) -> S3SuccessResponse:
59
+ """Delete S3 configuration
60
+
61
+ Delete S3 storage configuration. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Remove your S3 integration. Generated PDFs will use the default CDN storage after deletion. **Warning:** This action is irreversible. You'll need to reconfigure S3 to use it again. **No credits consumed:** This is a configuration endpoint.
62
+
63
+ :param _request_timeout: timeout setting for this request. If one
64
+ number provided, it will be total request
65
+ timeout. It can also be a pair (tuple) of
66
+ (connection, read) timeouts.
67
+ :type _request_timeout: int, tuple(int, int), optional
68
+ :param _request_auth: set to override the auth_settings for an a single
69
+ request; this effectively ignores the
70
+ authentication in the spec for a single request.
71
+ :type _request_auth: dict, optional
72
+ :param _content_type: force content-type for the request.
73
+ :type _content_type: str, Optional
74
+ :param _headers: set to override the headers for a single
75
+ request; this effectively ignores the headers
76
+ in the spec for a single request.
77
+ :type _headers: dict, optional
78
+ :param _host_index: set to override the host_index for a single
79
+ request; this effectively ignores the host_index
80
+ in the spec for a single request.
81
+ :type _host_index: int, optional
82
+ :return: Returns the result object.
83
+ """ # noqa: E501
84
+
85
+ _param = self._delete_s3_config_serialize(
86
+ _request_auth=_request_auth,
87
+ _content_type=_content_type,
88
+ _headers=_headers,
89
+ _host_index=_host_index
90
+ )
91
+
92
+ _response_types_map: Dict[str, Optional[str]] = {
93
+ '200': "S3SuccessResponse",
94
+ '403': None,
95
+ '422': "HTTPValidationError",
96
+ }
97
+ response_data = self.api_client.call_api(
98
+ *_param,
99
+ _request_timeout=_request_timeout
100
+ )
101
+ response_data.read()
102
+ return self.api_client.response_deserialize(
103
+ response_data=response_data,
104
+ response_types_map=_response_types_map,
105
+ ).data
106
+
107
+
108
+ @validate_call
109
+ def delete_s3_config_with_http_info(
110
+ self,
111
+ _request_timeout: Union[
112
+ None,
113
+ Annotated[StrictFloat, Field(gt=0)],
114
+ Tuple[
115
+ Annotated[StrictFloat, Field(gt=0)],
116
+ Annotated[StrictFloat, Field(gt=0)]
117
+ ]
118
+ ] = None,
119
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
120
+ _content_type: Optional[StrictStr] = None,
121
+ _headers: Optional[Dict[StrictStr, Any]] = None,
122
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
123
+ ) -> ApiResponse[S3SuccessResponse]:
124
+ """Delete S3 configuration
125
+
126
+ Delete S3 storage configuration. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Remove your S3 integration. Generated PDFs will use the default CDN storage after deletion. **Warning:** This action is irreversible. You'll need to reconfigure S3 to use it again. **No credits consumed:** This is a configuration endpoint.
127
+
128
+ :param _request_timeout: timeout setting for this request. If one
129
+ number provided, it will be total request
130
+ timeout. It can also be a pair (tuple) of
131
+ (connection, read) timeouts.
132
+ :type _request_timeout: int, tuple(int, int), optional
133
+ :param _request_auth: set to override the auth_settings for an a single
134
+ request; this effectively ignores the
135
+ authentication in the spec for a single request.
136
+ :type _request_auth: dict, optional
137
+ :param _content_type: force content-type for the request.
138
+ :type _content_type: str, Optional
139
+ :param _headers: set to override the headers for a single
140
+ request; this effectively ignores the headers
141
+ in the spec for a single request.
142
+ :type _headers: dict, optional
143
+ :param _host_index: set to override the host_index for a single
144
+ request; this effectively ignores the host_index
145
+ in the spec for a single request.
146
+ :type _host_index: int, optional
147
+ :return: Returns the result object.
148
+ """ # noqa: E501
149
+
150
+ _param = self._delete_s3_config_serialize(
151
+ _request_auth=_request_auth,
152
+ _content_type=_content_type,
153
+ _headers=_headers,
154
+ _host_index=_host_index
155
+ )
156
+
157
+ _response_types_map: Dict[str, Optional[str]] = {
158
+ '200': "S3SuccessResponse",
159
+ '403': None,
160
+ '422': "HTTPValidationError",
161
+ }
162
+ response_data = self.api_client.call_api(
163
+ *_param,
164
+ _request_timeout=_request_timeout
165
+ )
166
+ response_data.read()
167
+ return self.api_client.response_deserialize(
168
+ response_data=response_data,
169
+ response_types_map=_response_types_map,
170
+ )
171
+
172
+
173
+ @validate_call
174
+ def delete_s3_config_without_preload_content(
175
+ self,
176
+ _request_timeout: Union[
177
+ None,
178
+ Annotated[StrictFloat, Field(gt=0)],
179
+ Tuple[
180
+ Annotated[StrictFloat, Field(gt=0)],
181
+ Annotated[StrictFloat, Field(gt=0)]
182
+ ]
183
+ ] = None,
184
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
185
+ _content_type: Optional[StrictStr] = None,
186
+ _headers: Optional[Dict[StrictStr, Any]] = None,
187
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
188
+ ) -> RESTResponseType:
189
+ """Delete S3 configuration
190
+
191
+ Delete S3 storage configuration. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Remove your S3 integration. Generated PDFs will use the default CDN storage after deletion. **Warning:** This action is irreversible. You'll need to reconfigure S3 to use it again. **No credits consumed:** This is a configuration endpoint.
192
+
193
+ :param _request_timeout: timeout setting for this request. If one
194
+ number provided, it will be total request
195
+ timeout. It can also be a pair (tuple) of
196
+ (connection, read) timeouts.
197
+ :type _request_timeout: int, tuple(int, int), optional
198
+ :param _request_auth: set to override the auth_settings for an a single
199
+ request; this effectively ignores the
200
+ authentication in the spec for a single request.
201
+ :type _request_auth: dict, optional
202
+ :param _content_type: force content-type for the request.
203
+ :type _content_type: str, Optional
204
+ :param _headers: set to override the headers for a single
205
+ request; this effectively ignores the headers
206
+ in the spec for a single request.
207
+ :type _headers: dict, optional
208
+ :param _host_index: set to override the host_index for a single
209
+ request; this effectively ignores the host_index
210
+ in the spec for a single request.
211
+ :type _host_index: int, optional
212
+ :return: Returns the result object.
213
+ """ # noqa: E501
214
+
215
+ _param = self._delete_s3_config_serialize(
216
+ _request_auth=_request_auth,
217
+ _content_type=_content_type,
218
+ _headers=_headers,
219
+ _host_index=_host_index
220
+ )
221
+
222
+ _response_types_map: Dict[str, Optional[str]] = {
223
+ '200': "S3SuccessResponse",
224
+ '403': None,
225
+ '422': "HTTPValidationError",
226
+ }
227
+ response_data = self.api_client.call_api(
228
+ *_param,
229
+ _request_timeout=_request_timeout
230
+ )
231
+ return response_data.response
232
+
233
+
234
+ def _delete_s3_config_serialize(
235
+ self,
236
+ _request_auth,
237
+ _content_type,
238
+ _headers,
239
+ _host_index,
240
+ ) -> RequestSerialized:
241
+
242
+ _host = None
243
+
244
+ _collection_formats: Dict[str, str] = {
245
+ }
246
+
247
+ _path_params: Dict[str, str] = {}
248
+ _query_params: List[Tuple[str, str]] = []
249
+ _header_params: Dict[str, Optional[str]] = _headers or {}
250
+ _form_params: List[Tuple[str, str]] = []
251
+ _files: Dict[
252
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
253
+ ] = {}
254
+ _body_params: Optional[bytes] = None
255
+
256
+ # process the path parameters
257
+ # process the query parameters
258
+ # process the header parameters
259
+ # process the form parameters
260
+ # process the body parameter
261
+
262
+
263
+ # set the HTTP header `Accept`
264
+ if 'Accept' not in _header_params:
265
+ _header_params['Accept'] = self.api_client.select_header_accept(
266
+ [
267
+ 'application/json'
268
+ ]
269
+ )
270
+
271
+
272
+ # authentication setting
273
+ _auth_settings: List[str] = [
274
+ 'ApiKeyAuth'
275
+ ]
276
+
277
+ return self.api_client.param_serialize(
278
+ method='DELETE',
279
+ resource_path='/v1/integrations/s3',
280
+ path_params=_path_params,
281
+ query_params=_query_params,
282
+ header_params=_header_params,
283
+ body=_body_params,
284
+ post_params=_form_params,
285
+ files=_files,
286
+ auth_settings=_auth_settings,
287
+ collection_formats=_collection_formats,
288
+ _host=_host,
289
+ _request_auth=_request_auth
290
+ )
291
+
292
+
293
+
294
+
295
+ @validate_call
296
+ def get_s3_config(
297
+ self,
298
+ _request_timeout: Union[
299
+ None,
300
+ Annotated[StrictFloat, Field(gt=0)],
301
+ Tuple[
302
+ Annotated[StrictFloat, Field(gt=0)],
303
+ Annotated[StrictFloat, Field(gt=0)]
304
+ ]
305
+ ] = None,
306
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
307
+ _content_type: Optional[StrictStr] = None,
308
+ _headers: Optional[Dict[StrictStr, Any]] = None,
309
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
310
+ ) -> S3ConfigResponse:
311
+ """Get S3 configuration
312
+
313
+ Get current S3 storage configuration. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Retrieve your S3 integration settings. Secret access key is masked for security. **Returns 404** if S3 is not configured. **No credits consumed:** This is a read-only endpoint.
314
+
315
+ :param _request_timeout: timeout setting for this request. If one
316
+ number provided, it will be total request
317
+ timeout. It can also be a pair (tuple) of
318
+ (connection, read) timeouts.
319
+ :type _request_timeout: int, tuple(int, int), optional
320
+ :param _request_auth: set to override the auth_settings for an a single
321
+ request; this effectively ignores the
322
+ authentication in the spec for a single request.
323
+ :type _request_auth: dict, optional
324
+ :param _content_type: force content-type for the request.
325
+ :type _content_type: str, Optional
326
+ :param _headers: set to override the headers for a single
327
+ request; this effectively ignores the headers
328
+ in the spec for a single request.
329
+ :type _headers: dict, optional
330
+ :param _host_index: set to override the host_index for a single
331
+ request; this effectively ignores the host_index
332
+ in the spec for a single request.
333
+ :type _host_index: int, optional
334
+ :return: Returns the result object.
335
+ """ # noqa: E501
336
+
337
+ _param = self._get_s3_config_serialize(
338
+ _request_auth=_request_auth,
339
+ _content_type=_content_type,
340
+ _headers=_headers,
341
+ _host_index=_host_index
342
+ )
343
+
344
+ _response_types_map: Dict[str, Optional[str]] = {
345
+ '200': "S3ConfigResponse",
346
+ '403': None,
347
+ '404': None,
348
+ '422': "HTTPValidationError",
349
+ }
350
+ response_data = self.api_client.call_api(
351
+ *_param,
352
+ _request_timeout=_request_timeout
353
+ )
354
+ response_data.read()
355
+ return self.api_client.response_deserialize(
356
+ response_data=response_data,
357
+ response_types_map=_response_types_map,
358
+ ).data
359
+
360
+
361
+ @validate_call
362
+ def get_s3_config_with_http_info(
363
+ self,
364
+ _request_timeout: Union[
365
+ None,
366
+ Annotated[StrictFloat, Field(gt=0)],
367
+ Tuple[
368
+ Annotated[StrictFloat, Field(gt=0)],
369
+ Annotated[StrictFloat, Field(gt=0)]
370
+ ]
371
+ ] = None,
372
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
373
+ _content_type: Optional[StrictStr] = None,
374
+ _headers: Optional[Dict[StrictStr, Any]] = None,
375
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
376
+ ) -> ApiResponse[S3ConfigResponse]:
377
+ """Get S3 configuration
378
+
379
+ Get current S3 storage configuration. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Retrieve your S3 integration settings. Secret access key is masked for security. **Returns 404** if S3 is not configured. **No credits consumed:** This is a read-only endpoint.
380
+
381
+ :param _request_timeout: timeout setting for this request. If one
382
+ number provided, it will be total request
383
+ timeout. It can also be a pair (tuple) of
384
+ (connection, read) timeouts.
385
+ :type _request_timeout: int, tuple(int, int), optional
386
+ :param _request_auth: set to override the auth_settings for an a single
387
+ request; this effectively ignores the
388
+ authentication in the spec for a single request.
389
+ :type _request_auth: dict, optional
390
+ :param _content_type: force content-type for the request.
391
+ :type _content_type: str, Optional
392
+ :param _headers: set to override the headers for a single
393
+ request; this effectively ignores the headers
394
+ in the spec for a single request.
395
+ :type _headers: dict, optional
396
+ :param _host_index: set to override the host_index for a single
397
+ request; this effectively ignores the host_index
398
+ in the spec for a single request.
399
+ :type _host_index: int, optional
400
+ :return: Returns the result object.
401
+ """ # noqa: E501
402
+
403
+ _param = self._get_s3_config_serialize(
404
+ _request_auth=_request_auth,
405
+ _content_type=_content_type,
406
+ _headers=_headers,
407
+ _host_index=_host_index
408
+ )
409
+
410
+ _response_types_map: Dict[str, Optional[str]] = {
411
+ '200': "S3ConfigResponse",
412
+ '403': None,
413
+ '404': None,
414
+ '422': "HTTPValidationError",
415
+ }
416
+ response_data = self.api_client.call_api(
417
+ *_param,
418
+ _request_timeout=_request_timeout
419
+ )
420
+ response_data.read()
421
+ return self.api_client.response_deserialize(
422
+ response_data=response_data,
423
+ response_types_map=_response_types_map,
424
+ )
425
+
426
+
427
+ @validate_call
428
+ def get_s3_config_without_preload_content(
429
+ self,
430
+ _request_timeout: Union[
431
+ None,
432
+ Annotated[StrictFloat, Field(gt=0)],
433
+ Tuple[
434
+ Annotated[StrictFloat, Field(gt=0)],
435
+ Annotated[StrictFloat, Field(gt=0)]
436
+ ]
437
+ ] = None,
438
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
439
+ _content_type: Optional[StrictStr] = None,
440
+ _headers: Optional[Dict[StrictStr, Any]] = None,
441
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
442
+ ) -> RESTResponseType:
443
+ """Get S3 configuration
444
+
445
+ Get current S3 storage configuration. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Retrieve your S3 integration settings. Secret access key is masked for security. **Returns 404** if S3 is not configured. **No credits consumed:** This is a read-only endpoint.
446
+
447
+ :param _request_timeout: timeout setting for this request. If one
448
+ number provided, it will be total request
449
+ timeout. It can also be a pair (tuple) of
450
+ (connection, read) timeouts.
451
+ :type _request_timeout: int, tuple(int, int), optional
452
+ :param _request_auth: set to override the auth_settings for an a single
453
+ request; this effectively ignores the
454
+ authentication in the spec for a single request.
455
+ :type _request_auth: dict, optional
456
+ :param _content_type: force content-type for the request.
457
+ :type _content_type: str, Optional
458
+ :param _headers: set to override the headers for a single
459
+ request; this effectively ignores the headers
460
+ in the spec for a single request.
461
+ :type _headers: dict, optional
462
+ :param _host_index: set to override the host_index for a single
463
+ request; this effectively ignores the host_index
464
+ in the spec for a single request.
465
+ :type _host_index: int, optional
466
+ :return: Returns the result object.
467
+ """ # noqa: E501
468
+
469
+ _param = self._get_s3_config_serialize(
470
+ _request_auth=_request_auth,
471
+ _content_type=_content_type,
472
+ _headers=_headers,
473
+ _host_index=_host_index
474
+ )
475
+
476
+ _response_types_map: Dict[str, Optional[str]] = {
477
+ '200': "S3ConfigResponse",
478
+ '403': None,
479
+ '404': None,
480
+ '422': "HTTPValidationError",
481
+ }
482
+ response_data = self.api_client.call_api(
483
+ *_param,
484
+ _request_timeout=_request_timeout
485
+ )
486
+ return response_data.response
487
+
488
+
489
+ def _get_s3_config_serialize(
490
+ self,
491
+ _request_auth,
492
+ _content_type,
493
+ _headers,
494
+ _host_index,
495
+ ) -> RequestSerialized:
496
+
497
+ _host = None
498
+
499
+ _collection_formats: Dict[str, str] = {
500
+ }
501
+
502
+ _path_params: Dict[str, str] = {}
503
+ _query_params: List[Tuple[str, str]] = []
504
+ _header_params: Dict[str, Optional[str]] = _headers or {}
505
+ _form_params: List[Tuple[str, str]] = []
506
+ _files: Dict[
507
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
508
+ ] = {}
509
+ _body_params: Optional[bytes] = None
510
+
511
+ # process the path parameters
512
+ # process the query parameters
513
+ # process the header parameters
514
+ # process the form parameters
515
+ # process the body parameter
516
+
517
+
518
+ # set the HTTP header `Accept`
519
+ if 'Accept' not in _header_params:
520
+ _header_params['Accept'] = self.api_client.select_header_accept(
521
+ [
522
+ 'application/json'
523
+ ]
524
+ )
525
+
526
+
527
+ # authentication setting
528
+ _auth_settings: List[str] = [
529
+ 'ApiKeyAuth'
530
+ ]
531
+
532
+ return self.api_client.param_serialize(
533
+ method='GET',
534
+ resource_path='/v1/integrations/s3',
535
+ path_params=_path_params,
536
+ query_params=_query_params,
537
+ header_params=_header_params,
538
+ body=_body_params,
539
+ post_params=_form_params,
540
+ files=_files,
541
+ auth_settings=_auth_settings,
542
+ collection_formats=_collection_formats,
543
+ _host=_host,
544
+ _request_auth=_request_auth
545
+ )
546
+
547
+
548
+
549
+
550
+ @validate_call
551
+ def save_s3_config(
552
+ self,
553
+ s3_config_request: S3ConfigRequest,
554
+ _request_timeout: Union[
555
+ None,
556
+ Annotated[StrictFloat, Field(gt=0)],
557
+ Tuple[
558
+ Annotated[StrictFloat, Field(gt=0)],
559
+ Annotated[StrictFloat, Field(gt=0)]
560
+ ]
561
+ ] = None,
562
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
563
+ _content_type: Optional[StrictStr] = None,
564
+ _headers: Optional[Dict[StrictStr, Any]] = None,
565
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
566
+ ) -> S3SuccessResponse:
567
+ """Save S3 configuration
568
+
569
+ Save or update S3-compatible storage configuration. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Configure your S3-compatible storage to receive generated PDFs directly in your own bucket instead of the default CDN. **Supported providers:** - Amazon S3 - DigitalOcean Spaces - Cloudflare R2 - MinIO - Any S3-compatible storage **Secret key behavior:** - For new configuration: `secret_access_key` is required - For updates: Omit `secret_access_key` to keep existing value **No credits consumed:** This is a configuration endpoint.
570
+
571
+ :param s3_config_request: (required)
572
+ :type s3_config_request: S3ConfigRequest
573
+ :param _request_timeout: timeout setting for this request. If one
574
+ number provided, it will be total request
575
+ timeout. It can also be a pair (tuple) of
576
+ (connection, read) timeouts.
577
+ :type _request_timeout: int, tuple(int, int), optional
578
+ :param _request_auth: set to override the auth_settings for an a single
579
+ request; this effectively ignores the
580
+ authentication in the spec for a single request.
581
+ :type _request_auth: dict, optional
582
+ :param _content_type: force content-type for the request.
583
+ :type _content_type: str, Optional
584
+ :param _headers: set to override the headers for a single
585
+ request; this effectively ignores the headers
586
+ in the spec for a single request.
587
+ :type _headers: dict, optional
588
+ :param _host_index: set to override the host_index for a single
589
+ request; this effectively ignores the host_index
590
+ in the spec for a single request.
591
+ :type _host_index: int, optional
592
+ :return: Returns the result object.
593
+ """ # noqa: E501
594
+
595
+ _param = self._save_s3_config_serialize(
596
+ s3_config_request=s3_config_request,
597
+ _request_auth=_request_auth,
598
+ _content_type=_content_type,
599
+ _headers=_headers,
600
+ _host_index=_host_index
601
+ )
602
+
603
+ _response_types_map: Dict[str, Optional[str]] = {
604
+ '200': "S3SuccessResponse",
605
+ '400': None,
606
+ '403': None,
607
+ '422': "HTTPValidationError",
608
+ }
609
+ response_data = self.api_client.call_api(
610
+ *_param,
611
+ _request_timeout=_request_timeout
612
+ )
613
+ response_data.read()
614
+ return self.api_client.response_deserialize(
615
+ response_data=response_data,
616
+ response_types_map=_response_types_map,
617
+ ).data
618
+
619
+
620
+ @validate_call
621
+ def save_s3_config_with_http_info(
622
+ self,
623
+ s3_config_request: S3ConfigRequest,
624
+ _request_timeout: Union[
625
+ None,
626
+ Annotated[StrictFloat, Field(gt=0)],
627
+ Tuple[
628
+ Annotated[StrictFloat, Field(gt=0)],
629
+ Annotated[StrictFloat, Field(gt=0)]
630
+ ]
631
+ ] = None,
632
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
633
+ _content_type: Optional[StrictStr] = None,
634
+ _headers: Optional[Dict[StrictStr, Any]] = None,
635
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
636
+ ) -> ApiResponse[S3SuccessResponse]:
637
+ """Save S3 configuration
638
+
639
+ Save or update S3-compatible storage configuration. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Configure your S3-compatible storage to receive generated PDFs directly in your own bucket instead of the default CDN. **Supported providers:** - Amazon S3 - DigitalOcean Spaces - Cloudflare R2 - MinIO - Any S3-compatible storage **Secret key behavior:** - For new configuration: `secret_access_key` is required - For updates: Omit `secret_access_key` to keep existing value **No credits consumed:** This is a configuration endpoint.
640
+
641
+ :param s3_config_request: (required)
642
+ :type s3_config_request: S3ConfigRequest
643
+ :param _request_timeout: timeout setting for this request. If one
644
+ number provided, it will be total request
645
+ timeout. It can also be a pair (tuple) of
646
+ (connection, read) timeouts.
647
+ :type _request_timeout: int, tuple(int, int), optional
648
+ :param _request_auth: set to override the auth_settings for an a single
649
+ request; this effectively ignores the
650
+ authentication in the spec for a single request.
651
+ :type _request_auth: dict, optional
652
+ :param _content_type: force content-type for the request.
653
+ :type _content_type: str, Optional
654
+ :param _headers: set to override the headers for a single
655
+ request; this effectively ignores the headers
656
+ in the spec for a single request.
657
+ :type _headers: dict, optional
658
+ :param _host_index: set to override the host_index for a single
659
+ request; this effectively ignores the host_index
660
+ in the spec for a single request.
661
+ :type _host_index: int, optional
662
+ :return: Returns the result object.
663
+ """ # noqa: E501
664
+
665
+ _param = self._save_s3_config_serialize(
666
+ s3_config_request=s3_config_request,
667
+ _request_auth=_request_auth,
668
+ _content_type=_content_type,
669
+ _headers=_headers,
670
+ _host_index=_host_index
671
+ )
672
+
673
+ _response_types_map: Dict[str, Optional[str]] = {
674
+ '200': "S3SuccessResponse",
675
+ '400': None,
676
+ '403': None,
677
+ '422': "HTTPValidationError",
678
+ }
679
+ response_data = self.api_client.call_api(
680
+ *_param,
681
+ _request_timeout=_request_timeout
682
+ )
683
+ response_data.read()
684
+ return self.api_client.response_deserialize(
685
+ response_data=response_data,
686
+ response_types_map=_response_types_map,
687
+ )
688
+
689
+
690
+ @validate_call
691
+ def save_s3_config_without_preload_content(
692
+ self,
693
+ s3_config_request: S3ConfigRequest,
694
+ _request_timeout: Union[
695
+ None,
696
+ Annotated[StrictFloat, Field(gt=0)],
697
+ Tuple[
698
+ Annotated[StrictFloat, Field(gt=0)],
699
+ Annotated[StrictFloat, Field(gt=0)]
700
+ ]
701
+ ] = None,
702
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
703
+ _content_type: Optional[StrictStr] = None,
704
+ _headers: Optional[Dict[StrictStr, Any]] = None,
705
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
706
+ ) -> RESTResponseType:
707
+ """Save S3 configuration
708
+
709
+ Save or update S3-compatible storage configuration. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Configure your S3-compatible storage to receive generated PDFs directly in your own bucket instead of the default CDN. **Supported providers:** - Amazon S3 - DigitalOcean Spaces - Cloudflare R2 - MinIO - Any S3-compatible storage **Secret key behavior:** - For new configuration: `secret_access_key` is required - For updates: Omit `secret_access_key` to keep existing value **No credits consumed:** This is a configuration endpoint.
710
+
711
+ :param s3_config_request: (required)
712
+ :type s3_config_request: S3ConfigRequest
713
+ :param _request_timeout: timeout setting for this request. If one
714
+ number provided, it will be total request
715
+ timeout. It can also be a pair (tuple) of
716
+ (connection, read) timeouts.
717
+ :type _request_timeout: int, tuple(int, int), optional
718
+ :param _request_auth: set to override the auth_settings for an a single
719
+ request; this effectively ignores the
720
+ authentication in the spec for a single request.
721
+ :type _request_auth: dict, optional
722
+ :param _content_type: force content-type for the request.
723
+ :type _content_type: str, Optional
724
+ :param _headers: set to override the headers for a single
725
+ request; this effectively ignores the headers
726
+ in the spec for a single request.
727
+ :type _headers: dict, optional
728
+ :param _host_index: set to override the host_index for a single
729
+ request; this effectively ignores the host_index
730
+ in the spec for a single request.
731
+ :type _host_index: int, optional
732
+ :return: Returns the result object.
733
+ """ # noqa: E501
734
+
735
+ _param = self._save_s3_config_serialize(
736
+ s3_config_request=s3_config_request,
737
+ _request_auth=_request_auth,
738
+ _content_type=_content_type,
739
+ _headers=_headers,
740
+ _host_index=_host_index
741
+ )
742
+
743
+ _response_types_map: Dict[str, Optional[str]] = {
744
+ '200': "S3SuccessResponse",
745
+ '400': None,
746
+ '403': None,
747
+ '422': "HTTPValidationError",
748
+ }
749
+ response_data = self.api_client.call_api(
750
+ *_param,
751
+ _request_timeout=_request_timeout
752
+ )
753
+ return response_data.response
754
+
755
+
756
+ def _save_s3_config_serialize(
757
+ self,
758
+ s3_config_request,
759
+ _request_auth,
760
+ _content_type,
761
+ _headers,
762
+ _host_index,
763
+ ) -> RequestSerialized:
764
+
765
+ _host = None
766
+
767
+ _collection_formats: Dict[str, str] = {
768
+ }
769
+
770
+ _path_params: Dict[str, str] = {}
771
+ _query_params: List[Tuple[str, str]] = []
772
+ _header_params: Dict[str, Optional[str]] = _headers or {}
773
+ _form_params: List[Tuple[str, str]] = []
774
+ _files: Dict[
775
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
776
+ ] = {}
777
+ _body_params: Optional[bytes] = None
778
+
779
+ # process the path parameters
780
+ # process the query parameters
781
+ # process the header parameters
782
+ # process the form parameters
783
+ # process the body parameter
784
+ if s3_config_request is not None:
785
+ _body_params = s3_config_request
786
+
787
+
788
+ # set the HTTP header `Accept`
789
+ if 'Accept' not in _header_params:
790
+ _header_params['Accept'] = self.api_client.select_header_accept(
791
+ [
792
+ 'application/json'
793
+ ]
794
+ )
795
+
796
+ # set the HTTP header `Content-Type`
797
+ if _content_type:
798
+ _header_params['Content-Type'] = _content_type
799
+ else:
800
+ _default_content_type = (
801
+ self.api_client.select_header_content_type(
802
+ [
803
+ 'application/json'
804
+ ]
805
+ )
806
+ )
807
+ if _default_content_type is not None:
808
+ _header_params['Content-Type'] = _default_content_type
809
+
810
+ # authentication setting
811
+ _auth_settings: List[str] = [
812
+ 'ApiKeyAuth'
813
+ ]
814
+
815
+ return self.api_client.param_serialize(
816
+ method='POST',
817
+ resource_path='/v1/integrations/s3',
818
+ path_params=_path_params,
819
+ query_params=_query_params,
820
+ header_params=_header_params,
821
+ body=_body_params,
822
+ post_params=_form_params,
823
+ files=_files,
824
+ auth_settings=_auth_settings,
825
+ collection_formats=_collection_formats,
826
+ _host=_host,
827
+ _request_auth=_request_auth
828
+ )
829
+
830
+
831
+
832
+
833
+ @validate_call
834
+ def test_s3_connection(
835
+ self,
836
+ _request_timeout: Union[
837
+ None,
838
+ Annotated[StrictFloat, Field(gt=0)],
839
+ Tuple[
840
+ Annotated[StrictFloat, Field(gt=0)],
841
+ Annotated[StrictFloat, Field(gt=0)]
842
+ ]
843
+ ] = None,
844
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
845
+ _content_type: Optional[StrictStr] = None,
846
+ _headers: Optional[Dict[StrictStr, Any]] = None,
847
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
848
+ ) -> S3TestResponse:
849
+ """Test S3 connection
850
+
851
+ Test S3 connection with stored credentials. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Verify your S3 configuration is working correctly. The test will: 1. Connect to the endpoint 2. Verify bucket access 3. Check write permissions by uploading a small test file **Prerequisite:** S3 must be configured first using `POST /v1/integrations/s3` **No credits consumed:** This is a diagnostic endpoint.
852
+
853
+ :param _request_timeout: timeout setting for this request. If one
854
+ number provided, it will be total request
855
+ timeout. It can also be a pair (tuple) of
856
+ (connection, read) timeouts.
857
+ :type _request_timeout: int, tuple(int, int), optional
858
+ :param _request_auth: set to override the auth_settings for an a single
859
+ request; this effectively ignores the
860
+ authentication in the spec for a single request.
861
+ :type _request_auth: dict, optional
862
+ :param _content_type: force content-type for the request.
863
+ :type _content_type: str, Optional
864
+ :param _headers: set to override the headers for a single
865
+ request; this effectively ignores the headers
866
+ in the spec for a single request.
867
+ :type _headers: dict, optional
868
+ :param _host_index: set to override the host_index for a single
869
+ request; this effectively ignores the host_index
870
+ in the spec for a single request.
871
+ :type _host_index: int, optional
872
+ :return: Returns the result object.
873
+ """ # noqa: E501
874
+
875
+ _param = self._test_s3_connection_serialize(
876
+ _request_auth=_request_auth,
877
+ _content_type=_content_type,
878
+ _headers=_headers,
879
+ _host_index=_host_index
880
+ )
881
+
882
+ _response_types_map: Dict[str, Optional[str]] = {
883
+ '200': "S3TestResponse",
884
+ '400': None,
885
+ '403': None,
886
+ '422': "HTTPValidationError",
887
+ }
888
+ response_data = self.api_client.call_api(
889
+ *_param,
890
+ _request_timeout=_request_timeout
891
+ )
892
+ response_data.read()
893
+ return self.api_client.response_deserialize(
894
+ response_data=response_data,
895
+ response_types_map=_response_types_map,
896
+ ).data
897
+
898
+
899
+ @validate_call
900
+ def test_s3_connection_with_http_info(
901
+ self,
902
+ _request_timeout: Union[
903
+ None,
904
+ Annotated[StrictFloat, Field(gt=0)],
905
+ Tuple[
906
+ Annotated[StrictFloat, Field(gt=0)],
907
+ Annotated[StrictFloat, Field(gt=0)]
908
+ ]
909
+ ] = None,
910
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
911
+ _content_type: Optional[StrictStr] = None,
912
+ _headers: Optional[Dict[StrictStr, Any]] = None,
913
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
914
+ ) -> ApiResponse[S3TestResponse]:
915
+ """Test S3 connection
916
+
917
+ Test S3 connection with stored credentials. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Verify your S3 configuration is working correctly. The test will: 1. Connect to the endpoint 2. Verify bucket access 3. Check write permissions by uploading a small test file **Prerequisite:** S3 must be configured first using `POST /v1/integrations/s3` **No credits consumed:** This is a diagnostic endpoint.
918
+
919
+ :param _request_timeout: timeout setting for this request. If one
920
+ number provided, it will be total request
921
+ timeout. It can also be a pair (tuple) of
922
+ (connection, read) timeouts.
923
+ :type _request_timeout: int, tuple(int, int), optional
924
+ :param _request_auth: set to override the auth_settings for an a single
925
+ request; this effectively ignores the
926
+ authentication in the spec for a single request.
927
+ :type _request_auth: dict, optional
928
+ :param _content_type: force content-type for the request.
929
+ :type _content_type: str, Optional
930
+ :param _headers: set to override the headers for a single
931
+ request; this effectively ignores the headers
932
+ in the spec for a single request.
933
+ :type _headers: dict, optional
934
+ :param _host_index: set to override the host_index for a single
935
+ request; this effectively ignores the host_index
936
+ in the spec for a single request.
937
+ :type _host_index: int, optional
938
+ :return: Returns the result object.
939
+ """ # noqa: E501
940
+
941
+ _param = self._test_s3_connection_serialize(
942
+ _request_auth=_request_auth,
943
+ _content_type=_content_type,
944
+ _headers=_headers,
945
+ _host_index=_host_index
946
+ )
947
+
948
+ _response_types_map: Dict[str, Optional[str]] = {
949
+ '200': "S3TestResponse",
950
+ '400': None,
951
+ '403': None,
952
+ '422': "HTTPValidationError",
953
+ }
954
+ response_data = self.api_client.call_api(
955
+ *_param,
956
+ _request_timeout=_request_timeout
957
+ )
958
+ response_data.read()
959
+ return self.api_client.response_deserialize(
960
+ response_data=response_data,
961
+ response_types_map=_response_types_map,
962
+ )
963
+
964
+
965
+ @validate_call
966
+ def test_s3_connection_without_preload_content(
967
+ self,
968
+ _request_timeout: Union[
969
+ None,
970
+ Annotated[StrictFloat, Field(gt=0)],
971
+ Tuple[
972
+ Annotated[StrictFloat, Field(gt=0)],
973
+ Annotated[StrictFloat, Field(gt=0)]
974
+ ]
975
+ ] = None,
976
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
977
+ _content_type: Optional[StrictStr] = None,
978
+ _headers: Optional[Dict[StrictStr, Any]] = None,
979
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
980
+ ) -> RESTResponseType:
981
+ """Test S3 connection
982
+
983
+ Test S3 connection with stored credentials. **Authentication:** API Key required (`x-api-key` header) with admin privileges **Usage:** Verify your S3 configuration is working correctly. The test will: 1. Connect to the endpoint 2. Verify bucket access 3. Check write permissions by uploading a small test file **Prerequisite:** S3 must be configured first using `POST /v1/integrations/s3` **No credits consumed:** This is a diagnostic endpoint.
984
+
985
+ :param _request_timeout: timeout setting for this request. If one
986
+ number provided, it will be total request
987
+ timeout. It can also be a pair (tuple) of
988
+ (connection, read) timeouts.
989
+ :type _request_timeout: int, tuple(int, int), optional
990
+ :param _request_auth: set to override the auth_settings for an a single
991
+ request; this effectively ignores the
992
+ authentication in the spec for a single request.
993
+ :type _request_auth: dict, optional
994
+ :param _content_type: force content-type for the request.
995
+ :type _content_type: str, Optional
996
+ :param _headers: set to override the headers for a single
997
+ request; this effectively ignores the headers
998
+ in the spec for a single request.
999
+ :type _headers: dict, optional
1000
+ :param _host_index: set to override the host_index for a single
1001
+ request; this effectively ignores the host_index
1002
+ in the spec for a single request.
1003
+ :type _host_index: int, optional
1004
+ :return: Returns the result object.
1005
+ """ # noqa: E501
1006
+
1007
+ _param = self._test_s3_connection_serialize(
1008
+ _request_auth=_request_auth,
1009
+ _content_type=_content_type,
1010
+ _headers=_headers,
1011
+ _host_index=_host_index
1012
+ )
1013
+
1014
+ _response_types_map: Dict[str, Optional[str]] = {
1015
+ '200': "S3TestResponse",
1016
+ '400': None,
1017
+ '403': None,
1018
+ '422': "HTTPValidationError",
1019
+ }
1020
+ response_data = self.api_client.call_api(
1021
+ *_param,
1022
+ _request_timeout=_request_timeout
1023
+ )
1024
+ return response_data.response
1025
+
1026
+
1027
+ def _test_s3_connection_serialize(
1028
+ self,
1029
+ _request_auth,
1030
+ _content_type,
1031
+ _headers,
1032
+ _host_index,
1033
+ ) -> RequestSerialized:
1034
+
1035
+ _host = None
1036
+
1037
+ _collection_formats: Dict[str, str] = {
1038
+ }
1039
+
1040
+ _path_params: Dict[str, str] = {}
1041
+ _query_params: List[Tuple[str, str]] = []
1042
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1043
+ _form_params: List[Tuple[str, str]] = []
1044
+ _files: Dict[
1045
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1046
+ ] = {}
1047
+ _body_params: Optional[bytes] = None
1048
+
1049
+ # process the path parameters
1050
+ # process the query parameters
1051
+ # process the header parameters
1052
+ # process the form parameters
1053
+ # process the body parameter
1054
+
1055
+
1056
+ # set the HTTP header `Accept`
1057
+ if 'Accept' not in _header_params:
1058
+ _header_params['Accept'] = self.api_client.select_header_accept(
1059
+ [
1060
+ 'application/json'
1061
+ ]
1062
+ )
1063
+
1064
+
1065
+ # authentication setting
1066
+ _auth_settings: List[str] = [
1067
+ 'ApiKeyAuth'
1068
+ ]
1069
+
1070
+ return self.api_client.param_serialize(
1071
+ method='POST',
1072
+ resource_path='/v1/integrations/s3/test',
1073
+ path_params=_path_params,
1074
+ query_params=_query_params,
1075
+ header_params=_header_params,
1076
+ body=_body_params,
1077
+ post_params=_form_params,
1078
+ files=_files,
1079
+ auth_settings=_auth_settings,
1080
+ collection_formats=_collection_formats,
1081
+ _host=_host,
1082
+ _request_auth=_request_auth
1083
+ )
1084
+
1085
+