/*
* Copyright (c) 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.
*/
namespace TencentCloud.Cms.V20190321
{
using Newtonsoft.Json;
using System.Threading.Tasks;
using TencentCloud.Common;
using TencentCloud.Common.Profile;
using TencentCloud.Cms.V20190321.Models;
public class CmsClient : AbstractClient{
private const string endpoint = "cms.tencentcloudapi.com";
private const string version = "2019-03-21";
///
/// Client constructor.
///
/// Credentials.
/// Region name, such as "ap-guangzhou".
public CmsClient(Credential credential, string region)
: this(credential, region, new ClientProfile())
{
}
///
/// Client Constructor.
///
/// Credentials.
/// Region name, such as "ap-guangzhou".
/// Client profiles.
public CmsClient(Credential credential, string region, ClientProfile profile)
: base(endpoint, version, credential, region, profile)
{
}
///
/// 本文档适用于图片内容安全、视频内容安全自定义识别库的管理。
///
/// 通过该接口可以将图片新增到样本库。
///
///
///
public async Task CreateFileSample(CreateFileSampleRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = await this.InternalRequest(req, "CreateFileSample");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 本文档适用于图片内容安全、视频内容安全自定义识别库的管理。
///
/// 通过该接口可以将图片新增到样本库。
///
///
///
public CreateFileSampleResponse CreateFileSampleSync(CreateFileSampleRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "CreateFileSample");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 本文档适用于文本内容安全、音频内容安全自定义识别库的管理。
///
/// 通过该接口可以将文本新增到样本库。
///
///
///
public async Task CreateTextSample(CreateTextSampleRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = await this.InternalRequest(req, "CreateTextSample");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 本文档适用于文本内容安全、音频内容安全自定义识别库的管理。
///
/// 通过该接口可以将文本新增到样本库。
///
///
///
public CreateTextSampleResponse CreateTextSampleSync(CreateTextSampleRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "CreateTextSample");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 本文档适用于图片内容安全、视频内容安全自定义识别库的管理。
///
/// 删除图片样本库,支持批量删除,一次提交不超过20个。
///
///
///
public async Task DeleteFileSample(DeleteFileSampleRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DeleteFileSample");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 本文档适用于图片内容安全、视频内容安全自定义识别库的管理。
///
/// 删除图片样本库,支持批量删除,一次提交不超过20个。
///
///
///
public DeleteFileSampleResponse DeleteFileSampleSync(DeleteFileSampleRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DeleteFileSample");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 本文档适用于文本内容安全、音频内容安全自定义识别库的管理。
///
/// 删除文本样本库,暂时只支持单个删除。
///
///
///
public async Task DeleteTextSample(DeleteTextSampleRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DeleteTextSample");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 本文档适用于文本内容安全、音频内容安全自定义识别库的管理。
///
/// 删除文本样本库,暂时只支持单个删除。
///
///
///
public DeleteTextSampleResponse DeleteTextSampleSync(DeleteTextSampleRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DeleteTextSample");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 本文档适用于图片内容安全、视频内容安全自定义识别库的管理。
///
/// 查询图片样本库,支持批量查询。
///
///
///
public async Task DescribeFileSample(DescribeFileSampleRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeFileSample");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 本文档适用于图片内容安全、视频内容安全自定义识别库的管理。
///
/// 查询图片样本库,支持批量查询。
///
///
///
public DescribeFileSampleResponse DescribeFileSampleSync(DescribeFileSampleRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeFileSample");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 本文档适用于文本内容安全、音频内容安全自定义识别库的管理。
///
/// 支持批量查询文本样本库。
///
///
///
public async Task DescribeTextSample(DescribeTextSampleRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = await this.InternalRequest(req, "DescribeTextSample");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 本文档适用于文本内容安全、音频内容安全自定义识别库的管理。
///
/// 支持批量查询文本样本库。
///
///
///
public DescribeTextSampleResponse DescribeTextSampleSync(DescribeTextSampleRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "DescribeTextSample");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 图片内容检测服务(Image Moderation, IM)能自动扫描图片,识别涉黄、涉恐、涉政、涉毒等有害内容,同时支持用户配置图片黑名单,打击自定义的违规图片。
///
///
///
public async Task ImageModeration(ImageModerationRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = await this.InternalRequest(req, "ImageModeration");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 图片内容检测服务(Image Moderation, IM)能自动扫描图片,识别涉黄、涉恐、涉政、涉毒等有害内容,同时支持用户配置图片黑名单,打击自定义的违规图片。
///
///
///
public ImageModerationResponse ImageModerationSync(ImageModerationRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "ImageModeration");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 文本内容检测(Text Moderation)服务使用了深度学习技术,识别涉黄、涉政、涉恐等有害内容,同时支持用户配置词库,打击自定义的违规文本。
///
///
///
public async Task TextModeration(TextModerationRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = await this.InternalRequest(req, "TextModeration");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
///
/// 文本内容检测(Text Moderation)服务使用了深度学习技术,识别涉黄、涉政、涉恐等有害内容,同时支持用户配置词库,打击自定义的违规文本。
///
///
///
public TextModerationResponse TextModerationSync(TextModerationRequest req)
{
JsonResponseModel rsp = null;
try
{
var strResp = this.InternalRequestSync(req, "TextModeration");
rsp = JsonConvert.DeserializeObject>(strResp);
}
catch (JsonSerializationException e)
{
throw new TencentCloudSDKException(e.Message);
}
return rsp.Response;
}
}
}