Skip to content

Commit eddf05c

Browse files
committed
Use stdClass as data object
1 parent 9c1ae89 commit eddf05c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+755
-80
lines changed

.openapi-generator/FILES

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
README.md
55
docs/BatchData.md
66
docs/Component.md
7-
docs/Data.md
7+
docs/DataArray.md
88
docs/DocumentsApi.md
99
docs/InlineResponse200.md
1010
docs/InlineResponse2001.md
@@ -15,6 +15,7 @@ docs/InlineResponse2004.md
1515
docs/InlineResponse2004Meta.md
1616
docs/InlineResponse2005.md
1717
docs/InlineResponse401.md
18+
docs/InlineResponse402.md
1819
docs/InlineResponse403.md
1920
docs/InlineResponse404.md
2021
docs/InlineResponse422.md
@@ -46,7 +47,7 @@ pdf_generator_api_client/exceptions.py
4647
pdf_generator_api_client/model/__init__.py
4748
pdf_generator_api_client/model/batch_data.py
4849
pdf_generator_api_client/model/component.py
49-
pdf_generator_api_client/model/data.py
50+
pdf_generator_api_client/model/data_array.py
5051
pdf_generator_api_client/model/inline_response200.py
5152
pdf_generator_api_client/model/inline_response2001.py
5253
pdf_generator_api_client/model/inline_response2002.py
@@ -56,6 +57,7 @@ pdf_generator_api_client/model/inline_response2004.py
5657
pdf_generator_api_client/model/inline_response2004_meta.py
5758
pdf_generator_api_client/model/inline_response2005.py
5859
pdf_generator_api_client/model/inline_response401.py
60+
pdf_generator_api_client/model/inline_response402.py
5961
pdf_generator_api_client/model/inline_response403.py
6062
pdf_generator_api_client/model/inline_response404.py
6163
pdf_generator_api_client/model/inline_response422.py
@@ -80,4 +82,6 @@ setup.cfg
8082
setup.py
8183
test-requirements.txt
8284
test/__init__.py
85+
test/test_data_array.py
86+
test/test_inline_response402.py
8387
tox.ini

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ We have validated the generated libraries, but let us know if you find any anoma
147147
| Code | Description |
148148
|--------|--------------------------------|
149149
| 401 | Unauthorized |
150+
| 402 | Payment Required |
150151
| 403 | Forbidden |
151152
| 404 | Not Found |
152153
| 422 | Unprocessable Entity |
@@ -163,6 +164,11 @@ We have validated the generated libraries, but let us know if you find any anoma
163164
| Authentication failed: property 'exp' (expiration time) missing in JWT |
164165
| Authentication failed: incorrect signature |
165166

167+
## 402 Payment Required
168+
| Description |
169+
|-------------------------------------------------------------------------|
170+
| Your account is suspended, please upgrade your account |
171+
166172
## 403 Forbidden
167173
| Description |
168174
|-------------------------------------------------------------------------|
@@ -238,9 +244,9 @@ import pdf_generator_api_client
238244
from pprint import pprint
239245
from pdf_generator_api_client.api import documents_api
240246
from pdf_generator_api_client.model.batch_data import BatchData
241-
from pdf_generator_api_client.model.data import Data
242247
from pdf_generator_api_client.model.inline_response2004 import InlineResponse2004
243248
from pdf_generator_api_client.model.inline_response401 import InlineResponse401
249+
from pdf_generator_api_client.model.inline_response402 import InlineResponse402
244250
from pdf_generator_api_client.model.inline_response403 import InlineResponse403
245251
from pdf_generator_api_client.model.inline_response404 import InlineResponse404
246252
from pdf_generator_api_client.model.inline_response422 import InlineResponse422
@@ -267,17 +273,14 @@ with pdf_generator_api_client.ApiClient(configuration) as api_client:
267273
# Create an instance of the API class
268274
api_instance = documents_api.DocumentsApi(api_client)
269275
template_id = 19375 # int | Template unique identifier
270-
data = Data(
271-
id=12312,
272-
name="Sample Data",
273-
) # Data | Data used to generate the PDF. This can be JSON encoded string or a public URL to your JSON file.
276+
body = {} # {str: (bool, date, datetime, dict, float, int, list, str, none_type)} | Data used to generate the PDF. This can be JSON encoded string or a public URL to your JSON file.
274277
name = "My document" # str | Document name, returned in the meta data. (optional)
275278
format = "pdf" # str | Document format. The zip option will return a ZIP file with PDF files. (optional) (default to "pdf")
276-
output = "base64" # str | Response format. With the url option, the document is stored for 30 days and automatically deleted. (optional) (default to "base64")
279+
output = "base64" # str | Response format. "I" is used to return the file inline. With the url option, the document is stored for 30 days and automatically deleted. (optional) (default to "base64")
277280

278281
try:
279282
# Generate document
280-
api_response = api_instance.merge_template(template_id, data, name=name, format=format, output=output)
283+
api_response = api_instance.merge_template(template_id, body, name=name, format=format, output=output)
281284
pprint(api_response)
282285
except pdf_generator_api_client.ApiException as e:
283286
print("Exception when calling DocumentsApi->merge_template: %s\n" % e)
@@ -306,7 +309,7 @@ Class | Method | HTTP request | Description
306309

307310
- [BatchData](docs/BatchData.md)
308311
- [Component](docs/Component.md)
309-
- [Data](docs/Data.md)
312+
- [DataArray](docs/DataArray.md)
310313
- [InlineResponse200](docs/InlineResponse200.md)
311314
- [InlineResponse2001](docs/InlineResponse2001.md)
312315
- [InlineResponse2002](docs/InlineResponse2002.md)
@@ -316,6 +319,7 @@ Class | Method | HTTP request | Description
316319
- [InlineResponse2004Meta](docs/InlineResponse2004Meta.md)
317320
- [InlineResponse2005](docs/InlineResponse2005.md)
318321
- [InlineResponse401](docs/InlineResponse401.md)
322+
- [InlineResponse402](docs/InlineResponse402.md)
319323
- [InlineResponse403](docs/InlineResponse403.md)
320324
- [InlineResponse404](docs/InlineResponse404.md)
321325
- [InlineResponse422](docs/InlineResponse422.md)

docs/DataArray.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# DataArray
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**value** | **[{str: (bool, date, datetime, dict, float, int, list, str, none_type)}]** | |
8+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+

docs/DocumentsApi.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Method | HTTP request | Description
99

1010

1111
# **merge_template**
12-
> InlineResponse2004 merge_template(template_id, data)
12+
> InlineResponse2004 merge_template(template_id, body)
1313
1414
Generate document
1515

@@ -23,9 +23,9 @@ import time
2323
import pdf_generator_api_client
2424
from pdf_generator_api_client.api import documents_api
2525
from pdf_generator_api_client.model.inline_response401 import InlineResponse401
26-
from pdf_generator_api_client.model.data import Data
2726
from pdf_generator_api_client.model.inline_response422 import InlineResponse422
2827
from pdf_generator_api_client.model.inline_response404 import InlineResponse404
28+
from pdf_generator_api_client.model.inline_response402 import InlineResponse402
2929
from pdf_generator_api_client.model.inline_response500 import InlineResponse500
3030
from pdf_generator_api_client.model.inline_response403 import InlineResponse403
3131
from pdf_generator_api_client.model.inline_response2004 import InlineResponse2004
@@ -51,18 +51,15 @@ with pdf_generator_api_client.ApiClient(configuration) as api_client:
5151
# Create an instance of the API class
5252
api_instance = documents_api.DocumentsApi(api_client)
5353
template_id = 19375 # int | Template unique identifier
54-
data = Data(
55-
id=12312,
56-
name="Sample Data",
57-
) # Data | Data used to generate the PDF. This can be JSON encoded string or a public URL to your JSON file.
54+
body = {} # {str: (bool, date, datetime, dict, float, int, list, str, none_type)} | Data used to generate the PDF. This can be JSON encoded string or a public URL to your JSON file.
5855
name = "My document" # str | Document name, returned in the meta data. (optional)
5956
format = "pdf" # str | Document format. The zip option will return a ZIP file with PDF files. (optional) if omitted the server will use the default value of "pdf"
60-
output = "base64" # str | Response format. With the url option, the document is stored for 30 days and automatically deleted. (optional) if omitted the server will use the default value of "base64"
57+
output = "base64" # str | Response format. \"I\" is used to return the file inline. With the url option, the document is stored for 30 days and automatically deleted. (optional) if omitted the server will use the default value of "base64"
6158

6259
# example passing only required values which don't have defaults set
6360
try:
6461
# Generate document
65-
api_response = api_instance.merge_template(template_id, data)
62+
api_response = api_instance.merge_template(template_id, body)
6663
pprint(api_response)
6764
except pdf_generator_api_client.ApiException as e:
6865
print("Exception when calling DocumentsApi->merge_template: %s\n" % e)
@@ -71,7 +68,7 @@ with pdf_generator_api_client.ApiClient(configuration) as api_client:
7168
# and optional values
7269
try:
7370
# Generate document
74-
api_response = api_instance.merge_template(template_id, data, name=name, format=format, output=output)
71+
api_response = api_instance.merge_template(template_id, body, name=name, format=format, output=output)
7572
pprint(api_response)
7673
except pdf_generator_api_client.ApiException as e:
7774
print("Exception when calling DocumentsApi->merge_template: %s\n" % e)
@@ -83,10 +80,10 @@ with pdf_generator_api_client.ApiClient(configuration) as api_client:
8380
Name | Type | Description | Notes
8481
------------- | ------------- | ------------- | -------------
8582
**template_id** | **int**| Template unique identifier |
86-
**data** | [**Data**](Data.md)| Data used to generate the PDF. This can be JSON encoded string or a public URL to your JSON file. |
83+
**body** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}**| Data used to generate the PDF. This can be JSON encoded string or a public URL to your JSON file. |
8784
**name** | **str**| Document name, returned in the meta data. | [optional]
8885
**format** | **str**| Document format. The zip option will return a ZIP file with PDF files. | [optional] if omitted the server will use the default value of "pdf"
89-
**output** | **str**| Response format. With the url option, the document is stored for 30 days and automatically deleted. | [optional] if omitted the server will use the default value of "base64"
86+
**output** | **str**| Response format. \"I\" is used to return the file inline. With the url option, the document is stored for 30 days and automatically deleted. | [optional] if omitted the server will use the default value of "base64"
9087

9188
### Return type
9289

@@ -107,6 +104,7 @@ Name | Type | Description | Notes
107104
|-------------|-------------|------------------|
108105
**200** | Document data | - |
109106
**401** | Unauthorized | - |
107+
**402** | Account Suspended | - |
110108
**403** | Forbidden | - |
111109
**404** | Not Found | - |
112110
**422** | Unprocessable Entity | - |
@@ -119,7 +117,7 @@ Name | Type | Description | Notes
119117
120118
Generate document (multiple templates)
121119

122-
Allows to merge multiple templated with data and returns base64 encoded document or public URL to a document. NB! When the public URL option is used, the document is stored for 30 days and automatically deleted.
120+
Allows to merge multiple templates with data and returns base64 encoded document or public URL to a document. NB! When the public URL option is used, the document is stored for 30 days and automatically deleted.
123121

124122
### Example
125123

@@ -131,6 +129,7 @@ from pdf_generator_api_client.api import documents_api
131129
from pdf_generator_api_client.model.inline_response401 import InlineResponse401
132130
from pdf_generator_api_client.model.inline_response422 import InlineResponse422
133131
from pdf_generator_api_client.model.inline_response404 import InlineResponse404
132+
from pdf_generator_api_client.model.inline_response402 import InlineResponse402
134133
from pdf_generator_api_client.model.inline_response500 import InlineResponse500
135134
from pdf_generator_api_client.model.batch_data import BatchData
136135
from pdf_generator_api_client.model.inline_response403 import InlineResponse403
@@ -159,7 +158,7 @@ with pdf_generator_api_client.ApiClient(configuration) as api_client:
159158
batch_data = BatchData([{"template":52272,"data":{"key":"value"}},{"template":52273,"data":{"key2":"value2"}}]) # BatchData | Data used to specify templates and data objects which are used to merge the template
160159
name = "My document" # str | Document name, returned in the meta data. (optional)
161160
format = "pdf" # str | Document format. The zip option will return a ZIP file with PDF files. (optional) if omitted the server will use the default value of "pdf"
162-
output = "base64" # str | Response format. With the url option, the document is stored for 30 days and automatically deleted. (optional) if omitted the server will use the default value of "base64"
161+
output = "base64" # str | Response format. \"I\" is used to return the file inline. With the url option, the document is stored for 30 days and automatically deleted. (optional) if omitted the server will use the default value of "base64"
163162

164163
# example passing only required values which don't have defaults set
165164
try:
@@ -187,7 +186,7 @@ Name | Type | Description | Notes
187186
**batch_data** | [**BatchData**](BatchData.md)| Data used to specify templates and data objects which are used to merge the template |
188187
**name** | **str**| Document name, returned in the meta data. | [optional]
189188
**format** | **str**| Document format. The zip option will return a ZIP file with PDF files. | [optional] if omitted the server will use the default value of "pdf"
190-
**output** | **str**| Response format. With the url option, the document is stored for 30 days and automatically deleted. | [optional] if omitted the server will use the default value of "base64"
189+
**output** | **str**| Response format. \"I\" is used to return the file inline. With the url option, the document is stored for 30 days and automatically deleted. | [optional] if omitted the server will use the default value of "base64"
191190

192191
### Return type
193192

@@ -208,6 +207,7 @@ Name | Type | Description | Notes
208207
|-------------|-------------|------------------|
209208
**200** | Document data | - |
210209
**401** | Unauthorized | - |
210+
**402** | Account Suspended | - |
211211
**403** | Forbidden | - |
212212
**404** | Not Found | - |
213213
**422** | Unprocessable Entity | - |

docs/InlineResponse402.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# InlineResponse402
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**error** | **str** | Error description | [optional] if omitted the server will use the default value of "Your account is suspended, please upgrade your account or contact [email protected]"
8+
**status** | **int** | HTTP Error code | [optional]
9+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+
13+

0 commit comments

Comments
 (0)