antchain-mdp 2.0.0__tar.gz
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.
- antchain_mdp-2.0.0/LICENSE +13 -0
- antchain_mdp-2.0.0/MANIFEST.in +2 -0
- antchain_mdp-2.0.0/PKG-INFO +63 -0
- antchain_mdp-2.0.0/README-CN.md +38 -0
- antchain_mdp-2.0.0/README.md +40 -0
- antchain_mdp-2.0.0/antchain_mdp.egg-info/PKG-INFO +63 -0
- antchain_mdp-2.0.0/antchain_mdp.egg-info/SOURCES.txt +14 -0
- antchain_mdp-2.0.0/antchain_mdp.egg-info/dependency_links.txt +1 -0
- antchain_mdp-2.0.0/antchain_mdp.egg-info/requires.txt +3 -0
- antchain_mdp-2.0.0/antchain_mdp.egg-info/top_level.txt +1 -0
- antchain_mdp-2.0.0/antchain_sdk_mdp/__init__.py +1 -0
- antchain_mdp-2.0.0/antchain_sdk_mdp/client.py +386 -0
- antchain_mdp-2.0.0/antchain_sdk_mdp/models.py +351 -0
- antchain_mdp-2.0.0/setup.cfg +7 -0
- antchain_mdp-2.0.0/setup.py +78 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: antchain_mdp
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Ant Chain MDP SDK Library for Python
|
|
5
|
+
Home-page: https://github.com/alipay/antchain-openapi-prod-sdk
|
|
6
|
+
Author: Ant Chain SDK
|
|
7
|
+
Author-email: sdk-team@alibabacloud.com
|
|
8
|
+
License: Apache License 2.0
|
|
9
|
+
Description: English | [简体中文](README-CN.md)
|
|
10
|
+
|
|
11
|
+
## Ant Chain MPAASDP SDK for Python
|
|
12
|
+
|
|
13
|
+
## Requirements
|
|
14
|
+
|
|
15
|
+
- Python >= 3.6
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
- **Install with pip**
|
|
20
|
+
|
|
21
|
+
Python SDK uses a common package management tool named `pip`. If pip is not installed, see the [pip user guide](https://pip.pypa.io/en/stable/installing/ "pip User Guide") to install pip.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Install the antchain-mdp
|
|
25
|
+
pip install antchain-mdp
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Issues
|
|
29
|
+
|
|
30
|
+
[Opening an Issue](https://github.com/alipay/antchain-openapi-prod-sdk/issues/new), Issues not conforming to the guidelines may be closed immediately.
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
[Quick Examples](https://github.com/alipay/antchain-openapi-prod-sdk)
|
|
35
|
+
|
|
36
|
+
## Changelog
|
|
37
|
+
|
|
38
|
+
Detailed changes for each release are documented in the [release notes](./ChangeLog.md).
|
|
39
|
+
|
|
40
|
+
## References
|
|
41
|
+
|
|
42
|
+
- [Latest Release](https://github.com/alipay/antchain-openapi-prod-sdk/tree/master/python)
|
|
43
|
+
|
|
44
|
+
## License
|
|
45
|
+
|
|
46
|
+
[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
|
47
|
+
|
|
48
|
+
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
|
|
49
|
+
|
|
50
|
+
Keywords: antchain,mdp
|
|
51
|
+
Platform: any
|
|
52
|
+
Classifier: Development Status :: 4 - Beta
|
|
53
|
+
Classifier: Intended Audience :: Developers
|
|
54
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
55
|
+
Classifier: Programming Language :: Python
|
|
56
|
+
Classifier: Programming Language :: Python :: 3
|
|
57
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
58
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
59
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
60
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
61
|
+
Classifier: Topic :: Software Development
|
|
62
|
+
Requires-Python: >=3.6
|
|
63
|
+
Description-Content-Type: text/markdown
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
[English](README.md) | 简体中文
|
|
2
|
+
|
|
3
|
+
## Ant Chain MPAASDP SDK for Python
|
|
4
|
+
|
|
5
|
+
## 要求
|
|
6
|
+
|
|
7
|
+
- Python >= 3.6
|
|
8
|
+
|
|
9
|
+
## 安装
|
|
10
|
+
|
|
11
|
+
- **使用 pip 安装(推荐)**
|
|
12
|
+
|
|
13
|
+
如未安装 `pip`, 请先至pip官网 [pip user guide](https://pip.pypa.io/en/stable/installing/ "pip User Guide") 安装pip .
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# 安装 antchain-mdp
|
|
17
|
+
pip install antchain-mdp
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## 问题
|
|
21
|
+
|
|
22
|
+
[提交 Issue](https://github.com/alipay/antchain-openapi-prod-sdk/issues/new),不符合指南的问题可能会立即关闭。
|
|
23
|
+
|
|
24
|
+
## 使用说明
|
|
25
|
+
|
|
26
|
+
[快速使用](https://github.com/alipay/antchain-openapi-prod-sdk)
|
|
27
|
+
|
|
28
|
+
## 发行说明
|
|
29
|
+
|
|
30
|
+
每个版本的详细更改记录在[发行说明](./ChangeLog.md)中。
|
|
31
|
+
|
|
32
|
+
## 相关
|
|
33
|
+
|
|
34
|
+
- [最新源码](https://github.com/alipay/antchain-openapi-prod-sdk/)
|
|
35
|
+
|
|
36
|
+
## 许可证
|
|
37
|
+
|
|
38
|
+
[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
English | [简体中文](README-CN.md)
|
|
2
|
+
|
|
3
|
+
## Ant Chain MPAASDP SDK for Python
|
|
4
|
+
|
|
5
|
+
## Requirements
|
|
6
|
+
|
|
7
|
+
- Python >= 3.6
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
- **Install with pip**
|
|
12
|
+
|
|
13
|
+
Python SDK uses a common package management tool named `pip`. If pip is not installed, see the [pip user guide](https://pip.pypa.io/en/stable/installing/ "pip User Guide") to install pip.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Install the antchain-mdp
|
|
17
|
+
pip install antchain-mdp
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Issues
|
|
21
|
+
|
|
22
|
+
[Opening an Issue](https://github.com/alipay/antchain-openapi-prod-sdk/issues/new), Issues not conforming to the guidelines may be closed immediately.
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
[Quick Examples](https://github.com/alipay/antchain-openapi-prod-sdk)
|
|
27
|
+
|
|
28
|
+
## Changelog
|
|
29
|
+
|
|
30
|
+
Detailed changes for each release are documented in the [release notes](./ChangeLog.md).
|
|
31
|
+
|
|
32
|
+
## References
|
|
33
|
+
|
|
34
|
+
- [Latest Release](https://github.com/alipay/antchain-openapi-prod-sdk/tree/master/python)
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
|
39
|
+
|
|
40
|
+
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: antchain-mdp
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: Ant Chain MDP SDK Library for Python
|
|
5
|
+
Home-page: https://github.com/alipay/antchain-openapi-prod-sdk
|
|
6
|
+
Author: Ant Chain SDK
|
|
7
|
+
Author-email: sdk-team@alibabacloud.com
|
|
8
|
+
License: Apache License 2.0
|
|
9
|
+
Description: English | [简体中文](README-CN.md)
|
|
10
|
+
|
|
11
|
+
## Ant Chain MPAASDP SDK for Python
|
|
12
|
+
|
|
13
|
+
## Requirements
|
|
14
|
+
|
|
15
|
+
- Python >= 3.6
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
- **Install with pip**
|
|
20
|
+
|
|
21
|
+
Python SDK uses a common package management tool named `pip`. If pip is not installed, see the [pip user guide](https://pip.pypa.io/en/stable/installing/ "pip User Guide") to install pip.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Install the antchain-mdp
|
|
25
|
+
pip install antchain-mdp
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Issues
|
|
29
|
+
|
|
30
|
+
[Opening an Issue](https://github.com/alipay/antchain-openapi-prod-sdk/issues/new), Issues not conforming to the guidelines may be closed immediately.
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
[Quick Examples](https://github.com/alipay/antchain-openapi-prod-sdk)
|
|
35
|
+
|
|
36
|
+
## Changelog
|
|
37
|
+
|
|
38
|
+
Detailed changes for each release are documented in the [release notes](./ChangeLog.md).
|
|
39
|
+
|
|
40
|
+
## References
|
|
41
|
+
|
|
42
|
+
- [Latest Release](https://github.com/alipay/antchain-openapi-prod-sdk/tree/master/python)
|
|
43
|
+
|
|
44
|
+
## License
|
|
45
|
+
|
|
46
|
+
[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
|
|
47
|
+
|
|
48
|
+
Copyright (c) 2009-present, Alibaba Cloud All rights reserved.
|
|
49
|
+
|
|
50
|
+
Keywords: antchain,mdp
|
|
51
|
+
Platform: any
|
|
52
|
+
Classifier: Development Status :: 4 - Beta
|
|
53
|
+
Classifier: Intended Audience :: Developers
|
|
54
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
55
|
+
Classifier: Programming Language :: Python
|
|
56
|
+
Classifier: Programming Language :: Python :: 3
|
|
57
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
58
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
59
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
60
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
61
|
+
Classifier: Topic :: Software Development
|
|
62
|
+
Requires-Python: >=3.6
|
|
63
|
+
Description-Content-Type: text/markdown
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
3
|
+
README-CN.md
|
|
4
|
+
README.md
|
|
5
|
+
setup.cfg
|
|
6
|
+
setup.py
|
|
7
|
+
antchain_mdp.egg-info/PKG-INFO
|
|
8
|
+
antchain_mdp.egg-info/SOURCES.txt
|
|
9
|
+
antchain_mdp.egg-info/dependency_links.txt
|
|
10
|
+
antchain_mdp.egg-info/requires.txt
|
|
11
|
+
antchain_mdp.egg-info/top_level.txt
|
|
12
|
+
antchain_sdk_mdp/__init__.py
|
|
13
|
+
antchain_sdk_mdp/client.py
|
|
14
|
+
antchain_sdk_mdp/models.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
antchain_sdk_mdp
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '2.0.0'
|
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# This file is auto-generated, don't edit it. Thanks.
|
|
3
|
+
import time
|
|
4
|
+
|
|
5
|
+
from Tea.exceptions import TeaException, UnretryableException
|
|
6
|
+
from Tea.request import TeaRequest
|
|
7
|
+
from Tea.core import TeaCore
|
|
8
|
+
from antchain_alipay_util.antchain_utils import AntchainUtils
|
|
9
|
+
from typing import Dict
|
|
10
|
+
|
|
11
|
+
from antchain_sdk_mdp import models as mdp_models
|
|
12
|
+
from alibabacloud_tea_util.client import Client as UtilClient
|
|
13
|
+
from alibabacloud_tea_util import models as util_models
|
|
14
|
+
from alibabacloud_rpc_util.client import Client as RPCUtilClient
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Client:
|
|
18
|
+
_endpoint: str = None
|
|
19
|
+
_region_id: str = None
|
|
20
|
+
_access_key_id: str = None
|
|
21
|
+
_access_key_secret: str = None
|
|
22
|
+
_protocol: str = None
|
|
23
|
+
_user_agent: str = None
|
|
24
|
+
_read_timeout: int = None
|
|
25
|
+
_connect_timeout: int = None
|
|
26
|
+
_http_proxy: str = None
|
|
27
|
+
_https_proxy: str = None
|
|
28
|
+
_socks_5proxy: str = None
|
|
29
|
+
_socks_5net_work: str = None
|
|
30
|
+
_no_proxy: str = None
|
|
31
|
+
_max_idle_conns: int = None
|
|
32
|
+
_security_token: str = None
|
|
33
|
+
_max_idle_time_millis: int = None
|
|
34
|
+
_keep_alive_duration_millis: int = None
|
|
35
|
+
_max_requests: int = None
|
|
36
|
+
_max_requests_per_host: int = None
|
|
37
|
+
|
|
38
|
+
def __init__(
|
|
39
|
+
self,
|
|
40
|
+
config: mdp_models.Config,
|
|
41
|
+
):
|
|
42
|
+
"""
|
|
43
|
+
Init client with Config
|
|
44
|
+
@param config: config contains the necessary information to create a client
|
|
45
|
+
"""
|
|
46
|
+
if UtilClient.is_unset(config):
|
|
47
|
+
raise TeaException({
|
|
48
|
+
'code': 'ParameterMissing',
|
|
49
|
+
'message': "'config' can not be unset"
|
|
50
|
+
})
|
|
51
|
+
self._access_key_id = config.access_key_id
|
|
52
|
+
self._access_key_secret = config.access_key_secret
|
|
53
|
+
self._security_token = config.security_token
|
|
54
|
+
self._endpoint = config.endpoint
|
|
55
|
+
self._protocol = config.protocol
|
|
56
|
+
self._user_agent = config.user_agent
|
|
57
|
+
self._read_timeout = UtilClient.default_number(config.read_timeout, 20000)
|
|
58
|
+
self._connect_timeout = UtilClient.default_number(config.connect_timeout, 20000)
|
|
59
|
+
self._http_proxy = config.http_proxy
|
|
60
|
+
self._https_proxy = config.https_proxy
|
|
61
|
+
self._no_proxy = config.no_proxy
|
|
62
|
+
self._socks_5proxy = config.socks_5proxy
|
|
63
|
+
self._socks_5net_work = config.socks_5net_work
|
|
64
|
+
self._max_idle_conns = UtilClient.default_number(config.max_idle_conns, 60000)
|
|
65
|
+
self._max_idle_time_millis = UtilClient.default_number(config.max_idle_time_millis, 5)
|
|
66
|
+
self._keep_alive_duration_millis = UtilClient.default_number(config.keep_alive_duration_millis, 5000)
|
|
67
|
+
self._max_requests = UtilClient.default_number(config.max_requests, 100)
|
|
68
|
+
self._max_requests_per_host = UtilClient.default_number(config.max_requests_per_host, 100)
|
|
69
|
+
|
|
70
|
+
def do_request(
|
|
71
|
+
self,
|
|
72
|
+
version: str,
|
|
73
|
+
action: str,
|
|
74
|
+
protocol: str,
|
|
75
|
+
method: str,
|
|
76
|
+
pathname: str,
|
|
77
|
+
request: dict,
|
|
78
|
+
headers: Dict[str, str],
|
|
79
|
+
runtime: util_models.RuntimeOptions,
|
|
80
|
+
) -> dict:
|
|
81
|
+
"""
|
|
82
|
+
Encapsulate the request and invoke the network
|
|
83
|
+
@param action: api name
|
|
84
|
+
@param protocol: http or https
|
|
85
|
+
@param method: e.g. GET
|
|
86
|
+
@param pathname: pathname of every api
|
|
87
|
+
@param request: which contains request params
|
|
88
|
+
@param runtime: which controls some details of call api, such as retry times
|
|
89
|
+
@return: the response
|
|
90
|
+
"""
|
|
91
|
+
runtime.validate()
|
|
92
|
+
_runtime = {
|
|
93
|
+
'timeouted': 'retry',
|
|
94
|
+
'readTimeout': UtilClient.default_number(runtime.read_timeout, self._read_timeout),
|
|
95
|
+
'connectTimeout': UtilClient.default_number(runtime.connect_timeout, self._connect_timeout),
|
|
96
|
+
'httpProxy': UtilClient.default_string(runtime.http_proxy, self._http_proxy),
|
|
97
|
+
'httpsProxy': UtilClient.default_string(runtime.https_proxy, self._https_proxy),
|
|
98
|
+
'noProxy': UtilClient.default_string(runtime.no_proxy, self._no_proxy),
|
|
99
|
+
'maxIdleConns': UtilClient.default_number(runtime.max_idle_conns, self._max_idle_conns),
|
|
100
|
+
'maxIdleTimeMillis': self._max_idle_time_millis,
|
|
101
|
+
'keepAliveDuration': self._keep_alive_duration_millis,
|
|
102
|
+
'maxRequests': self._max_requests,
|
|
103
|
+
'maxRequestsPerHost': self._max_requests_per_host,
|
|
104
|
+
'retry': {
|
|
105
|
+
'retryable': runtime.autoretry,
|
|
106
|
+
'maxAttempts': UtilClient.default_number(runtime.max_attempts, 3)
|
|
107
|
+
},
|
|
108
|
+
'backoff': {
|
|
109
|
+
'policy': UtilClient.default_string(runtime.backoff_policy, 'no'),
|
|
110
|
+
'period': UtilClient.default_number(runtime.backoff_period, 1)
|
|
111
|
+
},
|
|
112
|
+
'ignoreSSL': runtime.ignore_ssl
|
|
113
|
+
}
|
|
114
|
+
_last_request = None
|
|
115
|
+
_last_exception = None
|
|
116
|
+
_now = time.time()
|
|
117
|
+
_retry_times = 0
|
|
118
|
+
while TeaCore.allow_retry(_runtime.get('retry'), _retry_times, _now):
|
|
119
|
+
if _retry_times > 0:
|
|
120
|
+
_backoff_time = TeaCore.get_backoff_time(_runtime.get('backoff'), _retry_times)
|
|
121
|
+
if _backoff_time > 0:
|
|
122
|
+
TeaCore.sleep(_backoff_time)
|
|
123
|
+
_retry_times = _retry_times + 1
|
|
124
|
+
try:
|
|
125
|
+
_request = TeaRequest()
|
|
126
|
+
_request.protocol = UtilClient.default_string(self._protocol, protocol)
|
|
127
|
+
_request.method = method
|
|
128
|
+
_request.pathname = pathname
|
|
129
|
+
_request.query = {
|
|
130
|
+
'method': action,
|
|
131
|
+
'version': version,
|
|
132
|
+
'sign_type': 'HmacSHA1',
|
|
133
|
+
'req_time': AntchainUtils.get_timestamp(),
|
|
134
|
+
'req_msg_id': AntchainUtils.get_nonce(),
|
|
135
|
+
'access_key': self._access_key_id,
|
|
136
|
+
'base_sdk_version': 'TeaSDK-2.0',
|
|
137
|
+
'sdk_version': '2.0.0',
|
|
138
|
+
'_prod_code': 'MDP',
|
|
139
|
+
'_prod_channel': 'default'
|
|
140
|
+
}
|
|
141
|
+
if not UtilClient.empty(self._security_token):
|
|
142
|
+
_request.query['security_token'] = self._security_token
|
|
143
|
+
_request.headers = TeaCore.merge({
|
|
144
|
+
'host': UtilClient.default_string(self._endpoint, 'openapi.antchain.antgroup.com'),
|
|
145
|
+
'user-agent': UtilClient.get_user_agent(self._user_agent)
|
|
146
|
+
}, headers)
|
|
147
|
+
tmp = UtilClient.anyify_map_value(RPCUtilClient.query(request))
|
|
148
|
+
_request.body = UtilClient.to_form_string(tmp)
|
|
149
|
+
_request.headers['content-type'] = 'application/x-www-form-urlencoded'
|
|
150
|
+
signed_param = TeaCore.merge(_request.query,
|
|
151
|
+
RPCUtilClient.query(request))
|
|
152
|
+
_request.query['sign'] = AntchainUtils.get_signature(signed_param, self._access_key_secret)
|
|
153
|
+
_last_request = _request
|
|
154
|
+
_response = TeaCore.do_action(_request, _runtime)
|
|
155
|
+
raw = UtilClient.read_as_string(_response.body)
|
|
156
|
+
obj = UtilClient.parse_json(raw)
|
|
157
|
+
res = UtilClient.assert_as_map(obj)
|
|
158
|
+
resp = UtilClient.assert_as_map(res.get('response'))
|
|
159
|
+
if AntchainUtils.has_error(raw, self._access_key_secret):
|
|
160
|
+
raise TeaException({
|
|
161
|
+
'message': resp.get('result_msg'),
|
|
162
|
+
'data': resp,
|
|
163
|
+
'code': resp.get('result_code')
|
|
164
|
+
})
|
|
165
|
+
return resp
|
|
166
|
+
except Exception as e:
|
|
167
|
+
if TeaCore.is_retryable(e):
|
|
168
|
+
_last_exception = e
|
|
169
|
+
continue
|
|
170
|
+
raise e
|
|
171
|
+
raise UnretryableException(_last_request, _last_exception)
|
|
172
|
+
|
|
173
|
+
async def do_request_async(
|
|
174
|
+
self,
|
|
175
|
+
version: str,
|
|
176
|
+
action: str,
|
|
177
|
+
protocol: str,
|
|
178
|
+
method: str,
|
|
179
|
+
pathname: str,
|
|
180
|
+
request: dict,
|
|
181
|
+
headers: Dict[str, str],
|
|
182
|
+
runtime: util_models.RuntimeOptions,
|
|
183
|
+
) -> dict:
|
|
184
|
+
"""
|
|
185
|
+
Encapsulate the request and invoke the network
|
|
186
|
+
@param action: api name
|
|
187
|
+
@param protocol: http or https
|
|
188
|
+
@param method: e.g. GET
|
|
189
|
+
@param pathname: pathname of every api
|
|
190
|
+
@param request: which contains request params
|
|
191
|
+
@param runtime: which controls some details of call api, such as retry times
|
|
192
|
+
@return: the response
|
|
193
|
+
"""
|
|
194
|
+
runtime.validate()
|
|
195
|
+
_runtime = {
|
|
196
|
+
'timeouted': 'retry',
|
|
197
|
+
'readTimeout': UtilClient.default_number(runtime.read_timeout, self._read_timeout),
|
|
198
|
+
'connectTimeout': UtilClient.default_number(runtime.connect_timeout, self._connect_timeout),
|
|
199
|
+
'httpProxy': UtilClient.default_string(runtime.http_proxy, self._http_proxy),
|
|
200
|
+
'httpsProxy': UtilClient.default_string(runtime.https_proxy, self._https_proxy),
|
|
201
|
+
'noProxy': UtilClient.default_string(runtime.no_proxy, self._no_proxy),
|
|
202
|
+
'maxIdleConns': UtilClient.default_number(runtime.max_idle_conns, self._max_idle_conns),
|
|
203
|
+
'maxIdleTimeMillis': self._max_idle_time_millis,
|
|
204
|
+
'keepAliveDuration': self._keep_alive_duration_millis,
|
|
205
|
+
'maxRequests': self._max_requests,
|
|
206
|
+
'maxRequestsPerHost': self._max_requests_per_host,
|
|
207
|
+
'retry': {
|
|
208
|
+
'retryable': runtime.autoretry,
|
|
209
|
+
'maxAttempts': UtilClient.default_number(runtime.max_attempts, 3)
|
|
210
|
+
},
|
|
211
|
+
'backoff': {
|
|
212
|
+
'policy': UtilClient.default_string(runtime.backoff_policy, 'no'),
|
|
213
|
+
'period': UtilClient.default_number(runtime.backoff_period, 1)
|
|
214
|
+
},
|
|
215
|
+
'ignoreSSL': runtime.ignore_ssl
|
|
216
|
+
}
|
|
217
|
+
_last_request = None
|
|
218
|
+
_last_exception = None
|
|
219
|
+
_now = time.time()
|
|
220
|
+
_retry_times = 0
|
|
221
|
+
while TeaCore.allow_retry(_runtime.get('retry'), _retry_times, _now):
|
|
222
|
+
if _retry_times > 0:
|
|
223
|
+
_backoff_time = TeaCore.get_backoff_time(_runtime.get('backoff'), _retry_times)
|
|
224
|
+
if _backoff_time > 0:
|
|
225
|
+
TeaCore.sleep(_backoff_time)
|
|
226
|
+
_retry_times = _retry_times + 1
|
|
227
|
+
try:
|
|
228
|
+
_request = TeaRequest()
|
|
229
|
+
_request.protocol = UtilClient.default_string(self._protocol, protocol)
|
|
230
|
+
_request.method = method
|
|
231
|
+
_request.pathname = pathname
|
|
232
|
+
_request.query = {
|
|
233
|
+
'method': action,
|
|
234
|
+
'version': version,
|
|
235
|
+
'sign_type': 'HmacSHA1',
|
|
236
|
+
'req_time': AntchainUtils.get_timestamp(),
|
|
237
|
+
'req_msg_id': AntchainUtils.get_nonce(),
|
|
238
|
+
'access_key': self._access_key_id,
|
|
239
|
+
'base_sdk_version': 'TeaSDK-2.0',
|
|
240
|
+
'sdk_version': '2.0.0',
|
|
241
|
+
'_prod_code': 'MDP',
|
|
242
|
+
'_prod_channel': 'default'
|
|
243
|
+
}
|
|
244
|
+
if not UtilClient.empty(self._security_token):
|
|
245
|
+
_request.query['security_token'] = self._security_token
|
|
246
|
+
_request.headers = TeaCore.merge({
|
|
247
|
+
'host': UtilClient.default_string(self._endpoint, 'openapi.antchain.antgroup.com'),
|
|
248
|
+
'user-agent': UtilClient.get_user_agent(self._user_agent)
|
|
249
|
+
}, headers)
|
|
250
|
+
tmp = UtilClient.anyify_map_value(RPCUtilClient.query(request))
|
|
251
|
+
_request.body = UtilClient.to_form_string(tmp)
|
|
252
|
+
_request.headers['content-type'] = 'application/x-www-form-urlencoded'
|
|
253
|
+
signed_param = TeaCore.merge(_request.query,
|
|
254
|
+
RPCUtilClient.query(request))
|
|
255
|
+
_request.query['sign'] = AntchainUtils.get_signature(signed_param, self._access_key_secret)
|
|
256
|
+
_last_request = _request
|
|
257
|
+
_response = await TeaCore.async_do_action(_request, _runtime)
|
|
258
|
+
raw = await UtilClient.read_as_string_async(_response.body)
|
|
259
|
+
obj = UtilClient.parse_json(raw)
|
|
260
|
+
res = UtilClient.assert_as_map(obj)
|
|
261
|
+
resp = UtilClient.assert_as_map(res.get('response'))
|
|
262
|
+
if AntchainUtils.has_error(raw, self._access_key_secret):
|
|
263
|
+
raise TeaException({
|
|
264
|
+
'message': resp.get('result_msg'),
|
|
265
|
+
'data': resp,
|
|
266
|
+
'code': resp.get('result_code')
|
|
267
|
+
})
|
|
268
|
+
return resp
|
|
269
|
+
except Exception as e:
|
|
270
|
+
if TeaCore.is_retryable(e):
|
|
271
|
+
_last_exception = e
|
|
272
|
+
continue
|
|
273
|
+
raise e
|
|
274
|
+
raise UnretryableException(_last_request, _last_exception)
|
|
275
|
+
|
|
276
|
+
def getuserscore(
|
|
277
|
+
self,
|
|
278
|
+
request: mdp_models.GetuserscoreRequest,
|
|
279
|
+
) -> mdp_models.GetuserscoreResponse:
|
|
280
|
+
"""
|
|
281
|
+
Description: 依据 modelid 和 userid,查询用户分数
|
|
282
|
+
Summary: 依据 modelid 和 userid,查询用户分数
|
|
283
|
+
"""
|
|
284
|
+
runtime = util_models.RuntimeOptions()
|
|
285
|
+
headers = {}
|
|
286
|
+
return self.getuserscore_ex(request, headers, runtime)
|
|
287
|
+
|
|
288
|
+
async def getuserscore_async(
|
|
289
|
+
self,
|
|
290
|
+
request: mdp_models.GetuserscoreRequest,
|
|
291
|
+
) -> mdp_models.GetuserscoreResponse:
|
|
292
|
+
"""
|
|
293
|
+
Description: 依据 modelid 和 userid,查询用户分数
|
|
294
|
+
Summary: 依据 modelid 和 userid,查询用户分数
|
|
295
|
+
"""
|
|
296
|
+
runtime = util_models.RuntimeOptions()
|
|
297
|
+
headers = {}
|
|
298
|
+
return await self.getuserscore_ex_async(request, headers, runtime)
|
|
299
|
+
|
|
300
|
+
def getuserscore_ex(
|
|
301
|
+
self,
|
|
302
|
+
request: mdp_models.GetuserscoreRequest,
|
|
303
|
+
headers: Dict[str, str],
|
|
304
|
+
runtime: util_models.RuntimeOptions,
|
|
305
|
+
) -> mdp_models.GetuserscoreResponse:
|
|
306
|
+
"""
|
|
307
|
+
Description: 依据 modelid 和 userid,查询用户分数
|
|
308
|
+
Summary: 依据 modelid 和 userid,查询用户分数
|
|
309
|
+
"""
|
|
310
|
+
UtilClient.validate_model(request)
|
|
311
|
+
return TeaCore.from_map(
|
|
312
|
+
mdp_models.GetuserscoreResponse(),
|
|
313
|
+
self.do_request('1.0', 'antdigital.mdp.getuserscore', 'HTTPS', 'POST', f'/gateway.do', TeaCore.to_map(request), headers, runtime)
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
async def getuserscore_ex_async(
|
|
317
|
+
self,
|
|
318
|
+
request: mdp_models.GetuserscoreRequest,
|
|
319
|
+
headers: Dict[str, str],
|
|
320
|
+
runtime: util_models.RuntimeOptions,
|
|
321
|
+
) -> mdp_models.GetuserscoreResponse:
|
|
322
|
+
"""
|
|
323
|
+
Description: 依据 modelid 和 userid,查询用户分数
|
|
324
|
+
Summary: 依据 modelid 和 userid,查询用户分数
|
|
325
|
+
"""
|
|
326
|
+
UtilClient.validate_model(request)
|
|
327
|
+
return TeaCore.from_map(
|
|
328
|
+
mdp_models.GetuserscoreResponse(),
|
|
329
|
+
await self.do_request_async('1.0', 'antdigital.mdp.getuserscore', 'HTTPS', 'POST', f'/gateway.do', TeaCore.to_map(request), headers, runtime)
|
|
330
|
+
)
|
|
331
|
+
|
|
332
|
+
def queryscore(
|
|
333
|
+
self,
|
|
334
|
+
request: mdp_models.QueryscoreRequest,
|
|
335
|
+
) -> mdp_models.QueryscoreResponse:
|
|
336
|
+
"""
|
|
337
|
+
Description: 依据 model_id 和 user_id,查询用户分数
|
|
338
|
+
Summary: 依据 model_id 和 user_id,查询用户分数
|
|
339
|
+
"""
|
|
340
|
+
runtime = util_models.RuntimeOptions()
|
|
341
|
+
headers = {}
|
|
342
|
+
return self.queryscore_ex(request, headers, runtime)
|
|
343
|
+
|
|
344
|
+
async def queryscore_async(
|
|
345
|
+
self,
|
|
346
|
+
request: mdp_models.QueryscoreRequest,
|
|
347
|
+
) -> mdp_models.QueryscoreResponse:
|
|
348
|
+
"""
|
|
349
|
+
Description: 依据 model_id 和 user_id,查询用户分数
|
|
350
|
+
Summary: 依据 model_id 和 user_id,查询用户分数
|
|
351
|
+
"""
|
|
352
|
+
runtime = util_models.RuntimeOptions()
|
|
353
|
+
headers = {}
|
|
354
|
+
return await self.queryscore_ex_async(request, headers, runtime)
|
|
355
|
+
|
|
356
|
+
def queryscore_ex(
|
|
357
|
+
self,
|
|
358
|
+
request: mdp_models.QueryscoreRequest,
|
|
359
|
+
headers: Dict[str, str],
|
|
360
|
+
runtime: util_models.RuntimeOptions,
|
|
361
|
+
) -> mdp_models.QueryscoreResponse:
|
|
362
|
+
"""
|
|
363
|
+
Description: 依据 model_id 和 user_id,查询用户分数
|
|
364
|
+
Summary: 依据 model_id 和 user_id,查询用户分数
|
|
365
|
+
"""
|
|
366
|
+
UtilClient.validate_model(request)
|
|
367
|
+
return TeaCore.from_map(
|
|
368
|
+
mdp_models.QueryscoreResponse(),
|
|
369
|
+
self.do_request('1.0', 'antdigital.mdp.queryscore', 'HTTPS', 'POST', f'/gateway.do', TeaCore.to_map(request), headers, runtime)
|
|
370
|
+
)
|
|
371
|
+
|
|
372
|
+
async def queryscore_ex_async(
|
|
373
|
+
self,
|
|
374
|
+
request: mdp_models.QueryscoreRequest,
|
|
375
|
+
headers: Dict[str, str],
|
|
376
|
+
runtime: util_models.RuntimeOptions,
|
|
377
|
+
) -> mdp_models.QueryscoreResponse:
|
|
378
|
+
"""
|
|
379
|
+
Description: 依据 model_id 和 user_id,查询用户分数
|
|
380
|
+
Summary: 依据 model_id 和 user_id,查询用户分数
|
|
381
|
+
"""
|
|
382
|
+
UtilClient.validate_model(request)
|
|
383
|
+
return TeaCore.from_map(
|
|
384
|
+
mdp_models.QueryscoreResponse(),
|
|
385
|
+
await self.do_request_async('1.0', 'antdigital.mdp.queryscore', 'HTTPS', 'POST', f'/gateway.do', TeaCore.to_map(request), headers, runtime)
|
|
386
|
+
)
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# This file is auto-generated, don't edit it. Thanks.
|
|
3
|
+
from Tea.model import TeaModel
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Config(TeaModel):
|
|
7
|
+
"""
|
|
8
|
+
Model for initing client
|
|
9
|
+
"""
|
|
10
|
+
def __init__(
|
|
11
|
+
self,
|
|
12
|
+
access_key_id: str = None,
|
|
13
|
+
access_key_secret: str = None,
|
|
14
|
+
security_token: str = None,
|
|
15
|
+
protocol: str = None,
|
|
16
|
+
read_timeout: int = None,
|
|
17
|
+
connect_timeout: int = None,
|
|
18
|
+
http_proxy: str = None,
|
|
19
|
+
https_proxy: str = None,
|
|
20
|
+
endpoint: str = None,
|
|
21
|
+
no_proxy: str = None,
|
|
22
|
+
max_idle_conns: int = None,
|
|
23
|
+
user_agent: str = None,
|
|
24
|
+
socks_5proxy: str = None,
|
|
25
|
+
socks_5net_work: str = None,
|
|
26
|
+
max_idle_time_millis: int = None,
|
|
27
|
+
keep_alive_duration_millis: int = None,
|
|
28
|
+
max_requests: int = None,
|
|
29
|
+
max_requests_per_host: int = None,
|
|
30
|
+
):
|
|
31
|
+
# accesskey id
|
|
32
|
+
self.access_key_id = access_key_id
|
|
33
|
+
# accesskey secret
|
|
34
|
+
self.access_key_secret = access_key_secret
|
|
35
|
+
# security token
|
|
36
|
+
self.security_token = security_token
|
|
37
|
+
# http protocol
|
|
38
|
+
self.protocol = protocol
|
|
39
|
+
# read timeout
|
|
40
|
+
self.read_timeout = read_timeout
|
|
41
|
+
# connect timeout
|
|
42
|
+
self.connect_timeout = connect_timeout
|
|
43
|
+
# http proxy
|
|
44
|
+
self.http_proxy = http_proxy
|
|
45
|
+
# https proxy
|
|
46
|
+
self.https_proxy = https_proxy
|
|
47
|
+
# endpoint
|
|
48
|
+
self.endpoint = endpoint
|
|
49
|
+
# proxy white list
|
|
50
|
+
self.no_proxy = no_proxy
|
|
51
|
+
# max idle conns
|
|
52
|
+
self.max_idle_conns = max_idle_conns
|
|
53
|
+
# user agent
|
|
54
|
+
self.user_agent = user_agent
|
|
55
|
+
# socks5 proxy
|
|
56
|
+
self.socks_5proxy = socks_5proxy
|
|
57
|
+
# socks5 network
|
|
58
|
+
self.socks_5net_work = socks_5net_work
|
|
59
|
+
# 长链接最大空闲时长
|
|
60
|
+
self.max_idle_time_millis = max_idle_time_millis
|
|
61
|
+
# 长链接最大连接时长
|
|
62
|
+
self.keep_alive_duration_millis = keep_alive_duration_millis
|
|
63
|
+
# 最大连接数(长链接最大总数)
|
|
64
|
+
self.max_requests = max_requests
|
|
65
|
+
# 每个目标主机的最大连接数(分主机域名的长链接最大总数
|
|
66
|
+
self.max_requests_per_host = max_requests_per_host
|
|
67
|
+
|
|
68
|
+
def validate(self):
|
|
69
|
+
pass
|
|
70
|
+
|
|
71
|
+
def to_map(self):
|
|
72
|
+
_map = super().to_map()
|
|
73
|
+
if _map is not None:
|
|
74
|
+
return _map
|
|
75
|
+
|
|
76
|
+
result = dict()
|
|
77
|
+
if self.access_key_id is not None:
|
|
78
|
+
result['accessKeyId'] = self.access_key_id
|
|
79
|
+
if self.access_key_secret is not None:
|
|
80
|
+
result['accessKeySecret'] = self.access_key_secret
|
|
81
|
+
if self.security_token is not None:
|
|
82
|
+
result['securityToken'] = self.security_token
|
|
83
|
+
if self.protocol is not None:
|
|
84
|
+
result['protocol'] = self.protocol
|
|
85
|
+
if self.read_timeout is not None:
|
|
86
|
+
result['readTimeout'] = self.read_timeout
|
|
87
|
+
if self.connect_timeout is not None:
|
|
88
|
+
result['connectTimeout'] = self.connect_timeout
|
|
89
|
+
if self.http_proxy is not None:
|
|
90
|
+
result['httpProxy'] = self.http_proxy
|
|
91
|
+
if self.https_proxy is not None:
|
|
92
|
+
result['httpsProxy'] = self.https_proxy
|
|
93
|
+
if self.endpoint is not None:
|
|
94
|
+
result['endpoint'] = self.endpoint
|
|
95
|
+
if self.no_proxy is not None:
|
|
96
|
+
result['noProxy'] = self.no_proxy
|
|
97
|
+
if self.max_idle_conns is not None:
|
|
98
|
+
result['maxIdleConns'] = self.max_idle_conns
|
|
99
|
+
if self.user_agent is not None:
|
|
100
|
+
result['userAgent'] = self.user_agent
|
|
101
|
+
if self.socks_5proxy is not None:
|
|
102
|
+
result['socks5Proxy'] = self.socks_5proxy
|
|
103
|
+
if self.socks_5net_work is not None:
|
|
104
|
+
result['socks5NetWork'] = self.socks_5net_work
|
|
105
|
+
if self.max_idle_time_millis is not None:
|
|
106
|
+
result['maxIdleTimeMillis'] = self.max_idle_time_millis
|
|
107
|
+
if self.keep_alive_duration_millis is not None:
|
|
108
|
+
result['keepAliveDurationMillis'] = self.keep_alive_duration_millis
|
|
109
|
+
if self.max_requests is not None:
|
|
110
|
+
result['maxRequests'] = self.max_requests
|
|
111
|
+
if self.max_requests_per_host is not None:
|
|
112
|
+
result['maxRequestsPerHost'] = self.max_requests_per_host
|
|
113
|
+
return result
|
|
114
|
+
|
|
115
|
+
def from_map(self, m: dict = None):
|
|
116
|
+
m = m or dict()
|
|
117
|
+
if m.get('accessKeyId') is not None:
|
|
118
|
+
self.access_key_id = m.get('accessKeyId')
|
|
119
|
+
if m.get('accessKeySecret') is not None:
|
|
120
|
+
self.access_key_secret = m.get('accessKeySecret')
|
|
121
|
+
if m.get('securityToken') is not None:
|
|
122
|
+
self.security_token = m.get('securityToken')
|
|
123
|
+
if m.get('protocol') is not None:
|
|
124
|
+
self.protocol = m.get('protocol')
|
|
125
|
+
if m.get('readTimeout') is not None:
|
|
126
|
+
self.read_timeout = m.get('readTimeout')
|
|
127
|
+
if m.get('connectTimeout') is not None:
|
|
128
|
+
self.connect_timeout = m.get('connectTimeout')
|
|
129
|
+
if m.get('httpProxy') is not None:
|
|
130
|
+
self.http_proxy = m.get('httpProxy')
|
|
131
|
+
if m.get('httpsProxy') is not None:
|
|
132
|
+
self.https_proxy = m.get('httpsProxy')
|
|
133
|
+
if m.get('endpoint') is not None:
|
|
134
|
+
self.endpoint = m.get('endpoint')
|
|
135
|
+
if m.get('noProxy') is not None:
|
|
136
|
+
self.no_proxy = m.get('noProxy')
|
|
137
|
+
if m.get('maxIdleConns') is not None:
|
|
138
|
+
self.max_idle_conns = m.get('maxIdleConns')
|
|
139
|
+
if m.get('userAgent') is not None:
|
|
140
|
+
self.user_agent = m.get('userAgent')
|
|
141
|
+
if m.get('socks5Proxy') is not None:
|
|
142
|
+
self.socks_5proxy = m.get('socks5Proxy')
|
|
143
|
+
if m.get('socks5NetWork') is not None:
|
|
144
|
+
self.socks_5net_work = m.get('socks5NetWork')
|
|
145
|
+
if m.get('maxIdleTimeMillis') is not None:
|
|
146
|
+
self.max_idle_time_millis = m.get('maxIdleTimeMillis')
|
|
147
|
+
if m.get('keepAliveDurationMillis') is not None:
|
|
148
|
+
self.keep_alive_duration_millis = m.get('keepAliveDurationMillis')
|
|
149
|
+
if m.get('maxRequests') is not None:
|
|
150
|
+
self.max_requests = m.get('maxRequests')
|
|
151
|
+
if m.get('maxRequestsPerHost') is not None:
|
|
152
|
+
self.max_requests_per_host = m.get('maxRequestsPerHost')
|
|
153
|
+
return self
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
class GetuserscoreRequest(TeaModel):
|
|
157
|
+
def __init__(
|
|
158
|
+
self,
|
|
159
|
+
auth_token: str = None,
|
|
160
|
+
product_instance_id: str = None,
|
|
161
|
+
model_id: str = None,
|
|
162
|
+
mobile_md_5: str = None,
|
|
163
|
+
):
|
|
164
|
+
# OAuth模式下的授权token
|
|
165
|
+
self.auth_token = auth_token
|
|
166
|
+
self.product_instance_id = product_instance_id
|
|
167
|
+
# 采用哪一个模型进行推理
|
|
168
|
+
self.model_id = model_id
|
|
169
|
+
# 手机号的 md5 值
|
|
170
|
+
self.mobile_md_5 = mobile_md_5
|
|
171
|
+
|
|
172
|
+
def validate(self):
|
|
173
|
+
self.validate_required(self.model_id, 'model_id')
|
|
174
|
+
self.validate_required(self.mobile_md_5, 'mobile_md_5')
|
|
175
|
+
|
|
176
|
+
def to_map(self):
|
|
177
|
+
_map = super().to_map()
|
|
178
|
+
if _map is not None:
|
|
179
|
+
return _map
|
|
180
|
+
|
|
181
|
+
result = dict()
|
|
182
|
+
if self.auth_token is not None:
|
|
183
|
+
result['auth_token'] = self.auth_token
|
|
184
|
+
if self.product_instance_id is not None:
|
|
185
|
+
result['product_instance_id'] = self.product_instance_id
|
|
186
|
+
if self.model_id is not None:
|
|
187
|
+
result['model_id'] = self.model_id
|
|
188
|
+
if self.mobile_md_5 is not None:
|
|
189
|
+
result['mobile_md5'] = self.mobile_md_5
|
|
190
|
+
return result
|
|
191
|
+
|
|
192
|
+
def from_map(self, m: dict = None):
|
|
193
|
+
m = m or dict()
|
|
194
|
+
if m.get('auth_token') is not None:
|
|
195
|
+
self.auth_token = m.get('auth_token')
|
|
196
|
+
if m.get('product_instance_id') is not None:
|
|
197
|
+
self.product_instance_id = m.get('product_instance_id')
|
|
198
|
+
if m.get('model_id') is not None:
|
|
199
|
+
self.model_id = m.get('model_id')
|
|
200
|
+
if m.get('mobile_md5') is not None:
|
|
201
|
+
self.mobile_md_5 = m.get('mobile_md5')
|
|
202
|
+
return self
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
class GetuserscoreResponse(TeaModel):
|
|
206
|
+
def __init__(
|
|
207
|
+
self,
|
|
208
|
+
req_msg_id: str = None,
|
|
209
|
+
result_code: str = None,
|
|
210
|
+
result_msg: str = None,
|
|
211
|
+
score: int = None,
|
|
212
|
+
):
|
|
213
|
+
# 请求唯一ID,用于链路跟踪和问题排查
|
|
214
|
+
self.req_msg_id = req_msg_id
|
|
215
|
+
# 结果码,一般OK表示调用成功
|
|
216
|
+
self.result_code = result_code
|
|
217
|
+
# 异常信息的文本描述
|
|
218
|
+
self.result_msg = result_msg
|
|
219
|
+
# 预测分数值
|
|
220
|
+
self.score = score
|
|
221
|
+
|
|
222
|
+
def validate(self):
|
|
223
|
+
pass
|
|
224
|
+
|
|
225
|
+
def to_map(self):
|
|
226
|
+
_map = super().to_map()
|
|
227
|
+
if _map is not None:
|
|
228
|
+
return _map
|
|
229
|
+
|
|
230
|
+
result = dict()
|
|
231
|
+
if self.req_msg_id is not None:
|
|
232
|
+
result['req_msg_id'] = self.req_msg_id
|
|
233
|
+
if self.result_code is not None:
|
|
234
|
+
result['result_code'] = self.result_code
|
|
235
|
+
if self.result_msg is not None:
|
|
236
|
+
result['result_msg'] = self.result_msg
|
|
237
|
+
if self.score is not None:
|
|
238
|
+
result['score'] = self.score
|
|
239
|
+
return result
|
|
240
|
+
|
|
241
|
+
def from_map(self, m: dict = None):
|
|
242
|
+
m = m or dict()
|
|
243
|
+
if m.get('req_msg_id') is not None:
|
|
244
|
+
self.req_msg_id = m.get('req_msg_id')
|
|
245
|
+
if m.get('result_code') is not None:
|
|
246
|
+
self.result_code = m.get('result_code')
|
|
247
|
+
if m.get('result_msg') is not None:
|
|
248
|
+
self.result_msg = m.get('result_msg')
|
|
249
|
+
if m.get('score') is not None:
|
|
250
|
+
self.score = m.get('score')
|
|
251
|
+
return self
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
class QueryscoreRequest(TeaModel):
|
|
255
|
+
def __init__(
|
|
256
|
+
self,
|
|
257
|
+
auth_token: str = None,
|
|
258
|
+
product_instance_id: str = None,
|
|
259
|
+
model_id: str = None,
|
|
260
|
+
mobile_md_5: str = None,
|
|
261
|
+
):
|
|
262
|
+
# OAuth模式下的授权token
|
|
263
|
+
self.auth_token = auth_token
|
|
264
|
+
self.product_instance_id = product_instance_id
|
|
265
|
+
# 模型 id
|
|
266
|
+
self.model_id = model_id
|
|
267
|
+
# 手机号 md5
|
|
268
|
+
self.mobile_md_5 = mobile_md_5
|
|
269
|
+
|
|
270
|
+
def validate(self):
|
|
271
|
+
self.validate_required(self.model_id, 'model_id')
|
|
272
|
+
self.validate_required(self.mobile_md_5, 'mobile_md_5')
|
|
273
|
+
|
|
274
|
+
def to_map(self):
|
|
275
|
+
_map = super().to_map()
|
|
276
|
+
if _map is not None:
|
|
277
|
+
return _map
|
|
278
|
+
|
|
279
|
+
result = dict()
|
|
280
|
+
if self.auth_token is not None:
|
|
281
|
+
result['auth_token'] = self.auth_token
|
|
282
|
+
if self.product_instance_id is not None:
|
|
283
|
+
result['product_instance_id'] = self.product_instance_id
|
|
284
|
+
if self.model_id is not None:
|
|
285
|
+
result['model_id'] = self.model_id
|
|
286
|
+
if self.mobile_md_5 is not None:
|
|
287
|
+
result['mobile_md5'] = self.mobile_md_5
|
|
288
|
+
return result
|
|
289
|
+
|
|
290
|
+
def from_map(self, m: dict = None):
|
|
291
|
+
m = m or dict()
|
|
292
|
+
if m.get('auth_token') is not None:
|
|
293
|
+
self.auth_token = m.get('auth_token')
|
|
294
|
+
if m.get('product_instance_id') is not None:
|
|
295
|
+
self.product_instance_id = m.get('product_instance_id')
|
|
296
|
+
if m.get('model_id') is not None:
|
|
297
|
+
self.model_id = m.get('model_id')
|
|
298
|
+
if m.get('mobile_md5') is not None:
|
|
299
|
+
self.mobile_md_5 = m.get('mobile_md5')
|
|
300
|
+
return self
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
class QueryscoreResponse(TeaModel):
|
|
304
|
+
def __init__(
|
|
305
|
+
self,
|
|
306
|
+
req_msg_id: str = None,
|
|
307
|
+
result_code: str = None,
|
|
308
|
+
result_msg: str = None,
|
|
309
|
+
score: int = None,
|
|
310
|
+
):
|
|
311
|
+
# 请求唯一ID,用于链路跟踪和问题排查
|
|
312
|
+
self.req_msg_id = req_msg_id
|
|
313
|
+
# 结果码,一般OK表示调用成功
|
|
314
|
+
self.result_code = result_code
|
|
315
|
+
# 异常信息的文本描述
|
|
316
|
+
self.result_msg = result_msg
|
|
317
|
+
# 分数
|
|
318
|
+
self.score = score
|
|
319
|
+
|
|
320
|
+
def validate(self):
|
|
321
|
+
pass
|
|
322
|
+
|
|
323
|
+
def to_map(self):
|
|
324
|
+
_map = super().to_map()
|
|
325
|
+
if _map is not None:
|
|
326
|
+
return _map
|
|
327
|
+
|
|
328
|
+
result = dict()
|
|
329
|
+
if self.req_msg_id is not None:
|
|
330
|
+
result['req_msg_id'] = self.req_msg_id
|
|
331
|
+
if self.result_code is not None:
|
|
332
|
+
result['result_code'] = self.result_code
|
|
333
|
+
if self.result_msg is not None:
|
|
334
|
+
result['result_msg'] = self.result_msg
|
|
335
|
+
if self.score is not None:
|
|
336
|
+
result['score'] = self.score
|
|
337
|
+
return result
|
|
338
|
+
|
|
339
|
+
def from_map(self, m: dict = None):
|
|
340
|
+
m = m or dict()
|
|
341
|
+
if m.get('req_msg_id') is not None:
|
|
342
|
+
self.req_msg_id = m.get('req_msg_id')
|
|
343
|
+
if m.get('result_code') is not None:
|
|
344
|
+
self.result_code = m.get('result_code')
|
|
345
|
+
if m.get('result_msg') is not None:
|
|
346
|
+
self.result_msg = m.get('result_msg')
|
|
347
|
+
if m.get('score') is not None:
|
|
348
|
+
self.score = m.get('score')
|
|
349
|
+
return self
|
|
350
|
+
|
|
351
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
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 antchain_mdp.
|
|
26
|
+
|
|
27
|
+
Created on 22/05/2025
|
|
28
|
+
|
|
29
|
+
@author: Ant Chain SDK
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
PACKAGE = "antchain_sdk_mdp"
|
|
33
|
+
NAME = "antchain_mdp" or "alibabacloud-package"
|
|
34
|
+
DESCRIPTION = "Ant Chain MDP SDK Library for Python"
|
|
35
|
+
AUTHOR = "Ant Chain SDK"
|
|
36
|
+
AUTHOR_EMAIL = "sdk-team@alibabacloud.com"
|
|
37
|
+
URL = "https://github.com/alipay/antchain-openapi-prod-sdk"
|
|
38
|
+
VERSION = __import__(PACKAGE).__version__
|
|
39
|
+
REQUIRES = [
|
|
40
|
+
"antchain_alipay_util>=1.0.1, <2.0.0",
|
|
41
|
+
"alibabacloud_tea_util>=0.3.13, <1.0.0",
|
|
42
|
+
"alibabacloud_rpc_util>=0.0.4, <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=["antchain","mdp"],
|
|
61
|
+
packages=find_packages(exclude=["tests*"]),
|
|
62
|
+
include_package_data=True,
|
|
63
|
+
platforms="any",
|
|
64
|
+
install_requires=REQUIRES,
|
|
65
|
+
python_requires=">=3.6",
|
|
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.6",
|
|
73
|
+
'Programming Language :: Python :: 3.7',
|
|
74
|
+
'Programming Language :: Python :: 3.8',
|
|
75
|
+
'Programming Language :: Python :: 3.9',
|
|
76
|
+
"Topic :: Software Development"
|
|
77
|
+
)
|
|
78
|
+
)
|