1 Star 7 Fork 0

tencentcloud/tencentcloud-sdk-go

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
client.go 21.51 KB
Copy Edit Raw Blame History
tencentcloud authored 2024-07-26 04:14 . release v1.0.972
// Copyright (c) 2017-2018 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.
package v20201229
import (
"context"
"errors"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
)
const APIVersion = "2020-12-29"
type Client struct {
common.Client
}
// Deprecated
func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error) {
cpf := profile.NewClientProfile()
client = &Client{}
client.Init(region).WithSecretId(secretId, secretKey).WithProfile(cpf)
return
}
func NewClient(credential common.CredentialIface, region string, clientProfile *profile.ClientProfile) (client *Client, err error) {
client = &Client{}
client.Init(region).
WithCredential(credential).
WithProfile(clientProfile)
return
}
func NewCancelTaskRequest() (request *CancelTaskRequest) {
request = &CancelTaskRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("vm", APIVersion, "CancelTask")
return
}
func NewCancelTaskResponse() (response *CancelTaskResponse) {
response = &CancelTaskResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// CancelTask
// 可使用该接口取消审核任务,成功取消后,该接口返回已取消任务的TaskId。<br>
//
//
//
// 默认接口请求频率限制:**20次/秒**。
//
// 可能返回的错误码:
// DRYRUNOPERATION = "DryRunOperation"
// FAILEDOPERATION = "FailedOperation"
// INVALIDPARAMETER = "InvalidParameter"
// INVALIDPARAMETERVALUE = "InvalidParameterValue"
// LIMITEXCEEDED = "LimitExceeded"
// MISSINGPARAMETER = "MissingParameter"
// OPERATIONDENIED = "OperationDenied"
// REQUESTLIMITEXCEEDED = "RequestLimitExceeded"
// RESOURCEINUSE = "ResourceInUse"
// RESOURCEINSUFFICIENT = "ResourceInsufficient"
// RESOURCENOTFOUND = "ResourceNotFound"
// RESOURCEUNAVAILABLE = "ResourceUnavailable"
// RESOURCESSOLDOUT = "ResourcesSoldOut"
// UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
// UNKNOWNPARAMETER = "UnknownParameter"
// UNSUPPORTEDOPERATION = "UnsupportedOperation"
func (c *Client) CancelTask(request *CancelTaskRequest) (response *CancelTaskResponse, err error) {
return c.CancelTaskWithContext(context.Background(), request)
}
// CancelTask
// 可使用该接口取消审核任务,成功取消后,该接口返回已取消任务的TaskId。<br>
//
//
//
// 默认接口请求频率限制:**20次/秒**。
//
// 可能返回的错误码:
// DRYRUNOPERATION = "DryRunOperation"
// FAILEDOPERATION = "FailedOperation"
// INVALIDPARAMETER = "InvalidParameter"
// INVALIDPARAMETERVALUE = "InvalidParameterValue"
// LIMITEXCEEDED = "LimitExceeded"
// MISSINGPARAMETER = "MissingParameter"
// OPERATIONDENIED = "OperationDenied"
// REQUESTLIMITEXCEEDED = "RequestLimitExceeded"
// RESOURCEINUSE = "ResourceInUse"
// RESOURCEINSUFFICIENT = "ResourceInsufficient"
// RESOURCENOTFOUND = "ResourceNotFound"
// RESOURCEUNAVAILABLE = "ResourceUnavailable"
// RESOURCESSOLDOUT = "ResourcesSoldOut"
// UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
// UNKNOWNPARAMETER = "UnknownParameter"
// UNSUPPORTEDOPERATION = "UnsupportedOperation"
func (c *Client) CancelTaskWithContext(ctx context.Context, request *CancelTaskRequest) (response *CancelTaskResponse, err error) {
if request == nil {
request = NewCancelTaskRequest()
}
if c.GetCredential() == nil {
return nil, errors.New("CancelTask require credential")
}
request.SetContext(ctx)
response = NewCancelTaskResponse()
err = c.Send(request, response)
return
}
func NewCreateVideoModerationTaskRequest() (request *CreateVideoModerationTaskRequest) {
request = &CreateVideoModerationTaskRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("vm", APIVersion, "CreateVideoModerationTask")
return
}
func NewCreateVideoModerationTaskResponse() (response *CreateVideoModerationTaskResponse) {
response = &CreateVideoModerationTaskResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// CreateVideoModerationTask
// 本接口(Video Moderation System,VM)用于提交视频文件或视频流进行智能审核任务。使用前请您使用腾讯云主账号登录控制台[开通视频内容安全服务](https://console.cloud.tencent.com/cms)并调整好对应的业务配置。<br>
//
// ### 功能使用说明:
//
//
//
// - 前往“[内容安全控制台-视频内容安全](https://console.cloud.tencent.com/cms)”开启使用视频内容安全服务,首次开通服务的用户可免费领用试用套餐包,包含200分钟的处理量(换算1s每帧截图,赠送**12000张图**、**200分钟的音频**处理量),有效期为15天。
//
//
//
// - 该接口为收费接口,计费方式敬请参见[腾讯云视频内容安全定价](https://cloud.tencent.com/product/vm/pricing)。
//
//
//
// - 默认接口请求频率限制:**20次/秒**,对于异步审核任务(点播视频),超出频率限制的请求会自动排入待审核队列,对于同步审核任务(直播视频),超出频率限制将会报错。
//
// - 默认并发审核路数限制:点播默认10路,异步审核任务(点播视频)数量超过并发审核路数时,将会进入排队;直播默认100路,同步审核任务(直播视频)超过并发审核路数,接口会返回错误。
//
//
//
//
//
// ### 接口功能说明:
//
//
//
// - 支持对视频文件或视频流进行自动检测,从 OCR文本识别、物体检测(实体、广告台标、二维码等)、图像识别及音频审核四个维度,通过深度学习技术识别视频中的违规内容;
//
// - 支持设置回调地址 Callback 获取检测结果,或通过接口(查看任务详情)主动轮询获取检测结果详情;对于正常审核中的视频任务,如含有违规内容,则截帧图片最长会在**3s**内回调,音频片段会在用户配置的**切片时长 + 2s**内回调;对于在队列中的待审核任务,回调时间为正常审核回调时间+等待时间;
//
// - 支持通过接口(查看审核任务列表)查询任务队列,用户可根据多种业务信息(业务类型、审核结果、任务状态等)筛选审核任务列表;
//
// - 支持识别多种违规场景,包括:低俗、谩骂、色情、广告等场景;
//
// - 支持根据不同的业务场景配置自定义的审核策略;
//
// - 支持用户自定义配置黑白词库及图片库,打击自定义违规内容(目前仅支持黑名单配置);
//
// - 支持用户自定义配置审核任务优先级,当有多个任务排队时,可根据用户配置自动调整任务优先级;
//
// - 支持批量提交检测任务,**最多可同时创建10个任务**;
//
//
//
// ### 视频文件调用说明:
//
//
//
// - 视频文件大小支持:**4K视频文件 < 10GB**;**低于4K视频文件 < 5GB**
//
// - 视频文件分辨率支持:**最佳分辨率为1920x1080 (1080p)**,如果视频文件小于300MB,则分辨率可以大于1080p,分辨率最大支持4K,更大视频可以调用[云转码服务](https://cloud.tencent.com/product/mps/details)转码后再送审;
//
// - 视频文件支持格式:flv、mkv 、mp4 、rmvb 、avi 、wmv、3gp、ts、mov、rm、mpeg、wmf等。
//
// - 视频文件支持的访问方式:链接地址(支持HTTP/HTTPS)、腾讯云COS存储;
//
// - 若传入视频文件的访问链接,则需要注意视频**头文件的读取时间限制为3秒**,为保障被检测视频的稳定性和可靠性,建议您使用腾讯云COS存储或者CDN缓存等;
//
// - 支持用户配置是否需要开启音频审核,若不开启则将仅对视频文件图像内容进行审核。
//
//
//
// ### 视频流调用说明:
//
//
//
// - 视频流时长支持:**8小时以内**
//
// - 视频流分辨率支持:支持**1920x1080 (1080p)**,更高分辨率视频可以调用[直播云转码服务](https://cloud.tencent.com/document/product/267/39889)转码后再送审;
//
// - 视频流支持格式:rmtp,flv 等主流视频流编码格式。
//
// - 视频文件支持的传输协议:HTTP/HTTPS/RTMP;
//
// - 支持用户配置是否需要开启音频审核,若不开启则将仅对视频流图像内容进行审核。
//
// 可能返回的错误码:
// DRYRUNOPERATION = "DryRunOperation"
// FAILEDOPERATION = "FailedOperation"
// INTERNALERROR = "InternalError"
// INVALIDPARAMETER = "InvalidParameter"
// INVALIDPARAMETERVALUE = "InvalidParameterValue"
// LIMITEXCEEDED = "LimitExceeded"
// MISSINGPARAMETER = "MissingParameter"
// OPERATIONDENIED = "OperationDenied"
// REQUESTLIMITEXCEEDED = "RequestLimitExceeded"
// RESOURCEINUSE = "ResourceInUse"
// RESOURCEINSUFFICIENT = "ResourceInsufficient"
// RESOURCENOTFOUND = "ResourceNotFound"
// RESOURCEUNAVAILABLE = "ResourceUnavailable"
// RESOURCESSOLDOUT = "ResourcesSoldOut"
// UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
// UNAUTHORIZEDOPERATION_UNAUTHORIZED = "UnauthorizedOperation.Unauthorized"
// UNKNOWNPARAMETER = "UnknownParameter"
// UNSUPPORTEDOPERATION = "UnsupportedOperation"
func (c *Client) CreateVideoModerationTask(request *CreateVideoModerationTaskRequest) (response *CreateVideoModerationTaskResponse, err error) {
return c.CreateVideoModerationTaskWithContext(context.Background(), request)
}
// CreateVideoModerationTask
// 本接口(Video Moderation System,VM)用于提交视频文件或视频流进行智能审核任务。使用前请您使用腾讯云主账号登录控制台[开通视频内容安全服务](https://console.cloud.tencent.com/cms)并调整好对应的业务配置。<br>
//
// ### 功能使用说明:
//
//
//
// - 前往“[内容安全控制台-视频内容安全](https://console.cloud.tencent.com/cms)”开启使用视频内容安全服务,首次开通服务的用户可免费领用试用套餐包,包含200分钟的处理量(换算1s每帧截图,赠送**12000张图**、**200分钟的音频**处理量),有效期为15天。
//
//
//
// - 该接口为收费接口,计费方式敬请参见[腾讯云视频内容安全定价](https://cloud.tencent.com/product/vm/pricing)。
//
//
//
// - 默认接口请求频率限制:**20次/秒**,对于异步审核任务(点播视频),超出频率限制的请求会自动排入待审核队列,对于同步审核任务(直播视频),超出频率限制将会报错。
//
// - 默认并发审核路数限制:点播默认10路,异步审核任务(点播视频)数量超过并发审核路数时,将会进入排队;直播默认100路,同步审核任务(直播视频)超过并发审核路数,接口会返回错误。
//
//
//
//
//
// ### 接口功能说明:
//
//
//
// - 支持对视频文件或视频流进行自动检测,从 OCR文本识别、物体检测(实体、广告台标、二维码等)、图像识别及音频审核四个维度,通过深度学习技术识别视频中的违规内容;
//
// - 支持设置回调地址 Callback 获取检测结果,或通过接口(查看任务详情)主动轮询获取检测结果详情;对于正常审核中的视频任务,如含有违规内容,则截帧图片最长会在**3s**内回调,音频片段会在用户配置的**切片时长 + 2s**内回调;对于在队列中的待审核任务,回调时间为正常审核回调时间+等待时间;
//
// - 支持通过接口(查看审核任务列表)查询任务队列,用户可根据多种业务信息(业务类型、审核结果、任务状态等)筛选审核任务列表;
//
// - 支持识别多种违规场景,包括:低俗、谩骂、色情、广告等场景;
//
// - 支持根据不同的业务场景配置自定义的审核策略;
//
// - 支持用户自定义配置黑白词库及图片库,打击自定义违规内容(目前仅支持黑名单配置);
//
// - 支持用户自定义配置审核任务优先级,当有多个任务排队时,可根据用户配置自动调整任务优先级;
//
// - 支持批量提交检测任务,**最多可同时创建10个任务**;
//
//
//
// ### 视频文件调用说明:
//
//
//
// - 视频文件大小支持:**4K视频文件 < 10GB**;**低于4K视频文件 < 5GB**
//
// - 视频文件分辨率支持:**最佳分辨率为1920x1080 (1080p)**,如果视频文件小于300MB,则分辨率可以大于1080p,分辨率最大支持4K,更大视频可以调用[云转码服务](https://cloud.tencent.com/product/mps/details)转码后再送审;
//
// - 视频文件支持格式:flv、mkv 、mp4 、rmvb 、avi 、wmv、3gp、ts、mov、rm、mpeg、wmf等。
//
// - 视频文件支持的访问方式:链接地址(支持HTTP/HTTPS)、腾讯云COS存储;
//
// - 若传入视频文件的访问链接,则需要注意视频**头文件的读取时间限制为3秒**,为保障被检测视频的稳定性和可靠性,建议您使用腾讯云COS存储或者CDN缓存等;
//
// - 支持用户配置是否需要开启音频审核,若不开启则将仅对视频文件图像内容进行审核。
//
//
//
// ### 视频流调用说明:
//
//
//
// - 视频流时长支持:**8小时以内**
//
// - 视频流分辨率支持:支持**1920x1080 (1080p)**,更高分辨率视频可以调用[直播云转码服务](https://cloud.tencent.com/document/product/267/39889)转码后再送审;
//
// - 视频流支持格式:rmtp,flv 等主流视频流编码格式。
//
// - 视频文件支持的传输协议:HTTP/HTTPS/RTMP;
//
// - 支持用户配置是否需要开启音频审核,若不开启则将仅对视频流图像内容进行审核。
//
// 可能返回的错误码:
// DRYRUNOPERATION = "DryRunOperation"
// FAILEDOPERATION = "FailedOperation"
// INTERNALERROR = "InternalError"
// INVALIDPARAMETER = "InvalidParameter"
// INVALIDPARAMETERVALUE = "InvalidParameterValue"
// LIMITEXCEEDED = "LimitExceeded"
// MISSINGPARAMETER = "MissingParameter"
// OPERATIONDENIED = "OperationDenied"
// REQUESTLIMITEXCEEDED = "RequestLimitExceeded"
// RESOURCEINUSE = "ResourceInUse"
// RESOURCEINSUFFICIENT = "ResourceInsufficient"
// RESOURCENOTFOUND = "ResourceNotFound"
// RESOURCEUNAVAILABLE = "ResourceUnavailable"
// RESOURCESSOLDOUT = "ResourcesSoldOut"
// UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
// UNAUTHORIZEDOPERATION_UNAUTHORIZED = "UnauthorizedOperation.Unauthorized"
// UNKNOWNPARAMETER = "UnknownParameter"
// UNSUPPORTEDOPERATION = "UnsupportedOperation"
func (c *Client) CreateVideoModerationTaskWithContext(ctx context.Context, request *CreateVideoModerationTaskRequest) (response *CreateVideoModerationTaskResponse, err error) {
if request == nil {
request = NewCreateVideoModerationTaskRequest()
}
if c.GetCredential() == nil {
return nil, errors.New("CreateVideoModerationTask require credential")
}
request.SetContext(ctx)
response = NewCreateVideoModerationTaskResponse()
err = c.Send(request, response)
return
}
func NewDescribeTaskDetailRequest() (request *DescribeTaskDetailRequest) {
request = &DescribeTaskDetailRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("vm", APIVersion, "DescribeTaskDetail")
return
}
func NewDescribeTaskDetailResponse() (response *DescribeTaskDetailResponse) {
response = &DescribeTaskDetailResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// DescribeTaskDetail
// 通过查看任务详情 DescribeTaskDetail 接口,可主动轮询获取检测结果详情。
//
// 可能返回的错误码:
// DRYRUNOPERATION = "DryRunOperation"
// FAILEDOPERATION = "FailedOperation"
// INTERNALERROR = "InternalError"
// INVALIDPARAMETER = "InvalidParameter"
// INVALIDPARAMETERVALUE = "InvalidParameterValue"
// LIMITEXCEEDED = "LimitExceeded"
// MISSINGPARAMETER = "MissingParameter"
// OPERATIONDENIED = "OperationDenied"
// REQUESTLIMITEXCEEDED = "RequestLimitExceeded"
// RESOURCEINUSE = "ResourceInUse"
// RESOURCEINSUFFICIENT = "ResourceInsufficient"
// RESOURCENOTFOUND = "ResourceNotFound"
// RESOURCEUNAVAILABLE = "ResourceUnavailable"
// RESOURCESSOLDOUT = "ResourcesSoldOut"
// UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
// UNKNOWNPARAMETER = "UnknownParameter"
// UNSUPPORTEDOPERATION = "UnsupportedOperation"
func (c *Client) DescribeTaskDetail(request *DescribeTaskDetailRequest) (response *DescribeTaskDetailResponse, err error) {
return c.DescribeTaskDetailWithContext(context.Background(), request)
}
// DescribeTaskDetail
// 通过查看任务详情 DescribeTaskDetail 接口,可主动轮询获取检测结果详情。
//
// 可能返回的错误码:
// DRYRUNOPERATION = "DryRunOperation"
// FAILEDOPERATION = "FailedOperation"
// INTERNALERROR = "InternalError"
// INVALIDPARAMETER = "InvalidParameter"
// INVALIDPARAMETERVALUE = "InvalidParameterValue"
// LIMITEXCEEDED = "LimitExceeded"
// MISSINGPARAMETER = "MissingParameter"
// OPERATIONDENIED = "OperationDenied"
// REQUESTLIMITEXCEEDED = "RequestLimitExceeded"
// RESOURCEINUSE = "ResourceInUse"
// RESOURCEINSUFFICIENT = "ResourceInsufficient"
// RESOURCENOTFOUND = "ResourceNotFound"
// RESOURCEUNAVAILABLE = "ResourceUnavailable"
// RESOURCESSOLDOUT = "ResourcesSoldOut"
// UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
// UNKNOWNPARAMETER = "UnknownParameter"
// UNSUPPORTEDOPERATION = "UnsupportedOperation"
func (c *Client) DescribeTaskDetailWithContext(ctx context.Context, request *DescribeTaskDetailRequest) (response *DescribeTaskDetailResponse, err error) {
if request == nil {
request = NewDescribeTaskDetailRequest()
}
if c.GetCredential() == nil {
return nil, errors.New("DescribeTaskDetail require credential")
}
request.SetContext(ctx)
response = NewDescribeTaskDetailResponse()
err = c.Send(request, response)
return
}
func NewDescribeTasksRequest() (request *DescribeTasksRequest) {
request = &DescribeTasksRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("vm", APIVersion, "DescribeTasks")
return
}
func NewDescribeTasksResponse() (response *DescribeTasksResponse) {
response = &DescribeTasksResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// DescribeTasks
// 通过查看审核任务列表接口,可查询任务队列;您可根据多种业务信息(业务类型、审核结果、任务状态等)筛选审核任务列表。<br>
//
//
//
// 默认接口请求频率限制:**20次/秒**。
//
// 可能返回的错误码:
// AUTHFAILURE = "AuthFailure"
// DRYRUNOPERATION = "DryRunOperation"
// FAILEDOPERATION = "FailedOperation"
// INTERNALERROR = "InternalError"
// INVALIDPARAMETER = "InvalidParameter"
// INVALIDPARAMETERVALUE = "InvalidParameterValue"
// LIMITEXCEEDED = "LimitExceeded"
// MISSINGPARAMETER = "MissingParameter"
// OPERATIONDENIED = "OperationDenied"
// REQUESTLIMITEXCEEDED = "RequestLimitExceeded"
// RESOURCEINUSE = "ResourceInUse"
// RESOURCEINSUFFICIENT = "ResourceInsufficient"
// RESOURCENOTFOUND = "ResourceNotFound"
// RESOURCEUNAVAILABLE = "ResourceUnavailable"
// RESOURCESSOLDOUT = "ResourcesSoldOut"
// UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
// UNKNOWNPARAMETER = "UnknownParameter"
// UNSUPPORTEDOPERATION = "UnsupportedOperation"
func (c *Client) DescribeTasks(request *DescribeTasksRequest) (response *DescribeTasksResponse, err error) {
return c.DescribeTasksWithContext(context.Background(), request)
}
// DescribeTasks
// 通过查看审核任务列表接口,可查询任务队列;您可根据多种业务信息(业务类型、审核结果、任务状态等)筛选审核任务列表。<br>
//
//
//
// 默认接口请求频率限制:**20次/秒**。
//
// 可能返回的错误码:
// AUTHFAILURE = "AuthFailure"
// DRYRUNOPERATION = "DryRunOperation"
// FAILEDOPERATION = "FailedOperation"
// INTERNALERROR = "InternalError"
// INVALIDPARAMETER = "InvalidParameter"
// INVALIDPARAMETERVALUE = "InvalidParameterValue"
// LIMITEXCEEDED = "LimitExceeded"
// MISSINGPARAMETER = "MissingParameter"
// OPERATIONDENIED = "OperationDenied"
// REQUESTLIMITEXCEEDED = "RequestLimitExceeded"
// RESOURCEINUSE = "ResourceInUse"
// RESOURCEINSUFFICIENT = "ResourceInsufficient"
// RESOURCENOTFOUND = "ResourceNotFound"
// RESOURCEUNAVAILABLE = "ResourceUnavailable"
// RESOURCESSOLDOUT = "ResourcesSoldOut"
// UNAUTHORIZEDOPERATION = "UnauthorizedOperation"
// UNKNOWNPARAMETER = "UnknownParameter"
// UNSUPPORTEDOPERATION = "UnsupportedOperation"
func (c *Client) DescribeTasksWithContext(ctx context.Context, request *DescribeTasksRequest) (response *DescribeTasksResponse, err error) {
if request == nil {
request = NewDescribeTasksRequest()
}
if c.GetCredential() == nil {
return nil, errors.New("DescribeTasks require credential")
}
request.SetContext(ctx)
response = NewDescribeTasksResponse()
err = c.Send(request, response)
return
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tencentcloud/tencentcloud-sdk-go.git
git@gitee.com:tencentcloud/tencentcloud-sdk-go.git
tencentcloud
tencentcloud-sdk-go
tencentcloud-sdk-go
master

Search