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.
- templatefox/__init__.py +87 -0
- templatefox/api/__init__.py +8 -0
- templatefox/api/account_api.py +579 -0
- templatefox/api/integrations_api.py +1085 -0
- templatefox/api/pdf_api.py +325 -0
- templatefox/api/templates_api.py +562 -0
- templatefox/api_client.py +805 -0
- templatefox/api_response.py +21 -0
- templatefox/configuration.py +609 -0
- templatefox/exceptions.py +220 -0
- templatefox/models/__init__.py +33 -0
- templatefox/models/account_info_response.py +95 -0
- templatefox/models/create_pdf_request.py +149 -0
- templatefox/models/create_pdf_response.py +94 -0
- templatefox/models/export_type.py +38 -0
- templatefox/models/http_validation_error.py +96 -0
- templatefox/models/location_inner.py +139 -0
- templatefox/models/s3_config_request.py +126 -0
- templatefox/models/s3_config_response.py +98 -0
- templatefox/models/s3_success_response.py +88 -0
- templatefox/models/s3_test_response.py +90 -0
- templatefox/models/template_field.py +101 -0
- templatefox/models/template_list_item.py +94 -0
- templatefox/models/templates_list_response.py +96 -0
- templatefox/models/transaction.py +108 -0
- templatefox/models/transactions_response.py +102 -0
- templatefox/models/validation_error.py +100 -0
- templatefox/py.typed +0 -0
- templatefox/rest.py +264 -0
- templatefox-1.0.0.dist-info/METADATA +225 -0
- templatefox-1.0.0.dist-info/RECORD +34 -0
- templatefox-1.0.0.dist-info/WHEEL +5 -0
- templatefox-1.0.0.dist-info/licenses/LICENSE +21 -0
- templatefox-1.0.0.dist-info/top_level.txt +1 -0
templatefox/__init__.py
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
TemplateFox API
|
|
7
|
+
|
|
8
|
+
Generate PDFs from HTML templates via API. Design once, generate thousands.
|
|
9
|
+
|
|
10
|
+
The version of the OpenAPI document: 1.0.0
|
|
11
|
+
Contact: support@pdftemplateapi.com
|
|
12
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
13
|
+
|
|
14
|
+
Do not edit the class manually.
|
|
15
|
+
""" # noqa: E501
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
__version__ = "1.0.0"
|
|
19
|
+
|
|
20
|
+
# Define package exports
|
|
21
|
+
__all__ = [
|
|
22
|
+
"AccountApi",
|
|
23
|
+
"IntegrationsApi",
|
|
24
|
+
"PDFApi",
|
|
25
|
+
"TemplatesApi",
|
|
26
|
+
"ApiResponse",
|
|
27
|
+
"ApiClient",
|
|
28
|
+
"Configuration",
|
|
29
|
+
"OpenApiException",
|
|
30
|
+
"ApiTypeError",
|
|
31
|
+
"ApiValueError",
|
|
32
|
+
"ApiKeyError",
|
|
33
|
+
"ApiAttributeError",
|
|
34
|
+
"ApiException",
|
|
35
|
+
"AccountInfoResponse",
|
|
36
|
+
"CreatePdfRequest",
|
|
37
|
+
"CreatePdfResponse",
|
|
38
|
+
"ExportType",
|
|
39
|
+
"HTTPValidationError",
|
|
40
|
+
"LocationInner",
|
|
41
|
+
"S3ConfigRequest",
|
|
42
|
+
"S3ConfigResponse",
|
|
43
|
+
"S3SuccessResponse",
|
|
44
|
+
"S3TestResponse",
|
|
45
|
+
"TemplateField",
|
|
46
|
+
"TemplateListItem",
|
|
47
|
+
"TemplatesListResponse",
|
|
48
|
+
"Transaction",
|
|
49
|
+
"TransactionsResponse",
|
|
50
|
+
"ValidationError",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
# import apis into sdk package
|
|
54
|
+
from templatefox.api.account_api import AccountApi as AccountApi
|
|
55
|
+
from templatefox.api.integrations_api import IntegrationsApi as IntegrationsApi
|
|
56
|
+
from templatefox.api.pdf_api import PDFApi as PDFApi
|
|
57
|
+
from templatefox.api.templates_api import TemplatesApi as TemplatesApi
|
|
58
|
+
|
|
59
|
+
# import ApiClient
|
|
60
|
+
from templatefox.api_response import ApiResponse as ApiResponse
|
|
61
|
+
from templatefox.api_client import ApiClient as ApiClient
|
|
62
|
+
from templatefox.configuration import Configuration as Configuration
|
|
63
|
+
from templatefox.exceptions import OpenApiException as OpenApiException
|
|
64
|
+
from templatefox.exceptions import ApiTypeError as ApiTypeError
|
|
65
|
+
from templatefox.exceptions import ApiValueError as ApiValueError
|
|
66
|
+
from templatefox.exceptions import ApiKeyError as ApiKeyError
|
|
67
|
+
from templatefox.exceptions import ApiAttributeError as ApiAttributeError
|
|
68
|
+
from templatefox.exceptions import ApiException as ApiException
|
|
69
|
+
|
|
70
|
+
# import models into sdk package
|
|
71
|
+
from templatefox.models.account_info_response import AccountInfoResponse as AccountInfoResponse
|
|
72
|
+
from templatefox.models.create_pdf_request import CreatePdfRequest as CreatePdfRequest
|
|
73
|
+
from templatefox.models.create_pdf_response import CreatePdfResponse as CreatePdfResponse
|
|
74
|
+
from templatefox.models.export_type import ExportType as ExportType
|
|
75
|
+
from templatefox.models.http_validation_error import HTTPValidationError as HTTPValidationError
|
|
76
|
+
from templatefox.models.location_inner import LocationInner as LocationInner
|
|
77
|
+
from templatefox.models.s3_config_request import S3ConfigRequest as S3ConfigRequest
|
|
78
|
+
from templatefox.models.s3_config_response import S3ConfigResponse as S3ConfigResponse
|
|
79
|
+
from templatefox.models.s3_success_response import S3SuccessResponse as S3SuccessResponse
|
|
80
|
+
from templatefox.models.s3_test_response import S3TestResponse as S3TestResponse
|
|
81
|
+
from templatefox.models.template_field import TemplateField as TemplateField
|
|
82
|
+
from templatefox.models.template_list_item import TemplateListItem as TemplateListItem
|
|
83
|
+
from templatefox.models.templates_list_response import TemplatesListResponse as TemplatesListResponse
|
|
84
|
+
from templatefox.models.transaction import Transaction as Transaction
|
|
85
|
+
from templatefox.models.transactions_response import TransactionsResponse as TransactionsResponse
|
|
86
|
+
from templatefox.models.validation_error import ValidationError as ValidationError
|
|
87
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# flake8: noqa
|
|
2
|
+
|
|
3
|
+
# import apis into api package
|
|
4
|
+
from templatefox.api.account_api import AccountApi
|
|
5
|
+
from templatefox.api.integrations_api import IntegrationsApi
|
|
6
|
+
from templatefox.api.pdf_api import PDFApi
|
|
7
|
+
from templatefox.api.templates_api import TemplatesApi
|
|
8
|
+
|
|
@@ -0,0 +1,579 @@
|
|
|
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 pydantic import Field
|
|
21
|
+
from typing import Optional
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from templatefox.models.account_info_response import AccountInfoResponse
|
|
24
|
+
from templatefox.models.transactions_response import TransactionsResponse
|
|
25
|
+
|
|
26
|
+
from templatefox.api_client import ApiClient, RequestSerialized
|
|
27
|
+
from templatefox.api_response import ApiResponse
|
|
28
|
+
from templatefox.rest import RESTResponseType
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class AccountApi:
|
|
32
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
33
|
+
Ref: https://openapi-generator.tech
|
|
34
|
+
|
|
35
|
+
Do not edit the class manually.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
def __init__(self, api_client=None) -> None:
|
|
39
|
+
if api_client is None:
|
|
40
|
+
api_client = ApiClient.get_default()
|
|
41
|
+
self.api_client = api_client
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@validate_call
|
|
45
|
+
def get_account(
|
|
46
|
+
self,
|
|
47
|
+
_request_timeout: Union[
|
|
48
|
+
None,
|
|
49
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
50
|
+
Tuple[
|
|
51
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
52
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
53
|
+
]
|
|
54
|
+
] = None,
|
|
55
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
56
|
+
_content_type: Optional[StrictStr] = None,
|
|
57
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
58
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
59
|
+
) -> AccountInfoResponse:
|
|
60
|
+
"""Get account info
|
|
61
|
+
|
|
62
|
+
Get account information including remaining credits. **Authentication:** API Key required (`x-api-key` header) or JWT token **Usage:** Check credit balance before performing operations. **No credits consumed:** This is a read-only endpoint.
|
|
63
|
+
|
|
64
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
65
|
+
number provided, it will be total request
|
|
66
|
+
timeout. It can also be a pair (tuple) of
|
|
67
|
+
(connection, read) timeouts.
|
|
68
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
69
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
70
|
+
request; this effectively ignores the
|
|
71
|
+
authentication in the spec for a single request.
|
|
72
|
+
:type _request_auth: dict, optional
|
|
73
|
+
:param _content_type: force content-type for the request.
|
|
74
|
+
:type _content_type: str, Optional
|
|
75
|
+
:param _headers: set to override the headers for a single
|
|
76
|
+
request; this effectively ignores the headers
|
|
77
|
+
in the spec for a single request.
|
|
78
|
+
:type _headers: dict, optional
|
|
79
|
+
:param _host_index: set to override the host_index for a single
|
|
80
|
+
request; this effectively ignores the host_index
|
|
81
|
+
in the spec for a single request.
|
|
82
|
+
:type _host_index: int, optional
|
|
83
|
+
:return: Returns the result object.
|
|
84
|
+
""" # noqa: E501
|
|
85
|
+
|
|
86
|
+
_param = self._get_account_serialize(
|
|
87
|
+
_request_auth=_request_auth,
|
|
88
|
+
_content_type=_content_type,
|
|
89
|
+
_headers=_headers,
|
|
90
|
+
_host_index=_host_index
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
94
|
+
'200': "AccountInfoResponse",
|
|
95
|
+
'403': None,
|
|
96
|
+
'422': "HTTPValidationError",
|
|
97
|
+
}
|
|
98
|
+
response_data = self.api_client.call_api(
|
|
99
|
+
*_param,
|
|
100
|
+
_request_timeout=_request_timeout
|
|
101
|
+
)
|
|
102
|
+
response_data.read()
|
|
103
|
+
return self.api_client.response_deserialize(
|
|
104
|
+
response_data=response_data,
|
|
105
|
+
response_types_map=_response_types_map,
|
|
106
|
+
).data
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
@validate_call
|
|
110
|
+
def get_account_with_http_info(
|
|
111
|
+
self,
|
|
112
|
+
_request_timeout: Union[
|
|
113
|
+
None,
|
|
114
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
115
|
+
Tuple[
|
|
116
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
117
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
118
|
+
]
|
|
119
|
+
] = None,
|
|
120
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
121
|
+
_content_type: Optional[StrictStr] = None,
|
|
122
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
123
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
124
|
+
) -> ApiResponse[AccountInfoResponse]:
|
|
125
|
+
"""Get account info
|
|
126
|
+
|
|
127
|
+
Get account information including remaining credits. **Authentication:** API Key required (`x-api-key` header) or JWT token **Usage:** Check credit balance before performing operations. **No credits consumed:** This is a read-only endpoint.
|
|
128
|
+
|
|
129
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
130
|
+
number provided, it will be total request
|
|
131
|
+
timeout. It can also be a pair (tuple) of
|
|
132
|
+
(connection, read) timeouts.
|
|
133
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
134
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
135
|
+
request; this effectively ignores the
|
|
136
|
+
authentication in the spec for a single request.
|
|
137
|
+
:type _request_auth: dict, optional
|
|
138
|
+
:param _content_type: force content-type for the request.
|
|
139
|
+
:type _content_type: str, Optional
|
|
140
|
+
:param _headers: set to override the headers for a single
|
|
141
|
+
request; this effectively ignores the headers
|
|
142
|
+
in the spec for a single request.
|
|
143
|
+
:type _headers: dict, optional
|
|
144
|
+
:param _host_index: set to override the host_index for a single
|
|
145
|
+
request; this effectively ignores the host_index
|
|
146
|
+
in the spec for a single request.
|
|
147
|
+
:type _host_index: int, optional
|
|
148
|
+
:return: Returns the result object.
|
|
149
|
+
""" # noqa: E501
|
|
150
|
+
|
|
151
|
+
_param = self._get_account_serialize(
|
|
152
|
+
_request_auth=_request_auth,
|
|
153
|
+
_content_type=_content_type,
|
|
154
|
+
_headers=_headers,
|
|
155
|
+
_host_index=_host_index
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
159
|
+
'200': "AccountInfoResponse",
|
|
160
|
+
'403': None,
|
|
161
|
+
'422': "HTTPValidationError",
|
|
162
|
+
}
|
|
163
|
+
response_data = self.api_client.call_api(
|
|
164
|
+
*_param,
|
|
165
|
+
_request_timeout=_request_timeout
|
|
166
|
+
)
|
|
167
|
+
response_data.read()
|
|
168
|
+
return self.api_client.response_deserialize(
|
|
169
|
+
response_data=response_data,
|
|
170
|
+
response_types_map=_response_types_map,
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
@validate_call
|
|
175
|
+
def get_account_without_preload_content(
|
|
176
|
+
self,
|
|
177
|
+
_request_timeout: Union[
|
|
178
|
+
None,
|
|
179
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
180
|
+
Tuple[
|
|
181
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
182
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
183
|
+
]
|
|
184
|
+
] = None,
|
|
185
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
186
|
+
_content_type: Optional[StrictStr] = None,
|
|
187
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
188
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
189
|
+
) -> RESTResponseType:
|
|
190
|
+
"""Get account info
|
|
191
|
+
|
|
192
|
+
Get account information including remaining credits. **Authentication:** API Key required (`x-api-key` header) or JWT token **Usage:** Check credit balance before performing operations. **No credits consumed:** This is a read-only endpoint.
|
|
193
|
+
|
|
194
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
195
|
+
number provided, it will be total request
|
|
196
|
+
timeout. It can also be a pair (tuple) of
|
|
197
|
+
(connection, read) timeouts.
|
|
198
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
199
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
200
|
+
request; this effectively ignores the
|
|
201
|
+
authentication in the spec for a single request.
|
|
202
|
+
:type _request_auth: dict, optional
|
|
203
|
+
:param _content_type: force content-type for the request.
|
|
204
|
+
:type _content_type: str, Optional
|
|
205
|
+
:param _headers: set to override the headers for a single
|
|
206
|
+
request; this effectively ignores the headers
|
|
207
|
+
in the spec for a single request.
|
|
208
|
+
:type _headers: dict, optional
|
|
209
|
+
:param _host_index: set to override the host_index for a single
|
|
210
|
+
request; this effectively ignores the host_index
|
|
211
|
+
in the spec for a single request.
|
|
212
|
+
:type _host_index: int, optional
|
|
213
|
+
:return: Returns the result object.
|
|
214
|
+
""" # noqa: E501
|
|
215
|
+
|
|
216
|
+
_param = self._get_account_serialize(
|
|
217
|
+
_request_auth=_request_auth,
|
|
218
|
+
_content_type=_content_type,
|
|
219
|
+
_headers=_headers,
|
|
220
|
+
_host_index=_host_index
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
224
|
+
'200': "AccountInfoResponse",
|
|
225
|
+
'403': None,
|
|
226
|
+
'422': "HTTPValidationError",
|
|
227
|
+
}
|
|
228
|
+
response_data = self.api_client.call_api(
|
|
229
|
+
*_param,
|
|
230
|
+
_request_timeout=_request_timeout
|
|
231
|
+
)
|
|
232
|
+
return response_data.response
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
def _get_account_serialize(
|
|
236
|
+
self,
|
|
237
|
+
_request_auth,
|
|
238
|
+
_content_type,
|
|
239
|
+
_headers,
|
|
240
|
+
_host_index,
|
|
241
|
+
) -> RequestSerialized:
|
|
242
|
+
|
|
243
|
+
_host = None
|
|
244
|
+
|
|
245
|
+
_collection_formats: Dict[str, str] = {
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
_path_params: Dict[str, str] = {}
|
|
249
|
+
_query_params: List[Tuple[str, str]] = []
|
|
250
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
251
|
+
_form_params: List[Tuple[str, str]] = []
|
|
252
|
+
_files: Dict[
|
|
253
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
254
|
+
] = {}
|
|
255
|
+
_body_params: Optional[bytes] = None
|
|
256
|
+
|
|
257
|
+
# process the path parameters
|
|
258
|
+
# process the query parameters
|
|
259
|
+
# process the header parameters
|
|
260
|
+
# process the form parameters
|
|
261
|
+
# process the body parameter
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
# set the HTTP header `Accept`
|
|
265
|
+
if 'Accept' not in _header_params:
|
|
266
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
267
|
+
[
|
|
268
|
+
'application/json'
|
|
269
|
+
]
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
# authentication setting
|
|
274
|
+
_auth_settings: List[str] = [
|
|
275
|
+
'ApiKeyAuth'
|
|
276
|
+
]
|
|
277
|
+
|
|
278
|
+
return self.api_client.param_serialize(
|
|
279
|
+
method='GET',
|
|
280
|
+
resource_path='/v1/account',
|
|
281
|
+
path_params=_path_params,
|
|
282
|
+
query_params=_query_params,
|
|
283
|
+
header_params=_header_params,
|
|
284
|
+
body=_body_params,
|
|
285
|
+
post_params=_form_params,
|
|
286
|
+
files=_files,
|
|
287
|
+
auth_settings=_auth_settings,
|
|
288
|
+
collection_formats=_collection_formats,
|
|
289
|
+
_host=_host,
|
|
290
|
+
_request_auth=_request_auth
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
@validate_call
|
|
297
|
+
def list_transactions(
|
|
298
|
+
self,
|
|
299
|
+
limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of records to return")] = None,
|
|
300
|
+
offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of records to skip")] = None,
|
|
301
|
+
_request_timeout: Union[
|
|
302
|
+
None,
|
|
303
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
304
|
+
Tuple[
|
|
305
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
306
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
307
|
+
]
|
|
308
|
+
] = None,
|
|
309
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
310
|
+
_content_type: Optional[StrictStr] = None,
|
|
311
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
312
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
313
|
+
) -> TransactionsResponse:
|
|
314
|
+
"""List transactions
|
|
315
|
+
|
|
316
|
+
List transaction history for the authenticated user. **Authentication:** API Key required (`x-api-key` header) or JWT token **Pagination:** Use `limit` and `offset` query parameters. **Transaction types:** - `PDFGEN`: PDF generation (consumes credits) - `REFUND`: Credit refund (on failed generation) - `PURCHASE`: Credit purchase - `BONUS`: Bonus credits **Credits field:** - Positive value = credits consumed - Negative value = credits added **No credits consumed:** This is a read-only endpoint.
|
|
317
|
+
|
|
318
|
+
:param limit: Number of records to return
|
|
319
|
+
:type limit: int
|
|
320
|
+
:param offset: Number of records to skip
|
|
321
|
+
:type offset: int
|
|
322
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
323
|
+
number provided, it will be total request
|
|
324
|
+
timeout. It can also be a pair (tuple) of
|
|
325
|
+
(connection, read) timeouts.
|
|
326
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
327
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
328
|
+
request; this effectively ignores the
|
|
329
|
+
authentication in the spec for a single request.
|
|
330
|
+
:type _request_auth: dict, optional
|
|
331
|
+
:param _content_type: force content-type for the request.
|
|
332
|
+
:type _content_type: str, Optional
|
|
333
|
+
:param _headers: set to override the headers for a single
|
|
334
|
+
request; this effectively ignores the headers
|
|
335
|
+
in the spec for a single request.
|
|
336
|
+
:type _headers: dict, optional
|
|
337
|
+
:param _host_index: set to override the host_index for a single
|
|
338
|
+
request; this effectively ignores the host_index
|
|
339
|
+
in the spec for a single request.
|
|
340
|
+
:type _host_index: int, optional
|
|
341
|
+
:return: Returns the result object.
|
|
342
|
+
""" # noqa: E501
|
|
343
|
+
|
|
344
|
+
_param = self._list_transactions_serialize(
|
|
345
|
+
limit=limit,
|
|
346
|
+
offset=offset,
|
|
347
|
+
_request_auth=_request_auth,
|
|
348
|
+
_content_type=_content_type,
|
|
349
|
+
_headers=_headers,
|
|
350
|
+
_host_index=_host_index
|
|
351
|
+
)
|
|
352
|
+
|
|
353
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
354
|
+
'200': "TransactionsResponse",
|
|
355
|
+
'403': None,
|
|
356
|
+
'422': "HTTPValidationError",
|
|
357
|
+
}
|
|
358
|
+
response_data = self.api_client.call_api(
|
|
359
|
+
*_param,
|
|
360
|
+
_request_timeout=_request_timeout
|
|
361
|
+
)
|
|
362
|
+
response_data.read()
|
|
363
|
+
return self.api_client.response_deserialize(
|
|
364
|
+
response_data=response_data,
|
|
365
|
+
response_types_map=_response_types_map,
|
|
366
|
+
).data
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
@validate_call
|
|
370
|
+
def list_transactions_with_http_info(
|
|
371
|
+
self,
|
|
372
|
+
limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of records to return")] = None,
|
|
373
|
+
offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of records to skip")] = None,
|
|
374
|
+
_request_timeout: Union[
|
|
375
|
+
None,
|
|
376
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
377
|
+
Tuple[
|
|
378
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
379
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
380
|
+
]
|
|
381
|
+
] = None,
|
|
382
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
383
|
+
_content_type: Optional[StrictStr] = None,
|
|
384
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
385
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
386
|
+
) -> ApiResponse[TransactionsResponse]:
|
|
387
|
+
"""List transactions
|
|
388
|
+
|
|
389
|
+
List transaction history for the authenticated user. **Authentication:** API Key required (`x-api-key` header) or JWT token **Pagination:** Use `limit` and `offset` query parameters. **Transaction types:** - `PDFGEN`: PDF generation (consumes credits) - `REFUND`: Credit refund (on failed generation) - `PURCHASE`: Credit purchase - `BONUS`: Bonus credits **Credits field:** - Positive value = credits consumed - Negative value = credits added **No credits consumed:** This is a read-only endpoint.
|
|
390
|
+
|
|
391
|
+
:param limit: Number of records to return
|
|
392
|
+
:type limit: int
|
|
393
|
+
:param offset: Number of records to skip
|
|
394
|
+
:type offset: int
|
|
395
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
396
|
+
number provided, it will be total request
|
|
397
|
+
timeout. It can also be a pair (tuple) of
|
|
398
|
+
(connection, read) timeouts.
|
|
399
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
400
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
401
|
+
request; this effectively ignores the
|
|
402
|
+
authentication in the spec for a single request.
|
|
403
|
+
:type _request_auth: dict, optional
|
|
404
|
+
:param _content_type: force content-type for the request.
|
|
405
|
+
:type _content_type: str, Optional
|
|
406
|
+
:param _headers: set to override the headers for a single
|
|
407
|
+
request; this effectively ignores the headers
|
|
408
|
+
in the spec for a single request.
|
|
409
|
+
:type _headers: dict, optional
|
|
410
|
+
:param _host_index: set to override the host_index for a single
|
|
411
|
+
request; this effectively ignores the host_index
|
|
412
|
+
in the spec for a single request.
|
|
413
|
+
:type _host_index: int, optional
|
|
414
|
+
:return: Returns the result object.
|
|
415
|
+
""" # noqa: E501
|
|
416
|
+
|
|
417
|
+
_param = self._list_transactions_serialize(
|
|
418
|
+
limit=limit,
|
|
419
|
+
offset=offset,
|
|
420
|
+
_request_auth=_request_auth,
|
|
421
|
+
_content_type=_content_type,
|
|
422
|
+
_headers=_headers,
|
|
423
|
+
_host_index=_host_index
|
|
424
|
+
)
|
|
425
|
+
|
|
426
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
427
|
+
'200': "TransactionsResponse",
|
|
428
|
+
'403': None,
|
|
429
|
+
'422': "HTTPValidationError",
|
|
430
|
+
}
|
|
431
|
+
response_data = self.api_client.call_api(
|
|
432
|
+
*_param,
|
|
433
|
+
_request_timeout=_request_timeout
|
|
434
|
+
)
|
|
435
|
+
response_data.read()
|
|
436
|
+
return self.api_client.response_deserialize(
|
|
437
|
+
response_data=response_data,
|
|
438
|
+
response_types_map=_response_types_map,
|
|
439
|
+
)
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
@validate_call
|
|
443
|
+
def list_transactions_without_preload_content(
|
|
444
|
+
self,
|
|
445
|
+
limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Number of records to return")] = None,
|
|
446
|
+
offset: Annotated[Optional[Annotated[int, Field(strict=True, ge=0)]], Field(description="Number of records to skip")] = None,
|
|
447
|
+
_request_timeout: Union[
|
|
448
|
+
None,
|
|
449
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
450
|
+
Tuple[
|
|
451
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
452
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
453
|
+
]
|
|
454
|
+
] = None,
|
|
455
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
456
|
+
_content_type: Optional[StrictStr] = None,
|
|
457
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
458
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
459
|
+
) -> RESTResponseType:
|
|
460
|
+
"""List transactions
|
|
461
|
+
|
|
462
|
+
List transaction history for the authenticated user. **Authentication:** API Key required (`x-api-key` header) or JWT token **Pagination:** Use `limit` and `offset` query parameters. **Transaction types:** - `PDFGEN`: PDF generation (consumes credits) - `REFUND`: Credit refund (on failed generation) - `PURCHASE`: Credit purchase - `BONUS`: Bonus credits **Credits field:** - Positive value = credits consumed - Negative value = credits added **No credits consumed:** This is a read-only endpoint.
|
|
463
|
+
|
|
464
|
+
:param limit: Number of records to return
|
|
465
|
+
:type limit: int
|
|
466
|
+
:param offset: Number of records to skip
|
|
467
|
+
:type offset: int
|
|
468
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
469
|
+
number provided, it will be total request
|
|
470
|
+
timeout. It can also be a pair (tuple) of
|
|
471
|
+
(connection, read) timeouts.
|
|
472
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
473
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
474
|
+
request; this effectively ignores the
|
|
475
|
+
authentication in the spec for a single request.
|
|
476
|
+
:type _request_auth: dict, optional
|
|
477
|
+
:param _content_type: force content-type for the request.
|
|
478
|
+
:type _content_type: str, Optional
|
|
479
|
+
:param _headers: set to override the headers for a single
|
|
480
|
+
request; this effectively ignores the headers
|
|
481
|
+
in the spec for a single request.
|
|
482
|
+
:type _headers: dict, optional
|
|
483
|
+
:param _host_index: set to override the host_index for a single
|
|
484
|
+
request; this effectively ignores the host_index
|
|
485
|
+
in the spec for a single request.
|
|
486
|
+
:type _host_index: int, optional
|
|
487
|
+
:return: Returns the result object.
|
|
488
|
+
""" # noqa: E501
|
|
489
|
+
|
|
490
|
+
_param = self._list_transactions_serialize(
|
|
491
|
+
limit=limit,
|
|
492
|
+
offset=offset,
|
|
493
|
+
_request_auth=_request_auth,
|
|
494
|
+
_content_type=_content_type,
|
|
495
|
+
_headers=_headers,
|
|
496
|
+
_host_index=_host_index
|
|
497
|
+
)
|
|
498
|
+
|
|
499
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
500
|
+
'200': "TransactionsResponse",
|
|
501
|
+
'403': None,
|
|
502
|
+
'422': "HTTPValidationError",
|
|
503
|
+
}
|
|
504
|
+
response_data = self.api_client.call_api(
|
|
505
|
+
*_param,
|
|
506
|
+
_request_timeout=_request_timeout
|
|
507
|
+
)
|
|
508
|
+
return response_data.response
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
def _list_transactions_serialize(
|
|
512
|
+
self,
|
|
513
|
+
limit,
|
|
514
|
+
offset,
|
|
515
|
+
_request_auth,
|
|
516
|
+
_content_type,
|
|
517
|
+
_headers,
|
|
518
|
+
_host_index,
|
|
519
|
+
) -> RequestSerialized:
|
|
520
|
+
|
|
521
|
+
_host = None
|
|
522
|
+
|
|
523
|
+
_collection_formats: Dict[str, str] = {
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
_path_params: Dict[str, str] = {}
|
|
527
|
+
_query_params: List[Tuple[str, str]] = []
|
|
528
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
529
|
+
_form_params: List[Tuple[str, str]] = []
|
|
530
|
+
_files: Dict[
|
|
531
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
532
|
+
] = {}
|
|
533
|
+
_body_params: Optional[bytes] = None
|
|
534
|
+
|
|
535
|
+
# process the path parameters
|
|
536
|
+
# process the query parameters
|
|
537
|
+
if limit is not None:
|
|
538
|
+
|
|
539
|
+
_query_params.append(('limit', limit))
|
|
540
|
+
|
|
541
|
+
if offset is not None:
|
|
542
|
+
|
|
543
|
+
_query_params.append(('offset', offset))
|
|
544
|
+
|
|
545
|
+
# process the header parameters
|
|
546
|
+
# process the form parameters
|
|
547
|
+
# process the body parameter
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
# set the HTTP header `Accept`
|
|
551
|
+
if 'Accept' not in _header_params:
|
|
552
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
553
|
+
[
|
|
554
|
+
'application/json'
|
|
555
|
+
]
|
|
556
|
+
)
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
# authentication setting
|
|
560
|
+
_auth_settings: List[str] = [
|
|
561
|
+
'ApiKeyAuth'
|
|
562
|
+
]
|
|
563
|
+
|
|
564
|
+
return self.api_client.param_serialize(
|
|
565
|
+
method='GET',
|
|
566
|
+
resource_path='/v1/account/transactions',
|
|
567
|
+
path_params=_path_params,
|
|
568
|
+
query_params=_query_params,
|
|
569
|
+
header_params=_header_params,
|
|
570
|
+
body=_body_params,
|
|
571
|
+
post_params=_form_params,
|
|
572
|
+
files=_files,
|
|
573
|
+
auth_settings=_auth_settings,
|
|
574
|
+
collection_formats=_collection_formats,
|
|
575
|
+
_host=_host,
|
|
576
|
+
_request_auth=_request_auth
|
|
577
|
+
)
|
|
578
|
+
|
|
579
|
+
|