Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest openapi generator image #528

Merged
merged 192 commits into from
Jul 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
7a23bdc
renaming for openapi-generator
wing328 Mar 6, 2018
309f429
Rename projects from swagger-codegen master branch
jmini Apr 14, 2018
7c96361
Merge commit 'oas3_support2' into 'swagger-codegen_renamed'
jmini Apr 14, 2018
092c6f0
Add OpenAPI spec 3.0 support (beta)
jmini Apr 17, 2018
013be15
Merge commit 'swagger-codegen_renamed' into 'master'
jmini Apr 17, 2018
1d0decf
update discriminator to discriminatorName (#142)
wing328 Apr 19, 2018
ae42198
fix: python clients (#136)
tomplus Apr 21, 2018
8b0eb01
update default user agent (#284)
wing328 May 1, 2018
e154b6d
Update wordings (#301)
wing328 May 3, 2018
512ddfc
Merge 'master' branch of 'swagger-codegen' into 'openapi-generator' (…
jmini May 5, 2018
30b63c0
Update python default value (#360)
wing328 May 7, 2018
604c88b
Update python test (#426)
wing328 May 12, 2018
3ca216f
Rename datatype to dataType in CodegenProperty (#69)
jmini May 18, 2018
719ab23
[python] asyncio supports _preload_content; remove unsed imports (#107)
tomplus May 24, 2018
d4895f4
Grammar and spelling fixes (#329)
scop Jun 16, 2018
87a8731
Improve logging in Python client (#480)
wing328 Jul 10, 2018
0480fa1
feat: use local_var_params to avoid collision with api parameters (#521)
tomplus Jul 12, 2018
00acbc9
[Python][Client] pure library client package (#470)
Jul 16, 2018
80f5fa7
Support for python 3.7 by renaming `async` to `async_req` (#519)
tomplus Jul 20, 2018
51305f2
fix: python-asyncio/aiohttp with disabled ssl verification (#891)
tomplus Aug 24, 2018
9a83d88
[PYTHON] Api doc python with multiple authentications (#928)
Aug 31, 2018
af07b4c
Add nullable support to Python client (#1073)
wing328 Sep 29, 2018
633170a
fix: python/asyncio no-ssl-verify affects verification of server cert…
tomplus Oct 12, 2018
e4d8853
Fix W605 Warning and reenable flake8 (#1334)
micw523 Oct 28, 2018
3f32847
[python] Avoid creating unused ThreadPools (#1387)
wing328 Nov 8, 2018
41140be
change python pool_thread default to 1 (#1403)
wing328 Nov 9, 2018
11e8658
feat: [python/asyncio] use ssl argument instead of ssl_context (depre…
tomplus Dec 21, 2018
24ef798
[python-client] Add model default values (#1776)
spacether Jan 9, 2019
34bb180
Python: Update api_doc_example for multiple auth (#1870)
cognifloyd Jan 11, 2019
f7d300c
[Spec] adds XmlItem model and route for xml testing (#1883)
spacether Jan 26, 2019
fc3247e
Add multiple servers support to Python client (#1969)
wing328 Jan 28, 2019
8c05733
Add Bearer authentication support to Python client (#1999)
wing328 Jan 30, 2019
3650fb9
[Python] Add "servers" support in path, operation (#2052)
wing328 Feb 8, 2019
7937a0f
[Python] handle nullable parameters with None added to allowed_values…
Feb 9, 2019
a47a1e6
Python apikey cookie (#2367)
tomghyselinck Mar 14, 2019
118afc7
Adding retries option to override default value 3 of urllib3 (#2460)
chowmean Mar 22, 2019
780e790
Adds exceptions module to python clients (#2393)
spacether Mar 22, 2019
35a841e
Added proxy headers option for urllib3 (#2467)
chowmean Mar 22, 2019
2841f12
[Bug][Python]Support body as bytes when Content-Type is unknown (#2626)
sarod Apr 26, 2019
70479dc
python: api_client: add the multipart files after sanitization (#2122)
May 7, 2019
6cf0658
Minor wording change (#2875)
wing328 May 13, 2019
3636d86
[Python] Remove unnecessary if else. (#2985)
wy193777 May 24, 2019
c4e8a40
[Python] ModuleNotFoundError when packagename contains dots (#2992)
saigiridhar21 May 29, 2019
d440913
[python] Adding constructor parameters to Configuration and improving…
saigiridhar21 May 29, 2019
08aa948
feat: configurable limit of simultaneous connections (python/asyncio)…
tomplus Jun 25, 2019
8f5b42a
[python] : Make example code snippet compilable (#3148)
saigiridhar21 Jun 28, 2019
33aee95
[python-experimental] automatically use values for enums of length1 (…
spacether Jul 31, 2019
fbb5a18
[Python] avoid unnecessary dictionary lookup in get_api_key method (#…
houqp Aug 13, 2019
8218fa2
[Python] support api key refresh in configuration module (#3594)
Aug 15, 2019
91d4c6e
Exclude "test" from packages so that it is not installed as top-level…
akaegi Aug 25, 2019
e8a3a27
Support custom git repository (#3757)
qmuntal Sep 3, 2019
9af5c1a
[python-experimental] generate model if type != object if enums/valid…
spacether Sep 24, 2019
ea771c3
Fixed Readonly Docs for python (#4085)
psav Oct 9, 2019
34d64ab
Fix readonly with isReadOnly (#4102)
wing328 Oct 9, 2019
98bf608
Skip adding None value in query parameters (#4161)
Oct 16, 2019
e355121
[python] Remove post_params and body from OPTIONS request (#4163)
Oct 16, 2019
0779caf
[python] Add option to skip client validations (#4137)
Oct 16, 2019
c93605a
[Python] Minor fix to code format (#4172)
wing328 Oct 16, 2019
cc11b6e
[python] Add ability to get allowed values (#4138)
Oct 24, 2019
6248023
[Python-experimental] types now classes, adds additionalProperties ha…
spacether Oct 28, 2019
554e6cb
[Python] [Bug] Correct typo in the word datetime (#4304)
Oct 29, 2019
5933bdf
[Python] Remove redundant else statement (#4311)
Oct 30, 2019
d12d265
[python][fix] Adding model summary to model documentation files (#4306)
saigiridhar21 Oct 30, 2019
d98b3f4
Do not HTML escaped the description in the doc (#4321)
wing328 Oct 31, 2019
0a9f1e3
[Python] Avoid pep8 violation (#4316)
Nov 3, 2019
b1f4108
[python][metadata]: Adding license and author fields (#4318)
saigiridhar21 Nov 3, 2019
20f0727
[Python-Experimental]: Remove redundant else statement (#4324)
Nov 4, 2019
db2880d
[Python] [Performance] Avoid unnessacary checks inside the loop (#4305)
Nov 7, 2019
dda7538
Fixes Python client Configuration class so each instance uses its own…
spacether Nov 17, 2019
360acdc
Updates python and python-flask travis CI testing to use python 3.6, …
spacether Dec 10, 2019
f543f21
fix package name in tox.ini (#4776)
wing328 Dec 12, 2019
52924f1
[Python] Adds allOf/oneOf/anyOf composed models (#4446)
spacether Dec 15, 2019
a8b8ddb
[Python] Remove mutable default argument (#4665)
jirikuncar Dec 17, 2019
779e70b
[Python] Updates python test framework to pytest (#4765)
spacether Dec 22, 2019
5dd55cc
replace petstore_api with packageName (#4921)
wing328 Jan 3, 2020
e6a668e
[Python] Allow models to have properties of type self (#4888)
spacether Jan 10, 2020
0f0aa0c
[Python] Conditionally set auth attributes (#4988)
sebastien-rosset Jan 16, 2020
f22c817
Add python-experimental-openapiv3-sample (#4992)
sebastien-rosset Jan 21, 2020
11fedab
Rebased to current upstream/master. (#4514)
michelealbano Jan 22, 2020
0cccbfb
[HttpBasicAuth] Use positive isBasicBasic tag instead of negative isB…
sebastien-rosset Jan 24, 2020
c0924d1
[Python] Support for HTTP signature (#4958)
sebastien-rosset Jan 27, 2020
73b4349
[python] Cleanup ThreadPool with atexit rather than __del__ (#5094)
fabianvf Jan 29, 2020
f538592
Switch to predominant use of appDescriptionWithNewLines in README.mus…
Jan 29, 2020
0df7216
[Python] Fix #5126 operations with req enums of length one (#5129)
spacether Jan 29, 2020
d296a2d
[Python] Python HTTP signature update (#5154)
sebastien-rosset Feb 3, 2020
f82715a
[python] use datetime aware object (#5209)
sebastien-rosset Feb 6, 2020
9977d22
[Python] 5094 followup - Reduce redundancy in docs (#5161)
fabianvf Feb 6, 2020
fd4cd68
python: Add gitlab-ci.mustache (#5342)
Feb 17, 2020
57f7c72
Respect usenose for Python CI (#5376)
Feb 20, 2020
686c3f7
[Python] add discard_unknown_keys parameter (#5362)
sebastien-rosset Feb 21, 2020
f20a3a3
[python] add method to set/get default configuration (#5315)
tomplus Feb 23, 2020
c3ed779
[python] Adds python oneOf/anyOf models + tests (#5341)
spacether Feb 28, 2020
f6e9644
Add serialization of ModelComposed (#5551)
sebastien-rosset Mar 7, 2020
446507e
Fixes kwargs typos, removes E501s (#5552)
spacether Mar 7, 2020
185cd3e
[python/asyncio] explicitly close client session via async context ma…
tomplus Mar 25, 2020
c2dadae
[Python-experimental] Documentation enhancement for oneOf schema and …
sebastien-rosset Apr 4, 2020
9f5ea56
[Python-experimental] Use DER encoding for ECDSA signatures, add para…
sebastien-rosset Apr 15, 2020
f91931d
[Python-experimental] Fix TypeError: unhashable type: 'list' (#5810)
sebastien-rosset Apr 16, 2020
1fbc64d
[python/asyncio] fix passing proxy parameters to aiohttp (#5943)
tomplus Apr 16, 2020
abd9642
Sync master to 5.0.x (#5968)
wing328 Apr 22, 2020
50238bf
Revert "Sync master to 5.0.x (#5968)"
wing328 Apr 22, 2020
3b106fd
Merge branch '5.0-sync-master3' into 5.0.x
wing328 Apr 22, 2020
1d3d523
[python-experimental] Minor doc update, code comments and exception h…
sebastien-rosset Apr 24, 2020
c727857
[Python experimental] Add __setattr__ function to ensure signing_info…
sebastien-rosset Apr 24, 2020
deecddb
[CORE] Fixes composed schema discriminator map (#4906)
spacether Apr 24, 2020
6f5e0b5
[Python experimental] Readme improvements (#6031)
sebastien-rosset Apr 24, 2020
fa5f7e5
[Python] Fix Python UTF-8 Encoding Issue (#5679)
CrshOverride Apr 26, 2020
3773521
Merge remote-tracking branch 'origin/master' into 5.0.x
wing328 Apr 28, 2020
e7ba20d
Adds memoization and deserialization through 2 or more discriminators…
spacether May 3, 2020
9fc7ab4
Merge remote-tracking branch 'origin/5.0.x'
wing328 May 6, 2020
9840730
[python-experimental] Raise builtin AttributeError instead of custom …
sebastien-rosset May 11, 2020
f300c07
[python-experimental] Improve error message for regex matching, add u…
sebastien-rosset May 11, 2020
7accc67
[codegen][Python-experimental] Discriminator NPE fix, handle 'null' t…
sebastien-rosset May 11, 2020
89b5c2f
[Python-experimental] JSON schema 'null' type should be modeled as 'n…
sebastien-rosset May 13, 2020
ffce474
[python-experimental] Support schema property which has $ref to 'oneO…
sebastien-rosset May 13, 2020
804fd58
[python-experimental] Support schema property which has $ref to 'oneO…
sebastien-rosset May 17, 2020
0b4f3a4
[codegen][python-experimental] Add configuration knob to disable JSON…
sebastien-rosset May 17, 2020
c960883
[Python-experimental] Should accept float value serialized without de…
sebastien-rosset May 22, 2020
95d0e6f
[python-experimental] Add support for pep 3134, attach cause of excep…
sebastien-rosset May 22, 2020
18c7329
[Python-experimental] Rename from_server variable to json_variable_na…
sebastien-rosset May 23, 2020
a9e712e
[Python-experimental] Fix type error if oneof/anyof child schema is n…
sebastien-rosset May 25, 2020
2b908e1
python-experimental updates ancestor + adds descendant discriminator …
spacether May 28, 2020
35b2b7d
[codegen][python-experimental] Composed schema with additionalPropert…
sebastien-rosset May 28, 2020
591899a
[python-experimental] Quicken package loading (#6437)
spacether Jun 1, 2020
4e0e68b
[BUG][python] Support named arrays (#6493)
jirikuncar Jun 4, 2020
a569475
[Python] Fixed docstrings in api.mustache (#6391)
Ark-kun Jun 4, 2020
21847db
[Python] Update docstring and fix a typo (#6612)
jirikuncar Jun 11, 2020
d3a6d48
[python-client] Enable per-request auth settings (#6569)
warrengray Jun 11, 2020
247544d
[feature][python] Support aliasing of API keys (#6469)
jirikuncar Jun 11, 2020
265154e
[Python] Add attribute_map to simple model (#6669)
jirikuncar Jun 15, 2020
2d731f5
[Python] Remove duplicate definition of Endpoint class (#6667)
therve Jun 16, 2020
57f64fc
[Python] enum serialization (#6746)
jirikuncar Jun 22, 2020
3d3d771
[Python] Support for per-operation servers (#6557)
jirikuncar Jun 26, 2020
9e15550
clarify direction of py client side validation flag (#6850)
mdavis-xyz Jul 3, 2020
b669e22
Python-exp remove codegemodel mutation, allow mixed OneOf types (#6797)
spacether Jul 18, 2020
145902c
[python-experimental] Removes python2 (#6991)
spacether Jul 19, 2020
8d442c9
Python-exp clean up model classnames (#7054)
spacether Jul 28, 2020
9302ebe
[python-experimental] simplifies json serialization (#7061)
spacether Jul 28, 2020
bb80c9c
[python{,-experimental}] Obey floating point timeouts provided to RES…
cjgibson Aug 10, 2020
a5e3e52
[python-experimental] Fix model tests (#7139)
timgclark Aug 12, 2020
1226606
[python-exp] simplify examples (#7157)
spacether Aug 20, 2020
97671b5
Subclass Python exceptions (#7321)
ryanrishi Sep 5, 2020
24be170
Support multiple api keys in python example documentation (#7417)
nmuesch Sep 15, 2020
fcdfa84
Adds free form model generation in python-experimental (#7373)
spacether Sep 20, 2020
6f4f738
remove hardcoded PetApi (#7483)
wing328 Sep 22, 2020
6f0478f
Add option to set recursion limit (#7491)
wing328 Sep 24, 2020
20972a8
[Python-experimental] Don't mandate passing in required value as argu…
Sep 29, 2020
92d76f4
[Python] correct return types if multiple responses are defined (#7427)
ksvirkou-hubspot Oct 3, 2020
65ca911
[python-experimental] implement `in` operator for model classes (#7637)
mks-m Oct 9, 2020
68ee3ae
Unifies naming for isMap in Schema class properties (#7640)
spacether Oct 12, 2020
4f22c21
Unifies naming for isArray in Schema class properties (#7691)
spacether Oct 19, 2020
e0c8b11
[python] Add option to return None instead of raising exception when …
Oct 25, 2020
9fcef2b
[python] add socket_options to configuration for the rest client (#7795)
meadsteve Oct 28, 2020
aabb607
[python] check output content-type only if preload_content is set (#7…
tomplus Nov 4, 2020
997f98c
added serialize option in to_dict function in python generated model …
gtarcoder Nov 5, 2020
29f961a
Removes secondaryParam and hasMore (#7882)
spacether Nov 7, 2020
2950155
Skip validation if input_value is None (#7845)
nmuesch Nov 8, 2020
1699424
[python] Renames python generators (#7965)
wing328 Nov 18, 2020
bd8874e
[python] Re-merge Subclass Python exceptions (#7321) (#8095)
Kylmakalle Dec 5, 2020
19b2cec
Fix bug [python][client] generated python client code cannot POST obj…
itaru2622 Dec 7, 2020
3961877
[python] Update python versions (#8042)
ulgens Dec 7, 2020
3acda73
Fixes issue #8014, _check_type flag not being honored. (#8053)
fbl100 Dec 7, 2020
0e0444a
Include description directly in python docstrings (#8154)
therve Dec 15, 2020
d79ed54
[Python][Client] Default to system CA instead of certifi (#8108)
rparini Dec 16, 2020
48a3cac
Fixes object serialization when there is an inline array property whi…
spacether Jan 8, 2021
1dd008e
[python] fix #8404: avoid shadowing the name Endpoint (#8405)
RonnyPfannschmidt Jan 13, 2021
0937196
[python] Fixes file upload + download, adds tests (#8437)
spacether Jan 15, 2021
ba1b7aa
Fix counting for large API solutions in generated Python README (#8403)
languitar Jan 15, 2021
6c8f7fe
Removes nulltype from python, updates samples (#8555)
spacether Jan 28, 2021
4222aa0
[PYTHON] use customized default Configuration() objects if configured…
adpoliak Jan 30, 2021
a94b5ec
[BUG][Python] init access token for python client configuration (#7469)
zilvinasu Feb 5, 2021
e690940
[python][template] move _path_to_item of simple init to avoid name er…
RonnyPfannschmidt Feb 23, 2021
9f9dee6
Add whitespace to SDK documentation where necessary (#8919)
tballast Mar 8, 2021
5991fc9
[python] Fixes additional_properties_type for models (#8802)
spacether Mar 31, 2021
01bc01a
Fixes serialization of array items in model_to_dict [python] (#9153)
spacether Apr 1, 2021
fac55a6
Bug - python client deserialization when attribute named `self` (#9006)
gbmarc1 Apr 11, 2021
00a1cf6
[Python] Fix exclusive min and max (#9340)
wing328 Apr 26, 2021
10353bd
Merge remote-tracking branch 'origin/master' into 5.2.x
wing328 Apr 28, 2021
c5b155e
[python] readonly constructors (#9409)
gbmarc1 May 11, 2021
2c7a470
Fixes python test_fake_api tests (#9483)
spacether May 18, 2021
f68be9e
[python][client] allow passing floats for _request_timeout (#9532)
daniel-k Jun 18, 2021
09212e5
Fix minor typo in @cached_property docstring (#9886)
bagerard Jul 4, 2021
0786ea4
[BUG][PYTHON] Do not set Content-Type for GET, HEAD or DELETE request…
johnboyes Jul 7, 2021
0aeae48
Merge branch 'split-branch2' into datadog-api-spec/test/hippo/updateo…
zippolyte Jul 27, 2021
e8d36dd
Add missing _from_openapi_data
zippolyte Jul 27, 2021
cda9b1a
Add missing read_only_vars
zippolyte Jul 27, 2021
90fd512
Fix case for one list
zippolyte Jul 28, 2021
0e26a9e
Fix readme links
zippolyte Jul 28, 2021
4acacba
fix oneOf
zippolyte Jul 28, 2021
c494bd7
don't set attributes on composed schema
zippolyte Jul 29, 2021
195c41e
add gitattributes
zippolyte Jul 30, 2021
91ce590
Regenerate client from commit a54f925 of spec repo
Jul 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.4.1.dev11",
"regenerated": "2021-07-23 09:17:27.076054",
"spec_repo_commit": "0b10309"
"regenerated": "2021-07-30 12:49:13.627605",
"spec_repo_commit": "a54f925"
},
"v2": {
"apigentools_version": "1.4.1.dev11",
"regenerated": "2021-07-23 09:17:49.537097",
"spec_repo_commit": "0b10309"
"regenerated": "2021-07-30 12:49:44.726331",
"spec_repo_commit": "a54f925"
}
}
}
6 changes: 3 additions & 3 deletions .generator/templates/api_client.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class ApiClient(object):
_return_http_data_only: typing.Optional[bool] = None,
collection_formats: typing.Optional[typing.Dict[str, str]] = None,
_preload_content: bool = True,
_request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
_request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None,
_host: typing.Optional[str] = None,
_check_type: typing.Optional[bool] = None
):
Expand Down Expand Up @@ -360,7 +360,7 @@ class ApiClient(object):
_return_http_data_only: typing.Optional[bool] = None,
collection_formats: typing.Optional[typing.Dict[str, str]] = None,
_preload_content: bool = True,
_request_timeout: typing.Optional[typing.Union[int, typing.Tuple]] = None,
_request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None,
_host: typing.Optional[str] = None,
_check_type: typing.Optional[bool] = None
):
Expand Down Expand Up @@ -700,7 +700,7 @@ class Endpoint(object):
'async_req': (bool,),
'_host_index': (none_type, int),
'_preload_content': (bool,),
'_request_timeout': (none_type, int, (int,), [int]),
'_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]),
'_return_http_data_only': (bool,),
'_check_input_type': (bool,),
'_check_return_type': (bool,)
Expand Down
3 changes: 3 additions & 0 deletions .generator/templates/model.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ from {{packageName}}.model_utils import ( # noqa: F401
none_type,
validate_get_composed_info,
)
from ..model_utils import OpenApiModel
from {{packageName}}.exceptions import ApiAttributeError

{{#models}}
{{#model}}
{{#imports}}
Expand Down
6 changes: 3 additions & 3 deletions .generator/templates/model_doc.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ Name | Type | Description | Notes
{{#optionalVars}}
**{{name}}** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | {{description}} | [optional] {{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}} if omitted the server will use the default value of {{{.}}}{{/defaultValue}}
{{/optionalVars}}
{{#additionalPropertiesType}}
**any string name** | **{{additionalPropertiesType}}** | any string name can be used but the value must be the correct type | [optional]
{{/additionalPropertiesType}}
{{#additionalProperties}}
**any string name** | {{^complexType}}**{{dataType}}**{{/complexType}}{{#complexType}}[**{{dataType}}**]({{complexType}}.md){{/complexType}} | any string name can be used but the value must be the correct type | [optional]
{{/additionalProperties}}
{{/oneOf}}

[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to README]](README.md)
Expand Down
10 changes: 5 additions & 5 deletions .generator/templates/model_templates/classvars.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
{{/optionalVars}}
}

{{#additionalPropertiesType}}
{{#additionalProperties}}
@cached_property
def additional_properties_type():
"""
Expand All @@ -72,11 +72,11 @@
lazy_import()
{{/-first}}
{{/imports}}
return ({{{additionalPropertiesType}}},) # noqa: E501
{{/additionalPropertiesType}}
{{^additionalPropertiesType}}
return ({{{dataType}}},) # noqa: E501
{{/additionalProperties}}
{{^additionalProperties}}
additional_properties_type = None
{{/additionalPropertiesType}}
{{/additionalProperties}}

_nullable = {{#isNullable}}True{{/isNullable}}{{^isNullable}}False{{/isNullable}}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
if args:
raise ApiTypeError(
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@classmethod
@convert_js_args_to_python_args
def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
"""{{classname}} - a model defined in OpenAPI

Keyword Args:
{{#requiredVars}}
{{#defaultValue}}
{{name}} ({{{dataType}}}):{{#description}} {{{description}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501
{{/defaultValue}}
{{^defaultValue}}
{{name}} ({{{dataType}}}):{{#description}} {{{description}}}{{/description}}
{{/defaultValue}}
{{/requiredVars}}
{{> model_templates/docstring_init_required_kwargs }}
{{#optionalVars}}
{{name}} ({{{dataType}}}):{{#description}} {{{description}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}} # noqa: E501
{{/optionalVars}}
"""

{{#requiredVars}}
{{#defaultValue}}
{{name}} = kwargs.get('{{name}}', {{{defaultValue}}})
{{/defaultValue}}
{{/requiredVars}}
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

self = super(OpenApiModel, cls).__new__(cls)

{{> model_templates/invalid_pos_args }}

self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

constant_args = {
'_check_type': _check_type,
'_path_to_item': _path_to_item,
'_spec_property_naming': _spec_property_naming,
'_configuration': _configuration,
'_visited_composed_classes': self._visited_composed_classes,
}
composed_info = validate_get_composed_info(
constant_args, kwargs, self)
self._composed_instances = composed_info[0]
self._var_name_to_model_instances = composed_info[1]
self._additional_properties_model_instances = composed_info[2]
discarded_args = composed_info[3]

return self
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{> model_templates/method_from_openapi_data_shared }}

{{#isEnum}}
self.value = value
{{/isEnum}}
{{#requiredVars}}
self.{{name}} = {{name}}
{{/requiredVars}}
for var_name, var_value in kwargs.items():
if var_name not in self.attribute_map and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self.additional_properties_type is None:
# discard variable.
continue
setattr(self, var_name, var_value)
return self
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
@classmethod
@convert_js_args_to_python_args
def _from_openapi_data(cls{{#requiredVars}}{{^defaultValue}}, {{name}}{{/defaultValue}}{{/requiredVars}}, *args, **kwargs): # noqa: E501
"""{{classname}} - a model defined in OpenAPI

{{#requiredVars}}
{{#-first}}
Args:
{{/-first}}
{{^defaultValue}}
{{name}} ({{{dataType}}}):{{#description}} {{{description}}}{{/description}}
{{/defaultValue}}
{{#-last}}

{{/-last}}
{{/requiredVars}}
Keyword Args:
{{#requiredVars}}
{{#defaultValue}}
{{name}} ({{{dataType}}}):{{#description}} {{{description}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501
{{/defaultValue}}
{{/requiredVars}}
{{> model_templates/docstring_init_required_kwargs }}
{{#optionalVars}}
{{name}} ({{{dataType}}}):{{#description}} {{{description}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}} # noqa: E501
{{/optionalVars}}
"""

{{#requiredVars}}
{{#defaultValue}}
{{name}} = kwargs.get('{{name}}', {{{defaultValue}}})
{{/defaultValue}}
{{/requiredVars}}
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

self = super(OpenApiModel, cls).__new__(cls)

{{> model_templates/invalid_pos_args }}

self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
@classmethod
@convert_js_args_to_python_args
def _from_openapi_data(cls, *args, **kwargs):
"""{{classname}} - a model defined in OpenAPI

Note that value can be passed either in args or in kwargs, but not in both.

Args:
args[0] ({{{dataType}}}):{{#description}} {{{description}}}.{{/description}}{{#defaultValue}} if omitted defaults to {{{defaultValue}}}{{/defaultValue}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501

Keyword Args:
value ({{{dataType}}}):{{#description}} {{{description}}}.{{/description}}{{#defaultValue}} if omitted defaults to {{{defaultValue}}}{{/defaultValue}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501
{{> model_templates/docstring_init_required_kwargs }}
"""
# required up here when default value is not given
_path_to_item = kwargs.pop('_path_to_item', ())

self = super(OpenApiModel, cls).__new__(cls)

if 'value' in kwargs:
value = kwargs.pop('value')
elif args:
args = list(args)
value = args.pop(0)
{{#defaultValue}}
else:
value = {{{defaultValue}}}
{{/defaultValue}}
{{^defaultValue}}
else:
raise ApiTypeError(
"value is required, but not passed in args or kwargs and doesn't have default",
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)
{{/defaultValue}}

_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

{{> model_templates/invalid_pos_args }}

self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
self.value = value
if kwargs:
raise ApiTypeError(
"Invalid named arguments=%s passed to %s. Remove those invalid named arguments." % (
kwargs,
self.__class__.__name__,
),
path_to_item=_path_to_item,
valid_classes=(self.__class__,),
)

return self
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,48 @@
'_additional_properties_model_instances',
])

{{> model_templates/method_init_shared }}
@convert_js_args_to_python_args
def __init__(self, *args, **kwargs): # noqa: E501
"""{{classname}} - a model defined in OpenAPI

Keyword Args:
{{#requiredVars}}
{{^isReadOnly}}
{{#defaultValue}}
{{name}} ({{{dataType}}}):{{#description}} {{{description}}}.{{/description}} defaults to {{{defaultValue}}}{{#allowableValues}}, must be one of [{{#enumVars}}{{{value}}}, {{/enumVars}}]{{/allowableValues}} # noqa: E501
{{/defaultValue}}
{{^defaultValue}}
{{name}} ({{{dataType}}}):{{#description}} {{{description}}}{{/description}}
{{/defaultValue}}
{{/isReadOnly}}
{{/requiredVars}}
{{> model_templates/docstring_init_required_kwargs }}
{{#optionalVars}}
{{name}} ({{{dataType}}}):{{#description}} {{{description}}}.{{/description}} [optional]{{#defaultValue}} if omitted the server will use the default value of {{{defaultValue}}}{{/defaultValue}} # noqa: E501
{{/optionalVars}}
"""

{{#requiredVars}}
{{^isReadOnly}}
{{#defaultValue}}
{{name}} = kwargs.get('{{name}}', {{{defaultValue}}})
{{/defaultValue}}
{{/isReadOnly}}
{{/requiredVars}}
_check_type = kwargs.pop('_check_type', True)
_spec_property_naming = kwargs.pop('_spec_property_naming', False)
_path_to_item = kwargs.pop('_path_to_item', ())
_configuration = kwargs.pop('_configuration', None)
_visited_composed_classes = kwargs.pop('_visited_composed_classes', ())

{{> model_templates/invalid_pos_args }}

self._data_store = {}
self._check_type = _check_type
self._spec_property_naming = _spec_property_naming
self._path_to_item = _path_to_item
self._configuration = _configuration
self._visited_composed_classes = _visited_composed_classes + (self.__class__,)

constant_args = {
'_check_type': _check_type,
Expand All @@ -19,28 +60,9 @@
'_configuration': _configuration,
'_visited_composed_classes': self._visited_composed_classes,
}
required_args = {
{{#requiredVars}}
'{{name}}': {{name}},
{{/requiredVars}}
}
model_args = {}
model_args.update(required_args)
model_args.update(kwargs)
composed_info = validate_get_composed_info(
constant_args, model_args, self)
constant_args, kwargs, self)
self._composed_instances = composed_info[0]
self._var_name_to_model_instances = composed_info[1]
self._additional_properties_model_instances = composed_info[2]
unused_args = composed_info[3]

for var_name, var_value in required_args.items():
setattr(self, var_name, var_value)
for var_name, var_value in kwargs.items():
if var_name in unused_args and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
not self._additional_properties_model_instances:
# discard variable.
continue
setattr(self, var_name, var_value)
discarded_args = composed_info[3]
Loading