/* * 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.Gme.V20180711 { using Newtonsoft.Json; using System.Threading.Tasks; using TencentCloud.Common; using TencentCloud.Common.Profile; using TencentCloud.Gme.V20180711.Models; public class GmeClient : AbstractClient{ private const string endpoint = "gme.tencentcloudapi.com"; private const string version = "2018-07-11"; /// /// Client constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". public GmeClient(Credential credential, string region) : this(credential, region, new ClientProfile()) { } /// /// Client Constructor. /// /// Credentials. /// Region name, such as "ap-guangzhou". /// Client profiles. public GmeClient(Credential credential, string region, ClientProfile profile) : base(endpoint, version, credential, region, profile) { } /// /// 本接口(CreateApp)用于创建一个GME应用。 /// /// /// public async Task CreateApp(CreateAppRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "CreateApp"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(CreateApp)用于创建一个GME应用。 /// /// /// public CreateAppResponse CreateAppSync(CreateAppRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "CreateApp"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeAppStatistics)用于获取某个GME应用的用量数据。包括实时语音,语音消息及转文本,语音分析等。最长查询周期为最近30天。 /// /// /// public async Task DescribeAppStatistics(DescribeAppStatisticsRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeAppStatistics"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeAppStatistics)用于获取某个GME应用的用量数据。包括实时语音,语音消息及转文本,语音分析等。最长查询周期为最近30天。 /// /// /// public DescribeAppStatisticsResponse DescribeAppStatisticsSync(DescribeAppStatisticsRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeAppStatistics"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 根据应用ID和文件ID查询识别结果 /// /// /// public async Task DescribeFilterResult(DescribeFilterResultRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeFilterResult"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 根据应用ID和文件ID查询识别结果 /// /// /// public DescribeFilterResultResponse DescribeFilterResultSync(DescribeFilterResultRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeFilterResult"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 根据日期查询识别结果列表 /// /// /// public async Task DescribeFilterResultList(DescribeFilterResultListRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeFilterResultList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 根据日期查询识别结果列表 /// /// /// public DescribeFilterResultListResponse DescribeFilterResultListSync(DescribeFilterResultListRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeFilterResultList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeScanResultList)用于查询语音检测结果,查询任务列表最多支持100个。 ///

如果在提交语音检测任务时未设置 Callback 字段,则需要通过本接口获取检测结果

///
/// /// public async Task DescribeScanResultList(DescribeScanResultListRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "DescribeScanResultList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(DescribeScanResultList)用于查询语音检测结果,查询任务列表最多支持100个。 ///

如果在提交语音检测任务时未设置 Callback 字段,则需要通过本接口获取检测结果

///
/// /// public DescribeScanResultListResponse DescribeScanResultListSync(DescribeScanResultListRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "DescribeScanResultList"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(ModifyAppStatus)用于修改应用总开关状态。 /// /// /// public async Task ModifyAppStatus(ModifyAppStatusRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ModifyAppStatus"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(ModifyAppStatus)用于修改应用总开关状态。 /// /// /// public ModifyAppStatusResponse ModifyAppStatusSync(ModifyAppStatusRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ModifyAppStatus"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(ScanVoice)用于提交语音检测任务,检测任务列表最多支持100个。使用前请您登录[控制台 - 服务配置](https://console.cloud.tencent.com/gamegme/conf)开启语音分析服务。 ///

/// ///

功能试用说明:

///
  • 打开前往控制台 - 产品试用免费试用语音分析服务。
  • ///
    /// ///

    接口功能说明:

    ///
  • 支持对语音流或语音文件进行检测,判断其中是否包含违规内容。
  • ///
  • 支持设置回调地址 Callback 获取检测结果,同时支持通过接口(查询语音检测结果)主动轮询获取检测结果。
  • ///
  • 支持场景输入,包括:谩骂、色情、涉政等场景
  • ///
  • 支持批量提交检测任务。检测任务列表最多支持100个。
  • ///
    ///

    音频文件限制说明:

    ///
  • 音频文件大小限制:100 M
  • ///
  • 音频文件时长限制:30分钟
  • ///
  • 音频文件格式支持的类型:.wav、.m4a、.amr、.mp3、.aac、.wma、.ogg
  • ///
    ///

    语音流限制说明:

    ///
  • 语音流格式支持的类型:.m3u8、.flv
  • ///
  • 语音流支持的传输协议:RTMP、HTTP、HTTPS
  • ///
  • 语音流时长限制:4小时
  • ///
  • 支持音视频流分离并对音频流进行分析
  • ///
    ///

    Scenes 与 Label 参数说明:

    ///

    提交语音检测任务时,需要指定 Scenes 场景参数,目前要求您设置 Scenes 参数值为:["default"];而在检测结果中,则包含请求时指定的场景,以及对应类型的检测结果。

    /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
    场景描述Label
    语音检测语音检测的检测类型 ///

    normal:正常文本

    ///

    porn:色情

    ///

    politics:涉政

    ///

    abuse:谩骂

    ///

    ad :广告

    ///

    terrorism:暴恐

    ///

    contraband :违禁

    ///

    customized:自定义词库。目前白名单开放,如有需要请联系我们

    ///
    ///
    ///

    回调相关说明:

    ///
  • 如果在请求参数中指定了回调地址参数 Callback,即一个 HTTP(S) 协议接口的 URL,则需要支持 POST 方法,传输数据编码采用 UTF-8。
  • ///
  • 在推送回调数据后,接收到的 HTTP 状态码为 200 时,表示推送成功。
  • ///
  • HTTP 头参数说明:
  • /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
    名称类型是否必需描述
    Signatuestring签名,具体见签名生成说明
    ///
      ///
    • 签名生成说明:
    • ///
        ///
      • 使用 HMAC-SH1 算法, 最终结果做 BASE64 编码;
      • ///
      • 签名原文串为 POST+body 的整个json内容(长度以 Content-Length 为准);
      • ///
      • 签名key为应用的 SecretKey,可以通过控制台查看。
      • ///
      ///
    /// ///
  • 回调示例如下(详细字段说明见结构: /// DescribeScanResult
  • ///
    {
            /// 	"Code": 0,
            /// 	"DataId": "1400000000_test_data_id",
            /// 	"ScanFinishTime": 1566720906,
            /// 	"HitFlag": true,
            /// 	"Live": false,
            /// 	"Msg": "",
            /// 	"ScanPiece": [{
            /// 		"DumpUrl": "",
            /// 		"HitFlag": true,
            /// 		"MainType": "abuse",
            /// 		"RoomId": "123",
            /// 		"OpenId": "xxx",
            /// 		"Info":"",
            /// 		"Offset": 0,
            /// 		"Duration": 3400,
            /// 		"PieceStartTime":1574684231,
            /// 		"ScanDetail": [{
            /// 			"EndTime": 1110,
            /// 			"KeyWord": "xxx",
            /// 			"Label": "abuse",
            /// 			"Rate": "90.00",
            /// 			"StartTime": 1110
            /// 		}, {
            /// 			"EndTime": 1380,
            /// 			"KeyWord": "xxx",
            /// 			"Label": "abuse",
            /// 			"Rate": "90.00",
            /// 			"StartTime": 930
            /// 		}, {
            /// 			"EndTime": 1560,
            /// 			"KeyWord": "xxx",
            /// 			"Label": "abuse",
            /// 			"Rate": "90.00",
            /// 			"StartTime": 930
            /// 		}, {
            /// 			"EndTime": 2820,
            /// 			"KeyWord": "xxx",
            /// 			"Label": "abuse",
            /// 			"Rate": "90.00",
            /// 			"StartTime": 2490
            /// 		}]
            /// 	}],
            /// 	"ScanStartTime": 1566720905,
            /// 	"Scenes": [
            /// 		"default"
            /// 	],
            /// 	"Status": "Success",
            /// 	"TaskId": "xxx",
            /// 	"Url": "https://xxx/xxx.m4a"
            /// }
            /// 
    ///
    /// /// public async Task ScanVoice(ScanVoiceRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "ScanVoice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口(ScanVoice)用于提交语音检测任务,检测任务列表最多支持100个。使用前请您登录[控制台 - 服务配置](https://console.cloud.tencent.com/gamegme/conf)开启语音分析服务。 ///

    /// ///

    功能试用说明:

    ///
  • 打开前往控制台 - 产品试用免费试用语音分析服务。
  • ///
    /// ///

    接口功能说明:

    ///
  • 支持对语音流或语音文件进行检测,判断其中是否包含违规内容。
  • ///
  • 支持设置回调地址 Callback 获取检测结果,同时支持通过接口(查询语音检测结果)主动轮询获取检测结果。
  • ///
  • 支持场景输入,包括:谩骂、色情、涉政等场景
  • ///
  • 支持批量提交检测任务。检测任务列表最多支持100个。
  • ///
    ///

    音频文件限制说明:

    ///
  • 音频文件大小限制:100 M
  • ///
  • 音频文件时长限制:30分钟
  • ///
  • 音频文件格式支持的类型:.wav、.m4a、.amr、.mp3、.aac、.wma、.ogg
  • ///
    ///

    语音流限制说明:

    ///
  • 语音流格式支持的类型:.m3u8、.flv
  • ///
  • 语音流支持的传输协议:RTMP、HTTP、HTTPS
  • ///
  • 语音流时长限制:4小时
  • ///
  • 支持音视频流分离并对音频流进行分析
  • ///
    ///

    Scenes 与 Label 参数说明:

    ///

    提交语音检测任务时,需要指定 Scenes 场景参数,目前要求您设置 Scenes 参数值为:["default"];而在检测结果中,则包含请求时指定的场景,以及对应类型的检测结果。

    /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
    场景描述Label
    语音检测语音检测的检测类型 ///

    normal:正常文本

    ///

    porn:色情

    ///

    politics:涉政

    ///

    abuse:谩骂

    ///

    ad :广告

    ///

    terrorism:暴恐

    ///

    contraband :违禁

    ///

    customized:自定义词库。目前白名单开放,如有需要请联系我们

    ///
    ///
    ///

    回调相关说明:

    ///
  • 如果在请求参数中指定了回调地址参数 Callback,即一个 HTTP(S) 协议接口的 URL,则需要支持 POST 方法,传输数据编码采用 UTF-8。
  • ///
  • 在推送回调数据后,接收到的 HTTP 状态码为 200 时,表示推送成功。
  • ///
  • HTTP 头参数说明:
  • /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// ///
    名称类型是否必需描述
    Signatuestring签名,具体见签名生成说明
    ///
      ///
    • 签名生成说明:
    • ///
        ///
      • 使用 HMAC-SH1 算法, 最终结果做 BASE64 编码;
      • ///
      • 签名原文串为 POST+body 的整个json内容(长度以 Content-Length 为准);
      • ///
      • 签名key为应用的 SecretKey,可以通过控制台查看。
      • ///
      ///
    /// ///
  • 回调示例如下(详细字段说明见结构: /// DescribeScanResult
  • ///
    {
            /// 	"Code": 0,
            /// 	"DataId": "1400000000_test_data_id",
            /// 	"ScanFinishTime": 1566720906,
            /// 	"HitFlag": true,
            /// 	"Live": false,
            /// 	"Msg": "",
            /// 	"ScanPiece": [{
            /// 		"DumpUrl": "",
            /// 		"HitFlag": true,
            /// 		"MainType": "abuse",
            /// 		"RoomId": "123",
            /// 		"OpenId": "xxx",
            /// 		"Info":"",
            /// 		"Offset": 0,
            /// 		"Duration": 3400,
            /// 		"PieceStartTime":1574684231,
            /// 		"ScanDetail": [{
            /// 			"EndTime": 1110,
            /// 			"KeyWord": "xxx",
            /// 			"Label": "abuse",
            /// 			"Rate": "90.00",
            /// 			"StartTime": 1110
            /// 		}, {
            /// 			"EndTime": 1380,
            /// 			"KeyWord": "xxx",
            /// 			"Label": "abuse",
            /// 			"Rate": "90.00",
            /// 			"StartTime": 930
            /// 		}, {
            /// 			"EndTime": 1560,
            /// 			"KeyWord": "xxx",
            /// 			"Label": "abuse",
            /// 			"Rate": "90.00",
            /// 			"StartTime": 930
            /// 		}, {
            /// 			"EndTime": 2820,
            /// 			"KeyWord": "xxx",
            /// 			"Label": "abuse",
            /// 			"Rate": "90.00",
            /// 			"StartTime": 2490
            /// 		}]
            /// 	}],
            /// 	"ScanStartTime": 1566720905,
            /// 	"Scenes": [
            /// 		"default"
            /// 	],
            /// 	"Status": "Success",
            /// 	"TaskId": "xxx",
            /// 	"Url": "https://xxx/xxx.m4a"
            /// }
            /// 
    ///
    /// /// public ScanVoiceResponse ScanVoiceSync(ScanVoiceRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "ScanVoice"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口用于识别涉黄、涉政等违规音频,成功会回调配置在应用的回调地址。回调示例如下: /// {"BizId":0,"FileId":"test_file_id","FileName":"test_file_name","FileUrl":"test_file_url","OpenId":"test_open_id","TimeStamp":"0000-00-00 00:00:00","Data":[{"Type":1,"Word":"xx"}]} /// Type表示过滤类型,1:政治,2:色情,3:谩骂 /// /// /// public async Task VoiceFilter(VoiceFilterRequest req) { JsonResponseModel rsp = null; try { var strResp = await this.InternalRequest(req, "VoiceFilter"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } /// /// 本接口用于识别涉黄、涉政等违规音频,成功会回调配置在应用的回调地址。回调示例如下: /// {"BizId":0,"FileId":"test_file_id","FileName":"test_file_name","FileUrl":"test_file_url","OpenId":"test_open_id","TimeStamp":"0000-00-00 00:00:00","Data":[{"Type":1,"Word":"xx"}]} /// Type表示过滤类型,1:政治,2:色情,3:谩骂 /// /// /// public VoiceFilterResponse VoiceFilterSync(VoiceFilterRequest req) { JsonResponseModel rsp = null; try { var strResp = this.InternalRequestSync(req, "VoiceFilter"); rsp = JsonConvert.DeserializeObject>(strResp); } catch (JsonSerializationException e) { throw new TencentCloudSDKException(e.Message); } return rsp.Response; } } }