@darabonba/python-generator 2.0.13 → 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 (112) hide show
  1. package/ChangeLog.md +2 -2
  2. package/lib/generator.js +1 -1
  3. package/package.json +1 -1
  4. package/tests/expected/websocket/tea_python_tests/client.py +20 -0
  5. package/tests/fixtures/websocket/.libraries.json +3 -0
  6. package/tests/fixtures/websocket/Darafile +9 -0
  7. package/tests/fixtures/websocket/libraries/alibabacloud_OpenApiV2_0.1.27/Teafile +21 -0
  8. package/tests/fixtures/websocket/libraries/alibabacloud_OpenApiV2_0.1.27/main.tea +1 -0
  9. package/tests/fixtures/websocket/libraries/alibabacloud_OpenApiV2_0.1.27/utils.dara +1 -0
  10. package/tests/fixtures/websocket/libraries/alibabacloud_OpenApiV2_0.1.27/websocketUtils.dara +9 -0
  11. package/tests/fixtures/websocket/main.dara +8 -0
  12. package/tests/main.tests.js +10 -0
  13. package/tests/output/alias/setup.py +0 -83
  14. package/tests/output/alias/tea_python_tests/client.py +0 -35
  15. package/tests/output/annotation/setup.py +0 -79
  16. package/tests/output/annotation/tea_python_tests/__init__.py +0 -1
  17. package/tests/output/annotation/tea_python_tests/client.py +0 -93
  18. package/tests/output/annotation/tea_python_tests/models/__init__.py +0 -9
  19. package/tests/output/annotation/tea_python_tests/models/_test.py +0 -38
  20. package/tests/output/api/setup.py +0 -79
  21. package/tests/output/api/tea_python_tests/__init__.py +0 -1
  22. package/tests/output/api/tea_python_tests/client.py +0 -106
  23. package/tests/output/builtin/setup.py +0 -79
  24. package/tests/output/builtin/tea_python_tests/__init__.py +0 -1
  25. package/tests/output/builtin/tea_python_tests/client.py +0 -687
  26. package/tests/output/comment/setup.py +0 -79
  27. package/tests/output/comment/tea_python_tests/__init__.py +0 -1
  28. package/tests/output/comment/tea_python_tests/client.py +0 -289
  29. package/tests/output/comment/tea_python_tests/models/__init__.py +0 -13
  30. package/tests/output/comment/tea_python_tests/models/_test_1.py +0 -103
  31. package/tests/output/comment/tea_python_tests/models/_test_2.py +0 -58
  32. package/tests/output/comment/tea_python_tests/models/_test_3.py +0 -64
  33. package/tests/output/complex/setup.py +0 -79
  34. package/tests/output/complex/tea_python_tests/__init__.py +0 -1
  35. package/tests/output/complex/tea_python_tests/client.py +0 -1172
  36. package/tests/output/complex/tea_python_tests/exceptions/__init__.py +0 -11
  37. package/tests/output/complex/tea_python_tests/exceptions/_err_1.py +0 -24
  38. package/tests/output/complex/tea_python_tests/exceptions/_err_2.py +0 -22
  39. package/tests/output/complex/tea_python_tests/models/__init__.py +0 -17
  40. package/tests/output/complex/tea_python_tests/models/_complex_request.py +0 -574
  41. package/tests/output/complex/tea_python_tests/models/_response.py +0 -34
  42. package/tests/output/const/setup.py +0 -79
  43. package/tests/output/const/tea_python_tests/__init__.py +0 -1
  44. package/tests/output/const/tea_python_tests/client.py +0 -12
  45. package/tests/output/empty/setup.py +0 -79
  46. package/tests/output/empty/tea_python_tests/__init__.py +0 -1
  47. package/tests/output/empty/tea_python_tests/client.py +0 -8
  48. package/tests/output/exec/setup.py +0 -79
  49. package/tests/output/exec/tea_python_tests/__init__.py +0 -1
  50. package/tests/output/exec/tea_python_tests/exec_client.py +0 -22
  51. package/tests/output/function/setup.py +0 -79
  52. package/tests/output/function/tea_python_tests/__init__.py +0 -1
  53. package/tests/output/function/tea_python_tests/client.py +0 -77
  54. package/tests/output/import/setup.py +0 -80
  55. package/tests/output/import/tea_python_tests/__init__.py +0 -1
  56. package/tests/output/import/tea_python_tests/client.py +0 -30
  57. package/tests/output/map/setup.py +0 -79
  58. package/tests/output/map/tea_python_tests/__init__.py +0 -1
  59. package/tests/output/map/tea_python_tests/client.py +0 -39
  60. package/tests/output/model/setup.py +0 -79
  61. package/tests/output/model/tea_python_tests/__init__.py +0 -1
  62. package/tests/output/model/tea_python_tests/client.py +0 -8
  63. package/tests/output/model/tea_python_tests/exceptions/__init__.py +0 -9
  64. package/tests/output/model/tea_python_tests/exceptions/_main_file.py +0 -29
  65. package/tests/output/model/tea_python_tests/models/__init__.py +0 -31
  66. package/tests/output/model/tea_python_tests/models/_class.py +0 -23
  67. package/tests/output/model/tea_python_tests/models/_m.py +0 -56
  68. package/tests/output/model/tea_python_tests/models/_main_file.py +0 -73
  69. package/tests/output/model/tea_python_tests/models/_model.py +0 -33
  70. package/tests/output/model/tea_python_tests/models/_my_model.py +0 -786
  71. package/tests/output/modelConfig/setup.py +0 -79
  72. package/tests/output/modelConfig/tea_python_tests/__init__.py +0 -1
  73. package/tests/output/modelConfig/tea_python_tests/client.py +0 -8
  74. package/tests/output/modelConfig/tea_python_tests/exceptions/__init__.py +0 -9
  75. package/tests/output/modelConfig/tea_python_tests/exceptions/_main_file.py +0 -29
  76. package/tests/output/modelConfig/tea_python_tests/models/__init__.py +0 -31
  77. package/tests/output/modelConfig/tea_python_tests/models/_class.py +0 -23
  78. package/tests/output/modelConfig/tea_python_tests/models/_m.py +0 -56
  79. package/tests/output/modelConfig/tea_python_tests/models/_main_file.py +0 -73
  80. package/tests/output/modelConfig/tea_python_tests/models/_model.py +0 -33
  81. package/tests/output/modelConfig/tea_python_tests/models/_my_model.py +0 -750
  82. package/tests/output/multi/setup.py +0 -79
  83. package/tests/output/multi/tea_python_tests/__init__.py +0 -1
  84. package/tests/output/multi/tea_python_tests/api.py +0 -93
  85. package/tests/output/multi/tea_python_tests/api_models/__init__.py +0 -9
  86. package/tests/output/multi/tea_python_tests/api_models/_test_model_dir_2.py +0 -35
  87. package/tests/output/multi/tea_python_tests/client.py +0 -39
  88. package/tests/output/multi/tea_python_tests/exceptions/__init__.py +0 -11
  89. package/tests/output/multi/tea_python_tests/exceptions/_err.py +0 -38
  90. package/tests/output/multi/tea_python_tests/lib/util.py +0 -18
  91. package/tests/output/multi/tea_python_tests/model/user.py +0 -27
  92. package/tests/output/multi/tea_python_tests/model/user_exceptions/__init__.py +0 -13
  93. package/tests/output/multi/tea_python_tests/model/user_exceptions/_err.py +0 -22
  94. package/tests/output/multi/tea_python_tests/model/user_exceptions/_err_1.py +0 -54
  95. package/tests/output/multi/tea_python_tests/model/user_exceptions/_err_2.py +0 -18
  96. package/tests/output/multi/tea_python_tests/model/user_models/__init__.py +0 -11
  97. package/tests/output/multi/tea_python_tests/model/user_models/_base_info.py +0 -73
  98. package/tests/output/multi/tea_python_tests/model/user_models/_info.py +0 -82
  99. package/tests/output/multi/tea_python_tests/models/__init__.py +0 -11
  100. package/tests/output/multi/tea_python_tests/models/_test_model_dir.py +0 -84
  101. package/tests/output/statements/setup.py +0 -79
  102. package/tests/output/statements/tea_python_tests/__init__.py +0 -1
  103. package/tests/output/statements/tea_python_tests/client.py +0 -86
  104. package/tests/output/super/setup.py +0 -79
  105. package/tests/output/super/tea_python_tests/__init__.py +0 -1
  106. package/tests/output/super/tea_python_tests/client.py +0 -16
  107. package/tests/output/typedef/setup.py +0 -80
  108. package/tests/output/typedef/tea_python_tests/__init__.py +0 -1
  109. package/tests/output/typedef/tea_python_tests/client.py +0 -74
  110. package/tests/output/typedef/tea_python_tests/models/__init__.py +0 -9
  111. package/tests/output/typedef/tea_python_tests/models/_m.py +0 -45
  112. /package/tests/{output/alias → expected/websocket}/tea_python_tests/__init__.py +0 -0
@@ -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 19/12/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,289 +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 List, Dict, BinaryIO, Any
6
-
7
- from darabonba.core import DaraCore
8
- from darabonba.exceptions import UnretryableException
9
- from darabonba.policy.retry import RetryPolicyContext
10
- from darabonba.request import DaraRequest
11
- from tea_python_tests import models as main_models
12
-
13
- # top comment
14
- """
15
- * @remarks
16
- * top annotation
17
- """
18
- class Client:
19
- # type's comment
20
- _a: List[str] = None
21
- _comple_list: List[List[str]] = None
22
- _endpoint_map: Dict[str, str] = None
23
- def __init__(self):
24
- # string declate comment
25
- str = 'sss'
26
- # new model instance comment
27
- model_instance = main_models.Test1(
28
- test = 'test',
29
- # est declare back comment
30
- test_2 = 'test2'
31
- )
32
- array = [
33
- # array string comment
34
- 'string',
35
- # array number comment
36
- 300
37
- # array back comment
38
- ]
39
-
40
- """
41
- * @remarks
42
- * testAPI
43
- """
44
- # estAPI comment one
45
- # estAPI comment two
46
- def test_api(self) -> None:
47
- _runtime = {
48
- }
49
- _last_request = None
50
- _last_response = None
51
- _retries_attempted = 0
52
- _context = RetryPolicyContext(
53
- retries_attempted= _retries_attempted
54
- )
55
- while DaraCore.should_retry(_runtime.get('retryOptions'), _context):
56
- if _retries_attempted > 0:
57
- _backoff_time = DaraCore.get_backoff_time(_runtime.get('retryOptions'), _context)
58
- if _backoff_time > 0:
59
- DaraCore.sleep(_backoff_time)
60
- _retries_attempted = _retries_attempted + 1
61
- try:
62
- _request = DaraRequest()
63
- # new model instance comment
64
- model_instance = main_models.Test1(
65
- # test declare front comment
66
- test = 'test',
67
- # test2 declare front comment
68
- test_2 = 'test2'
69
- )
70
- # number declare comment
71
- num = 123
72
- # static function call comment
73
- self.static_func()
74
- _last_request = _request
75
- _response = DaraCore.do_action(_request, _runtime)
76
- _last_response = _response
77
- # static async function call
78
- self.test_func('test', True, [
79
- [
80
- 'str'
81
- ],
82
- [
83
- 'str1'
84
- ]
85
- ])
86
- # return comment
87
- return
88
- except Exception as e:
89
- _context = RetryPolicyContext(
90
- retries_attempted= _retries_attempted,
91
- http_request = _last_request,
92
- http_response = _last_response,
93
- exception = e
94
- )
95
- continue
96
- raise UnretryableException(_context)
97
-
98
- async def test_api_async(self) -> None:
99
- _runtime = {
100
- }
101
- _last_request = None
102
- _last_response = None
103
- _retries_attempted = 0
104
- _context = RetryPolicyContext(
105
- retries_attempted= _retries_attempted
106
- )
107
- while DaraCore.should_retry(_runtime.get('retryOptions'), _context):
108
- if _retries_attempted > 0:
109
- _backoff_time = DaraCore.get_backoff_time(_runtime.get('retryOptions'), _context)
110
- if _backoff_time > 0:
111
- DaraCore.sleep(_backoff_time)
112
- _retries_attempted = _retries_attempted + 1
113
- try:
114
- _request = DaraRequest()
115
- # new model instance comment
116
- model_instance = main_models.Test1(
117
- # test declare front comment
118
- test = 'test',
119
- # test2 declare front comment
120
- test_2 = 'test2'
121
- )
122
- # number declare comment
123
- num = 123
124
- # static function call comment
125
- self.static_func()
126
- _last_request = _request
127
- _response = await DaraCore.async_do_action(_request, _runtime)
128
- _last_response = _response
129
- # static async function call
130
- await self.test_func_async('test', True, [
131
- [
132
- 'str'
133
- ],
134
- [
135
- 'str1'
136
- ]
137
- ])
138
- # return comment
139
- return
140
- except Exception as e:
141
- _context = RetryPolicyContext(
142
- retries_attempted= _retries_attempted,
143
- http_request = _last_request,
144
- http_response = _last_response,
145
- exception = e
146
- )
147
- continue
148
- raise UnretryableException(_context)
149
-
150
- # testAPI2 comment
151
- def test_api2(self) -> None:
152
- _runtime = {
153
- 'retry': True,
154
- }
155
- _last_request = None
156
- _last_response = None
157
- _retries_attempted = 0
158
- _context = RetryPolicyContext(
159
- retries_attempted= _retries_attempted
160
- )
161
- while DaraCore.should_retry(_runtime.get('retryOptions'), _context):
162
- if _retries_attempted > 0:
163
- _backoff_time = DaraCore.get_backoff_time(_runtime.get('retryOptions'), _context)
164
- if _backoff_time > 0:
165
- DaraCore.sleep(_backoff_time)
166
- _retries_attempted = _retries_attempted + 1
167
- try:
168
- _request = DaraRequest()
169
- # new model instance comment
170
- model_instance = main_models.Test3()
171
- # boolean declare comment
172
- bool = True
173
- if bool:
174
- # mpty if
175
- pass
176
- else:
177
- # mpty else
178
- pass
179
- # api function call comment
180
- self.test_api()
181
- # back comment
182
- _last_request = _request
183
- _response = DaraCore.do_action(_request, _runtime)
184
- _last_response = _response
185
- # empty return comment
186
- pass
187
- except Exception as e:
188
- _context = RetryPolicyContext(
189
- retries_attempted= _retries_attempted,
190
- http_request = _last_request,
191
- http_response = _last_response,
192
- exception = e
193
- )
194
- continue
195
- raise UnretryableException(_context)
196
-
197
- async def test_api2_async(self) -> None:
198
- _runtime = {
199
- 'retry': True,
200
- }
201
- _last_request = None
202
- _last_response = None
203
- _retries_attempted = 0
204
- _context = RetryPolicyContext(
205
- retries_attempted= _retries_attempted
206
- )
207
- while DaraCore.should_retry(_runtime.get('retryOptions'), _context):
208
- if _retries_attempted > 0:
209
- _backoff_time = DaraCore.get_backoff_time(_runtime.get('retryOptions'), _context)
210
- if _backoff_time > 0:
211
- DaraCore.sleep(_backoff_time)
212
- _retries_attempted = _retries_attempted + 1
213
- try:
214
- _request = DaraRequest()
215
- # new model instance comment
216
- model_instance = main_models.Test3()
217
- # boolean declare comment
218
- bool = True
219
- if bool:
220
- # mpty if
221
- pass
222
- else:
223
- # mpty else
224
- pass
225
- # api function call comment
226
- await self.test_api_async()
227
- # back comment
228
- _last_request = _request
229
- _response = await DaraCore.async_do_action(_request, _runtime)
230
- _last_response = _response
231
- # empty return comment
232
- pass
233
- except Exception as e:
234
- _context = RetryPolicyContext(
235
- retries_attempted= _retries_attempted,
236
- http_request = _last_request,
237
- http_response = _last_response,
238
- exception = e
239
- )
240
- continue
241
- raise UnretryableException(_context)
242
-
243
- @staticmethod
244
- def static_func() -> None:
245
- a = [
246
- # empty annotation comment
247
- ]
248
-
249
- @staticmethod
250
- def test_func(
251
- str: str,
252
- val: bool,
253
- comple_list: List[List[str]],
254
- ) -> str:
255
- # empty comment1
256
- # empty comment2
257
- s = 'test'
258
- return s
259
-
260
- @staticmethod
261
- async def test_func_async(
262
- str: str,
263
- val: bool,
264
- comple_list: List[List[str]],
265
- ) -> str:
266
- # empty comment1
267
- # empty comment2
268
- s = 'test'
269
- return s
270
-
271
- @staticmethod
272
- def test_func_params(
273
- comple_list: List[List[str]],
274
- map_test: Dict[str, str],
275
- read: BinaryIO,
276
- any_test: Any,
277
- test_1: main_models.Test1,
278
- ) -> None:
279
- pass
280
-
281
- @staticmethod
282
- async def test_func_params_async(
283
- comple_list: List[List[str]],
284
- map_test: Dict[str, str],
285
- read: BinaryIO,
286
- any_test: Any,
287
- test_1: main_models.Test1,
288
- ) -> None:
289
- pass
@@ -1,13 +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 ._test_1 import Test1
6
- from ._test_2 import Test2
7
- from ._test_3 import Test3
8
-
9
- __all__ = [
10
- Test1,
11
- Test2,
12
- Test3
13
- ]
@@ -1,103 +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 List
6
-
7
- from darabonba.model import DaraModel
8
-
9
- # import comment
10
-
11
-
12
- """
13
- * @remarks
14
- * TestModel
15
- """
16
- class Test1(DaraModel):
17
- def __init__(
18
- self,
19
- test: str = None,
20
- # odel的test back comment
21
- test_2: str = None,
22
- # odel的test2 back comment
23
- test_3: List[List[str]] = None,
24
- test_5: str = None,
25
- sts: str = None,
26
- a_sts: str = None,
27
- ):
28
- # test desc
29
- self.test = test
30
- # odel的test back comment
31
- # test2 desc
32
- self.test_2 = test_2
33
- # odel的test2 back comment
34
- # test3 desc
35
- self.test_3 = test_3
36
- # test desc
37
- self.test_5 = test_5
38
- # sts desc
39
- self.sts = sts
40
- # asts desc
41
- self.a_sts = a_sts
42
-
43
- def validate(self):
44
- self.validate_required(self.test, 'test')
45
- # odel的test back comment
46
- self.validate_required(self.test_2, 'test_2')
47
- # odel的test2 back comment
48
- self.validate_required(self.test_3, 'test_3')
49
- self.validate_required(self.test_5, 'test_5')
50
- self.validate_required(self.sts, 'sts')
51
- self.validate_required(self.a_sts, 'a_sts')
52
-
53
- def to_map(self):
54
- result = dict()
55
- _map = super().to_map()
56
- if _map is not None:
57
- result = _map
58
- if self.test is not None:
59
- result['test'] = self.test
60
-
61
- # odel的test back comment
62
- if self.test_2 is not None:
63
- result['test2'] = self.test_2
64
-
65
- # odel的test2 back comment
66
- if self.test_3 is not None:
67
- result['test3'] = self.test_3
68
-
69
- if self.test_5 is not None:
70
- result['test5'] = self.test_5
71
-
72
- if self.sts is not None:
73
- result['sts'] = self.sts
74
-
75
- if self.a_sts is not None:
76
- result['asts'] = self.a_sts
77
-
78
- return result
79
-
80
- def from_map(self, m: dict = None):
81
- m = m or dict()
82
- if m.get('test') is not None:
83
- self.test = m.get('test')
84
-
85
- # odel的test back comment
86
- if m.get('test2') is not None:
87
- self.test_2 = m.get('test2')
88
-
89
- # odel的test2 back comment
90
- if m.get('test3') is not None:
91
- self.test_3 = m.get('test3')
92
-
93
- if m.get('test5') is not None:
94
- self.test_5 = m.get('test5')
95
-
96
- if m.get('sts') is not None:
97
- self.sts = m.get('sts')
98
-
99
- if m.get('asts') is not None:
100
- self.a_sts = m.get('asts')
101
-
102
- return self
103
-
@@ -1,58 +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
-
7
- """
8
- * @remarks
9
- * TestModel2
10
- """
11
- class Test2(DaraModel):
12
- def __init__(
13
- self,
14
- # model的test front comment
15
- test: str = None,
16
- # model的test front comment
17
- test_2: str = None,
18
- ):
19
- # model的test front comment
20
- # test desc
21
- self.test = test
22
- # model的test front comment
23
- # test2 desc
24
- self.test_2 = test_2
25
-
26
- def validate(self):
27
- # model的test front comment
28
- self.validate_required(self.test, 'test')
29
- # model的test front comment
30
- self.validate_required(self.test_2, 'test_2')
31
-
32
- def to_map(self):
33
- result = dict()
34
- _map = super().to_map()
35
- if _map is not None:
36
- result = _map
37
- # model的test front comment
38
- if self.test is not None:
39
- result['test'] = self.test
40
-
41
- # model的test front comment
42
- if self.test_2 is not None:
43
- result['test2'] = self.test_2
44
-
45
- return result
46
-
47
- def from_map(self, m: dict = None):
48
- m = m or dict()
49
- # model的test front comment
50
- if m.get('test') is not None:
51
- self.test = m.get('test')
52
-
53
- # model的test front comment
54
- if m.get('test2') is not None:
55
- self.test_2 = m.get('test2')
56
-
57
- return self
58
-
@@ -1,64 +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
-
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
- result = dict()
37
- _map = super().to_map()
38
- if _map is not None:
39
- result = _map
40
- # model的test front comment
41
- if self.test is not None:
42
- result['test'] = self.test
43
-
44
- # empty comment1
45
- # empy comment2
46
- if self.test_1 is not None:
47
- result['test1'] = self.test_1
48
-
49
- return result
50
-
51
- def from_map(self, m: dict = None):
52
- m = m or dict()
53
- # model的test front comment
54
- if m.get('test') is not None:
55
- self.test = m.get('test')
56
-
57
- # empty comment1
58
- # empy comment2
59
- if m.get('test1') is not None:
60
- self.test_1 = m.get('test1')
61
-
62
- return self
63
-
64
- # odel的test back comment
@@ -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 19/12/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"