Exemplo n.º 1
0
    def DescribeTextSample(self, request):
        """支持批量查询文字样本库

        :param request: 调用DescribeTextSample所需参数的结构体。
        :type request: :class:`tencentcloud.cms.v20190321.models.DescribeTextSampleRequest`
        :rtype: :class:`tencentcloud.cms.v20190321.models.DescribeTextSampleResponse`

        """
        try:
            params = request._serialize()
            body = self.call("DescribeTextSample", params)
            response = json.loads(body)
            if "Error" not in response["Response"]:
                model = models.DescribeTextSampleResponse()
                model._deserialize(response["Response"])
                return model
            else:
                code = response["Response"]["Error"]["Code"]
                message = response["Response"]["Error"]["Message"]
                reqid = response["Response"]["RequestId"]
                raise TencentCloudSDKException(code, message, reqid)
        except Exception as e:
            if isinstance(e, TencentCloudSDKException):
                raise
            else:
                raise TencentCloudSDKException(e.message, e.message)
Exemplo n.º 2
0
    def DescribeTextSample(self, request):
        """本文档适用于文本内容安全、音频内容安全自定义识别库的管理。
        <br>
        支持批量查询文本样本库。

        :param request: Request instance for DescribeTextSample.
        :type request: :class:`tencentcloud.cms.v20190321.models.DescribeTextSampleRequest`
        :rtype: :class:`tencentcloud.cms.v20190321.models.DescribeTextSampleResponse`

        """
        try:
            params = request._serialize()
            headers = request.headers
            body = self.call("DescribeTextSample", params, headers=headers)
            response = json.loads(body)
            if "Error" not in response["Response"]:
                model = models.DescribeTextSampleResponse()
                model._deserialize(response["Response"])
                return model
            else:
                code = response["Response"]["Error"]["Code"]
                message = response["Response"]["Error"]["Message"]
                reqid = response["Response"]["RequestId"]
                raise TencentCloudSDKException(code, message, reqid)
        except Exception as e:
            if isinstance(e, TencentCloudSDKException):
                raise
            else:
                raise TencentCloudSDKException(e.message, e.message)