@darabonba/python-generator 2.0.12 → 2.0.14

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.
Files changed (124) hide show
  1. package/ChangeLog.md +3 -0
  2. package/lib/generator.js +51 -51
  3. package/lib/helper.js +45 -3
  4. package/package.json +1 -1
  5. package/tests/expected/complex/tea_python_tests/client.py +7 -5
  6. package/tests/expected/function/tea_python_tests/client.py +12 -0
  7. package/tests/expected/model/tea_python_tests/models/_my_model.py +36 -0
  8. package/tests/expected/websocket/tea_python_tests/client.py +20 -0
  9. package/tests/fixtures/complex/Darafile +5 -0
  10. package/tests/fixtures/complex/libraries/Darafile +4 -1
  11. package/tests/fixtures/complex/libraries/import.dara +1 -0
  12. package/tests/fixtures/complex/main.dara +1 -0
  13. package/tests/fixtures/function/Darafile +7 -1
  14. package/tests/fixtures/function/main.dara +8 -0
  15. package/tests/fixtures/model/Darafile +8 -0
  16. package/tests/fixtures/model/main.dara +4 -0
  17. package/tests/fixtures/websocket/.libraries.json +3 -0
  18. package/tests/fixtures/websocket/Darafile +9 -0
  19. package/tests/fixtures/websocket/libraries/alibabacloud_OpenApiV2_0.1.27/Teafile +21 -0
  20. package/tests/fixtures/websocket/libraries/alibabacloud_OpenApiV2_0.1.27/main.tea +1 -0
  21. package/tests/fixtures/websocket/libraries/alibabacloud_OpenApiV2_0.1.27/utils.dara +1 -0
  22. package/tests/fixtures/websocket/libraries/alibabacloud_OpenApiV2_0.1.27/websocketUtils.dara +9 -0
  23. package/tests/fixtures/websocket/main.dara +8 -0
  24. package/tests/main.tests.js +10 -0
  25. package/tests/output/alias/setup.py +0 -83
  26. package/tests/output/alias/tea_python_tests/client.py +0 -35
  27. package/tests/output/annotation/setup.py +0 -79
  28. package/tests/output/annotation/tea_python_tests/__init__.py +0 -1
  29. package/tests/output/annotation/tea_python_tests/client.py +0 -93
  30. package/tests/output/annotation/tea_python_tests/models/__init__.py +0 -9
  31. package/tests/output/annotation/tea_python_tests/models/_test.py +0 -38
  32. package/tests/output/api/setup.py +0 -79
  33. package/tests/output/api/tea_python_tests/__init__.py +0 -1
  34. package/tests/output/api/tea_python_tests/client.py +0 -106
  35. package/tests/output/builtin/setup.py +0 -79
  36. package/tests/output/builtin/tea_python_tests/__init__.py +0 -1
  37. package/tests/output/builtin/tea_python_tests/client.py +0 -687
  38. package/tests/output/comment/setup.py +0 -79
  39. package/tests/output/comment/tea_python_tests/__init__.py +0 -1
  40. package/tests/output/comment/tea_python_tests/client.py +0 -289
  41. package/tests/output/comment/tea_python_tests/models/__init__.py +0 -13
  42. package/tests/output/comment/tea_python_tests/models/_test_1.py +0 -103
  43. package/tests/output/comment/tea_python_tests/models/_test_2.py +0 -58
  44. package/tests/output/comment/tea_python_tests/models/_test_3.py +0 -64
  45. package/tests/output/complex/setup.py +0 -79
  46. package/tests/output/complex/tea_python_tests/__init__.py +0 -1
  47. package/tests/output/complex/tea_python_tests/client.py +0 -1170
  48. package/tests/output/complex/tea_python_tests/exceptions/__init__.py +0 -11
  49. package/tests/output/complex/tea_python_tests/exceptions/_err_1.py +0 -24
  50. package/tests/output/complex/tea_python_tests/exceptions/_err_2.py +0 -22
  51. package/tests/output/complex/tea_python_tests/models/__init__.py +0 -17
  52. package/tests/output/complex/tea_python_tests/models/_complex_request.py +0 -574
  53. package/tests/output/complex/tea_python_tests/models/_response.py +0 -34
  54. package/tests/output/const/setup.py +0 -79
  55. package/tests/output/const/tea_python_tests/__init__.py +0 -1
  56. package/tests/output/const/tea_python_tests/client.py +0 -12
  57. package/tests/output/empty/setup.py +0 -79
  58. package/tests/output/empty/tea_python_tests/__init__.py +0 -1
  59. package/tests/output/empty/tea_python_tests/client.py +0 -8
  60. package/tests/output/exec/setup.py +0 -79
  61. package/tests/output/exec/tea_python_tests/__init__.py +0 -1
  62. package/tests/output/exec/tea_python_tests/exec_client.py +0 -22
  63. package/tests/output/function/setup.py +0 -79
  64. package/tests/output/function/tea_python_tests/__init__.py +0 -1
  65. package/tests/output/function/tea_python_tests/client.py +0 -65
  66. package/tests/output/import/setup.py +0 -80
  67. package/tests/output/import/tea_python_tests/__init__.py +0 -1
  68. package/tests/output/import/tea_python_tests/client.py +0 -30
  69. package/tests/output/map/setup.py +0 -79
  70. package/tests/output/map/tea_python_tests/__init__.py +0 -1
  71. package/tests/output/map/tea_python_tests/client.py +0 -39
  72. package/tests/output/model/setup.py +0 -79
  73. package/tests/output/model/tea_python_tests/__init__.py +0 -1
  74. package/tests/output/model/tea_python_tests/client.py +0 -8
  75. package/tests/output/model/tea_python_tests/exceptions/__init__.py +0 -9
  76. package/tests/output/model/tea_python_tests/exceptions/_main_file.py +0 -29
  77. package/tests/output/model/tea_python_tests/models/__init__.py +0 -31
  78. package/tests/output/model/tea_python_tests/models/_class.py +0 -23
  79. package/tests/output/model/tea_python_tests/models/_m.py +0 -56
  80. package/tests/output/model/tea_python_tests/models/_main_file.py +0 -73
  81. package/tests/output/model/tea_python_tests/models/_model.py +0 -33
  82. package/tests/output/model/tea_python_tests/models/_my_model.py +0 -750
  83. package/tests/output/modelConfig/setup.py +0 -79
  84. package/tests/output/modelConfig/tea_python_tests/__init__.py +0 -1
  85. package/tests/output/modelConfig/tea_python_tests/client.py +0 -8
  86. package/tests/output/modelConfig/tea_python_tests/exceptions/__init__.py +0 -9
  87. package/tests/output/modelConfig/tea_python_tests/exceptions/_main_file.py +0 -29
  88. package/tests/output/modelConfig/tea_python_tests/models/__init__.py +0 -31
  89. package/tests/output/modelConfig/tea_python_tests/models/_class.py +0 -23
  90. package/tests/output/modelConfig/tea_python_tests/models/_m.py +0 -56
  91. package/tests/output/modelConfig/tea_python_tests/models/_main_file.py +0 -73
  92. package/tests/output/modelConfig/tea_python_tests/models/_model.py +0 -33
  93. package/tests/output/modelConfig/tea_python_tests/models/_my_model.py +0 -750
  94. package/tests/output/multi/setup.py +0 -79
  95. package/tests/output/multi/tea_python_tests/__init__.py +0 -1
  96. package/tests/output/multi/tea_python_tests/api.py +0 -93
  97. package/tests/output/multi/tea_python_tests/api_models/__init__.py +0 -9
  98. package/tests/output/multi/tea_python_tests/api_models/_test_model_dir_2.py +0 -35
  99. package/tests/output/multi/tea_python_tests/client.py +0 -39
  100. package/tests/output/multi/tea_python_tests/exceptions/__init__.py +0 -11
  101. package/tests/output/multi/tea_python_tests/exceptions/_err.py +0 -38
  102. package/tests/output/multi/tea_python_tests/lib/util.py +0 -18
  103. package/tests/output/multi/tea_python_tests/model/user.py +0 -27
  104. package/tests/output/multi/tea_python_tests/model/user_exceptions/__init__.py +0 -13
  105. package/tests/output/multi/tea_python_tests/model/user_exceptions/_err.py +0 -22
  106. package/tests/output/multi/tea_python_tests/model/user_exceptions/_err_1.py +0 -54
  107. package/tests/output/multi/tea_python_tests/model/user_exceptions/_err_2.py +0 -18
  108. package/tests/output/multi/tea_python_tests/model/user_models/__init__.py +0 -11
  109. package/tests/output/multi/tea_python_tests/model/user_models/_base_info.py +0 -73
  110. package/tests/output/multi/tea_python_tests/model/user_models/_info.py +0 -82
  111. package/tests/output/multi/tea_python_tests/models/__init__.py +0 -11
  112. package/tests/output/multi/tea_python_tests/models/_test_model_dir.py +0 -84
  113. package/tests/output/statements/setup.py +0 -79
  114. package/tests/output/statements/tea_python_tests/__init__.py +0 -1
  115. package/tests/output/statements/tea_python_tests/client.py +0 -86
  116. package/tests/output/super/setup.py +0 -79
  117. package/tests/output/super/tea_python_tests/__init__.py +0 -1
  118. package/tests/output/super/tea_python_tests/client.py +0 -16
  119. package/tests/output/typedef/setup.py +0 -80
  120. package/tests/output/typedef/tea_python_tests/__init__.py +0 -1
  121. package/tests/output/typedef/tea_python_tests/client.py +0 -74
  122. package/tests/output/typedef/tea_python_tests/models/__init__.py +0 -9
  123. package/tests/output/typedef/tea_python_tests/models/_m.py +0 -45
  124. /package/tests/{output/alias → expected/websocket}/tea_python_tests/__init__.py +0 -0
@@ -1,84 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # This file is auto-generated, don't edit it. Thanks.
3
- from __future__ import annotations
4
-
5
- from typing import Any
6
-
7
- from darabonba.model import DaraModel
8
- from tea_python_tests.model import user_models as user_models
9
-
10
- class TestModelDIR(DaraModel):
11
- def __init__(
12
- self,
13
- test: str = None,
14
- a: Any = None,
15
- ):
16
- self.test = test
17
- self.a = a
18
-
19
- def validate(self):
20
- self.validate_required(self.test, 'test')
21
- self.validate_required(self.a, 'a')
22
-
23
- def to_map(self):
24
- result = dict()
25
- _map = super().to_map()
26
- if _map is not None:
27
- result = _map
28
- if self.test is not None:
29
- result['test'] = self.test
30
-
31
- if self.a is not None:
32
- result['a'] = self.a
33
-
34
- return result
35
-
36
- def from_map(self, m: dict = None):
37
- m = m or dict()
38
- if m.get('test') is not None:
39
- self.test = m.get('test')
40
-
41
- if m.get('a') is not None:
42
- self.a = m.get('a')
43
-
44
- return self
45
-
46
-
47
-
48
- class TestModelDir(DaraModel):
49
- def __init__(
50
- self,
51
- test: int = None,
52
- m: user_models.Info = None,
53
- ):
54
- self.test = test
55
- self.m = m
56
-
57
- def validate(self):
58
- self.validate_required(self.test, 'test')
59
- self.validate_required(self.m, 'm')
60
-
61
- def to_map(self):
62
- result = dict()
63
- _map = super().to_map()
64
- if _map is not None:
65
- result = _map
66
- if self.test is not None:
67
- result['test'] = self.test
68
-
69
- if self.m is not None:
70
- result['m'] = self.m.to_map()
71
-
72
- return result
73
-
74
- def from_map(self, m: dict = None):
75
- m = m or dict()
76
- if m.get('test') is not None:
77
- self.test = m.get('test')
78
-
79
- if m.get('m') is not None:
80
- temp_model = user_models.Info()
81
- self.m = temp_model.from_map(m.get('m'))
82
-
83
- return self
84
-
@@ -1,79 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- """
3
- Licensed to the Apache Software Foundation (ASF) under one
4
- or more contributor license agreements. See the NOTICE file
5
- distributed with this work for additional information
6
- regarding copyright ownership. The ASF licenses this file
7
- to you under the Apache License, Version 2.0 (the
8
- "License"); you may not use this file except in compliance
9
- with the License. You may obtain a copy of the License at
10
-
11
- http://www.apache.org/licenses/LICENSE-2.0
12
-
13
- Unless required by applicable law or agreed to in writing,
14
- software distributed under the License is distributed on an
15
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- KIND, either express or implied. See the License for the
17
- specific language governing permissions and limitations
18
- under the License.
19
- """
20
-
21
- import os
22
- from setuptools import setup, find_packages
23
-
24
- """
25
- setup module for tea_python_tests.
26
-
27
- Created on 13/08/2025
28
-
29
- @author: Alibaba
30
- """
31
-
32
- PACKAGE = "tea_python_tests"
33
- NAME = "tea_python_tests"
34
- DESCRIPTION = ""
35
- AUTHOR = "Alibaba"
36
- AUTHOR_EMAIL = "sdk-team@alibabacloud.com"
37
- URL = "https://github.com/"
38
- VERSION = __import__(PACKAGE).__version__
39
- REQUIRES = [
40
- "darabonba-core>=1.0.0, <2.0.0"
41
-
42
- ]
43
-
44
- LONG_DESCRIPTION = ''
45
- if os.path.exists('./README.md'):
46
- with open("README.md", encoding='utf-8') as fp:
47
- LONG_DESCRIPTION = fp.read()
48
-
49
- setup(
50
- name=NAME,
51
- version=VERSION,
52
- description=DESCRIPTION,
53
- long_description=LONG_DESCRIPTION,
54
- long_description_content_type='text/markdown',
55
- author=AUTHOR,
56
- author_email=AUTHOR_EMAIL,
57
- license="Apache License 2.0",
58
- url=URL,
59
- keywords=["tea","python","tests"],
60
- packages=find_packages(exclude=["tests*"]),
61
- include_package_data=True,
62
- platforms="any",
63
- install_requires=REQUIRES,
64
- python_requires=">=3.7",
65
- classifiers=(
66
- "Development Status :: 4 - Beta",
67
- "Intended Audience :: Developers",
68
- "License :: OSI Approved :: Apache Software License",
69
- "Programming Language :: Python",
70
- "Programming Language :: Python :: 3",
71
- "Programming Language :: Python :: 3.7",
72
- "Programming Language :: Python :: 3.8",
73
- "Programming Language :: Python :: 3.9",
74
- "Programming Language :: Python :: 3.10",
75
- "Programming Language :: Python :: 3.11",
76
- "Programming Language :: Python :: 3.12",
77
- "Topic :: Software Development"
78
- )
79
- )
@@ -1 +0,0 @@
1
- __version__ = "1.0.0"
@@ -1,86 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # This file is auto-generated, don't edit it. Thanks.
3
- from __future__ import annotations
4
-
5
- from darabonba.core import DaraCore
6
- from darabonba.exceptions import DaraException
7
- from darabonba.request import DaraRequest
8
-
9
- class Client:
10
- def __init__(self):
11
- pass
12
-
13
- def hello(self) -> None:
14
- _request = DaraRequest()
15
- _request.method = 'GET'
16
- _request.pathname = '/'
17
- _request.headers = {
18
- 'host': 'www.test.com'
19
- }
20
- if True:
21
- _request.headers["host"] = 'www.test2.com'
22
- _last_request = _request
23
- _response = DaraCore.do_action(_request)
24
- if True:
25
- raise DaraException(_request, _response)
26
- else:
27
- True
28
-
29
- self.hello_if()
30
- not False
31
- a = None
32
- a = 'string'
33
- return
34
-
35
- async def hello_async(self) -> None:
36
- _request = DaraRequest()
37
- _request.method = 'GET'
38
- _request.pathname = '/'
39
- _request.headers = {
40
- 'host': 'www.test.com'
41
- }
42
- if True:
43
- _request.headers["host"] = 'www.test2.com'
44
- _last_request = _request
45
- _response = await DaraCore.async_do_action(_request)
46
- if True:
47
- raise DaraException(_request, _response)
48
- else:
49
- True
50
-
51
- self.hello_if()
52
- not False
53
- a = None
54
- a = 'string'
55
- return
56
-
57
- @staticmethod
58
- def hello_if() -> None:
59
- if True:
60
- pass
61
- if True:
62
- pass
63
- elif True:
64
- pass
65
- else:
66
- pass
67
-
68
- @staticmethod
69
- def hello_throw() -> None:
70
- raise DaraException({})
71
-
72
- @staticmethod
73
- def hello_for_break() -> None:
74
- for item in [ ]:
75
- break
76
-
77
- @staticmethod
78
- def hello_while() -> None:
79
- while True:
80
- break
81
-
82
- @staticmethod
83
- def hello_declare() -> None:
84
- hello = 'world'
85
- hello_null = None
86
- hello = 'hehe'
@@ -1,79 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- """
3
- Licensed to the Apache Software Foundation (ASF) under one
4
- or more contributor license agreements. See the NOTICE file
5
- distributed with this work for additional information
6
- regarding copyright ownership. The ASF licenses this file
7
- to you under the Apache License, Version 2.0 (the
8
- "License"); you may not use this file except in compliance
9
- with the License. You may obtain a copy of the License at
10
-
11
- http://www.apache.org/licenses/LICENSE-2.0
12
-
13
- Unless required by applicable law or agreed to in writing,
14
- software distributed under the License is distributed on an
15
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- KIND, either express or implied. See the License for the
17
- specific language governing permissions and limitations
18
- under the License.
19
- """
20
-
21
- import os
22
- from setuptools import setup, find_packages
23
-
24
- """
25
- setup module for tea_python_tests.
26
-
27
- Created on 13/08/2025
28
-
29
- @author: Alibaba
30
- """
31
-
32
- PACKAGE = "tea_python_tests"
33
- NAME = "tea_python_tests"
34
- DESCRIPTION = ""
35
- AUTHOR = "Alibaba"
36
- AUTHOR_EMAIL = "sdk-team@alibabacloud.com"
37
- URL = "https://github.com/"
38
- VERSION = __import__(PACKAGE).__version__
39
- REQUIRES = [
40
- "darabonba-core>=1.0.0, <2.0.0"
41
-
42
- ]
43
-
44
- LONG_DESCRIPTION = ''
45
- if os.path.exists('./README.md'):
46
- with open("README.md", encoding='utf-8') as fp:
47
- LONG_DESCRIPTION = fp.read()
48
-
49
- setup(
50
- name=NAME,
51
- version=VERSION,
52
- description=DESCRIPTION,
53
- long_description=LONG_DESCRIPTION,
54
- long_description_content_type='text/markdown',
55
- author=AUTHOR,
56
- author_email=AUTHOR_EMAIL,
57
- license="Apache License 2.0",
58
- url=URL,
59
- keywords=["tea","python","tests"],
60
- packages=find_packages(exclude=["tests*"]),
61
- include_package_data=True,
62
- platforms="any",
63
- install_requires=REQUIRES,
64
- python_requires=">=3.7",
65
- classifiers=(
66
- "Development Status :: 4 - Beta",
67
- "Intended Audience :: Developers",
68
- "License :: OSI Approved :: Apache Software License",
69
- "Programming Language :: Python",
70
- "Programming Language :: Python :: 3",
71
- "Programming Language :: Python :: 3.7",
72
- "Programming Language :: Python :: 3.8",
73
- "Programming Language :: Python :: 3.9",
74
- "Programming Language :: Python :: 3.10",
75
- "Programming Language :: Python :: 3.11",
76
- "Programming Language :: Python :: 3.12",
77
- "Topic :: Software Development"
78
- )
79
- )
@@ -1 +0,0 @@
1
- __version__ = "1.0.0"
@@ -1,16 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # This file is auto-generated, don't edit it. Thanks.
3
- from __future__ import annotations
4
-
5
- from Source import models as source_models
6
- from Source.source_client import SourceClient
7
-
8
-
9
-
10
- class Client(SourceClient):
11
-
12
- def __init__(
13
- self,
14
- config: source_models.Config,
15
- ):
16
- super().__init__(config)
@@ -1,80 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- """
3
- Licensed to the Apache Software Foundation (ASF) under one
4
- or more contributor license agreements. See the NOTICE file
5
- distributed with this work for additional information
6
- regarding copyright ownership. The ASF licenses this file
7
- to you under the Apache License, Version 2.0 (the
8
- "License"); you may not use this file except in compliance
9
- with the License. You may obtain a copy of the License at
10
-
11
- http://www.apache.org/licenses/LICENSE-2.0
12
-
13
- Unless required by applicable law or agreed to in writing,
14
- software distributed under the License is distributed on an
15
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- KIND, either express or implied. See the License for the
17
- specific language governing permissions and limitations
18
- under the License.
19
- """
20
-
21
- import os
22
- from setuptools import setup, find_packages
23
-
24
- """
25
- setup module for tea_python_tests.
26
-
27
- Created on 13/08/2025
28
-
29
- @author: Alibaba
30
- """
31
-
32
- PACKAGE = "tea_python_tests"
33
- NAME = "tea_python_tests"
34
- DESCRIPTION = ""
35
- AUTHOR = "Alibaba"
36
- AUTHOR_EMAIL = "sdk-team@alibabacloud.com"
37
- URL = "https://github.com/"
38
- VERSION = __import__(PACKAGE).__version__
39
- REQUIRES = [
40
- "darabonba-core>=1.0.0, <2.0.0",
41
- "requests>=2.21.0, <3.0.0",
42
- "alibabacloud-tea>=0.2.9, <1.0.0"
43
- ]
44
-
45
- LONG_DESCRIPTION = ''
46
- if os.path.exists('./README.md'):
47
- with open("README.md", encoding='utf-8') as fp:
48
- LONG_DESCRIPTION = fp.read()
49
-
50
- setup(
51
- name=NAME,
52
- version=VERSION,
53
- description=DESCRIPTION,
54
- long_description=LONG_DESCRIPTION,
55
- long_description_content_type='text/markdown',
56
- author=AUTHOR,
57
- author_email=AUTHOR_EMAIL,
58
- license="Apache License 2.0",
59
- url=URL,
60
- keywords=["tea","python","tests"],
61
- packages=find_packages(exclude=["tests*"]),
62
- include_package_data=True,
63
- platforms="any",
64
- install_requires=REQUIRES,
65
- python_requires=">=3.7",
66
- classifiers=(
67
- "Development Status :: 4 - Beta",
68
- "Intended Audience :: Developers",
69
- "License :: OSI Approved :: Apache Software License",
70
- "Programming Language :: Python",
71
- "Programming Language :: Python :: 3",
72
- "Programming Language :: Python :: 3.7",
73
- "Programming Language :: Python :: 3.8",
74
- "Programming Language :: Python :: 3.9",
75
- "Programming Language :: Python :: 3.10",
76
- "Programming Language :: Python :: 3.11",
77
- "Programming Language :: Python :: 3.12",
78
- "Topic :: Software Development"
79
- )
80
- )
@@ -1 +0,0 @@
1
- __version__ = "1.0.0"
@@ -1,74 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # This file is auto-generated, don't edit it. Thanks.
3
- from __future__ import annotations
4
-
5
- from typing import Dict, Any
6
-
7
- from requests import Request, Response
8
- from Source.source_client import SourceClient
9
- from tea_python_tests import models as main_models
10
- from Tea.model import TeaModel
11
-
12
- class Client:
13
- _vid: Request = None
14
- _model: TeaModel = None
15
-
16
- def __init__(
17
- self,
18
- request: Request,
19
- model: TeaModel,
20
- ):
21
- self._vid = request
22
- self._model = model
23
-
24
- def main(
25
- self,
26
- test_1: Request,
27
- test_2: TeaModel,
28
- ) -> None:
29
- oss = SourceClient(test_1)
30
- m = main_models.M(
31
- a = test_1,
32
- b = test_2
33
- )
34
- self._vid = test_1
35
- self._model = test_2
36
-
37
- async def main_async(
38
- self,
39
- test_1: Request,
40
- test_2: TeaModel,
41
- ) -> None:
42
- oss = SourceClient(test_1)
43
- m = main_models.M(
44
- a = test_1,
45
- b = test_2
46
- )
47
- self._vid = test_1
48
- self._model = test_2
49
-
50
- def test_http_request(
51
- self,
52
- req: Request,
53
- ) -> Response:
54
- return self.test_http_request_with('test', req)
55
-
56
- async def test_http_request_async(
57
- self,
58
- req: Request,
59
- ) -> Response:
60
- return self.test_http_request_with('test', req)
61
-
62
- @staticmethod
63
- def test_http_request_with(
64
- method: str,
65
- req: Request,
66
- ) -> Response:
67
- raise Exception('Un-implemented')
68
-
69
- @staticmethod
70
- def test_http_header(
71
- method: str,
72
- headers: Dict[str, Any],
73
- ) -> Response:
74
- raise Exception('Un-implemented')
@@ -1,9 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # This file is auto-generated, don't edit it. Thanks.
3
- from __future__ import annotations
4
-
5
- from ._m import M
6
-
7
- __all__ = [
8
- M
9
- ]
@@ -1,45 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- # This file is auto-generated, don't edit it. Thanks.
3
- from __future__ import annotations
4
-
5
- from darabonba.model import DaraModel
6
- from requests import Request
7
- from Tea.model import TeaModel
8
-
9
-
10
-
11
- class M(DaraModel):
12
- def __init__(
13
- self,
14
- a: Request = None,
15
- b: TeaModel = None,
16
- ):
17
- self.a = a
18
- self.b = b
19
-
20
- def validate(self):
21
- pass
22
-
23
- def to_map(self):
24
- result = dict()
25
- _map = super().to_map()
26
- if _map is not None:
27
- result = _map
28
- if self.a is not None:
29
- result['a'] = self.a
30
-
31
- if self.b is not None:
32
- result['b'] = self.b
33
-
34
- return result
35
-
36
- def from_map(self, m: dict = None):
37
- m = m or dict()
38
- if m.get('a') is not None:
39
- self.a = m.get('a')
40
-
41
- if m.get('b') is not None:
42
- self.b = m.get('b')
43
-
44
- return self
45
-