@kattebak/openapi-generator-ts 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +189 -0
- package/dist/cli/commands/generate.d.ts +23 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/generate.js +116 -0
- package/dist/cli/commands/generate.js.map +1 -0
- package/dist/cli/commands/list.d.ts +2 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/list.js +26 -0
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +6 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +80 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/convert-template.d.ts +31 -0
- package/dist/cli/convert-template.d.ts.map +1 -0
- package/dist/cli/convert-template.js +204 -0
- package/dist/cli/convert-template.js.map +1 -0
- package/dist/cli/convert-template.test.d.ts +2 -0
- package/dist/cli/convert-template.test.d.ts.map +1 -0
- package/dist/cli/convert-template.test.js +74 -0
- package/dist/cli/convert-template.test.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +246 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/core/config.d.ts +252 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +31 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/generator.d.ts +99 -0
- package/dist/core/generator.d.ts.map +1 -0
- package/dist/core/generator.js +492 -0
- package/dist/core/generator.js.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +4 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/types.d.ts +47 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +5 -0
- package/dist/core/types.js.map +1 -0
- package/dist/generators/generators.test.d.ts +6 -0
- package/dist/generators/generators.test.d.ts.map +1 -0
- package/dist/generators/generators.test.js +247 -0
- package/dist/generators/generators.test.js.map +1 -0
- package/dist/generators/go.d.ts +10 -0
- package/dist/generators/go.d.ts.map +1 -0
- package/dist/generators/go.js +327 -0
- package/dist/generators/go.js.map +1 -0
- package/dist/generators/index.d.ts +29 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +58 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/generators/php.d.ts +14 -0
- package/dist/generators/php.d.ts.map +1 -0
- package/dist/generators/php.js +241 -0
- package/dist/generators/php.js.map +1 -0
- package/dist/generators/python.d.ts +10 -0
- package/dist/generators/python.d.ts.map +1 -0
- package/dist/generators/python.js +273 -0
- package/dist/generators/python.js.map +1 -0
- package/dist/generators/typescript-fetch.d.ts +14 -0
- package/dist/generators/typescript-fetch.d.ts.map +1 -0
- package/dist/generators/typescript-fetch.js +217 -0
- package/dist/generators/typescript-fetch.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/models/codegen-model.d.ts +123 -0
- package/dist/models/codegen-model.d.ts.map +1 -0
- package/dist/models/codegen-model.js +64 -0
- package/dist/models/codegen-model.js.map +1 -0
- package/dist/models/codegen-model.test.d.ts +6 -0
- package/dist/models/codegen-model.test.d.ts.map +1 -0
- package/dist/models/codegen-model.test.js +143 -0
- package/dist/models/codegen-model.test.js.map +1 -0
- package/dist/models/codegen-operation.d.ts +95 -0
- package/dist/models/codegen-operation.d.ts.map +1 -0
- package/dist/models/codegen-operation.js +54 -0
- package/dist/models/codegen-operation.js.map +1 -0
- package/dist/models/codegen-parameter.d.ts +86 -0
- package/dist/models/codegen-parameter.d.ts.map +1 -0
- package/dist/models/codegen-parameter.js +47 -0
- package/dist/models/codegen-parameter.js.map +1 -0
- package/dist/models/codegen-property.d.ts +95 -0
- package/dist/models/codegen-property.d.ts.map +1 -0
- package/dist/models/codegen-property.js +47 -0
- package/dist/models/codegen-property.js.map +1 -0
- package/dist/models/codegen-response.d.ts +64 -0
- package/dist/models/codegen-response.d.ts.map +1 -0
- package/dist/models/codegen-response.js +42 -0
- package/dist/models/codegen-response.js.map +1 -0
- package/dist/models/codegen-security.d.ts +34 -0
- package/dist/models/codegen-security.d.ts.map +1 -0
- package/dist/models/codegen-security.js +18 -0
- package/dist/models/codegen-security.js.map +1 -0
- package/dist/models/index.d.ts +8 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +7 -0
- package/dist/models/index.js.map +1 -0
- package/dist/parser/index.d.ts +4 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +4 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/openapi-parser.d.ts +71 -0
- package/dist/parser/openapi-parser.d.ts.map +1 -0
- package/dist/parser/openapi-parser.js +195 -0
- package/dist/parser/openapi-parser.js.map +1 -0
- package/dist/parser/openapi-parser.test.d.ts +6 -0
- package/dist/parser/openapi-parser.test.d.ts.map +1 -0
- package/dist/parser/openapi-parser.test.js +238 -0
- package/dist/parser/openapi-parser.test.js.map +1 -0
- package/dist/parser/operation-transformer.d.ts +95 -0
- package/dist/parser/operation-transformer.d.ts.map +1 -0
- package/dist/parser/operation-transformer.js +634 -0
- package/dist/parser/operation-transformer.js.map +1 -0
- package/dist/parser/schema-transformer.d.ts +134 -0
- package/dist/parser/schema-transformer.d.ts.map +1 -0
- package/dist/parser/schema-transformer.js +557 -0
- package/dist/parser/schema-transformer.js.map +1 -0
- package/dist/template/engine-adapter.d.ts +55 -0
- package/dist/template/engine-adapter.d.ts.map +1 -0
- package/dist/template/engine-adapter.js +178 -0
- package/dist/template/engine-adapter.js.map +1 -0
- package/dist/template/engine-adapter.test.d.ts +6 -0
- package/dist/template/engine-adapter.test.d.ts.map +1 -0
- package/dist/template/engine-adapter.test.js +186 -0
- package/dist/template/engine-adapter.test.js.map +1 -0
- package/dist/template/index.d.ts +5 -0
- package/dist/template/index.d.ts.map +1 -0
- package/dist/template/index.js +5 -0
- package/dist/template/index.js.map +1 -0
- package/dist/template/lambdas/indent-lambdas.d.ts +40 -0
- package/dist/template/lambdas/indent-lambdas.d.ts.map +1 -0
- package/dist/template/lambdas/indent-lambdas.js +98 -0
- package/dist/template/lambdas/indent-lambdas.js.map +1 -0
- package/dist/template/lambdas/index.d.ts +44 -0
- package/dist/template/lambdas/index.d.ts.map +1 -0
- package/dist/template/lambdas/index.js +79 -0
- package/dist/template/lambdas/index.js.map +1 -0
- package/dist/template/lambdas/string-lambdas.d.ts +78 -0
- package/dist/template/lambdas/string-lambdas.d.ts.map +1 -0
- package/dist/template/lambdas/string-lambdas.js +148 -0
- package/dist/template/lambdas/string-lambdas.js.map +1 -0
- package/dist/template/lambdas/string-lambdas.test.d.ts +6 -0
- package/dist/template/lambdas/string-lambdas.test.d.ts.map +1 -0
- package/dist/template/lambdas/string-lambdas.test.js +158 -0
- package/dist/template/lambdas/string-lambdas.test.js.map +1 -0
- package/dist/template/template-locator.d.ts +72 -0
- package/dist/template/template-locator.d.ts.map +1 -0
- package/dist/template/template-locator.js +173 -0
- package/dist/template/template-locator.js.map +1 -0
- package/dist/template/template-manager.d.ts +65 -0
- package/dist/template/template-manager.d.ts.map +1 -0
- package/dist/template/template-manager.js +185 -0
- package/dist/template/template-manager.js.map +1 -0
- package/package.json +67 -0
- package/templates/go/.travis.yml +8 -0
- package/templates/go/README.mustache +236 -0
- package/templates/go/api.mustache +452 -0
- package/templates/go/api_doc.mustache +92 -0
- package/templates/go/api_test.mustache +59 -0
- package/templates/go/client.mustache +761 -0
- package/templates/go/configuration.mustache +332 -0
- package/templates/go/git_push.sh.mustache +57 -0
- package/templates/go/gitignore.mustache +24 -0
- package/templates/go/go.mod.mustache +16 -0
- package/templates/go/go.sum.mustache +19 -0
- package/templates/go/model.mustache +21 -0
- package/templates/go/model_anyof.mustache +93 -0
- package/templates/go/model_doc.mustache +97 -0
- package/templates/go/model_enum.mustache +101 -0
- package/templates/go/model_oneof.mustache +160 -0
- package/templates/go/model_simple.mustache +572 -0
- package/templates/go/nullable_model.mustache +35 -0
- package/templates/go/openapi.mustache +1 -0
- package/templates/go/partial_header.mustache +18 -0
- package/templates/go/response.mustache +38 -0
- package/templates/go/signing.mustache +453 -0
- package/templates/go/utils.mustache +352 -0
- package/templates/php/.php-cs-fixer.dist.php +29 -0
- package/templates/php/.travis.yml +8 -0
- package/templates/php/ApiException.mustache +111 -0
- package/templates/php/Configuration.mustache +606 -0
- package/templates/php/FormDataProcessor.mustache +238 -0
- package/templates/php/HeaderSelector.mustache +265 -0
- package/templates/php/ModelInterface.mustache +103 -0
- package/templates/php/ObjectSerializer.mustache +591 -0
- package/templates/php/README.mustache +151 -0
- package/templates/php/api.mustache +891 -0
- package/templates/php/api_doc.mustache +105 -0
- package/templates/php/api_test.mustache +80 -0
- package/templates/php/composer.mustache +44 -0
- package/templates/php/git_push.sh.mustache +57 -0
- package/templates/php/gitignore +15 -0
- package/templates/php/libraries/psr-18/ApiException.mustache +114 -0
- package/templates/php/libraries/psr-18/DebugPlugin.mustache +93 -0
- package/templates/php/libraries/psr-18/README.mustache +161 -0
- package/templates/php/libraries/psr-18/api.mustache +833 -0
- package/templates/php/libraries/psr-18/api_doc.mustache +79 -0
- package/templates/php/libraries/psr-18/composer.mustache +56 -0
- package/templates/php/model.mustache +47 -0
- package/templates/php/model_doc.mustache +10 -0
- package/templates/php/model_enum.mustache +33 -0
- package/templates/php/model_generic.mustache +565 -0
- package/templates/php/model_test.mustache +88 -0
- package/templates/php/partial_header.mustache +18 -0
- package/templates/php/php_doc_auth_partial.mustache +23 -0
- package/templates/php/phpunit.xml.mustache +18 -0
- package/templates/python/README.mustache +60 -0
- package/templates/python/README_onlypackage.mustache +50 -0
- package/templates/python/__init__.mustache +1 -0
- package/templates/python/__init__api.mustache +19 -0
- package/templates/python/__init__model.mustache +22 -0
- package/templates/python/__init__package.mustache +49 -0
- package/templates/python/api.mustache +244 -0
- package/templates/python/api_client.mustache +822 -0
- package/templates/python/api_doc.mustache +81 -0
- package/templates/python/api_doc_example.mustache +38 -0
- package/templates/python/api_response.mustache +21 -0
- package/templates/python/api_test.mustache +48 -0
- package/templates/python/asyncio/rest.mustache +209 -0
- package/templates/python/common_README.mustache +85 -0
- package/templates/python/configuration.mustache +806 -0
- package/templates/python/exceptions.mustache +210 -0
- package/templates/python/exports_api.mustache +3 -0
- package/templates/python/exports_model.mustache +3 -0
- package/templates/python/exports_package.mustache +20 -0
- package/templates/python/git_push.sh.mustache +57 -0
- package/templates/python/github-workflow.mustache +35 -0
- package/templates/python/gitignore.mustache +66 -0
- package/templates/python/gitlab-ci.mustache +31 -0
- package/templates/python/httpx/rest.mustache +190 -0
- package/templates/python/model.mustache +16 -0
- package/templates/python/model_anyof.mustache +182 -0
- package/templates/python/model_doc.mustache +40 -0
- package/templates/python/model_enum.mustache +36 -0
- package/templates/python/model_generic.mustache +403 -0
- package/templates/python/model_oneof.mustache +209 -0
- package/templates/python/model_test.mustache +60 -0
- package/templates/python/partial_api.mustache +52 -0
- package/templates/python/partial_api_args.mustache +18 -0
- package/templates/python/partial_header.mustache +19 -0
- package/templates/python/py.typed.mustache +1 -0
- package/templates/python/pyproject.mustache +172 -0
- package/templates/python/python_doc_auth_partial.mustache +108 -0
- package/templates/python/requirements.mustache +23 -0
- package/templates/python/rest.mustache +254 -0
- package/templates/python/setup.mustache +60 -0
- package/templates/python/setup_cfg.mustache +2 -0
- package/templates/python/signing.mustache +422 -0
- package/templates/python/test-requirements.mustache +6 -0
- package/templates/python/tornado/rest.mustache +148 -0
- package/templates/python/tox.mustache +9 -0
- package/templates/python/travis.mustache +17 -0
- package/templates/typescript-fetch/ApiEntitiesRecord.mustache +26 -0
- package/templates/typescript-fetch/ApiEntitiesReducer.mustache +21 -0
- package/templates/typescript-fetch/ApiEntitiesSelectors.mustache +5 -0
- package/templates/typescript-fetch/README.mustache +127 -0
- package/templates/typescript-fetch/allSagas.mustache +19 -0
- package/templates/typescript-fetch/api_doc.mustache +63 -0
- package/templates/typescript-fetch/api_example.mustache +44 -0
- package/templates/typescript-fetch/apis.index.mustache +16 -0
- package/templates/typescript-fetch/apis.mustache +483 -0
- package/templates/typescript-fetch/apisAssignQueryParam.mustache +12 -0
- package/templates/typescript-fetch/gitignore +4 -0
- package/templates/typescript-fetch/index.mustache +17 -0
- package/templates/typescript-fetch/licenseInfo.mustache +11 -0
- package/templates/typescript-fetch/modelEnum.mustache +28 -0
- package/templates/typescript-fetch/modelEnumInterfaces.mustache +37 -0
- package/templates/typescript-fetch/modelGeneric.mustache +261 -0
- package/templates/typescript-fetch/modelGenericInterfaces.mustache +50 -0
- package/templates/typescript-fetch/modelOneOf.mustache +255 -0
- package/templates/typescript-fetch/modelOneOfInterfaces.mustache +6 -0
- package/templates/typescript-fetch/model_doc.mustache +41 -0
- package/templates/typescript-fetch/models.index.mustache +32 -0
- package/templates/typescript-fetch/models.mustache +24 -0
- package/templates/typescript-fetch/npmignore.mustache +1 -0
- package/templates/typescript-fetch/package.mustache +43 -0
- package/templates/typescript-fetch/recordGeneric.mustache +295 -0
- package/templates/typescript-fetch/records.mustache +17 -0
- package/templates/typescript-fetch/runtime.mustache +424 -0
- package/templates/typescript-fetch/runtimeSagasAndRecords.mustache +120 -0
- package/templates/typescript-fetch/sagaApiManager.mustache +28 -0
- package/templates/typescript-fetch/sagas.mustache +245 -0
- package/templates/typescript-fetch/sourceLibraryIndex.mustache +1 -0
- package/templates/typescript-fetch/tsconfig.esm.mustache +7 -0
- package/templates/typescript-fetch/tsconfig.mustache +25 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="./vendor/autoload.php" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
|
|
3
|
+
<coverage processUncoveredFiles="true">
|
|
4
|
+
<include>
|
|
5
|
+
<directory suffix=".php">{{#forwardslash}}{{apiSrcPath}}{{/forwardslash}}</directory>
|
|
6
|
+
<directory suffix=".php">{{#forwardslash}}{{modelSrcPath}}{{/forwardslash}}</directory>
|
|
7
|
+
</include>
|
|
8
|
+
</coverage>
|
|
9
|
+
<testsuites>
|
|
10
|
+
<testsuite name="tests">
|
|
11
|
+
<directory>{{apiTestPath}}</directory>
|
|
12
|
+
<directory>{{modelTestPath}}</directory>
|
|
13
|
+
</testsuite>
|
|
14
|
+
</testsuites>
|
|
15
|
+
<php>
|
|
16
|
+
<ini name="error_reporting" value="E_ALL"/>
|
|
17
|
+
</php>
|
|
18
|
+
</phpunit>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# {{{projectName}}}
|
|
2
|
+
{{#if appDescriptionWithNewLines}}
|
|
3
|
+
{{{appDescriptionWithNewLines}}}
|
|
4
|
+
{{/if}}
|
|
5
|
+
|
|
6
|
+
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
7
|
+
|
|
8
|
+
- API version: {{appVersion}}
|
|
9
|
+
- Package version: {{packageVersion}}
|
|
10
|
+
{{^hideGenerationTimestamp}}
|
|
11
|
+
- Build date: {{generatedDate}}
|
|
12
|
+
{{/hideGenerationTimestamp}}
|
|
13
|
+
- Generator version: {{generatorVersion}}
|
|
14
|
+
- Build package: {{generatorClass}}
|
|
15
|
+
{{#if infoUrl}}
|
|
16
|
+
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
|
|
17
|
+
{{/if}}
|
|
18
|
+
|
|
19
|
+
## Requirements.
|
|
20
|
+
|
|
21
|
+
Python {{{generatorLanguageVersion}}}
|
|
22
|
+
|
|
23
|
+
## Installation & Usage
|
|
24
|
+
### pip install
|
|
25
|
+
|
|
26
|
+
If the python package is hosted on a repository, you can install directly using:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git
|
|
30
|
+
```
|
|
31
|
+
(you may need to run `pip` with root permission: `sudo pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git`)
|
|
32
|
+
|
|
33
|
+
Then import the package:
|
|
34
|
+
```python
|
|
35
|
+
import {{{packageName}}}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Setuptools
|
|
39
|
+
|
|
40
|
+
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
python setup.py install --user
|
|
44
|
+
```
|
|
45
|
+
(or `sudo python setup.py install` to install the package for all users)
|
|
46
|
+
|
|
47
|
+
Then import the package:
|
|
48
|
+
```python
|
|
49
|
+
import {{{packageName}}}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Tests
|
|
53
|
+
|
|
54
|
+
Execute `pytest` to run the tests.
|
|
55
|
+
|
|
56
|
+
## Getting Started
|
|
57
|
+
|
|
58
|
+
Please follow the [installation procedure](#installation--usage) and then run the following:
|
|
59
|
+
|
|
60
|
+
{{> common_README }}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# {{{projectName}}}
|
|
2
|
+
{{#if appDescription}}
|
|
3
|
+
{{{appDescription}}}
|
|
4
|
+
{{/if}}
|
|
5
|
+
|
|
6
|
+
The `{{packageName}}` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
7
|
+
|
|
8
|
+
- API version: {{appVersion}}
|
|
9
|
+
- Package version: {{packageVersion}}
|
|
10
|
+
{{^hideGenerationTimestamp}}
|
|
11
|
+
- Build date: {{generatedDate}}
|
|
12
|
+
{{/hideGenerationTimestamp}}
|
|
13
|
+
- Generator version: {{generatorVersion}}
|
|
14
|
+
- Build package: {{generatorClass}}
|
|
15
|
+
{{#if infoUrl}}
|
|
16
|
+
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
|
|
17
|
+
{{/if}}
|
|
18
|
+
|
|
19
|
+
## Requirements.
|
|
20
|
+
|
|
21
|
+
Python {{{generatorLanguageVersion}}}
|
|
22
|
+
|
|
23
|
+
## Installation & Usage
|
|
24
|
+
|
|
25
|
+
This python library package is generated without supporting files like setup.py or requirements files
|
|
26
|
+
|
|
27
|
+
To be able to use it, you will need these dependencies in your own package that uses this library:
|
|
28
|
+
|
|
29
|
+
* urllib3 >= 2.[1].0, < 3.[0].0
|
|
30
|
+
* python-dateutil >= 2.[8].2
|
|
31
|
+
{{#async}}
|
|
32
|
+
* aiohttp >= 3.[8].4
|
|
33
|
+
* aiohttp-retry >= 2.[8].3
|
|
34
|
+
{{/async}}
|
|
35
|
+
{{#tornado}}
|
|
36
|
+
* tornado >= 4.2, < 5
|
|
37
|
+
{{/tornado}}
|
|
38
|
+
{{#hasHttpSignatureMethods}}
|
|
39
|
+
* pem >= 19.[3].0
|
|
40
|
+
* pycryptodome >= 3.[9].0
|
|
41
|
+
{{/hasHttpSignatureMethods}}
|
|
42
|
+
* pydantic >= 2
|
|
43
|
+
* typing-extensions >= 4.[7].1
|
|
44
|
+
|
|
45
|
+
## Getting Started
|
|
46
|
+
|
|
47
|
+
In your own code, to use this library to connect and interact with {{{projectName}}},
|
|
48
|
+
you can run the following:
|
|
49
|
+
|
|
50
|
+
{{> common_README }}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# flake8: noqa
|
|
2
|
+
|
|
3
|
+
{{^lazyImports}}
|
|
4
|
+
{{>exports_api}}
|
|
5
|
+
{{/lazyImports}}
|
|
6
|
+
{{#lazyImports}}if __import__("typing").TYPE_CHECKING:
|
|
7
|
+
{{>exports_api}}
|
|
8
|
+
else:
|
|
9
|
+
from lazy_imports import LazyModule, as_package, load
|
|
10
|
+
|
|
11
|
+
load(
|
|
12
|
+
LazyModule(
|
|
13
|
+
*as_package(__file__),
|
|
14
|
+
"""{{>exports_api}}""",
|
|
15
|
+
name=__name__,
|
|
16
|
+
doc=__doc__,
|
|
17
|
+
)
|
|
18
|
+
)
|
|
19
|
+
{{/lazyImports}}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
{{>partial_header}}
|
|
5
|
+
|
|
6
|
+
{{^lazyImports}}
|
|
7
|
+
{{>exports_model}}
|
|
8
|
+
{{/lazyImports}}
|
|
9
|
+
{{#lazyImports}}if __import__("typing").TYPE_CHECKING:
|
|
10
|
+
{{>exports_model}}
|
|
11
|
+
else:
|
|
12
|
+
from lazy_imports import LazyModule, as_package, load
|
|
13
|
+
|
|
14
|
+
load(
|
|
15
|
+
LazyModule(
|
|
16
|
+
*as_package(__file__),
|
|
17
|
+
"""{{>exports_model}}""",
|
|
18
|
+
name=__name__,
|
|
19
|
+
doc=__doc__,
|
|
20
|
+
)
|
|
21
|
+
)
|
|
22
|
+
{{/lazyImports}}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
|
|
5
|
+
{{>partial_header}}
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
__version__ = "{{packageVersion}}"
|
|
9
|
+
|
|
10
|
+
# Define package exports
|
|
11
|
+
__all__ = [
|
|
12
|
+
{{#apiInfo}}{{#apis}}"{{classname}}",
|
|
13
|
+
{{/apis}}{{/apiInfo}}"ApiResponse",
|
|
14
|
+
"ApiClient",
|
|
15
|
+
"Configuration",
|
|
16
|
+
"OpenApiException",
|
|
17
|
+
"ApiTypeError",
|
|
18
|
+
"ApiValueError",
|
|
19
|
+
"ApiKeyError",
|
|
20
|
+
"ApiAttributeError",
|
|
21
|
+
"ApiException",
|
|
22
|
+
{{#hasHttpSignatureMethods}}"HttpSigningConfiguration",
|
|
23
|
+
{{/hasHttpSignatureMethods}}{{#models}}{{#model}}"{{classname}}"{{#unless @last}},
|
|
24
|
+
{{/unless}}{{#if @last}},{{/if}}{{/model}}{{/models}}
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
{{^lazyImports}}
|
|
28
|
+
{{>exports_package}}
|
|
29
|
+
{{/lazyImports}}
|
|
30
|
+
{{#lazyImports}}if __import__("typing").TYPE_CHECKING:
|
|
31
|
+
{{>exports_package}}
|
|
32
|
+
else:
|
|
33
|
+
from lazy_imports import LazyModule, as_package, load
|
|
34
|
+
|
|
35
|
+
load(
|
|
36
|
+
LazyModule(
|
|
37
|
+
*as_package(__file__),
|
|
38
|
+
("__version__", __version__),
|
|
39
|
+
("__all__", __all__),
|
|
40
|
+
"""{{>exports_package}}""",
|
|
41
|
+
name=__name__,
|
|
42
|
+
doc=__doc__,
|
|
43
|
+
)
|
|
44
|
+
)
|
|
45
|
+
{{/lazyImports}}
|
|
46
|
+
{{#recursionLimit}}
|
|
47
|
+
|
|
48
|
+
__import__('sys').setrecursionlimit({{{.}}})
|
|
49
|
+
{{/recursionLimit}}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
{{>partial_header}}
|
|
4
|
+
|
|
5
|
+
import warnings
|
|
6
|
+
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
7
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
8
|
+
from typing_extensions import Annotated
|
|
9
|
+
|
|
10
|
+
{{#imports}}
|
|
11
|
+
{{import}}
|
|
12
|
+
{{/imports}}
|
|
13
|
+
|
|
14
|
+
from {{packageName}}.api_client import ApiClient, RequestSerialized
|
|
15
|
+
from {{packageName}}.api_response import ApiResponse
|
|
16
|
+
from {{packageName}}.rest import RESTResponseType
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
{{#operations}}
|
|
20
|
+
class {{classname}}:
|
|
21
|
+
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
22
|
+
Ref: https://openapi-generator.tech
|
|
23
|
+
|
|
24
|
+
Do not edit the class manually.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
def __init__(self, api_client=None) -> None:
|
|
28
|
+
if api_client is None:
|
|
29
|
+
api_client = ApiClient.get_default()
|
|
30
|
+
self.api_client = api_client
|
|
31
|
+
{{#operation}}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@validate_call
|
|
35
|
+
{{#async}}async {{/async}}def {{operationId}}{{>partial_api_args}} -> {{{returnType}}}{{#unless returnType}}None{{/unless}}:
|
|
36
|
+
{{>partial_api}}
|
|
37
|
+
|
|
38
|
+
response_data = {{#async}}await {{/async}}self.api_client.call_api(
|
|
39
|
+
*_param,
|
|
40
|
+
_request_timeout=_request_timeout
|
|
41
|
+
)
|
|
42
|
+
{{#async}}await {{/async}}response_data.read()
|
|
43
|
+
return self.api_client.response_deserialize(
|
|
44
|
+
response_data=response_data,
|
|
45
|
+
response_types_map=_response_types_map,
|
|
46
|
+
).data
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@validate_call
|
|
50
|
+
{{#async}}async {{/async}}def {{operationId}}_with_http_info{{>partial_api_args}} -> ApiResponse[{{{returnType}}}{{#unless returnType}}None{{/unless}}]:
|
|
51
|
+
{{>partial_api}}
|
|
52
|
+
|
|
53
|
+
response_data = {{#async}}await {{/async}}self.api_client.call_api(
|
|
54
|
+
*_param,
|
|
55
|
+
_request_timeout=_request_timeout
|
|
56
|
+
)
|
|
57
|
+
{{#async}}await {{/async}}response_data.read()
|
|
58
|
+
return self.api_client.response_deserialize(
|
|
59
|
+
response_data=response_data,
|
|
60
|
+
response_types_map=_response_types_map,
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@validate_call
|
|
65
|
+
{{#async}}async {{/async}}def {{operationId}}_without_preload_content{{>partial_api_args}} -> RESTResponseType:
|
|
66
|
+
{{>partial_api}}
|
|
67
|
+
|
|
68
|
+
response_data = {{#async}}await {{/async}}self.api_client.call_api(
|
|
69
|
+
*_param,
|
|
70
|
+
_request_timeout=_request_timeout
|
|
71
|
+
)
|
|
72
|
+
return response_data.response
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def _{{operationId}}_serialize(
|
|
76
|
+
self,
|
|
77
|
+
{{#allParams}}
|
|
78
|
+
{{paramName}},
|
|
79
|
+
{{/allParams}}
|
|
80
|
+
_request_auth,
|
|
81
|
+
_content_type,
|
|
82
|
+
_headers,
|
|
83
|
+
_host_index,
|
|
84
|
+
) -> RequestSerialized:
|
|
85
|
+
|
|
86
|
+
{{#if servers}}
|
|
87
|
+
_hosts = [{{#servers}}
|
|
88
|
+
'{{{url}}}'{{#unless @last}},{{/unless}}{{/servers}}
|
|
89
|
+
]
|
|
90
|
+
_host = _hosts[_host_index]
|
|
91
|
+
{{/if}}
|
|
92
|
+
{{#unless servers}}
|
|
93
|
+
_host = None
|
|
94
|
+
{{/if}}
|
|
95
|
+
|
|
96
|
+
_collection_formats: Dict[str, str] = {
|
|
97
|
+
{{#allParams}}
|
|
98
|
+
{{#isArray}}
|
|
99
|
+
'{{baseName}}': '{{collectionFormat}}',
|
|
100
|
+
{{/isArray}}
|
|
101
|
+
{{/allParams}}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
_path_params: Dict[str, str] = {}
|
|
105
|
+
_query_params: List[Tuple[str, str]] = []
|
|
106
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
107
|
+
_form_params: List[Tuple[str, str]] = []
|
|
108
|
+
_files: Dict[
|
|
109
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
110
|
+
] = {}
|
|
111
|
+
_body_params: Optional[bytes] = None
|
|
112
|
+
|
|
113
|
+
# process the path parameters
|
|
114
|
+
{{#pathParams}}
|
|
115
|
+
if {{paramName}} is not None:
|
|
116
|
+
_path_params['{{baseName}}'] = {{paramName}}{{#isEnumRef}}.value{{/isEnumRef}}
|
|
117
|
+
{{/pathParams}}
|
|
118
|
+
# process the query parameters
|
|
119
|
+
{{#queryParams}}
|
|
120
|
+
if {{paramName}} is not None:
|
|
121
|
+
{{#isDateTime}}
|
|
122
|
+
if isinstance({{paramName}}, datetime):
|
|
123
|
+
_query_params.append(
|
|
124
|
+
(
|
|
125
|
+
'{{baseName}}',
|
|
126
|
+
{{paramName}}.strftime(
|
|
127
|
+
self.api_client.configuration.datetime_format
|
|
128
|
+
)
|
|
129
|
+
)
|
|
130
|
+
)
|
|
131
|
+
else:
|
|
132
|
+
_query_params.append(('{{baseName}}', {{paramName}}))
|
|
133
|
+
{{/isDateTime}}
|
|
134
|
+
{{#isDate}}
|
|
135
|
+
if isinstance({{paramName}}, date):
|
|
136
|
+
_query_params.append(
|
|
137
|
+
(
|
|
138
|
+
'{{baseName}}',
|
|
139
|
+
{{paramName}}.strftime(
|
|
140
|
+
self.api_client.configuration.date_format
|
|
141
|
+
)
|
|
142
|
+
)
|
|
143
|
+
)
|
|
144
|
+
else:
|
|
145
|
+
_query_params.append(('{{baseName}}', {{paramName}}))
|
|
146
|
+
{{/isDate}}
|
|
147
|
+
{{^isDateTime}}{{^isDate}}
|
|
148
|
+
_query_params.append(('{{baseName}}', {{paramName}}{{#isEnumRef}}.value{{/isEnumRef}}))
|
|
149
|
+
{{/isDate}}{{/isDateTime}}
|
|
150
|
+
{{/queryParams}}
|
|
151
|
+
# process the header parameters
|
|
152
|
+
{{#headerParams}}
|
|
153
|
+
if {{paramName}} is not None:
|
|
154
|
+
_header_params['{{baseName}}'] = {{paramName}}
|
|
155
|
+
{{/headerParams}}
|
|
156
|
+
# process the form parameters
|
|
157
|
+
{{#formParams}}
|
|
158
|
+
if {{paramName}} is not None:
|
|
159
|
+
{{#isFile}}
|
|
160
|
+
_files['{{{baseName}}}'] = {{paramName}}
|
|
161
|
+
{{/isFile}}
|
|
162
|
+
{{^isFile}}
|
|
163
|
+
_form_params.append(('{{{baseName}}}', {{paramName}}))
|
|
164
|
+
{{/isFile}}
|
|
165
|
+
{{/formParams}}
|
|
166
|
+
# process the body parameter
|
|
167
|
+
{{#bodyParam}}
|
|
168
|
+
if {{paramName}} is not None:
|
|
169
|
+
{{#isBinary}}
|
|
170
|
+
# convert to byte array if the input is a file name (str)
|
|
171
|
+
if isinstance({{paramName}}, str):
|
|
172
|
+
with open({{paramName}}, "rb") as _fp:
|
|
173
|
+
_body_params = _fp.read()
|
|
174
|
+
elif isinstance({{paramName}}, tuple):
|
|
175
|
+
# drop the filename from the tuple
|
|
176
|
+
_body_params = {{paramName}}[1]
|
|
177
|
+
else:
|
|
178
|
+
_body_params = {{paramName}}
|
|
179
|
+
{{/isBinary}}
|
|
180
|
+
{{^isBinary}}
|
|
181
|
+
_body_params = {{paramName}}
|
|
182
|
+
{{/isBinary}}
|
|
183
|
+
{{/bodyParam}}
|
|
184
|
+
|
|
185
|
+
{{#constantParams}}
|
|
186
|
+
{{#isQueryParam}}
|
|
187
|
+
# Set client side default value of Query Param "{{baseName}}".
|
|
188
|
+
_query_params.append(('{{baseName}}', {{#_enum}}'{{{.}}}'{{/_enum}}))
|
|
189
|
+
{{/isQueryParam}}
|
|
190
|
+
{{#isHeaderParam}}
|
|
191
|
+
# Set client side default value of Header Param "{{baseName}}".
|
|
192
|
+
_header_params['{{baseName}}'] = {{#_enum}}'{{{.}}}'{{/_enum}}
|
|
193
|
+
{{/isHeaderParam}}
|
|
194
|
+
{{/constantParams}}
|
|
195
|
+
|
|
196
|
+
{{#hasProduces}}
|
|
197
|
+
# set the HTTP header `Accept`
|
|
198
|
+
if 'Accept' not in _header_params:
|
|
199
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
200
|
+
[{{#produces}}
|
|
201
|
+
'{{{mediaType}}}'{{#unless @last}}, {{/unless}}{{/produces}}
|
|
202
|
+
]
|
|
203
|
+
)
|
|
204
|
+
{{/hasProduces}}
|
|
205
|
+
|
|
206
|
+
{{#hasConsumes}}
|
|
207
|
+
# set the HTTP header `Content-Type`
|
|
208
|
+
if _content_type:
|
|
209
|
+
_header_params['Content-Type'] = _content_type
|
|
210
|
+
else:
|
|
211
|
+
_default_content_type = (
|
|
212
|
+
self.api_client.select_header_content_type(
|
|
213
|
+
[{{#consumes}}
|
|
214
|
+
'{{{mediaType}}}'{{#unless @last}}, {{/unless}}{{/consumes}}
|
|
215
|
+
]
|
|
216
|
+
)
|
|
217
|
+
)
|
|
218
|
+
if _default_content_type is not None:
|
|
219
|
+
_header_params['Content-Type'] = _default_content_type
|
|
220
|
+
{{/hasConsumes}}
|
|
221
|
+
|
|
222
|
+
# authentication setting
|
|
223
|
+
_auth_settings: List[str] = [{{#authMethods}}
|
|
224
|
+
'{{name}}'{{#unless @last}}, {{/unless}}{{/authMethods}}
|
|
225
|
+
]
|
|
226
|
+
|
|
227
|
+
return self.api_client.param_serialize(
|
|
228
|
+
method='{{httpMethod}}',
|
|
229
|
+
resource_path='{{{path}}}',
|
|
230
|
+
path_params=_path_params,
|
|
231
|
+
query_params=_query_params,
|
|
232
|
+
header_params=_header_params,
|
|
233
|
+
body=_body_params,
|
|
234
|
+
post_params=_form_params,
|
|
235
|
+
files=_files,
|
|
236
|
+
auth_settings=_auth_settings,
|
|
237
|
+
collection_formats=_collection_formats,
|
|
238
|
+
_host=_host,
|
|
239
|
+
_request_auth=_request_auth
|
|
240
|
+
)
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
{{/operation}}
|
|
244
|
+
{{/operations}}
|