Skip to content

Commit ed0ea5a

Browse files
authored
auto codegen for UNVS
1 parent cbab226 commit ed0ea5a

File tree

7 files changed

+190
-0
lines changed

7 files changed

+190
-0
lines changed

docs/services.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ UK8S
164164
:members:
165165

166166

167+
UNVS
168+
----
169+
170+
.. autoclass:: ucloud.services.unvs.client.UNVSClient
171+
:members:
172+
173+
167174
VPC
168175
---
169176

ucloud/client.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,16 @@ def umem(self):
222222
self.logger,
223223
)
224224

225+
def unvs(self):
226+
from ucloud.services.unvs.client import UNVSClient
227+
228+
return UNVSClient(
229+
self._auto_config("unvs"),
230+
self.transport,
231+
self.middleware,
232+
self.logger,
233+
)
234+
225235
def unet(self):
226236
from ucloud.services.unet.client import UNetClient
227237

ucloud/services/unvs/__init__.py

Whitespace-only changes.

ucloud/services/unvs/client.py

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
""" Code is generated by ucloud-model, DO NOT EDIT IT. """
2+
3+
import typing
4+
5+
6+
from ucloud.core.client import Client
7+
from ucloud.services.unvs.schemas import apis
8+
9+
10+
class UNVSClient(Client):
11+
def __init__(
12+
self, config: dict, transport=None, middleware=None, logger=None
13+
):
14+
super(UNVSClient, self).__init__(config, transport, middleware, logger)
15+
16+
def get_mobile(self, req: typing.Optional[dict] = None, **kwargs) -> dict:
17+
"""GetMobile - 一键登录
18+
19+
**Request**
20+
21+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
22+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
23+
- **BusinessId** (str) - (Required) 业务ID
24+
- **Token** (str) - (Required) token
25+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
26+
27+
**Response**
28+
29+
- **Data** (dict) - 见 **PhoneInfo** 模型定义
30+
- **Message** (str) - 发生错误时表示错误字符串
31+
- **ReqUuid** (str) - 本次请求Uuid
32+
33+
**Response Model**
34+
35+
**PhoneInfo**
36+
- **Phone** (str) - 返回的电话号码
37+
38+
39+
"""
40+
# build request
41+
d = {
42+
"ProjectId": self.config.project_id,
43+
"Region": self.config.region,
44+
}
45+
req and d.update(req)
46+
d = apis.GetMobileRequestSchema().dumps(d)
47+
48+
resp = self.invoke("GetMobile", d, **kwargs)
49+
return apis.GetMobileResponseSchema().loads(resp)
50+
51+
def verify_mobile(
52+
self, req: typing.Optional[dict] = None, **kwargs
53+
) -> dict:
54+
"""VerifyMobile - 号码检测
55+
56+
**Request**
57+
58+
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
59+
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
60+
- **BusinessId** (str) - (Required) 业务ID
61+
- **Phone** (str) - (Required) 需要检测的手机号
62+
- **Token** (str) - (Required) token
63+
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
64+
65+
**Response**
66+
67+
- **Data** (dict) - 见 **VerifyInfo** 模型定义
68+
- **Message** (str) - 发生错误时表示错误字符串
69+
- **ReqUuid** (str) - 本次请求Uuid
70+
71+
**Response Model**
72+
73+
**VerifyInfo**
74+
- **VerifyResult** (str) - 检测结果:PASS:一致,REJECT:不一致
75+
76+
77+
"""
78+
# build request
79+
d = {
80+
"ProjectId": self.config.project_id,
81+
"Region": self.config.region,
82+
}
83+
req and d.update(req)
84+
d = apis.VerifyMobileRequestSchema().dumps(d)
85+
86+
resp = self.invoke("VerifyMobile", d, **kwargs)
87+
return apis.VerifyMobileResponseSchema().loads(resp)

ucloud/services/unvs/schemas/__init__.py

Whitespace-only changes.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
""" Code is generated by ucloud-model, DO NOT EDIT IT. """
2+
3+
4+
from ucloud.core.typesystem import schema, fields
5+
from ucloud.services.unvs.schemas import models
6+
7+
""" UNVS API Schema
8+
"""
9+
10+
11+
"""
12+
API: GetMobile
13+
14+
一键登录
15+
"""
16+
17+
18+
class GetMobileRequestSchema(schema.RequestSchema):
19+
"""GetMobile - 一键登录"""
20+
21+
fields = {
22+
"BusinessId": fields.Str(required=True, dump_to="BusinessId"),
23+
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
24+
"Region": fields.Str(required=False, dump_to="Region"),
25+
"Token": fields.Str(required=True, dump_to="Token"),
26+
"Zone": fields.Str(required=False, dump_to="Zone"),
27+
}
28+
29+
30+
class GetMobileResponseSchema(schema.ResponseSchema):
31+
"""GetMobile - 一键登录"""
32+
33+
fields = {
34+
"Data": models.PhoneInfoSchema(),
35+
"Message": fields.Str(required=False, load_from="Message"),
36+
"ReqUuid": fields.Str(required=False, load_from="ReqUuid"),
37+
}
38+
39+
40+
"""
41+
API: VerifyMobile
42+
43+
号码检测
44+
"""
45+
46+
47+
class VerifyMobileRequestSchema(schema.RequestSchema):
48+
"""VerifyMobile - 号码检测"""
49+
50+
fields = {
51+
"BusinessId": fields.Str(required=True, dump_to="BusinessId"),
52+
"Phone": fields.Str(required=True, dump_to="Phone"),
53+
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
54+
"Region": fields.Str(required=False, dump_to="Region"),
55+
"Token": fields.Str(required=True, dump_to="Token"),
56+
"Zone": fields.Str(required=False, dump_to="Zone"),
57+
}
58+
59+
60+
class VerifyMobileResponseSchema(schema.ResponseSchema):
61+
"""VerifyMobile - 号码检测"""
62+
63+
fields = {
64+
"Data": models.VerifyInfoSchema(),
65+
"Message": fields.Str(required=False, load_from="Message"),
66+
"ReqUuid": fields.Str(required=False, load_from="ReqUuid"),
67+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
""" Code is generated by ucloud-model, DO NOT EDIT IT. """
2+
3+
from ucloud.core.typesystem import schema, fields
4+
5+
6+
class PhoneInfoSchema(schema.ResponseSchema):
7+
"""PhoneInfo - 号码信息"""
8+
9+
fields = {
10+
"Phone": fields.Str(required=False, load_from="Phone"),
11+
}
12+
13+
14+
class VerifyInfoSchema(schema.ResponseSchema):
15+
"""VerifyInfo - 检测结果信息"""
16+
17+
fields = {
18+
"VerifyResult": fields.Str(required=False, load_from="VerifyResult"),
19+
}

0 commit comments

Comments
 (0)