@darabonba/python-generator 2.0.1 → 2.0.3
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/.github/workflows/ci.yml +1 -1
- package/ChangeLog.md +12 -0
- package/lib/generator.js +223 -127
- package/lib/helper.js +21 -1
- package/package.json +1 -1
- package/tests/expected/{python3/model/tea_python_tests/client.py → annotation/tea_python_tests/models/__init__.py} +6 -3
- package/tests/expected/annotation/tea_python_tests/{models.py → models/_test.py} +1 -1
- package/tests/expected/comment/tea_python_tests/models/__init__.py +15 -0
- package/tests/expected/comment/tea_python_tests/models/_test_1.py +91 -0
- package/tests/expected/comment/tea_python_tests/models/_test_2.py +55 -0
- package/tests/expected/comment/tea_python_tests/models/_test_3.py +61 -0
- package/tests/expected/complex/tea_python_tests/client.py +6 -6
- package/tests/expected/complex/tea_python_tests/exceptions/__init__.py +13 -0
- package/tests/expected/complex/tea_python_tests/exceptions/_err_1.py +23 -0
- package/tests/expected/complex/tea_python_tests/exceptions/_err_2.py +22 -0
- package/tests/expected/complex/tea_python_tests/models/__init__.py +19 -0
- package/tests/{output/complex/tea_python_tests/models.py → expected/complex/tea_python_tests/models/_complex_request.py} +22 -151
- package/tests/expected/complex/tea_python_tests/models/_complex_request_configs.py +47 -0
- package/tests/expected/complex/tea_python_tests/models/_complex_request_header.py +42 -0
- package/tests/expected/complex/tea_python_tests/models/_complex_request_part.py +33 -0
- package/tests/expected/complex/tea_python_tests/models/_response.py +33 -0
- package/tests/expected/model/tea_python_tests/exceptions/__init__.py +11 -0
- package/tests/expected/model/tea_python_tests/{exceptions.py → exceptions/_main_file.py} +1 -1
- package/tests/expected/model/tea_python_tests/models/__init__.py +33 -0
- package/tests/expected/model/tea_python_tests/models/_class.py +24 -0
- package/tests/expected/model/tea_python_tests/models/_m.py +38 -0
- package/tests/expected/model/tea_python_tests/models/_main_file_model.py +45 -0
- package/tests/expected/model/tea_python_tests/models/_main_file_model_model.py +32 -0
- package/tests/expected/model/tea_python_tests/models/_model.py +32 -0
- package/tests/expected/model/tea_python_tests/models/_msub_m.py +26 -0
- package/tests/expected/model/tea_python_tests/{models.py → models/_my_model.py} +41 -363
- package/tests/expected/model/tea_python_tests/models/_my_model_model.py +45 -0
- package/tests/expected/model/tea_python_tests/models/_my_model_model_model.py +32 -0
- package/tests/expected/model/tea_python_tests/models/_my_model_subarraymodel.py +24 -0
- package/tests/expected/model/tea_python_tests/models/_my_model_submodel.py +45 -0
- package/tests/expected/model/tea_python_tests/models/_my_model_submodel_model.py +32 -0
- package/tests/expected/multi/tea_python_tests/api.py +0 -2
- package/tests/expected/multi/tea_python_tests/api_models/__init__.py +11 -0
- package/tests/expected/{python3/annotation/tea_python_tests/models.py → multi/tea_python_tests/api_models/_test_model_dir_2.py} +7 -9
- package/tests/expected/multi/tea_python_tests/client.py +0 -2
- package/tests/expected/multi/tea_python_tests/exceptions/__init__.py +13 -0
- package/tests/{output/complex/tea_python_tests/exceptions.py → expected/multi/tea_python_tests/exceptions/_err.py} +10 -11
- package/tests/expected/multi/tea_python_tests/model/user_exceptions/__init__.py +15 -0
- package/tests/expected/multi/tea_python_tests/model/user_exceptions/_err.py +22 -0
- package/tests/expected/multi/tea_python_tests/model/{user_exceptions.py → user_exceptions/_err_1.py} +3 -32
- package/tests/expected/multi/tea_python_tests/model/user_exceptions/_err_2.py +18 -0
- package/tests/expected/multi/tea_python_tests/model/user_models/__init__.py +13 -0
- package/tests/expected/multi/tea_python_tests/model/user_models/_base_info.py +72 -0
- package/tests/expected/multi/tea_python_tests/model/{user_models.py → user_models/_info.py} +3 -69
- package/tests/expected/multi/tea_python_tests/models/__init__.py +13 -0
- package/tests/expected/multi/tea_python_tests/models/_test_model_dir.py +79 -0
- package/tests/expected/{python2/empty/tea_python_tests/client.py → typedef/tea_python_tests/models/__init__.py} +9 -3
- package/tests/{output/typedef/tea_python_tests/models.py → expected/typedef/tea_python_tests/models/_m.py} +1 -1
- package/tests/fixtures/multi/api.dara +4 -0
- package/tests/fixtures/multi/main.dara +18 -0
- package/tests/main.tests.js +194 -219
- package/tests/output/annotation/tea_python_tests/models/__init__.py +11 -0
- package/tests/output/annotation/tea_python_tests/{models.py → models/_test.py} +1 -1
- package/tests/output/comment/tea_python_tests/models/__init__.py +15 -0
- package/tests/output/comment/tea_python_tests/models/_test_1.py +91 -0
- package/tests/output/comment/tea_python_tests/models/_test_2.py +55 -0
- package/tests/output/comment/tea_python_tests/models/_test_3.py +61 -0
- package/tests/output/complex/tea_python_tests/client.py +6 -6
- package/tests/output/complex/tea_python_tests/exceptions/__init__.py +13 -0
- package/tests/output/complex/tea_python_tests/exceptions/_err_1.py +23 -0
- package/tests/output/complex/tea_python_tests/exceptions/_err_2.py +22 -0
- package/tests/output/complex/tea_python_tests/models/__init__.py +19 -0
- package/tests/{expected/complex/tea_python_tests/models.py → output/complex/tea_python_tests/models/_complex_request.py} +22 -151
- package/tests/output/complex/tea_python_tests/models/_complex_request_configs.py +47 -0
- package/tests/output/complex/tea_python_tests/models/_complex_request_header.py +42 -0
- package/tests/output/complex/tea_python_tests/models/_complex_request_part.py +33 -0
- package/tests/output/complex/tea_python_tests/models/_response.py +33 -0
- package/tests/output/model/tea_python_tests/exceptions/__init__.py +11 -0
- package/tests/output/model/tea_python_tests/{exceptions.py → exceptions/_main_file.py} +1 -1
- package/tests/output/model/tea_python_tests/models/__init__.py +33 -0
- package/tests/output/model/tea_python_tests/models/_class.py +24 -0
- package/tests/output/model/tea_python_tests/models/_m.py +38 -0
- package/tests/output/model/tea_python_tests/models/_main_file_model.py +45 -0
- package/tests/output/model/tea_python_tests/models/_main_file_model_model.py +32 -0
- package/tests/output/model/tea_python_tests/models/_model.py +32 -0
- package/tests/output/model/tea_python_tests/models/_msub_m.py +26 -0
- package/tests/output/model/tea_python_tests/{models.py → models/_my_model.py} +41 -363
- package/tests/output/model/tea_python_tests/models/_my_model_model.py +45 -0
- package/tests/output/model/tea_python_tests/models/_my_model_model_model.py +32 -0
- package/tests/output/model/tea_python_tests/models/_my_model_subarraymodel.py +24 -0
- package/tests/output/model/tea_python_tests/models/_my_model_submodel.py +45 -0
- package/tests/output/model/tea_python_tests/models/_my_model_submodel_model.py +32 -0
- package/tests/output/multi/tea_python_tests/api.py +0 -2
- package/tests/output/multi/tea_python_tests/api_models/__init__.py +11 -0
- package/tests/{expected/python2/annotation/tea_python_tests/models.py → output/multi/tea_python_tests/api_models/_test_model_dir_2.py} +12 -11
- package/tests/output/multi/tea_python_tests/client.py +0 -2
- package/tests/output/multi/tea_python_tests/exceptions/__init__.py +13 -0
- package/tests/{expected/complex/tea_python_tests/exceptions.py → output/multi/tea_python_tests/exceptions/_err.py} +10 -11
- package/tests/output/multi/tea_python_tests/model/user_exceptions/__init__.py +15 -0
- package/tests/output/multi/tea_python_tests/model/user_exceptions/_err.py +22 -0
- package/tests/output/multi/tea_python_tests/model/{user_exceptions.py → user_exceptions/_err_1.py} +3 -32
- package/tests/output/multi/tea_python_tests/model/user_exceptions/_err_2.py +18 -0
- package/tests/output/multi/tea_python_tests/model/user_models/__init__.py +13 -0
- package/tests/output/multi/tea_python_tests/model/user_models/_base_info.py +72 -0
- package/tests/output/multi/tea_python_tests/model/{user_models.py → user_models/_info.py} +3 -69
- package/tests/output/multi/tea_python_tests/models/__init__.py +13 -0
- package/tests/output/multi/tea_python_tests/models/_test_model_dir.py +79 -0
- package/tests/{expected/python2/model/tea_python_tests/client.py → output/typedef/tea_python_tests/models/__init__.py} +9 -3
- package/tests/{expected/typedef/tea_python_tests/models.py → output/typedef/tea_python_tests/models/_m.py} +1 -1
- package/tests/expected/comment/tea_python_tests/models.py +0 -195
- package/tests/expected/python2/alias/setup.py +0 -79
- package/tests/expected/python2/alias/tea_python_tests/client.py +0 -23
- package/tests/expected/python2/annotation/tea_python_tests/client.py +0 -54
- package/tests/expected/python2/api/tea_python_tests/client.py +0 -54
- package/tests/expected/python2/comment/tea_python_tests/client.py +0 -188
- package/tests/expected/python2/comment/tea_python_tests/models.py +0 -146
- package/tests/expected/python2/complex/tea_python_tests/client.py +0 -301
- package/tests/expected/python2/complex/tea_python_tests/models.py +0 -315
- package/tests/expected/python2/const/tea_python_tests/client.py +0 -14
- package/tests/expected/python2/empty/setup.py +0 -76
- package/tests/expected/python2/exec/tea_python_tests/exec_client.py +0 -16
- package/tests/expected/python2/function/tea_python_tests/client.py +0 -47
- package/tests/expected/python2/import/setup.py +0 -85
- package/tests/expected/python2/import/tea_python_tests/client.py +0 -24
- package/tests/expected/python2/map/tea_python_tests/client.py +0 -19
- package/tests/expected/python2/model/tea_python_tests/models.py +0 -575
- package/tests/expected/python2/statements/tea_python_tests/client.py +0 -64
- package/tests/expected/python2/super/tea_python_tests/client.py +0 -8
- package/tests/expected/python2/typedef/setup.py +0 -85
- package/tests/expected/python2/typedef/tea_python_tests/client.py +0 -38
- package/tests/expected/python2/typedef/tea_python_tests/models.py +0 -35
- package/tests/expected/python3/alias/setup.py +0 -77
- package/tests/expected/python3/alias/tea_python_tests/client.py +0 -32
- package/tests/expected/python3/annotation/tea_python_tests/client.py +0 -88
- package/tests/expected/python3/api/tea_python_tests/client.py +0 -92
- package/tests/expected/python3/comment/tea_python_tests/__init__.py +0 -1
- package/tests/expected/python3/comment/tea_python_tests/client.py +0 -319
- package/tests/expected/python3/comment/tea_python_tests/models.py +0 -163
- package/tests/expected/python3/complex/tea_python_tests/__init__.py +0 -1
- package/tests/expected/python3/complex/tea_python_tests/client.py +0 -514
- package/tests/expected/python3/complex/tea_python_tests/models.py +0 -349
- package/tests/expected/python3/const/tea_python_tests/__init__.py +0 -1
- package/tests/expected/python3/const/tea_python_tests/client.py +0 -9
- package/tests/expected/python3/empty/setup.py +0 -74
- package/tests/expected/python3/empty/tea_python_tests/__init__.py +0 -1
- package/tests/expected/python3/empty/tea_python_tests/client.py +0 -5
- package/tests/expected/python3/exec/tea_python_tests/__init__.py +0 -1
- package/tests/expected/python3/exec/tea_python_tests/exec_client.py +0 -20
- package/tests/expected/python3/function/tea_python_tests/__init__.py +0 -1
- package/tests/expected/python3/function/tea_python_tests/client.py +0 -67
- package/tests/expected/python3/import/setup.py +0 -77
- package/tests/expected/python3/import/tea_python_tests/__init__.py +0 -1
- package/tests/expected/python3/import/tea_python_tests/client.py +0 -28
- package/tests/expected/python3/map/tea_python_tests/__init__.py +0 -1
- package/tests/expected/python3/map/tea_python_tests/client.py +0 -22
- package/tests/expected/python3/model/tea_python_tests/__init__.py +0 -1
- package/tests/expected/python3/model/tea_python_tests/models.py +0 -631
- package/tests/expected/python3/statements/tea_python_tests/__init__.py +0 -1
- package/tests/expected/python3/statements/tea_python_tests/client.py +0 -83
- package/tests/expected/python3/super/tea_python_tests/__init__.py +0 -1
- package/tests/expected/python3/super/tea_python_tests/client.py +0 -13
- package/tests/expected/python3/typedef/setup.py +0 -77
- package/tests/expected/python3/typedef/tea_python_tests/__init__.py +0 -1
- package/tests/expected/python3/typedef/tea_python_tests/client.py +0 -72
- package/tests/expected/python3/typedef/tea_python_tests/models.py +0 -39
- package/tests/output/comment/tea_python_tests/models.py +0 -195
- /package/tests/expected/{python2/alias → multi}/tea_python_tests/__init__.py +0 -0
- /package/tests/{expected/python2/annotation → output/alias}/tea_python_tests/__init__.py +0 -0
- /package/tests/{expected/python2/api → output/annotation}/tea_python_tests/__init__.py +0 -0
- /package/tests/{expected/python2/comment → output/api}/tea_python_tests/__init__.py +0 -0
- /package/tests/{expected/python2/complex → output/builtin}/tea_python_tests/__init__.py +0 -0
- /package/tests/{expected/python2/const → output/comment}/tea_python_tests/__init__.py +0 -0
- /package/tests/{expected/python2/empty → output/complex}/tea_python_tests/__init__.py +0 -0
- /package/tests/{expected/python2/exec → output/const}/tea_python_tests/__init__.py +0 -0
- /package/tests/{expected/python2/function → output/empty}/tea_python_tests/__init__.py +0 -0
- /package/tests/{expected/python2/import → output/exec}/tea_python_tests/__init__.py +0 -0
- /package/tests/{expected/python2/map → output/function}/tea_python_tests/__init__.py +0 -0
- /package/tests/{expected/python2/model → output/import}/tea_python_tests/__init__.py +0 -0
- /package/tests/{expected/python2/statements → output/map}/tea_python_tests/__init__.py +0 -0
- /package/tests/{expected/python2/super → output/model}/tea_python_tests/__init__.py +0 -0
- /package/tests/{expected/python2/typedef → output/multi}/tea_python_tests/__init__.py +0 -0
- /package/tests/{expected/python3/alias → output/statements}/tea_python_tests/__init__.py +0 -0
- /package/tests/{expected/python3/annotation → output/super}/tea_python_tests/__init__.py +0 -0
- /package/tests/{expected/python3/api → output/typedef}/tea_python_tests/__init__.py +0 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# This file is auto-generated, don't edit it. Thanks.
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from darabonba.model import DaraModel
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
* @remarks
|
|
9
|
+
* TestModel3
|
|
10
|
+
"""
|
|
11
|
+
class Test3(DaraModel):
|
|
12
|
+
def __init__(
|
|
13
|
+
self, *,
|
|
14
|
+
# model的test front comment
|
|
15
|
+
test: str = None,
|
|
16
|
+
# empty comment1
|
|
17
|
+
# empy comment2
|
|
18
|
+
test_1: str = None,
|
|
19
|
+
):
|
|
20
|
+
# model的test front comment
|
|
21
|
+
# test desc
|
|
22
|
+
self.test = test
|
|
23
|
+
# empty comment1
|
|
24
|
+
# empy comment2
|
|
25
|
+
# test desc
|
|
26
|
+
self.test_1 = test_1
|
|
27
|
+
|
|
28
|
+
def validate(self):
|
|
29
|
+
# model的test front comment
|
|
30
|
+
self.validate_required(self.test, 'test')
|
|
31
|
+
# empty comment1
|
|
32
|
+
# empy comment2
|
|
33
|
+
self.validate_required(self.test_1, 'test_1')
|
|
34
|
+
|
|
35
|
+
def to_map(self):
|
|
36
|
+
_map = super().to_map()
|
|
37
|
+
if _map is not None:
|
|
38
|
+
return _map
|
|
39
|
+
|
|
40
|
+
result = dict()
|
|
41
|
+
# model的test front comment
|
|
42
|
+
if self.test is not None:
|
|
43
|
+
result['test'] = self.test
|
|
44
|
+
# empty comment1
|
|
45
|
+
# empy comment2
|
|
46
|
+
if self.test_1 is not None:
|
|
47
|
+
result['test1'] = self.test_1
|
|
48
|
+
return result
|
|
49
|
+
|
|
50
|
+
def from_map(self, m: dict = None):
|
|
51
|
+
m = m or dict()
|
|
52
|
+
# model的test front comment
|
|
53
|
+
if m.get('test') is not None:
|
|
54
|
+
self.test = m.get('test')
|
|
55
|
+
# empty comment1
|
|
56
|
+
# empy comment2
|
|
57
|
+
if m.get('test1') is not None:
|
|
58
|
+
self.test_1 = m.get('test1')
|
|
59
|
+
return self
|
|
60
|
+
|
|
61
|
+
# odel的test back comment
|
|
@@ -1114,11 +1114,11 @@ class Client(SourceClient):
|
|
|
1114
1114
|
code = 'str'
|
|
1115
1115
|
)
|
|
1116
1116
|
|
|
1117
|
-
except
|
|
1117
|
+
except main_exceptions.Err1Exception as err :
|
|
1118
1118
|
logging.log(logging.NOTSET, err.name)
|
|
1119
|
-
except
|
|
1119
|
+
except main_exceptions.Err2Exception as err :
|
|
1120
1120
|
logging.log(logging.NOTSET, err.name)
|
|
1121
|
-
except
|
|
1121
|
+
except source_exceptions.Err3Exception as err :
|
|
1122
1122
|
logging.log(logging.NOTSET, err.name)
|
|
1123
1123
|
except Exception as err :
|
|
1124
1124
|
logging.log(logging.NOTSET, err.name)
|
|
@@ -1156,11 +1156,11 @@ class Client(SourceClient):
|
|
|
1156
1156
|
code = 'str'
|
|
1157
1157
|
)
|
|
1158
1158
|
|
|
1159
|
-
except
|
|
1159
|
+
except main_exceptions.Err1Exception as err :
|
|
1160
1160
|
logging.log(logging.NOTSET, err.name)
|
|
1161
|
-
except
|
|
1161
|
+
except main_exceptions.Err2Exception as err :
|
|
1162
1162
|
logging.log(logging.NOTSET, err.name)
|
|
1163
|
-
except
|
|
1163
|
+
except source_exceptions.Err3Exception as err :
|
|
1164
1164
|
logging.log(logging.NOTSET, err.name)
|
|
1165
1165
|
except Exception as err :
|
|
1166
1166
|
logging.log(logging.NOTSET, err.name)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# This file is auto-generated, don't edit it. Thanks.
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from darabonba.exceptions import DaraException
|
|
5
|
+
from typing import Dict
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Err1Exception(DaraException):
|
|
9
|
+
def __init__(
|
|
10
|
+
self, *,
|
|
11
|
+
message: str = None,
|
|
12
|
+
code: str = None,
|
|
13
|
+
stack: str = None,
|
|
14
|
+
data: Dict[str, str] = None,
|
|
15
|
+
):
|
|
16
|
+
super().__init__({
|
|
17
|
+
'message': message,
|
|
18
|
+
'code': code,
|
|
19
|
+
'stack': stack,
|
|
20
|
+
})
|
|
21
|
+
self.name = 'Err1Exception'
|
|
22
|
+
self.data = data
|
|
23
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# This file is auto-generated, don't edit it. Thanks.
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from darabonba.exceptions import DaraException
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Err2Exception(DaraException):
|
|
8
|
+
def __init__(
|
|
9
|
+
self, *,
|
|
10
|
+
message: str = None,
|
|
11
|
+
code: str = None,
|
|
12
|
+
stack: str = None,
|
|
13
|
+
access_err_message: str = None,
|
|
14
|
+
):
|
|
15
|
+
super().__init__({
|
|
16
|
+
'message': message,
|
|
17
|
+
'code': code,
|
|
18
|
+
'stack': stack,
|
|
19
|
+
})
|
|
20
|
+
self.name = 'Err2Exception'
|
|
21
|
+
self.access_err_message = access_err_message
|
|
22
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# This file is auto-generated, don't edit it. Thanks.
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
from ._complex_request_header import ComplexRequestHeader
|
|
8
|
+
from ._complex_request_configs import ComplexRequestConfigs
|
|
9
|
+
from ._complex_request_part import ComplexRequestPart
|
|
10
|
+
from ._complex_request import ComplexRequest
|
|
11
|
+
from ._response import Response
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
ComplexRequestHeader,
|
|
15
|
+
ComplexRequestConfigs,
|
|
16
|
+
ComplexRequestPart,
|
|
17
|
+
ComplexRequest,
|
|
18
|
+
Response
|
|
19
|
+
]
|
|
@@ -2,126 +2,23 @@
|
|
|
2
2
|
# This file is auto-generated, don't edit it. Thanks.
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from darabonba.model import DaraModel
|
|
5
|
+
from tea_python_tests import models as main_models
|
|
5
6
|
from darabonba.request import DaraRequest
|
|
6
7
|
from darabonba.response import DaraResponse
|
|
7
8
|
from Source import models as source_models
|
|
8
9
|
from Source.source_client import SourceClient
|
|
9
|
-
from
|
|
10
|
-
from typing import List, Dict, BinaryIO, Any
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class ComplexRequestHeader(DaraModel):
|
|
16
|
-
def __init__(
|
|
17
|
-
self,
|
|
18
|
-
content: str = None,
|
|
19
|
-
):
|
|
20
|
-
# The ID of the security group to which you want to assign the instance. Instances in the same security group can communicate with each other. The maximum number of instances that a security group can contain depends on the type of the security group. For more information, see the "Security group limits" section in [Limits](https://help.aliyun.com/document_detail/25412.html#SecurityGroupQuota).
|
|
21
|
-
#
|
|
22
|
-
# >Notice: The network type of the new instance must be the same as that of the security group specified by the `SecurityGroupId` parameter. For example, if the specified security group is of the VPC type, the new instance is also of the VPC type and you must specify `VSwitchId`.
|
|
23
|
-
#
|
|
24
|
-
# If you do not use `LaunchTemplateId` or `LaunchTemplateName` to specify a launch template, you must specify SecurityGroupId. Take note of the following items:
|
|
25
|
-
#
|
|
26
|
-
# * You can set `SecurityGroupId` to specify a single security group or set `SecurityGroupIds.N` to specify one or more security groups. However, you cannot specify both `SecurityGroupId` and `SecurityGroupIds.N`.
|
|
27
|
-
# * If `NetworkInterface.N.InstanceType` is set to `Primary`, you cannot specify `SecurityGroupId` or `SecurityGroupIds.N` but can specify `NetworkInterface.N.SecurityGroupId` or `NetworkInterface.N.SecurityGroupIds.N`.
|
|
28
|
-
self.content = content
|
|
29
|
-
|
|
30
|
-
def validate(self):
|
|
31
|
-
self.validate_required(self.content, 'content')
|
|
32
|
-
|
|
33
|
-
def to_map(self):
|
|
34
|
-
_map = super().to_map()
|
|
35
|
-
if _map is not None:
|
|
36
|
-
return _map
|
|
37
|
-
|
|
38
|
-
result = dict()
|
|
39
|
-
if self.content is not None:
|
|
40
|
-
result['Content'] = self.content
|
|
41
|
-
return result
|
|
42
|
-
|
|
43
|
-
def from_map(self, m: dict = None):
|
|
44
|
-
m = m or dict()
|
|
45
|
-
if m.get('Content') is not None:
|
|
46
|
-
self.content = m.get('Content')
|
|
47
|
-
return self
|
|
48
|
-
|
|
49
|
-
class ComplexRequestConfigs(DaraModel):
|
|
50
|
-
def __init__(
|
|
51
|
-
self,
|
|
52
|
-
key: str = None,
|
|
53
|
-
value: List[str] = None,
|
|
54
|
-
extra: Dict[str, str] = None,
|
|
55
|
-
):
|
|
56
|
-
self.key = key
|
|
57
|
-
self.value = value
|
|
58
|
-
self.extra = extra
|
|
59
|
-
|
|
60
|
-
def validate(self):
|
|
61
|
-
self.validate_required(self.key, 'key')
|
|
62
|
-
self.validate_required(self.value, 'value')
|
|
63
|
-
self.validate_required(self.extra, 'extra')
|
|
64
|
-
|
|
65
|
-
def to_map(self):
|
|
66
|
-
_map = super().to_map()
|
|
67
|
-
if _map is not None:
|
|
68
|
-
return _map
|
|
69
|
-
|
|
70
|
-
result = dict()
|
|
71
|
-
if self.key is not None:
|
|
72
|
-
result['key'] = self.key
|
|
73
|
-
if self.value is not None:
|
|
74
|
-
result['value'] = self.value
|
|
75
|
-
if self.extra is not None:
|
|
76
|
-
result['extra'] = self.extra
|
|
77
|
-
return result
|
|
10
|
+
from typing import BinaryIO, List, Dict, Any
|
|
78
11
|
|
|
79
|
-
def from_map(self, m: dict = None):
|
|
80
|
-
m = m or dict()
|
|
81
|
-
if m.get('key') is not None:
|
|
82
|
-
self.key = m.get('key')
|
|
83
|
-
if m.get('value') is not None:
|
|
84
|
-
self.value = m.get('value')
|
|
85
|
-
if m.get('extra') is not None:
|
|
86
|
-
self.extra = m.get('extra')
|
|
87
|
-
return self
|
|
88
|
-
|
|
89
|
-
class ComplexRequestPart(DaraModel):
|
|
90
|
-
def __init__(
|
|
91
|
-
self,
|
|
92
|
-
part_number: str = None,
|
|
93
|
-
):
|
|
94
|
-
# PartNumber
|
|
95
|
-
self.part_number = part_number
|
|
96
|
-
|
|
97
|
-
def validate(self):
|
|
98
|
-
pass
|
|
99
|
-
|
|
100
|
-
def to_map(self):
|
|
101
|
-
_map = super().to_map()
|
|
102
|
-
if _map is not None:
|
|
103
|
-
return _map
|
|
104
|
-
|
|
105
|
-
result = dict()
|
|
106
|
-
if self.part_number is not None:
|
|
107
|
-
result['PartNumber'] = self.part_number
|
|
108
|
-
return result
|
|
109
|
-
|
|
110
|
-
def from_map(self, m: dict = None):
|
|
111
|
-
m = m or dict()
|
|
112
|
-
if m.get('PartNumber') is not None:
|
|
113
|
-
self.part_number = m.get('PartNumber')
|
|
114
|
-
return self
|
|
115
12
|
|
|
116
13
|
class ComplexRequest(DaraModel):
|
|
117
14
|
def __init__(
|
|
118
|
-
self,
|
|
15
|
+
self, *,
|
|
119
16
|
access_key: str = None,
|
|
120
17
|
body: BinaryIO = None,
|
|
121
18
|
strs: List[str] = None,
|
|
122
19
|
map_list: List[Dict[str, Any]] = None,
|
|
123
|
-
header: ComplexRequestHeader = None,
|
|
124
|
-
configs: ComplexRequestConfigs = None,
|
|
20
|
+
header: main_models.ComplexRequestHeader = None,
|
|
21
|
+
configs: main_models.ComplexRequestConfigs = None,
|
|
125
22
|
num: int = None,
|
|
126
23
|
i_64: int = None,
|
|
127
24
|
f_64: float = None,
|
|
@@ -159,7 +56,7 @@ class ComplexRequest(DaraModel):
|
|
|
159
56
|
print: str = None,
|
|
160
57
|
exec: str = None,
|
|
161
58
|
str: str = None,
|
|
162
|
-
part: List[ComplexRequestPart] = None,
|
|
59
|
+
part: List[main_models.ComplexRequestPart] = None,
|
|
163
60
|
):
|
|
164
61
|
self.access_key = access_key
|
|
165
62
|
# Body
|
|
@@ -401,10 +298,9 @@ class ComplexRequest(DaraModel):
|
|
|
401
298
|
result['numMap'] = self.num_map
|
|
402
299
|
if self.model_map is not None:
|
|
403
300
|
result['modelMap'] = {}
|
|
404
|
-
for k1, v1 in
|
|
301
|
+
for k1, v1 in self.model_map.items():
|
|
405
302
|
result['modelMap'][k1] = v1.to_map() if v1 else None
|
|
406
303
|
|
|
407
|
-
|
|
408
304
|
if self.request is not None:
|
|
409
305
|
result['request'] = self.request.to_map()
|
|
410
306
|
|
|
@@ -424,12 +320,9 @@ class ComplexRequest(DaraModel):
|
|
|
424
320
|
if self.str is not None:
|
|
425
321
|
result['srt'] = self.str
|
|
426
322
|
if self.part is not None:
|
|
427
|
-
l1 = 0
|
|
428
323
|
result['Part'] = []
|
|
429
324
|
for k1 in self.part:
|
|
430
|
-
|
|
431
|
-
result['Part'][l1] = k1.to_map() if k1 else None
|
|
432
|
-
|
|
325
|
+
result['Part'].append(k1.to_map() if k1 else None)
|
|
433
326
|
|
|
434
327
|
return result
|
|
435
328
|
|
|
@@ -444,11 +337,11 @@ class ComplexRequest(DaraModel):
|
|
|
444
337
|
if m.get('mapList') is not None:
|
|
445
338
|
self.map_list = m.get('mapList')
|
|
446
339
|
if m.get('header') is not None:
|
|
447
|
-
temp_model = ComplexRequestHeader
|
|
340
|
+
temp_model = main_models.ComplexRequestHeader()
|
|
448
341
|
self.header = temp_model.from_map(m.get('header'))
|
|
449
342
|
|
|
450
343
|
if m.get('configs') is not None:
|
|
451
|
-
temp_model = ComplexRequestConfigs
|
|
344
|
+
temp_model = main_models.ComplexRequestConfigs()
|
|
452
345
|
self.configs = temp_model.from_map(m.get('configs'))
|
|
453
346
|
|
|
454
347
|
if m.get('num') is not None:
|
|
@@ -500,10 +393,12 @@ class ComplexRequest(DaraModel):
|
|
|
500
393
|
if m.get('byt') is not None:
|
|
501
394
|
self.byt = m.get('byt')
|
|
502
395
|
if m.get('req') is not None:
|
|
503
|
-
|
|
396
|
+
temp_model = DaraRequest()
|
|
397
|
+
self.req = temp_model.from_map(m.get('req'))
|
|
504
398
|
|
|
505
399
|
if m.get('resp') is not None:
|
|
506
|
-
|
|
400
|
+
temp_model = DaraResponse()
|
|
401
|
+
self.resp = temp_model.from_map(m.get('resp'))
|
|
507
402
|
|
|
508
403
|
if m.get('map') is not None:
|
|
509
404
|
self.map = m.get('map')
|
|
@@ -512,15 +407,18 @@ class ComplexRequest(DaraModel):
|
|
|
512
407
|
if m.get('modelMap') is not None:
|
|
513
408
|
self.model_map = {}
|
|
514
409
|
for k1, v1 in m.get('modelMap').items():
|
|
515
|
-
|
|
410
|
+
temp_model = source_models.Request()
|
|
411
|
+
self.model_map[k1] = temp_model.from_map(v1)
|
|
516
412
|
|
|
517
413
|
if m.get('request') is not None:
|
|
518
|
-
|
|
414
|
+
temp_model = source_models.Request()
|
|
415
|
+
self.request = temp_model.from_map(m.get('request'))
|
|
519
416
|
|
|
520
417
|
if m.get('client') is not None:
|
|
521
418
|
self.client = m.get('client')
|
|
522
419
|
if m.get('instance') is not None:
|
|
523
|
-
|
|
420
|
+
temp_model = source_models.RequestInstance()
|
|
421
|
+
self.instance = temp_model.from_map(m.get('instance'))
|
|
524
422
|
|
|
525
423
|
if m.get('from') is not None:
|
|
526
424
|
self.from_ = m.get('from')
|
|
@@ -536,35 +434,8 @@ class ComplexRequest(DaraModel):
|
|
|
536
434
|
l1 = 0
|
|
537
435
|
self.part = []
|
|
538
436
|
for k1 in m.get('Part'):
|
|
539
|
-
|
|
540
|
-
temp_model
|
|
541
|
-
self.part[l1] = temp_model.from_map(k1)
|
|
542
|
-
|
|
543
|
-
return self
|
|
437
|
+
temp_model = main_models.ComplexRequestPart()
|
|
438
|
+
self.part.append(temp_model.from_map(k1))
|
|
544
439
|
|
|
545
|
-
class Response(DaraModel):
|
|
546
|
-
def __init__(
|
|
547
|
-
self,
|
|
548
|
-
instance: main_models.ComplexRequestPart = None,
|
|
549
|
-
):
|
|
550
|
-
self.instance = instance
|
|
551
|
-
|
|
552
|
-
def validate(self):
|
|
553
|
-
self.validate_required(self.instance, 'instance')
|
|
554
|
-
|
|
555
|
-
def to_map(self):
|
|
556
|
-
_map = super().to_map()
|
|
557
|
-
if _map is not None:
|
|
558
|
-
return _map
|
|
559
|
-
|
|
560
|
-
result = dict()
|
|
561
|
-
if self.instance is not None:
|
|
562
|
-
result['instance'] = self.instance
|
|
563
|
-
return result
|
|
564
|
-
|
|
565
|
-
def from_map(self, m: dict = None):
|
|
566
|
-
m = m or dict()
|
|
567
|
-
if m.get('instance') is not None:
|
|
568
|
-
self.instance = m.get('instance')
|
|
569
440
|
return self
|
|
570
441
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# This file is auto-generated, don't edit it. Thanks.
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from darabonba.model import DaraModel
|
|
5
|
+
from typing import List, Dict
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ComplexRequestConfigs(DaraModel):
|
|
9
|
+
def __init__(
|
|
10
|
+
self, *,
|
|
11
|
+
key: str = None,
|
|
12
|
+
value: List[str] = None,
|
|
13
|
+
extra: Dict[str, str] = None,
|
|
14
|
+
):
|
|
15
|
+
self.key = key
|
|
16
|
+
self.value = value
|
|
17
|
+
self.extra = extra
|
|
18
|
+
|
|
19
|
+
def validate(self):
|
|
20
|
+
self.validate_required(self.key, 'key')
|
|
21
|
+
self.validate_required(self.value, 'value')
|
|
22
|
+
self.validate_required(self.extra, 'extra')
|
|
23
|
+
|
|
24
|
+
def to_map(self):
|
|
25
|
+
_map = super().to_map()
|
|
26
|
+
if _map is not None:
|
|
27
|
+
return _map
|
|
28
|
+
|
|
29
|
+
result = dict()
|
|
30
|
+
if self.key is not None:
|
|
31
|
+
result['key'] = self.key
|
|
32
|
+
if self.value is not None:
|
|
33
|
+
result['value'] = self.value
|
|
34
|
+
if self.extra is not None:
|
|
35
|
+
result['extra'] = self.extra
|
|
36
|
+
return result
|
|
37
|
+
|
|
38
|
+
def from_map(self, m: dict = None):
|
|
39
|
+
m = m or dict()
|
|
40
|
+
if m.get('key') is not None:
|
|
41
|
+
self.key = m.get('key')
|
|
42
|
+
if m.get('value') is not None:
|
|
43
|
+
self.value = m.get('value')
|
|
44
|
+
if m.get('extra') is not None:
|
|
45
|
+
self.extra = m.get('extra')
|
|
46
|
+
return self
|
|
47
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# This file is auto-generated, don't edit it. Thanks.
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from darabonba.model import DaraModel
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ComplexRequestHeader(DaraModel):
|
|
10
|
+
def __init__(
|
|
11
|
+
self, *,
|
|
12
|
+
content: str = None,
|
|
13
|
+
):
|
|
14
|
+
# The ID of the security group to which you want to assign the instance. Instances in the same security group can communicate with each other. The maximum number of instances that a security group can contain depends on the type of the security group. For more information, see the "Security group limits" section in [Limits](https://help.aliyun.com/document_detail/25412.html#SecurityGroupQuota).
|
|
15
|
+
#
|
|
16
|
+
# >Notice: The network type of the new instance must be the same as that of the security group specified by the `SecurityGroupId` parameter. For example, if the specified security group is of the VPC type, the new instance is also of the VPC type and you must specify `VSwitchId`.
|
|
17
|
+
#
|
|
18
|
+
# If you do not use `LaunchTemplateId` or `LaunchTemplateName` to specify a launch template, you must specify SecurityGroupId. Take note of the following items:
|
|
19
|
+
#
|
|
20
|
+
# * You can set `SecurityGroupId` to specify a single security group or set `SecurityGroupIds.N` to specify one or more security groups. However, you cannot specify both `SecurityGroupId` and `SecurityGroupIds.N`.
|
|
21
|
+
# * If `NetworkInterface.N.InstanceType` is set to `Primary`, you cannot specify `SecurityGroupId` or `SecurityGroupIds.N` but can specify `NetworkInterface.N.SecurityGroupId` or `NetworkInterface.N.SecurityGroupIds.N`.
|
|
22
|
+
self.content = content
|
|
23
|
+
|
|
24
|
+
def validate(self):
|
|
25
|
+
self.validate_required(self.content, 'content')
|
|
26
|
+
|
|
27
|
+
def to_map(self):
|
|
28
|
+
_map = super().to_map()
|
|
29
|
+
if _map is not None:
|
|
30
|
+
return _map
|
|
31
|
+
|
|
32
|
+
result = dict()
|
|
33
|
+
if self.content is not None:
|
|
34
|
+
result['Content'] = self.content
|
|
35
|
+
return result
|
|
36
|
+
|
|
37
|
+
def from_map(self, m: dict = None):
|
|
38
|
+
m = m or dict()
|
|
39
|
+
if m.get('Content') is not None:
|
|
40
|
+
self.content = m.get('Content')
|
|
41
|
+
return self
|
|
42
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# This file is auto-generated, don't edit it. Thanks.
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from darabonba.model import DaraModel
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ComplexRequestPart(DaraModel):
|
|
8
|
+
def __init__(
|
|
9
|
+
self, *,
|
|
10
|
+
part_number: str = None,
|
|
11
|
+
):
|
|
12
|
+
# PartNumber
|
|
13
|
+
self.part_number = part_number
|
|
14
|
+
|
|
15
|
+
def validate(self):
|
|
16
|
+
pass
|
|
17
|
+
|
|
18
|
+
def to_map(self):
|
|
19
|
+
_map = super().to_map()
|
|
20
|
+
if _map is not None:
|
|
21
|
+
return _map
|
|
22
|
+
|
|
23
|
+
result = dict()
|
|
24
|
+
if self.part_number is not None:
|
|
25
|
+
result['PartNumber'] = self.part_number
|
|
26
|
+
return result
|
|
27
|
+
|
|
28
|
+
def from_map(self, m: dict = None):
|
|
29
|
+
m = m or dict()
|
|
30
|
+
if m.get('PartNumber') is not None:
|
|
31
|
+
self.part_number = m.get('PartNumber')
|
|
32
|
+
return self
|
|
33
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# This file is auto-generated, don't edit it. Thanks.
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from darabonba.model import DaraModel
|
|
5
|
+
from tea_python_tests import models as main_models
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Response(DaraModel):
|
|
9
|
+
def __init__(
|
|
10
|
+
self, *,
|
|
11
|
+
instance: main_models.ComplexRequestPart = None,
|
|
12
|
+
):
|
|
13
|
+
self.instance = instance
|
|
14
|
+
|
|
15
|
+
def validate(self):
|
|
16
|
+
self.validate_required(self.instance, 'instance')
|
|
17
|
+
|
|
18
|
+
def to_map(self):
|
|
19
|
+
_map = super().to_map()
|
|
20
|
+
if _map is not None:
|
|
21
|
+
return _map
|
|
22
|
+
|
|
23
|
+
result = dict()
|
|
24
|
+
if self.instance is not None:
|
|
25
|
+
result['instance'] = self.instance
|
|
26
|
+
return result
|
|
27
|
+
|
|
28
|
+
def from_map(self, m: dict = None):
|
|
29
|
+
m = m or dict()
|
|
30
|
+
if m.get('instance') is not None:
|
|
31
|
+
self.instance = m.get('instance')
|
|
32
|
+
return self
|
|
33
|
+
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# This file is auto-generated, don't edit it. Thanks.
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
from ._msub_m import MSubM
|
|
8
|
+
from ._main_file_model_model import MainFileModelModel
|
|
9
|
+
from ._main_file_model import MainFileModel
|
|
10
|
+
from ._my_model_model_model import MyModelModelModel
|
|
11
|
+
from ._my_model_model import MyModelModel
|
|
12
|
+
from ._my_model_submodel_model import MyModelSubmodelModel
|
|
13
|
+
from ._my_model_submodel import MyModelSubmodel
|
|
14
|
+
from ._my_model_subarraymodel import MyModelSubarraymodel
|
|
15
|
+
from ._m import M
|
|
16
|
+
from ._class import Class
|
|
17
|
+
from ._model import Model
|
|
18
|
+
from ._my_model import MyModel
|
|
19
|
+
|
|
20
|
+
__all__ = [
|
|
21
|
+
MSubM,
|
|
22
|
+
MainFileModelModel,
|
|
23
|
+
MainFileModel,
|
|
24
|
+
MyModelModelModel,
|
|
25
|
+
MyModelModel,
|
|
26
|
+
MyModelSubmodelModel,
|
|
27
|
+
MyModelSubmodel,
|
|
28
|
+
MyModelSubarraymodel,
|
|
29
|
+
M,
|
|
30
|
+
Class,
|
|
31
|
+
Model,
|
|
32
|
+
MyModel
|
|
33
|
+
]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# This file is auto-generated, don't edit it. Thanks.
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from darabonba.model import DaraModel
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Class(DaraModel):
|
|
8
|
+
def __init__(self):
|
|
9
|
+
pass
|
|
10
|
+
def validate(self):
|
|
11
|
+
pass
|
|
12
|
+
|
|
13
|
+
def to_map(self):
|
|
14
|
+
_map = super().to_map()
|
|
15
|
+
if _map is not None:
|
|
16
|
+
return _map
|
|
17
|
+
|
|
18
|
+
result = dict()
|
|
19
|
+
return result
|
|
20
|
+
|
|
21
|
+
def from_map(self, m: dict = None):
|
|
22
|
+
m = m or dict()
|
|
23
|
+
return self
|
|
24
|
+
|