第一次提交:阿龙电竞 Django 后端最新版本
This commit is contained in:
@@ -0,0 +1,198 @@
|
||||
# -*- coding: utf8 -*-
|
||||
# Copyright (c) 2017-2025 Tencent. 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.
|
||||
|
||||
|
||||
# CAM签名/鉴权错误。
|
||||
AUTHFAILURE = 'AuthFailure'
|
||||
|
||||
# 机构名称要求输入中英文或数字,不超过32个字符
|
||||
AUTHORITY_AUTHORITYNAMELENGTHLONG = 'Authority.AuthorityNameLengthLong'
|
||||
|
||||
# 认证备注要求输入中英文或数字,不超过64个字符
|
||||
AUTHORITY_AUTHORITYREMARKLENGTHLONG = 'Authority.AuthorityRemarkLengthLong'
|
||||
|
||||
# 该权威机构已被认证:<%ExtMsg%>
|
||||
AUTHORITY_ERRCODEAUTHORITYREGISTERED = 'Authority.ErrCodeAuthorityRegistered'
|
||||
|
||||
# 该DID已经认证为权威机构:<%ExtMsg%>
|
||||
AUTHORITY_ERRCODEDIDAUTHORITYREGISTERED = 'Authority.ErrCodeDidAuthorityRegistered'
|
||||
|
||||
# CAM鉴权失败
|
||||
CAM_INVALIDAUTH = 'Cam.InvalidAuth'
|
||||
|
||||
# 创建凭证模板失败,请重新操作
|
||||
CPT_CREATECPTFAILED = 'Cpt.CreateCPTFailed'
|
||||
|
||||
# 模板内容为无效的json格式
|
||||
CPT_INVALIDCPTJSON = 'Cpt.InvalidCPTJson'
|
||||
|
||||
# 凭证模板不存在
|
||||
CREDENTIAL_CPTNOTEXISTED = 'Credential.CPTNotExisted'
|
||||
|
||||
# 凭证过期:<%ExtMsg%>
|
||||
CREDENTIAL_CREDENTIALEXPIRED = 'Credential.CredentialExpired'
|
||||
|
||||
# 创建凭证表达失败
|
||||
CREDENTIAL_FAILEDCREATEPRESENTATION = 'Credential.FailedCreatePresentation'
|
||||
|
||||
# 生成证明承诺失败
|
||||
CREDENTIAL_GENERATECOMMITMENTFAILED = 'Credential.GenerateCommitmentFailed'
|
||||
|
||||
# 生成范围证明失败
|
||||
CREDENTIAL_GENERATERANGEPROOF = 'Credential.GenerateRangeProof'
|
||||
|
||||
# 凭证持有人DID不匹配,请确认后重新操作:<%ExtMsg%>
|
||||
CREDENTIAL_HOLDERDIDNOTMATCH = 'Credential.HolderDidNotMatch'
|
||||
|
||||
# 无效的凭证ID,请确认后重新操作:<%ExtMsg%>
|
||||
CREDENTIAL_INVALIDCRDLID = 'Credential.InvalidCRDLId'
|
||||
|
||||
# 无效的凭证颁发者,请确认后重新操作
|
||||
CREDENTIAL_INVALIDCRDLISSUER = 'Credential.InvalidCRDLIssuer'
|
||||
|
||||
# 无效的凭证声明,请确认声明格式:<%ExtMsg%>
|
||||
CREDENTIAL_INVALIDCLAIM = 'Credential.InvalidClaim'
|
||||
|
||||
# 无效的选择性披露策略,请确认后重新操作:<%ExtMsg%>
|
||||
CREDENTIAL_INVALIDDISCLOSUREPOLICY = 'Credential.InvalidDisclosurePolicy'
|
||||
|
||||
# 无效的操作类型声明,请确认后重新操作:<%ExtMsg%>
|
||||
CREDENTIAL_INVALIDOPERATECLAIM = 'Credential.InvalidOperateClaim'
|
||||
|
||||
# 无效请求参数,请确认参数格式:<%ExtMsg%>
|
||||
CREDENTIAL_INVALIDPARAS = 'Credential.InvalidParas'
|
||||
|
||||
# 无效的证明承诺
|
||||
CREDENTIAL_INVALIDPROOFCOMMITMENT = 'Credential.InvalidProofCommitment'
|
||||
|
||||
# 无效的证明值,证明值要求是无符号整形
|
||||
CREDENTIAL_INVALIDPROOFVALUE = 'Credential.InvalidProofValue'
|
||||
|
||||
# 无效的零知识证明内容
|
||||
CREDENTIAL_INVALIDZEROPROOF = 'Credential.InvalidZeroProof'
|
||||
|
||||
# 凭证颁发者DID不匹配,请确认后重新操作:<%ExtMsg%>
|
||||
CREDENTIAL_ISSUERDIDNOTMATCH = 'Credential.IssuerDidNotMatch'
|
||||
|
||||
# 凭证声明缺少ID字段,请确认后重新操作
|
||||
CREDENTIAL_NOIDINCLAIM = 'Credential.NoIdInClaim'
|
||||
|
||||
# 证明数值不存在
|
||||
CREDENTIAL_PROOFVALUENOTEXISTED = 'Credential.ProofValueNotExisted'
|
||||
|
||||
# 凭证验证失败:<%ExtMsg%>
|
||||
CREDENTIAL_VERIFYCRDLFAILED = 'Credential.VerifyCRDLFailed'
|
||||
|
||||
# 零知识证明验证失败
|
||||
CREDENTIAL_VERIFYZEROPROOFFAILED = 'Credential.VerifyZeroProofFailed'
|
||||
|
||||
# 数据库操作失败,请重新操作
|
||||
DATABASE_FAILEDOPERATION = 'DataBase.FailedOperation'
|
||||
|
||||
# 您无操作权限
|
||||
DID_PERMISSIONDENIED = 'Did.PermissionDenied'
|
||||
|
||||
# DID标识已存在
|
||||
DIDFAILEDOPERATION_DIDEXISTED = 'DidFailedOperation.DidExisted'
|
||||
|
||||
# DID标识不存在:<%ExtMsg%>
|
||||
DIDFAILEDOPERATION_DIDNOTEXISTED = 'DidFailedOperation.DidNotExisted'
|
||||
|
||||
# DID属性objectId已存在
|
||||
DIDFAILEDOPERATION_DIDOBJECTIDEXISTED = 'DidFailedOperation.DidObjectIdExisted'
|
||||
|
||||
# DID状态无效
|
||||
DIDFAILEDOPERATION_DIDSTATUSINVALID = 'DidFailedOperation.DidStatusInvalid'
|
||||
|
||||
# 用户尚未创建DID服务,请确认后重新操作
|
||||
DIDFAILEDOPERATION_DIDSVCNOTEXISTED = 'DidFailedOperation.DidSvcNotExisted'
|
||||
|
||||
# 获取DID文档失败,请重新操作
|
||||
DIDFAILEDOPERATION_GETDIDDOCFILED = 'DidFailedOperation.GetDidDocFiled'
|
||||
|
||||
# 非权威机构DID:<%ExtMsg%>
|
||||
DIDFAILEDOPERATION_NOTAUTHORITY = 'DidFailedOperation.NotAuthority'
|
||||
|
||||
# 非DID创建者,无法更新DID状态
|
||||
DIDFAILEDOPERATION_NOTDIDCREATOR = 'DidFailedOperation.NotDidCreator'
|
||||
|
||||
# DID私钥格式错误,请填写正确的DID私钥
|
||||
DIDFAILEDOPERATION_PRIVATEKEYINVALID = 'DidFailedOperation.PrivateKeyInvalid'
|
||||
|
||||
# DID公钥格式错误,请填写正确的DID公钥
|
||||
DIDFAILEDOPERATION_PUBLICKEYINVALID = 'DidFailedOperation.PublicKeyInvalid'
|
||||
|
||||
# DID服务请求错误,请稍后重试或联系客服
|
||||
DIDSDK_UNKNOWNERROR = 'DidSdk.UnknownError'
|
||||
|
||||
# 用户接口鉴权失败
|
||||
FAILEDOPERATION_INVALIDAUTH = 'FailedOperation.InvalidAuth'
|
||||
|
||||
# 无效的请求参数
|
||||
FAILEDOPERATION_INVALIDPARAMETERVALUE = 'FailedOperation.InvalidParameterValue'
|
||||
|
||||
# 操作失败。
|
||||
FAILEDOPERATION_OPERATIONEXCEPTION = 'FailedOperation.OperationException'
|
||||
|
||||
# 用户无接口访问权限
|
||||
FAILEDOPERATION_PERMISSIONDENIED = 'FailedOperation.PermissionDenied'
|
||||
|
||||
# HTTP请求创建失败,请稍后重试,或联系客服
|
||||
HTTPINVOKER_NEWQUESTERROR = 'HttpInvoker.NewQuestError'
|
||||
|
||||
# HTTP请求发送失败,请稍后重试,或联系客服
|
||||
HTTPINVOKER_SENDQUESTERROR = 'HttpInvoker.SendQuestError'
|
||||
|
||||
# 内部错误。
|
||||
INTERNALERROR = 'InternalError'
|
||||
|
||||
# API服务出错
|
||||
INTERNALERROR_APIUNKNOWNERROR = 'InternalError.ApiUnknownError'
|
||||
|
||||
# 服务器异常。
|
||||
INTERNALERROR_SERVEREXCEPTION = 'InternalError.ServerException'
|
||||
|
||||
# 服务已停止,请您检查当前是否有计费套餐包
|
||||
INTERNALERROR_SERVICEDISABLED = 'InternalError.ServiceDisabled'
|
||||
|
||||
# 服务错误,请稍后重试,或联系客服
|
||||
INTERNALERROR_SERVICEERROR = 'InternalError.ServiceError'
|
||||
|
||||
# 服务异常。
|
||||
INTERNALERROR_SERVICEPANIC = 'InternalError.ServicePanic'
|
||||
|
||||
# 服务错误,请稍后重试,或联系客服
|
||||
INTERNALERROR_UNKNOWNERROR = 'InternalError.UnknownError'
|
||||
|
||||
# 参数错误。
|
||||
INVALIDPARAMETER = 'InvalidParameter'
|
||||
|
||||
# 参数取值错误。
|
||||
INVALIDPARAMETERVALUE = 'InvalidParameterValue'
|
||||
|
||||
# 无效的时间格式,请确认后重新操作
|
||||
INVALIDPARAMETERVALUE_ILLEGALDATETIME = 'InvalidParameterValue.IllegalDateTime'
|
||||
|
||||
# 请求参数格式错误,请按照格式要求重新填写
|
||||
INVALIDPARAMETERVALUE_ILLEGALVALUE = 'InvalidParameterValue.IllegalValue'
|
||||
|
||||
# 用户请求资源未存在:<%ExtMsg%>
|
||||
INVALIDPARAMETERVALUE_RESOURCENOTEXISTED = 'InvalidParameterValue.ResourceNotExisted'
|
||||
|
||||
# 资源不存在。
|
||||
RESOURCENOTFOUND = 'ResourceNotFound'
|
||||
|
||||
# 操作不支持。
|
||||
UNSUPPORTEDOPERATION = 'UnsupportedOperation'
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,443 @@
|
||||
# -*- coding: utf8 -*-
|
||||
# Copyright (c) 2017-2025 Tencent. 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.tdid.v20210519 import models
|
||||
|
||||
|
||||
class TdidClient(AbstractClient):
|
||||
_apiVersion = '2021-05-19'
|
||||
_endpoint = 'tdid.tencentcloudapi.com'
|
||||
_service = 'tdid'
|
||||
|
||||
|
||||
def CreateDisclosedCredential(self, request):
|
||||
r"""根据披露策略创建选择性披露凭证
|
||||
|
||||
:param request: Request instance for CreateDisclosedCredential.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.CreateDisclosedCredentialRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.CreateDisclosedCredentialResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("CreateDisclosedCredential", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.CreateDisclosedCredentialResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def CreatePresentation(self, request):
|
||||
r"""创建凭证持有人的可验证表达
|
||||
|
||||
:param request: Request instance for CreatePresentation.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.CreatePresentationRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.CreatePresentationResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("CreatePresentation", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.CreatePresentationResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def CreateTDidByHost(self, request):
|
||||
r"""自动生成公私钥对托管在DID平台,并注册DID标识
|
||||
|
||||
:param request: Request instance for CreateTDidByHost.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.CreateTDidByHostRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.CreateTDidByHostResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("CreateTDidByHost", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.CreateTDidByHostResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def CreateTDidByPubKey(self, request):
|
||||
r"""使用导入的公钥文件注册DID标识
|
||||
|
||||
:param request: Request instance for CreateTDidByPubKey.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.CreateTDidByPubKeyRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.CreateTDidByPubKeyResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("CreateTDidByPubKey", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.CreateTDidByPubKeyResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def DeactivateTDid(self, request):
|
||||
r"""更新DID标识的禁用状态
|
||||
|
||||
:param request: Request instance for DeactivateTDid.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.DeactivateTDidRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.DeactivateTDidResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("DeactivateTDid", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.DeactivateTDidResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def GetAppSummary(self, request):
|
||||
r"""获取某个应用关键指标统计数据
|
||||
|
||||
:param request: Request instance for GetAppSummary.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.GetAppSummaryRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.GetAppSummaryResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("GetAppSummary", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.GetAppSummaryResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def GetCredentialState(self, request):
|
||||
r"""获取凭证链上状态信息
|
||||
|
||||
:param request: Request instance for GetCredentialState.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.GetCredentialStateRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.GetCredentialStateResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("GetCredentialState", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.GetCredentialStateResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def GetOverSummary(self, request):
|
||||
r"""获取某个应用关键指标统计数据
|
||||
|
||||
:param request: Request instance for GetOverSummary.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.GetOverSummaryRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.GetOverSummaryResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("GetOverSummary", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.GetOverSummaryResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def GetTDidByObjectId(self, request):
|
||||
r"""通过业务层绑定的对象ID获取DID标识
|
||||
|
||||
:param request: Request instance for GetTDidByObjectId.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.GetTDidByObjectIdRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.GetTDidByObjectIdResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("GetTDidByObjectId", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.GetTDidByObjectIdResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def GetTDidDocument(self, request):
|
||||
r"""获取DID标识的文档
|
||||
|
||||
:param request: Request instance for GetTDidDocument.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.GetTDidDocumentRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.GetTDidDocumentResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("GetTDidDocument", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.GetTDidDocumentResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def GetTDidPubKey(self, request):
|
||||
r"""查询DID标识的认证公钥
|
||||
|
||||
:param request: Request instance for GetTDidPubKey.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.GetTDidPubKeyRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.GetTDidPubKeyResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("GetTDidPubKey", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.GetTDidPubKeyResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def IssueCredential(self, request):
|
||||
r"""颁发可验证凭证
|
||||
|
||||
:param request: Request instance for IssueCredential.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.IssueCredentialRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.IssueCredentialResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("IssueCredential", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.IssueCredentialResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def QueryAuthorityInfo(self, request):
|
||||
r"""查询权威机构信息
|
||||
|
||||
:param request: Request instance for QueryAuthorityInfo.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.QueryAuthorityInfoRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.QueryAuthorityInfoResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("QueryAuthorityInfo", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.QueryAuthorityInfoResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def QueryCPT(self, request):
|
||||
r"""查询凭证模板内容
|
||||
|
||||
:param request: Request instance for QueryCPT.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.QueryCPTRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.QueryCPTResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("QueryCPT", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.QueryCPTResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def SetTDidAttribute(self, request):
|
||||
r"""设置DID文档的自定义属性
|
||||
|
||||
:param request: Request instance for SetTDidAttribute.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.SetTDidAttributeRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.SetTDidAttributeResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("SetTDidAttribute", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.SetTDidAttributeResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def UpdateCredentialState(self, request):
|
||||
r"""1. 首次更新凭证状态基于不同场景参数有所差异,分以下两种场景:
|
||||
(1) 颁发凭证的DID是本腾讯云账号创建
|
||||
(2) 颁发凭证的DID是非本腾讯云账号创建(此调用方式也适用于场景1)
|
||||
2. 首次更新过凭证状态后,凭证状态已绑定该账号的链上用户,后续更新凭证状态只需参数CredentialStatus即可, OperateCredential和OriginCredential参数均不需要
|
||||
|
||||
:param request: Request instance for UpdateCredentialState.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.UpdateCredentialStateRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.UpdateCredentialStateResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("UpdateCredentialState", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.UpdateCredentialStateResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def VerifyCredentials(self, request):
|
||||
r"""验证已签名的可验证凭证
|
||||
|
||||
:param request: Request instance for VerifyCredentials.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.VerifyCredentialsRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.VerifyCredentialsResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("VerifyCredentials", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.VerifyCredentialsResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
|
||||
|
||||
def VerifyPresentation(self, request):
|
||||
r"""验证可验证表达的内容
|
||||
|
||||
:param request: Request instance for VerifyPresentation.
|
||||
:type request: :class:`tencentcloud.tdid.v20210519.models.VerifyPresentationRequest`
|
||||
:rtype: :class:`tencentcloud.tdid.v20210519.models.VerifyPresentationResponse`
|
||||
|
||||
"""
|
||||
try:
|
||||
params = request._serialize()
|
||||
headers = request.headers
|
||||
body = self.call("VerifyPresentation", params, headers=headers)
|
||||
response = json.loads(body)
|
||||
model = models.VerifyPresentationResponse()
|
||||
model._deserialize(response["Response"])
|
||||
return model
|
||||
except Exception as e:
|
||||
if isinstance(e, TencentCloudSDKException):
|
||||
raise
|
||||
else:
|
||||
raise TencentCloudSDKException(type(e).__name__, str(e))
|
||||
@@ -0,0 +1,353 @@
|
||||
# -*- coding: utf8 -*-
|
||||
# Copyright (c) 2017-2025 Tencent. 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.
|
||||
|
||||
|
||||
|
||||
from tencentcloud.common.abstract_client_async import AbstractClient
|
||||
from tencentcloud.tdid.v20210519 import models
|
||||
from typing import Dict
|
||||
|
||||
|
||||
class TdidClient(AbstractClient):
|
||||
_apiVersion = '2021-05-19'
|
||||
_endpoint = 'tdid.tencentcloudapi.com'
|
||||
_service = 'tdid'
|
||||
|
||||
async def CreateDisclosedCredential(
|
||||
self,
|
||||
request: models.CreateDisclosedCredentialRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.CreateDisclosedCredentialResponse:
|
||||
"""
|
||||
根据披露策略创建选择性披露凭证
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "CreateDisclosedCredential"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.CreateDisclosedCredentialResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def CreatePresentation(
|
||||
self,
|
||||
request: models.CreatePresentationRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.CreatePresentationResponse:
|
||||
"""
|
||||
创建凭证持有人的可验证表达
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "CreatePresentation"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.CreatePresentationResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def CreateTDidByHost(
|
||||
self,
|
||||
request: models.CreateTDidByHostRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.CreateTDidByHostResponse:
|
||||
"""
|
||||
自动生成公私钥对托管在DID平台,并注册DID标识
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "CreateTDidByHost"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.CreateTDidByHostResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def CreateTDidByPubKey(
|
||||
self,
|
||||
request: models.CreateTDidByPubKeyRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.CreateTDidByPubKeyResponse:
|
||||
"""
|
||||
使用导入的公钥文件注册DID标识
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "CreateTDidByPubKey"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.CreateTDidByPubKeyResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def DeactivateTDid(
|
||||
self,
|
||||
request: models.DeactivateTDidRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.DeactivateTDidResponse:
|
||||
"""
|
||||
更新DID标识的禁用状态
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "DeactivateTDid"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.DeactivateTDidResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def GetAppSummary(
|
||||
self,
|
||||
request: models.GetAppSummaryRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.GetAppSummaryResponse:
|
||||
"""
|
||||
获取某个应用关键指标统计数据
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "GetAppSummary"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.GetAppSummaryResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def GetCredentialState(
|
||||
self,
|
||||
request: models.GetCredentialStateRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.GetCredentialStateResponse:
|
||||
"""
|
||||
获取凭证链上状态信息
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "GetCredentialState"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.GetCredentialStateResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def GetOverSummary(
|
||||
self,
|
||||
request: models.GetOverSummaryRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.GetOverSummaryResponse:
|
||||
"""
|
||||
获取某个应用关键指标统计数据
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "GetOverSummary"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.GetOverSummaryResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def GetTDidByObjectId(
|
||||
self,
|
||||
request: models.GetTDidByObjectIdRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.GetTDidByObjectIdResponse:
|
||||
"""
|
||||
通过业务层绑定的对象ID获取DID标识
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "GetTDidByObjectId"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.GetTDidByObjectIdResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def GetTDidDocument(
|
||||
self,
|
||||
request: models.GetTDidDocumentRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.GetTDidDocumentResponse:
|
||||
"""
|
||||
获取DID标识的文档
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "GetTDidDocument"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.GetTDidDocumentResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def GetTDidPubKey(
|
||||
self,
|
||||
request: models.GetTDidPubKeyRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.GetTDidPubKeyResponse:
|
||||
"""
|
||||
查询DID标识的认证公钥
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "GetTDidPubKey"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.GetTDidPubKeyResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def IssueCredential(
|
||||
self,
|
||||
request: models.IssueCredentialRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.IssueCredentialResponse:
|
||||
"""
|
||||
颁发可验证凭证
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "IssueCredential"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.IssueCredentialResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def QueryAuthorityInfo(
|
||||
self,
|
||||
request: models.QueryAuthorityInfoRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.QueryAuthorityInfoResponse:
|
||||
"""
|
||||
查询权威机构信息
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "QueryAuthorityInfo"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.QueryAuthorityInfoResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def QueryCPT(
|
||||
self,
|
||||
request: models.QueryCPTRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.QueryCPTResponse:
|
||||
"""
|
||||
查询凭证模板内容
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "QueryCPT"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.QueryCPTResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def SetTDidAttribute(
|
||||
self,
|
||||
request: models.SetTDidAttributeRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.SetTDidAttributeResponse:
|
||||
"""
|
||||
设置DID文档的自定义属性
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "SetTDidAttribute"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.SetTDidAttributeResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def UpdateCredentialState(
|
||||
self,
|
||||
request: models.UpdateCredentialStateRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.UpdateCredentialStateResponse:
|
||||
"""
|
||||
1. 首次更新凭证状态基于不同场景参数有所差异,分以下两种场景:
|
||||
(1) 颁发凭证的DID是本腾讯云账号创建
|
||||
(2) 颁发凭证的DID是非本腾讯云账号创建(此调用方式也适用于场景1)
|
||||
2. 首次更新过凭证状态后,凭证状态已绑定该账号的链上用户,后续更新凭证状态只需参数CredentialStatus即可, OperateCredential和OriginCredential参数均不需要
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "UpdateCredentialState"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.UpdateCredentialStateResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def VerifyCredentials(
|
||||
self,
|
||||
request: models.VerifyCredentialsRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.VerifyCredentialsResponse:
|
||||
"""
|
||||
验证已签名的可验证凭证
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "VerifyCredentials"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.VerifyCredentialsResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
|
||||
async def VerifyPresentation(
|
||||
self,
|
||||
request: models.VerifyPresentationRequest,
|
||||
opts: Dict = None,
|
||||
) -> models.VerifyPresentationResponse:
|
||||
"""
|
||||
验证可验证表达的内容
|
||||
"""
|
||||
|
||||
kwargs = {}
|
||||
kwargs["action"] = "VerifyPresentation"
|
||||
kwargs["params"] = request._serialize()
|
||||
kwargs["resp_cls"] = models.VerifyPresentationResponse
|
||||
kwargs["headers"] = request.headers
|
||||
kwargs["opts"] = opts or {}
|
||||
|
||||
return await self.call_and_deserialize(**kwargs)
|
||||
Reference in New Issue
Block a user