/
acp_client.py
210 lines (174 loc) · 8.21 KB
/
acp_client.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import json
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.common.abstract_client import AbstractClient
from tencentcloud.acp.v20220105 import models
class AcpClient(AbstractClient):
_apiVersion = '2022-01-05'
_endpoint = 'acp.tencentcloudapi.com'
_service = 'acp'
def CreateAppScanTask(self, request):
"""创建应用合规隐私诊断任务
:param request: Request instance for CreateAppScanTask.
:type request: :class:`tencentcloud.acp.v20220105.models.CreateAppScanTaskRequest`
:rtype: :class:`tencentcloud.acp.v20220105.models.CreateAppScanTaskResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("CreateAppScanTask", params, headers=headers)
response = json.loads(body)
model = models.CreateAppScanTaskResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def CreateAppScanTaskRepeat(self, request):
"""App应用合规隐私诊断重试任务
:param request: Request instance for CreateAppScanTaskRepeat.
:type request: :class:`tencentcloud.acp.v20220105.models.CreateAppScanTaskRepeatRequest`
:rtype: :class:`tencentcloud.acp.v20220105.models.CreateAppScanTaskRepeatResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("CreateAppScanTaskRepeat", params, headers=headers)
response = json.loads(body)
model = models.CreateAppScanTaskRepeatResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeChannelTaskReportUrl(self, request):
"""获取子渠道的App合规诊断任务报告url
:param request: Request instance for DescribeChannelTaskReportUrl.
:type request: :class:`tencentcloud.acp.v20220105.models.DescribeChannelTaskReportUrlRequest`
:rtype: :class:`tencentcloud.acp.v20220105.models.DescribeChannelTaskReportUrlResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeChannelTaskReportUrl", params, headers=headers)
response = json.loads(body)
model = models.DescribeChannelTaskReportUrlResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeFileTicket(self, request):
"""获取应用合规文件上传凭证,用于上传诊断文件
:param request: Request instance for DescribeFileTicket.
:type request: :class:`tencentcloud.acp.v20220105.models.DescribeFileTicketRequest`
:rtype: :class:`tencentcloud.acp.v20220105.models.DescribeFileTicketResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeFileTicket", params, headers=headers)
response = json.loads(body)
model = models.DescribeFileTicketResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeResourceUsageInfo(self, request):
"""查询应用合规平台用户资源的使用情况
:param request: Request instance for DescribeResourceUsageInfo.
:type request: :class:`tencentcloud.acp.v20220105.models.DescribeResourceUsageInfoRequest`
:rtype: :class:`tencentcloud.acp.v20220105.models.DescribeResourceUsageInfoResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeResourceUsageInfo", params, headers=headers)
response = json.loads(body)
model = models.DescribeResourceUsageInfoResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeScanTaskList(self, request):
"""获取App隐私合规诊断任务列表
:param request: Request instance for DescribeScanTaskList.
:type request: :class:`tencentcloud.acp.v20220105.models.DescribeScanTaskListRequest`
:rtype: :class:`tencentcloud.acp.v20220105.models.DescribeScanTaskListResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeScanTaskList", params, headers=headers)
response = json.loads(body)
model = models.DescribeScanTaskListResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeScanTaskReportUrl(self, request):
"""获取App合规诊断任务报告url
:param request: Request instance for DescribeScanTaskReportUrl.
:type request: :class:`tencentcloud.acp.v20220105.models.DescribeScanTaskReportUrlRequest`
:rtype: :class:`tencentcloud.acp.v20220105.models.DescribeScanTaskReportUrlResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeScanTaskReportUrl", params, headers=headers)
response = json.loads(body)
model = models.DescribeScanTaskReportUrlResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))
def DescribeScanTaskStatus(self, request):
"""查询App隐私合规诊断任务状态
:param request: Request instance for DescribeScanTaskStatus.
:type request: :class:`tencentcloud.acp.v20220105.models.DescribeScanTaskStatusRequest`
:rtype: :class:`tencentcloud.acp.v20220105.models.DescribeScanTaskStatusResponse`
"""
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeScanTaskStatus", params, headers=headers)
response = json.loads(body)
model = models.DescribeScanTaskStatusResponse()
model._deserialize(response["Response"])
return model
except Exception as e:
if isinstance(e, TencentCloudSDKException):
raise
else:
raise TencentCloudSDKException(type(e).__name__, str(e))